34 float total_score = 0;
35 float totalplayers = 0;
41 float mean_score = total_score / totalplayers;
45 float handicap =
fabs((score - mean_score) *
48 if (score < mean_score)
58 handicap = 1 / (
fabs(handicap) + 1);
#define PlayerScore_Get(player, scorefield)
Returns the player's score.
void DynamicHandicap_UpdateHandicap()
Updates the handicap of all players.
#define FOREACH_CLIENT(cond, body)
int autocvar_g_dynamic_handicap
Whether to enable dynamic handicap.
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
REGISTER_MUTATOR(dynamic_handicap, autocvar_g_dynamic_handicap)
float autocvar_g_dynamic_handicap_max
The maximum value of the handicap.
float autocvar_g_dynamic_handicap_exponent
The exponent used to calculate handicap.
float DynamicHandicap_ClampHandicap(float handicap)
Clamps the value of the handicap.
float autocvar_g_dynamic_handicap_min
The minimum value of the handicap.
float autocvar_g_dynamic_handicap_scale
The scale of the handicap.
MUTATOR_HOOKFUNCTION(dynamic_handicap, BuildMutatorsString)
void Handicap_SetForcedHandicap(entity player, float value)
Sets the forced handicap of the player.