Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
scores.qh
Go to the documentation of this file.
1#pragma once
2
3#include <common/scores.qh>
4
6
7entity scores_initialized; // non-NULL when scores labels/rules have been set
8
13void PlayerScore_Attach(entity player);
14
18void PlayerScore_Detach(entity player);
19
26float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score);
27
34float PlayerScore_Set(entity player, PlayerScoreField scorefield, float score);
35
42#define PlayerScore_Get(player, scorefield) PlayerScore_Add(player, scorefield, 0)
43
50bool PlayerScore_Clear(entity player);
51
57float TeamScore_Add(entity player, float scorefield, float score);
58
64float TeamScore_AddToTeam(int t, float scorefield, float score);
65
69float TeamScore_GetCompareValue(float t);
70
75float PlayerTeamScore_Add(entity player, PlayerScoreField pscorefield, float tscorefield, float score);
76
80void ScoreInfo_SetLabel_TeamScore(int i, string label, float scoreflags);
81
85void ScoreInfo_SetLabel_PlayerScore(PlayerScoreField i, string label, float scoreflags);
86
91void ScoreInfo_Init(int teams);
92
96void Score_ClearAll();
97
101void Score_NicePrint(entity to);
102
116#define WINNINGCONDITIONHELPER_LOWERISBETTER_WORST 999999999
117
129string GetPlayerScoreString(entity pl, float shortString);
130string GetTeamScoreString(int tm, float shortString);
131
140entity PlayerScore_Sort(.float field, int teams, bool strict, bool nospectators);
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
entity teams
Definition main.qh:58
entity PlayerScoreField
Definition scores.qh:140
float WinningConditionHelper_secondscore
second highest score
Definition scores.qh:108
void PlayerScore_Detach(entity player)
Detaches a PlayerScore entity from the player.
Definition scores.qc:344
string GetTeamScoreString(int tm, float shortString)
Definition scores.qc:674
float TeamScore_Add(entity player, float scorefield, float score)
Adds a score to the player's team's scores.
Definition scores.qc:134
entity WinningConditionHelper_second
the second player, or NULL if none
Definition scores.qh:113
float TeamScore_GetCompareValue(float t)
Returns a value indicating the team score (and higher is better).
Definition scores.qc:806
void WinningConditionHelper(entity this)
Sets the following results for the current scores entities.
Definition scores.qc:443
entity scores_initialized
Definition scores.qh:7
void ScoreInfo_Init(int teams)
Initialize the scores info for the given number of teams.
Definition scores.qc:232
void Score_ClearAll()
Clear ALL scores (for ready-restart).
Definition scores.qc:306
void ScoreInfo_SetLabel_PlayerScore(PlayerScoreField i, string label, float scoreflags)
Set the label of a player score item, as well as the scoring flags.
float WinningConditionHelper_winnerteam
the color of the winning team, or -1 if none
Definition scores.qh:109
float TeamScore_AddToTeam(int t, float scorefield, float score)
Adds a score to the given team.
Definition scores.qc:107
entity WinningConditionHelper_winner
the winning player, or NULL if none
Definition scores.qh:112
float WinningConditionHelper_topscore
highest score
Definition scores.qh:107
float WinningConditionHelper_equality
we have no winner
Definition scores.qh:111
float PlayerTeamScore_Add(entity player, PlayerScoreField pscorefield, float tscorefield, float score)
Adds a score to both the player and the team.
Definition scores.qc:406
void PlayerScore_Attach(entity player)
Attaches a PlayerScore entity to a player.
Definition scores.qc:334
void Score_NicePrint(entity to)
Prints the scores to the console of a player.
Definition scores.qc:917
bool autocvar_g_full_getstatus_responses
Definition scores.qh:5
float WinningConditionHelper_lowerisbetter
lower is better, duh
Definition scores.qh:114
float WinningConditionHelper_zeroisworst
zero is worst, duh
Definition scores.qh:115
void ScoreInfo_SetLabel_TeamScore(int i, string label, float scoreflags)
Set the label of a team score item, as well as the scoring flags.
string GetPlayerScoreString(entity pl, float shortString)
Returns score strings for eventlog etc.
Definition scores.qc:613
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:748
float WinningConditionHelper_secondteam
the color of the second team, or -1 if none
Definition scores.qh:110
float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score)
Adds a score to the player's scores.
Definition scores.qc:352
float PlayerScore_Set(entity player, PlayerScoreField scorefield, float score)
Sets the player's score to the score parameter.
Definition scores.qc:384
bool PlayerScore_Clear(entity player)
Initialize the score of this player if needed.
Definition scores.qc:285