]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/handicap.qh
Separated handicap into give and take variables
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / handicap.qh
1 #pragma once
2
3 /// \file
4 /// \brief Header file that describes the handicap system.
5 /// \author Lyberta
6 /// \copyright GNU GPLv2 or any later version.
7
8 // Handicap is used to make the game harder for strong players and easier for
9 // weak players. Values greater than 1 make the game harder and values less than
10 // 1 make the game easier. Right now handicap only affects damage. There are 2
11 // types of handicap: voluntary and forced. Voluntary handicap can be set via
12 // cl_handicap cvars. For obvious reasons, it can't be less than 1. Forced
13 // handicap can be set by server mutators. The total handicap is the product of
14 // voluntary and forced handicap.
15 // Both handicaps are separated into _take and _give so that mutators and
16 // players are able to nerf their damage output or increase intake
17 // without changing the other.
18
19 /// \brief Initializes handicap to its default value.
20 /// \param[in,out] player Player to initialize.
21 /// \return No return.
22 void Handicap_Initialize(entity player);
23
24 /// \brief Returns the voluntary handicap of the player.
25 /// \param[in] player Player to check.
26 /// \param[in] receiving Whether handicap is for receiving or dealing.
27 /// \return Voluntary handicap of the player.
28 float Handicap_GetVoluntaryHandicap(entity player, bool receiving);
29
30 /// \brief Returns the forced handicap of the player.
31 /// \param[in] player Player to check.
32 /// \param[in] receiving Whether handicap is for receiving or dealing.
33 /// \return Forced handicap of the player.
34 float Handicap_GetForcedHandicap(entity player, bool receiving);
35
36 /// \brief Sets the forced handicap of the player.
37 /// \param[in] player Player to alter.
38 /// \param[in] value Handicap value to set.
39 /// \param[in] receiving Whether handicap is for receiving or dealing.
40 /// \return No return.
41 void Handicap_SetForcedHandicap(entity player, float value, bool receiving);
42
43 /// \brief Returns the total handicap of the player.
44 /// \param[in] player Player to check.
45 /// \param[in] receiving Whether handicap is for receiving or dealing.
46 /// \return Total handicap of the player.
47 float Handicap_GetTotalHandicap(entity player, bool receiving);