19 CS(player).m_handicap_give = 1;
20 CS(player).m_handicap_take = 1;
31 return bound(1.0,
CS_CVAR(player).cvar_cl_handicap_damage_taken, 10.0);
33 return bound(1.0,
CS_CVAR(player).cvar_cl_handicap_damage_given, 10.0);
52 if (
CS_CVAR(player).cvar_cl_handicap_damage_taken > 1)
53 handicap_value =
CS_CVAR(player).cvar_cl_handicap_damage_taken;
54 else if (
CS_CVAR(player).cvar_cl_handicap.y > 0)
55 handicap_value =
CS_CVAR(player).cvar_cl_handicap.y;
57 handicap_value =
CS_CVAR(player).cvar_cl_handicap.x;
61 if (
CS_CVAR(player).cvar_cl_handicap_damage_given > 1)
62 handicap_value =
CS_CVAR(player).cvar_cl_handicap_damage_given;
64 handicap_value =
CS_CVAR(player).cvar_cl_handicap.x;
67 return bound(1.0, handicap_value, 10.0);
76 return (
CS(player)) ?
CS(player).m_handicap_take : 1;
78 return (
CS(player)) ?
CS(player).m_handicap_give : 1;
86 error(
"Handicap_SetForcedHandicap: Invalid handicap value.");
89 CS(player).m_handicap_take = value;
91 CS(player).m_handicap_give = value;
108 player.handicap_level = 0;
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void Handicap_SetForcedHandicap(entity player, float value, bool receiving)
Sets the forced handicap of the player.
void Handicap_Initialize(entity player)
Initializes handicap to its default value.
float Handicap_GetTotalHandicap(entity player, bool receiving)
Returns the total handicap of the player.
float Handicap_GetForcedHandicap(entity player, bool receiving)
Returns the forced handicap of the player.
float m_handicap_give
Holds the forced handicap value.
void Handicap_UpdateHandicapLevel(entity player)
Updates .handicap_level for the player.
float m_handicap_take
Holds the forced handicap value.
float Handicap_GetVoluntaryHandicap(entity player, bool receiving)
Returns the voluntary handicap of the player.
Header file that describes the handicap system.
#define HANDICAP_DISABLED()
#define HANDICAP_MAX_LEVEL_EQUIVALENT
#define REPLICATE_APPLYCHANGE(var, ApplyChange_code)
Allows setting code that will be executed on cvar value changes.
ERASEABLE float map_bound_ranges(float value, float src_min, float src_max, float dest_min, float dest_max)
Same as map_ranges except that values outside the source range are clamped to min or max.
ClientState CS(Client this)