2 #define MAX_TEAMSCORE 2
5 * Attaches a PlayerScore entity to a player. Use that in ClientConnect.
6 * Remember to detach it in ClientDisconnect!
8 void PlayerScore_Attach(entity player);
11 * Detaches a PlayerScore entity from the player. Use that in ClientDisconnect.
13 void PlayerScore_Detach(entity player);
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.
20 void PlayerScore_Add(entity player, float scorefield, float score);
23 * Initialize the score of this player if needed.
24 * Does nothing in teamplay.
25 * Use that when a spectator becomes a player.
27 void PlayerScore_Clear(entity player);
30 * Adds a score to the player's team's scores.
31 * NEVER call this if team has not been set yet!
33 void TeamScore_Add(entity player, float scorefield, float score);
36 * Initialize the scores info for the given number of teams.
37 * Immediately set all labels afterwards.
39 void ScoreInfo_Init(float teams);
42 * Set the label of a team score item, as well as the scoring flags.
44 void ScoreInfo_SetLabel_TeamScore(float i, string label, float scoreflags);
47 * Set the label of a player score item, as well as the scoring flags.
49 void ScoreInfo_SetLabel_PlayerScore(float i, string label, float scoreflags);
52 * Lower scores are better (e.g. deaths)
54 #define SFL_DECREASING 1
57 * Scoring priority (NOTE: PRIMARY is used for fraglimit)
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
66 * Sets the following results for the current scores entities.
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
77 #define SP_SCORE 3 // personal score, game modes can set it their own way
80 #define SP_CTF_RETURNS 5
82 #define ST_CTF_SCORE 1
84 #define SP_KH_COLLECT 4
85 #define SP_KH_LOSEKEY 5
86 #define SP_KH_CAPTURE 6
88 #define SP_KH_DESTROYED 8