Xonotic
scores.qh
Go to the documentation of this file.
1 #pragma once
2 
3 #include <common/scores.qh>
4 
6 
7 entity scores_initialized; // non-NULL when scores labels/rules have been set
9 
14 void PlayerScore_Attach(entity player);
15 
19 void PlayerScore_Detach(entity player);
20 
27 float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score);
28 
35 float PlayerScore_Set(entity player, PlayerScoreField scorefield, float score);
36 
43 #define PlayerScore_Get(player, scorefield) PlayerScore_Add(player, scorefield, 0)
44 
51 float PlayerScore_Clear(entity player);
52 
58 float TeamScore_Add(entity player, float scorefield, float score);
59 
65 float TeamScore_AddToTeam(int t, float scorefield, float score);
66 
70 float TeamScore_GetCompareValue(float t);
71 
76 float PlayerTeamScore_Add(entity player, PlayerScoreField pscorefield, float tscorefield, float score);
77 
81 void ScoreInfo_SetLabel_TeamScore(float i, string label, float scoreflags);
82 
86 void ScoreInfo_SetLabel_PlayerScore(PlayerScoreField i, string label, float scoreflags);
87 
92 void ScoreInfo_Init(float teams);
93 
97 void Score_ClearAll();
98 
103 
107 void WinningConditionHelper(entity this);
117 #define WINNINGCONDITIONHELPER_LOWERISBETTER_WORST 999999999
118 
130 string GetPlayerScoreString(entity pl, float shortString);
131 string GetTeamScoreString(float tm, float shortString);
132 
141 entity PlayerScore_Sort(.float field, int teams, bool strict, bool nospectators);
void ScoreInfo_Init(float teams)
Initialize the scores info for the given number of teams.
bool autocvar_g_full_getstatus_responses
Definition: scores.qh:5
void WinningConditionHelper(entity this)
Sets the following results for the current scores entities.
Definition: scores.qc:415
float WinningConditionHelper_secondteam
the color of the second team, or -1 if none
Definition: scores.qh:111
entity PlayerScore_Sort(.float field, int teams, bool strict, bool nospectators)
Sorts the players and stores their place in the given field, starting with.
Definition: scores.qc:724
entity() spawn
float WinningConditionHelper_lowerisbetter
lower is better, duh
Definition: scores.qh:115
entity to
Definition: self.qh:96
void PlayerScore_Attach(entity player)
Attaches a PlayerScore entity to a player.
Definition: scores.qc:318
float scoreboard_pos
Definition: scores.qh:8
float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score)
Adds a score to the player&#39;s scores.
Definition: scores.qc:336
string GetTeamScoreString(float tm, float shortString)
Definition: scores.qc:648
float PlayerTeamScore_Add(entity player, PlayerScoreField pscorefield, float tscorefield, float score)
Adds a score to both the player and the team.
Definition: scores.qc:390
void ScoreInfo_SetLabel_TeamScore(float i, string label, float scoreflags)
Set the label of a team score item, as well as the scoring flags.
Definition: scores.qc:181
entity teams
Definition: main.qh:44
entity WinningConditionHelper_winner
the winning player, or NULL if none
Definition: scores.qh:113
string GetPlayerScoreString(entity pl, float shortString)
Returns score strings for eventlog etc.
Definition: scores.qc:586
float WinningConditionHelper_zeroisworst
zero is worst, duh
Definition: scores.qh:116
entity scores_initialized
Definition: scores.qh:7
float WinningConditionHelper_secondscore
second highest score
Definition: scores.qh:109
void PlayerScore_Detach(entity player)
Detaches a PlayerScore entity from the player.
Definition: scores.qc:328
void Score_NicePrint(entity to)
Prints the scores to the console of a player.
Definition: scores.qc:903
entity WinningConditionHelper_second
the second player, or NULL if none
Definition: scores.qh:114
float TeamScore_Add(entity player, float scorefield, float score)
Adds a score to the player&#39;s team&#39;s scores.
Definition: scores.qc:137
void Score_ClearAll()
Clear ALL scores (for ready-restart).
Definition: scores.qc:288
float PlayerScore_Clear(entity player)
Initialize the score of this player if needed.
Definition: scores.qc:267
float TeamScore_AddToTeam(int t, float scorefield, float score)
Adds a score to the given team.
Definition: scores.qc:108
void ScoreInfo_SetLabel_PlayerScore(PlayerScoreField i, string label, float scoreflags)
Set the label of a player score item, as well as the scoring flags.
Definition: scores.qc:165
float WinningConditionHelper_winnerteam
the color of the winning team, or -1 if none
Definition: scores.qh:110
float TeamScore_GetCompareValue(float t)
Returns a value indicating the team score (and higher is better).
Definition: scores.qc:783
float PlayerScore_Set(entity player, PlayerScoreField scorefield, float score)
Sets the player&#39;s score to the score parameter.
Definition: scores.qc:368
float WinningConditionHelper_topscore
highest score
Definition: scores.qh:108
float WinningConditionHelper_equality
we have no winner
Definition: scores.qh:112
entity PlayerScoreField
Definition: scores.qh:133