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 * Clear ALL scores (for ready-restart).
54 void Score_ClearAll();
57 * Lower scores are better (e.g. deaths)
59 #define SFL_DECREASING 1
62 * Scoring priority (NOTE: PRIMARY is used for fraglimit)
64 #define SFL_SORT_PRIO_LOW 2
65 #define SFL_SORT_PRIO_MED 4
66 #define SFL_SORT_PRIO_HIGH 8
67 #define SFL_SORT_PRIO_PRIMARY 14
68 #define SFL_SORT_PRIO_MASK 14
71 * Sets the following results for the current scores entities.
73 void WinningConditionHelper();
74 float WinningConditionHelper_topscore; ///< highest score
75 float WinningConditionHelper_equality; ///< 1 if and only if the top two have equal scores
76 float WinningConditionHelper_winnerteam; ///< the color of the winning team, or -1 if none
77 entity WinningConditionHelper_winner; ///< the winning player, or world if none
82 #define SP_SCORE 3 // personal score, game modes can set it their own way
85 #define SP_CTF_RETURNS 5
87 #define ST_CTF_SCORE 1
89 #define SP_KH_COLLECT 4
90 #define SP_KH_LOSEKEY 5
91 #define SP_KH_CAPTURE 6
93 #define SP_KH_DESTROYED 8