Xonotic
sv_clanarena.qh
Go to the documentation of this file.
1 #pragma once
2 
4 #include <server/elimination.qh>
7 
12 //int autocvar_g_ca_teams;
15 string autocvar_g_ca_weaponarena = "most";
16 
17 
20 
21 const int ST_CA_ROUNDS = 1;
22 
23 bool CA_CheckTeams();
24 bool CA_CheckWinner();
25 void CA_RoundStart();
26 bool ca_isEliminated(entity e);
27 
28 REGISTER_MUTATOR(ca, false)
29 {
32  {
33  GameRules_teams(true);
37 
39  if (ca_teams < 2)
40  ca_teams = cvar("g_ca_teams"); // read the cvar directly as it gets written earlier in the same frame
41 
42  ca_teams = BITS(bound(2, ca_teams, 4));
44  field_team(ST_CA_ROUNDS, "rounds", SFL_SORT_PRIO_PRIMARY);
45  });
46 
47  allowed_to_spawn = true;
51  }
52  return 0;
53 }
#define GameRules_scoring(teams, spprio, stprio, fields)
Definition: sv_rules.qh:53
#define MUTATOR_STATIC()
Definition: base.qh:288
void GameRules_spawning_teams(bool value)
Used to disable team spawns in team modes.
Definition: sv_rules.qc:22
int autocvar_g_ca_point_limit
Definition: sv_clanarena.qh:8
void round_handler_Spawn(bool() canRoundStart_func, bool() canRoundEnd_func, void() roundStart_func)
bool ca_isEliminated(entity e)
bool CA_CheckWinner()
Definition: sv_clanarena.qc:47
entity() spawn
void EliminatedPlayers_Init(float(entity) isEliminated_func)
Definition: elimination.qc:27
void GameRules_limit_score(int limit)
Definition: sv_rules.qc:34
const int SFL_SORT_PRIO_PRIMARY
Definition: scores.qh:127
bool allowed_to_spawn
Definition: sv_clanarena.qh:19
bool autocvar_g_ca_team_spawns
Definition: sv_clanarena.qh:11
REGISTER_MUTATOR(ca, false)
Definition: sv_clanarena.qh:28
int autocvar_g_ca_teams_override
Definition: sv_clanarena.qh:13
bool CA_CheckTeams()
Definition: sv_clanarena.qc:92
void GameRules_teams(bool value)
Definition: sv_rules.qc:6
int autocvar_g_ca_point_leadlimit
Definition: sv_clanarena.qh:9
float autocvar_g_ca_round_timelimit
Definition: sv_clanarena.qh:10
const int ST_CA_ROUNDS
Definition: sv_clanarena.qh:21
float autocvar_g_ca_warmup
Definition: sv_clanarena.qh:14
int ca_teams
Definition: sv_clanarena.qh:18
string autocvar_g_ca_weaponarena
Definition: sv_clanarena.qh:15
void GameRules_limit_lead(int limit)
Definition: sv_rules.qc:44
#define MUTATOR_ONADD
Definition: base.qh:284
void CA_RoundStart()
Definition: sv_clanarena.qc:87
void round_handler_Init(float the_delay, float the_count, float the_round_timelimit)
#define BITS(n)
Definition: bits.qh:9