X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fgamemodes%2Fsv_rules.qh;h=2efcf19738aa34ee1b4d2aee1e22a3c74db1274f;hb=696eba76e32c34cd859c690133eb7c5a3d891f59;hp=1b0f8a7bd89128fccc844f0fc05ccdf243608b91;hpb=546842f7e5a63b11a9b862dbf1709318bb97689b;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/gamemodes/sv_rules.qh b/qcsrc/common/gamemodes/sv_rules.qh index 1b0f8a7bd..2efcf1973 100644 --- a/qcsrc/common/gamemodes/sv_rules.qh +++ b/qcsrc/common/gamemodes/sv_rules.qh @@ -1,8 +1,27 @@ #pragma once +//int autocvar_leadlimit; +int autocvar_leadlimit_and_fraglimit; +int autocvar_leadlimit_override; + // TODO: find a better location for these? int total_players; +.int ingame; +#define INGAME_STATUS_NONE 0 +#define INGAME_STATUS_JOINING 0.5 +#define INGAME_STATUS_JOINED 1 + +// typically used by game modes that temporarily turn players into spectators/observers +// when they are eliminated but keeping them "in game", i.e. listed among players +#define INGAME_STATUS_SET(it, s) (it).ingame = s +#define INGAME_STATUS_CLEAR(it) INGAME_STATUS_SET(it, INGAME_STATUS_NONE) + +#define INGAME(it) ((it).ingame) +#define INGAME_JOINED(it) ((it).ingame == INGAME_STATUS_JOINED) +#define INGAME_JOINING(it) ((it).ingame == INGAME_STATUS_JOINING) + + // todo: accept the number of teams as a parameter void GameRules_teams(bool value); @@ -53,6 +72,9 @@ void _GameRules_scoring_end(); void GameRules_scoring_vip(entity player, bool value); bool GameRules_scoring_is_vip(entity player); +#define GameRules_scoring_add_float2int(client, fld, value, float_field, score_factor) \ + _GameRules_scoring_add_float2int(client, SP_##fld, value, float_field, score_factor) +float _GameRules_scoring_add_float2int(entity client, entity sp, float value, .float field, float score_factor); #define GameRules_scoring_add(client, fld, value) _GameRules_scoring_add(client, SP_##fld, value) float _GameRules_scoring_add(entity client, entity sp, float value); #define GameRules_scoring_add_team(client, fld, value) _GameRules_scoring_add_team(client, SP_##fld, ST_##fld, value)