From 77b9e17220f2dda92a3973978238481bb39c59c9 Mon Sep 17 00:00:00 2001 From: Lyberta Date: Thu, 4 May 2017 00:04:28 +0300 Subject: [PATCH] Survival: Added stealth option. --- .../mutators/mutator/gamemode_survival.qc | 28 +++++++++++++------ survival.cfg | 1 + 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/qcsrc/server/mutators/mutator/gamemode_survival.qc b/qcsrc/server/mutators/mutator/gamemode_survival.qc index 86ac5700c..1056c886f 100644 --- a/qcsrc/server/mutators/mutator/gamemode_survival.qc +++ b/qcsrc/server/mutators/mutator/gamemode_survival.qc @@ -61,6 +61,8 @@ int autocvar_g_surv_point_leadlimit; ///< Maximum lead of a single team. /// \brief How much players are allowed in teams (excluding cannon fodder). int autocvar_g_surv_team_size; +/// \brief If set, defenders will not be shown on the radar. +int autocvar_g_surv_stealth; /// \brief Whether to force overkill player models for attackers. int autocvar_g_surv_attacker_force_overkill_models; @@ -1352,6 +1354,10 @@ void Surv_RoundStart() break; } } + if (autocvar_g_surv_stealth) + { + return; + } FOREACH_CLIENT(IS_PLAYER(it), { switch (it.team) @@ -2116,15 +2122,6 @@ MUTATOR_HOOKFUNCTION(surv, PlayerDamaged) return; } Surv_UpdateDefenderHealthStat(); - if (target.health < 1) - { - WaypointSprite_Kill(target.surv_attack_sprite); - } - else - { - WaypointSprite_UpdateHealth(target.surv_attack_sprite, target.health + - target.armorvalue); - } entity attacker = M_ARGV(0, entity); if ((attacker.team == surv_attackerteam) && (attacker.surv_role == SURVIVAL_ROLE_PLAYER)) @@ -2134,6 +2131,19 @@ MUTATOR_HOOKFUNCTION(surv, PlayerDamaged) float score = (health + armor) * autocvar_g_surv_attacker_damage_score; PlayerScore_Add(attacker, SP_SCORE, score); } + if (autocvar_g_surv_stealth) + { + return; + } + if (target.health < 1) + { + WaypointSprite_Kill(target.surv_attack_sprite); + } + else + { + WaypointSprite_UpdateHealth(target.surv_attack_sprite, target.health + + target.armorvalue); + } } /// \brief Hook which is called when the player dies. diff --git a/survival.cfg b/survival.cfg index 038cdc826..2a9d95bbe 100644 --- a/survival.cfg +++ b/survival.cfg @@ -19,6 +19,7 @@ set g_surv_round_timelimit 300 "Round time limit in seconds" seta g_surv_point_limit -1 "Survival point limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)" seta g_surv_point_leadlimit -1 "Survival point lead limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)" set g_surv_team_size 4 "How much players are allowed in teams (excluding cannon fodder)" +set g_surv_stealth 0 "If set, defenders will not be shown on the radar" set g_surv_attacker_force_overkill_models 0 "Whether to force overkill player models for attackers" set g_surv_defender_force_overkill_models 1 "Whether to force overkill player models for defenders" -- 2.39.5