]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/server/scores.qh
oops, KH uses 9 scores (REDUCE THEM!)
[divverent/nexuiz.git] / data / qcsrc / server / scores.qh
1 #define MAX_SCORE 9
2 #define MAX_TEAMSCORE 2
3
4 /**
5  * Attaches a PlayerScore entity to a player. Use that in ClientConnect.
6  * Remember to detach it in ClientDisconnect!
7  */
8 void PlayerScore_Attach(entity player);
9
10 /**
11  * Detaches a PlayerScore entity from the player. Use that in ClientDisconnect.
12  */
13 void PlayerScore_Detach(entity player);
14
15 /**
16  * Adds a score to the player's scores.
17  * NEVER call this if PlayerScore_Attach has not been called yet!
18  * Means: FIXME make players unable to join the game when not called ClientConnect yet.
19  */
20 void PlayerScore_Add(entity player, float scorefield, float score);
21
22 /**
23  * Initialize the score of this player if needed.
24  * Does nothing in teamplay.
25  * Use that when a spectator becomes a player.
26  */
27 void PlayerScore_Clear(entity player);
28
29 /**
30  * Adds a score to the player's team's scores.
31  * NEVER call this if team has not been set yet!
32  */
33 void TeamScore_Add(entity player, float scorefield, float score);
34
35 /**
36  * Initialize the scores info for the given number of teams.
37  * Immediately set all labels afterwards.
38  */
39 void ScoreInfo_Init(float teams);
40
41 /**
42  * Set the label of a team score item, as well as the scoring flags.
43  */
44 void ScoreInfo_SetLabel_TeamScore(float i, string label, float scoreflags);
45
46 /**
47  * Set the label of a player score item, as well as the scoring flags.
48  */
49 void ScoreInfo_SetLabel_PlayerScore(float i, string label, float scoreflags);
50
51 /**
52  * Lower scores are better (e.g. deaths)
53  */
54 #define SFL_DECREASING         1
55
56 /**
57  * Scoring priority (NOTE: PRIMARY is used for fraglimit)
58  */
59 #define SFL_SORT_PRIO_LOW      2
60 #define SFL_SORT_PRIO_MED      4
61 #define SFL_SORT_PRIO_HIGH     8
62 #define SFL_SORT_PRIO_PRIMARY 14
63 #define SFL_SORT_PRIO_MASK    14
64
65 /**
66  * Sets the following results for the current scores entities.
67  */
68 void WinningConditionHelper();
69 float WinningConditionHelper_topscore;   ///< highest score
70 float WinningConditionHelper_equality;   ///< 1 if and only if the top two have equal scores
71 float WinningConditionHelper_winnerteam; ///< the color of the winning team, or -1 if none
72 entity WinningConditionHelper_winner;    ///< the winning player, or world if none
73
74 #define SP_KILLS 0
75 #define SP_DEATHS 1
76 #define SP_SUICIDES 2
77 #define SP_SCORE 3 // personal score, game modes can set it their own way
78
79 #define SP_CTF_CAPS 4
80 #define SP_CTF_RETURNS 5
81 #define ST_CTF_CAPS 0
82 #define ST_CTF_SCORE 1
83
84 #define SP_KH_COLLECT 4
85 #define SP_KH_LOSEKEY 5
86 #define SP_KH_CAPTURE 6
87 #define SP_KH_PUSH 7
88 #define SP_KH_DESTROYED 8
89 #define ST_KH_CAPS 0
90 #define ST_KH_SCORE 1