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
12
13bool IsTeamAvailable(int team_num)
14{
15 return boolean(ScoreRules_teams & Team_TeamToBit(team_num));
16}
17
19{
20 return boolean(teams & BIT(0)) + boolean(teams & BIT(1)) + boolean(teams & BIT(2)) + boolean(teams & BIT(3));
21}
22
23// NOTE: ST_constants may not be >= MAX_TEAMSCORE
24// scores that should be in all modes:
25void ScoreRules_basics(int teams, float sprio, float stprio, float score_enabled)
26{
27 FOREACH(Scores, true, {
29 });
30 for(int i = 0; i < MAX_TEAMSCORE; ++i)
32
35
36 if(score_enabled)
37 ScoreInfo_SetLabel_TeamScore(ST_SCORE, "score", stprio);
38
40 ScoreInfo_SetLabel_PlayerScore(SP_KILLS, "kills", 0);
41
43
45 {
47 if (teamplay)
48 ScoreInfo_SetLabel_PlayerScore(SP_TEAMKILLS, "teamkills", SFL_LOWER_IS_BETTER);
49 }
50
51 if(score_enabled)
52 ScoreInfo_SetLabel_PlayerScore(SP_SCORE, "score", sprio);
53
55 {
56 ScoreInfo_SetLabel_PlayerScore(SP_DMG, "dmg", 0);
58
61 }
62
63 if(STAT(SHOWFPS))
65}
66
71
#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
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
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
const int SFL_SORT_PRIO_PRIMARY
Definition scores.qh:134
#define FOREACH(list, cond, body)
Definition iter.qh:19
#define STAT(...)
Definition stats.qh:82
#define NULL
Definition post.qh:14
void ScoreInfo_Init(int teams)
Initialize the scores info for the given number of teams.
Definition scores.qc:232
void ScoreInfo_SetLabel_TeamScore(int i, string label, int scoreflags)
Definition scores.qc:188
void ScoreInfo_SetLabel_PlayerScore(PlayerScoreField i, string label, int scoreflags)
Definition scores.qc:167
bool IsTeamAvailable(int team_num)
bool autocvar_sv_showskill
int ScoreRules_teams
void ScoreRules_basics_end()
void ScoreRules_generic()
void ScoreRules_basics(int teams, float sprio, float stprio, float score_enabled)
int NumTeams(int teams)
#define AVAILABLE_TEAMS
#define INDEPENDENT_PLAYERS
Definition client.qh:311
#define GameRules_scoring(teams, spprio, stprio, fields)
Definition sv_rules.qh:58
void TeamBalance_Destroy(entity balance)
Destroy the team balance entity.
Definition teamplay.qc:599
int TeamBalance_GetAllowedTeams(entity balance)
Returns the bitmask of allowed teams.
Definition teamplay.qc:612
entity TeamBalance_CheckAllowedTeams(entity for_whom)
Checks whether the player can join teams according to global configuration and mutator settings.
Definition teamplay.qc:459
int Team_TeamToBit(int team_num)
Converts team value into bit value that is used in team bitmasks.
Definition teams.qh:199
bool teamplay
Definition teams.qh:59