Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
scores_rules.qh File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define AVAILABLE_TEAMS   teamplay
 Number of teams that exist currently.

Functions

int NumTeams (int teams)
void ScoreRules_basics (int teams, float sprio, float stprio, float score_enabled)
void ScoreRules_basics_end ()

Macro Definition Documentation

◆ AVAILABLE_TEAMS

Function Documentation

◆ NumTeams()

int NumTeams ( int teams)

Definition at line 12 of file scores_rules.qc.

13{
14 return boolean(teams & BIT(0)) + boolean(teams & BIT(1)) + boolean(teams & BIT(2)) + boolean(teams & BIT(3));
15}
#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

References BIT, boolean, and teams.

Referenced by ctf_DelayedInit(), and ScoreRules_basics().

◆ ScoreRules_basics()

void ScoreRules_basics ( int teams,
float sprio,
float stprio,
float score_enabled )

Definition at line 19 of file scores_rules.qc.

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}
#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_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
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

References autocvar_sv_showskill, AVAILABLE_TEAMS, FOREACH, INDEPENDENT_PLAYERS, MAX_TEAMSCORE, NumTeams(), ScoreInfo_SetLabel_PlayerScore(), ScoreInfo_SetLabel_TeamScore(), SFL_LOWER_IS_BETTER, SFL_NOT_SORTABLE, ST_SCORE, STAT, Team_InitTeams(), teamplay, teamplay_bitmask, and teams.

◆ ScoreRules_basics_end()

void ScoreRules_basics_end ( )

Definition at line 63 of file scores_rules.qc.

64{
66}
void ScoreInfo_Init(int teams)
Initialize the scores info for the given number of teams.
Definition scores.qc:233

References ScoreInfo_Init(), and teamplay_bitmask.