if (this.score_frame_dmg)
{
+ this.handicap_avg_given_sum += this.score_frame_dmg * Handicap_GetTotalHandicap(this, false);
GameRules_scoring_add(this, DMG, this.score_frame_dmg);
this.score_frame_dmg = 0;
}
if (this.score_frame_dmgtaken)
{
+ this.handicap_avg_taken_sum += this.score_frame_dmgtaken * Handicap_GetTotalHandicap(this, true);
GameRules_scoring_add(this, DMGTAKEN, this.score_frame_dmgtaken);
this.score_frame_dmgtaken = 0;
}
/// \param[in] player Player to check.
void Handicap_UpdateHandicapLevel(entity player);
-#define HANDICAP_MAX_LEVEL_EQUIVALENT 2.0
-
-.int handicap_level;
// This int ranges 0 to 16, 0 meaning no handicap, 1 to 16 representing handicap "levels" mapped
// from 1.0 to HANDICAP_MAX_LEVEL_EQUIVALENT, using (given + taken)/2 (i.e. both-ways handicap).
// It is networked to the client.
// The levels are mostly meaningless, just used to determine the player_handicap icon color.
+.int handicap_level;
+
+#define HANDICAP_MAX_LEVEL_EQUIVALENT 2.0
+
+// These store the player's total "average-sum" given/taken damage handicaps respectively.
+// average-sum refers to the arithmetic sum of damage taken/given, weighted by respective handicap.
+// To calculate the average handicap, divide by damage taken/given.
+.float handicap_avg_given_sum;
+.float handicap_avg_taken_sum;