Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
scores_rules.qc
Go to the documentation of this file.
1#include "scores_rules.qh"
2
4#include <common/stats.qh>
6#include <server/client.qh>
7#include <server/scores.qh>
8#include <server/teamplay.qh>
9
11
13{
14 return boolean(teams & BIT(0)) + boolean(teams & BIT(1)) + boolean(teams & BIT(2)) + boolean(teams & BIT(3));
15}
16
17// NOTE: ST_constants may not be >= MAX_TEAMSCORE
18// scores that should be in all modes:
19void ScoreRules_basics(int teams, float sprio, float stprio, float score_enabled)
20{
21 FOREACH(Scores, true, {
23 });
24 for(int i = 0; i < MAX_TEAMSCORE; ++i)
26
31
32 if(score_enabled)
33 ScoreInfo_SetLabel_TeamScore(ST_SCORE, "score", stprio);
34
36 ScoreInfo_SetLabel_PlayerScore(SP_KILLS, "kills", 0);
37
39
41 {
43 if (teamplay)
44 ScoreInfo_SetLabel_PlayerScore(SP_TEAMKILLS, "teamkills", SFL_LOWER_IS_BETTER);
45 }
46
47 if(score_enabled)
48 ScoreInfo_SetLabel_PlayerScore(SP_SCORE, "score", sprio);
49
51 {
52 ScoreInfo_SetLabel_PlayerScore(SP_DMG, "dmg", 0);
54
57 }
58
59 if(STAT(SHOWFPS))
61}
62
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition bits.qh:8
#define boolean(value)
Definition bool.qh:9
entity teams
Definition main.qh:58
#define MAX_TEAMSCORE
Definition scores.qh:149
const int SFL_LOWER_IS_BETTER
Lower scores are better (e.g.
Definition scores.qh:102
const int ST_SCORE
Definition scores.qh:158
const int SFL_NOT_SORTABLE
Definition scores.qh:124
#define FOREACH(list, cond, body)
Definition iter.qh:19
#define STAT(...)
Definition stats.qh:94
void ScoreInfo_Init(int teams)
Initialize the scores info for the given number of teams.
Definition scores.qc:233
void ScoreInfo_SetLabel_TeamScore(int i, string label, int scoreflags)
Definition scores.qc:189
void ScoreInfo_SetLabel_PlayerScore(PlayerScoreField i, string label, int scoreflags)
Definition scores.qc:168
int autocvar_sv_showskill
void ScoreRules_basics_end()
void ScoreRules_basics(int teams, float sprio, float stprio, float score_enabled)
int NumTeams(int teams)
#define AVAILABLE_TEAMS
Number of teams that exist currently.
#define INDEPENDENT_PLAYERS
Definition client.qh:311
void Team_InitTeams()
Definition teamplay.qc:76
int teamplay_bitmask
The set of currently available teams (AVAILABLE_TEAMS is the number of them).
Definition teamplay.qh:18
bool teamplay
Definition teams.qh:59