|
Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
|
|
Source file that contains implementation of the handicap system. More...
#include "handicap.qh"#include <common/state.qh>#include <common/ent_cs.qh>#include <lib/replicate.qh>#include <server/client.qh>Go to the source code of this file.
Functions | |
| float | Handicap_GetForcedHandicap (entity player, bool receiving) |
| Returns the forced handicap of the player. | |
| float | Handicap_GetTotalHandicap (entity player, bool receiving) |
| Returns the total handicap of the player. | |
| float | Handicap_GetVoluntaryHandicap (entity player, bool receiving) |
| Returns the voluntary handicap of the player. | |
| void | Handicap_Initialize (entity player) |
| Initializes handicap to its default value. | |
| void | Handicap_SetForcedHandicap (entity player, float value, bool receiving) |
| Sets the forced handicap of the player. | |
| void | Handicap_UpdateHandicapLevel (entity player) |
| Updates .handicap_level for the player. | |
| REPLICATE_APPLYCHANGE ("cl_handicap_damage_given", { Handicap_UpdateHandicapLevel(this);}) | |
| REPLICATE_APPLYCHANGE ("cl_handicap_damage_taken", { Handicap_UpdateHandicapLevel(this);}) | |
Variables | |
| float | m_handicap_give |
| Holds the forced handicap value. | |
| float | m_handicap_take |
| Holds the forced handicap value. | |
Source file that contains implementation of the handicap system.
Definition in file handicap.qc.
Returns the forced handicap of the player.
| [in] | player | Player to check. |
| [in] | receiving | Whether handicap is for receiving or dealing. |
Definition at line 71 of file handicap.qc.
References CS(), entity(), and HANDICAP_DISABLED.
Referenced by Handicap_GetTotalHandicap().
Returns the total handicap of the player.
| [in] | player | Player to check. |
| [in] | receiving | Whether handicap is for receiving or dealing. |
Definition at line 96 of file handicap.qc.
References entity(), HANDICAP_DISABLED, Handicap_GetForcedHandicap(), and Handicap_GetVoluntaryHandicap().
Referenced by Handicap_UpdateHandicapLevel(), PlayerDamage(), and PlayerFrame().
Returns the voluntary handicap of the player.
| [in] | player | Player to check. |
| [in] | receiving | Whether handicap is for receiving or dealing. |
Definition at line 25 of file handicap.qc.
References bound(), CS_CVAR, entity(), and HANDICAP_DISABLED.
Referenced by Handicap_GetTotalHandicap().
Initializes handicap to its default value.
| [in,out] | player | Player to initialize. |
Definition at line 16 of file handicap.qc.
References CS(), entity(), and Handicap_UpdateHandicapLevel().
Referenced by ClientConnect().
Sets the forced handicap of the player.
| [in] | player | Player to alter. |
| [in] | value | Handicap value to set. |
| [in] | receiving | Whether handicap is for receiving or dealing. |
Definition at line 81 of file handicap.qc.
References CS(), entity(), error, HANDICAP_DISABLED, and Handicap_UpdateHandicapLevel().
Referenced by DynamicHandicap_UpdateHandicap().
Updates .handicap_level for the player.
| [in] | player | Player to check. |
Definition at line 104 of file handicap.qc.
References entity(), floor(), HANDICAP_DISABLED, Handicap_GetTotalHandicap(), HANDICAP_MAX_LEVEL_EQUIVALENT, and map_bound_ranges().
Referenced by Handicap_Initialize(), Handicap_SetForcedHandicap(), REPLICATE_APPLYCHANGE(), and REPLICATE_APPLYCHANGE().
| REPLICATE_APPLYCHANGE | ( | "cl_handicap_damage_given" | , |
| { Handicap_UpdateHandicapLevel(this);} | ) |
References Handicap_UpdateHandicapLevel().
| REPLICATE_APPLYCHANGE | ( | "cl_handicap_damage_taken" | , |
| { Handicap_UpdateHandicapLevel(this);} | ) |
References Handicap_UpdateHandicapLevel().
| float m_handicap_give |
Holds the forced handicap value.
Definition at line 13 of file handicap.qc.
| float m_handicap_take |
Holds the forced handicap value.
Definition at line 14 of file handicap.qc.