3 // TODO: find a better location for these?
5 float redalive, bluealive, yellowalive, pinkalive;
7 // todo: accept the number of teams as a parameter
8 void GameRules_teams(bool value);
11 * Used to disable team spawns in team modes
13 void GameRules_spawning_teams(bool value);
16 * Disabling score disables the "score" column on the scoreboard
18 void GameRules_score_enabled(bool value);
20 void GameRules_limit_score(int limit);
21 void GameRules_limit_lead(int limit);
22 void GameRules_limit_time(int limit);
23 void GameRules_limit_time_qualifying(int limit);
26 * Set any unspecified rules to their defaults
28 void GameRules_limit_fallbacks();
31 * @param teams a bitmask of active teams
32 * @param spprio player score priority (if frags aren't enabled)
33 * @param stprio team score priority (if frags aren't enabled)
35 #define GameRules_scoring(teams, spprio, stprio, fields) MACRO_BEGIN { \
36 _GameRules_scoring_begin((teams), (spprio), (stprio)); \
37 noref void(entity, string, float) field = _GameRules_scoring_field; \
38 /* todo: just have the one `field` function */ \
39 noref void(int, string, float) field_team = _GameRules_scoring_field_team; \
41 _GameRules_scoring_end(); \
44 void _GameRules_scoring_begin(int teams, float spprio, float stprio);
45 void _GameRules_scoring_field(entity i, string label, int scoreflags);
46 void _GameRules_scoring_field_team(float i, string label, int scoreflags);
47 void _GameRules_scoring_end();
50 * Mark a player as being 'important' (flag carrier, ball carrier, etc)
51 * @param player the entity to mark
52 * @param value VIP status
54 void GameRules_scoring_vip(entity player, bool value);
55 bool GameRules_scoring_is_vip(entity player);
57 #define GameRules_scoring_add(client, fld, value) _GameRules_scoring_add(client, SP_##fld, value)
58 float _GameRules_scoring_add(entity client, entity sp, float value);
59 #define GameRules_scoring_add_team(client, fld, value) _GameRules_scoring_add_team(client, SP_##fld, ST_##fld, value)
60 float _GameRules_scoring_add_team(entity client, entity sp, int st, float value);