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

Functions

bool IsTeamAvailable (int team_num)
int NumTeams (int teams)
void ScoreRules_basics (int teams, float sprio, float stprio, float score_enabled)
void ScoreRules_basics_end ()
void ScoreRules_generic ()

Macro Definition Documentation

◆ AVAILABLE_TEAMS

Function Documentation

◆ IsTeamAvailable()

bool IsTeamAvailable ( int team_num)

Definition at line 13 of file scores_rules.qc.

14{
15 return boolean(ScoreRules_teams & Team_TeamToBit(team_num));
16}
#define boolean(value)
Definition bool.qh:9
int ScoreRules_teams
int Team_TeamToBit(int team_num)
Converts team value into bit value that is used in team bitmasks.
Definition teams.qh:199

References boolean, ScoreRules_teams, and Team_TeamToBit().

Referenced by GameCommand_moveplayer().

◆ NumTeams()

int NumTeams ( int teams)

Definition at line 18 of file scores_rules.qc.

19{
20 return boolean(teams & BIT(0)) + boolean(teams & BIT(1)) + boolean(teams & BIT(2)) + boolean(teams & BIT(3));
21}
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition bits.qh:8
entity teams
Definition main.qh:58

References BIT, boolean, and teams.

Referenced by CA_CheckTeams(), ctf_DelayedInit(), freezetag_CheckTeams(), GoalTouch(), kh_GetMissingTeams(), kh_Key_AllOwnedByWhichTeam(), kh_LoserTeam(), kh_StartRound(), kh_WinnerTeam(), and ScoreRules_basics().

◆ ScoreRules_basics()

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

Definition at line 25 of file scores_rules.qc.

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}
#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:82
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 autocvar_sv_showskill
int NumTeams(int teams)
#define AVAILABLE_TEAMS
#define INDEPENDENT_PLAYERS
Definition client.qh:311
bool teamplay
Definition teams.qh:59

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

◆ ScoreRules_basics_end()

void ScoreRules_basics_end ( )

Definition at line 67 of file scores_rules.qc.

68{
70}
void ScoreInfo_Init(int teams)
Initialize the scores info for the given number of teams.
Definition scores.qc:232

References ScoreInfo_Init(), and ScoreRules_teams.

◆ ScoreRules_generic()

void ScoreRules_generic ( )

Definition at line 72 of file scores_rules.qc.

73{
74 int teams = 0;
75 if (teamplay)
76 {
79 TeamBalance_Destroy(balance);
80 }
82}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
const int SFL_SORT_PRIO_PRIMARY
Definition scores.qh:134
#define NULL
Definition post.qh:14
#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

References entity(), GameRules_scoring, NULL, SFL_SORT_PRIO_PRIMARY, TeamBalance_CheckAllowedTeams(), TeamBalance_Destroy(), TeamBalance_GetAllowedTeams(), teamplay, and teams.

Referenced by GameplayMode_DelayedInit().