3 //int autocvar_leadlimit;
4 int autocvar_leadlimit_and_fraglimit;
5 int autocvar_leadlimit_override;
7 // TODO: find a better location for these?
11 #define INGAME_STATUS_NONE 0
12 #define INGAME_STATUS_JOINING 0.5
13 #define INGAME_STATUS_JOINED 1
15 // typically used by game modes that temporarily turn players into spectators/observers
16 // when they are eliminated but keeping them "in game", i.e. listed among players
17 #define INGAME_STATUS_SET(it, s) (it).ingame = s
18 #define INGAME_STATUS_CLEAR(it) INGAME_STATUS_SET(it, INGAME_STATUS_NONE)
20 #define INGAME(it) ((it).ingame)
21 #define INGAME_JOINED(it) ((it).ingame == INGAME_STATUS_JOINED)
22 #define INGAME_JOINING(it) ((it).ingame == INGAME_STATUS_JOINING)
25 // todo: accept the number of teams as a parameter
26 void GameRules_teams(bool value);
29 * Used to disable team spawns in team modes
31 void GameRules_spawning_teams(bool value);
34 * Disabling score disables the "score" column on the scoreboard
36 void GameRules_score_enabled(bool value);
38 void GameRules_limit_score(int limit);
39 void GameRules_limit_lead(int limit);
40 void GameRules_limit_time(int limit);
41 void GameRules_limit_time_qualifying(int limit);
44 * Set any unspecified rules to their defaults
46 void GameRules_limit_fallbacks();
49 * @param teams a bitmask of active teams
50 * @param spprio player score priority (if frags aren't enabled)
51 * @param stprio team score priority (if frags aren't enabled)
53 #define GameRules_scoring(teams, spprio, stprio, fields) MACRO_BEGIN \
54 _GameRules_scoring_begin((teams), (spprio), (stprio)); \
55 noref void(entity, string, float) field = _GameRules_scoring_field; \
56 /* todo: just have the one `field` function */ \
57 noref void(int, string, float) field_team = _GameRules_scoring_field_team; \
59 _GameRules_scoring_end(); \
62 void _GameRules_scoring_begin(int teams, float spprio, float stprio);
63 void _GameRules_scoring_field(entity i, string label, int scoreflags);
64 void _GameRules_scoring_field_team(float i, string label, int scoreflags);
65 void _GameRules_scoring_end();
68 * Mark a player as being 'important' (flag carrier, ball carrier, etc)
69 * @param player the entity to mark
70 * @param value VIP status
72 void GameRules_scoring_vip(entity player, bool value);
73 bool GameRules_scoring_is_vip(entity player);
75 #define GameRules_scoring_add_float2int(client, fld, value, float_field, score_factor) \
76 _GameRules_scoring_add_float2int(client, SP_##fld, value, float_field, score_factor)
77 float _GameRules_scoring_add_float2int(entity client, entity sp, float value, .float field, float score_factor);
78 #define GameRules_scoring_add(client, fld, value) _GameRules_scoring_add(client, SP_##fld, value)
79 float _GameRules_scoring_add(entity client, entity sp, float value);
80 #define GameRules_scoring_add_team(client, fld, value) _GameRules_scoring_add_team(client, SP_##fld, ST_##fld, value)
81 float _GameRules_scoring_add_team(entity client, entity sp, int st, float value);