From 0180f7d9e81be2b24e52eb90b14e6823c5cdd357 Mon Sep 17 00:00:00 2001 From: terencehill Date: Wed, 21 Apr 2021 16:19:37 +0200 Subject: [PATCH] Freezetag: use an alternative lower revive speed if g_freezetag_revive_time_to_score is active but make so that revivals can be resumed at the same speed from the current revival progress: previously a revival always took 2.5 seconds, now it takes from 0 to 4 seconds --- gamemodes-server.cfg | 3 ++- qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc | 5 ++++- qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qh | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gamemodes-server.cfg b/gamemodes-server.cfg index 691299e44..bb17922f8 100644 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@ -367,7 +367,8 @@ set g_freezetag_warmup 10 "Time players get to run around before the round start set g_freezetag_point_limit -1 "Freeze Tag point limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)" set g_freezetag_point_leadlimit -1 "Freeze Tag point lead limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)" set g_freezetag_revive_speed 0.4 "Speed for reviving a frozen teammate" -set g_freezetag_revive_clearspeed 1.6 "Speed at which reviving progress gets lost when out of range" +set g_freezetag_revive_speed_t2s 0.25 "Speed for reviving a frozen teammate if g_freezetag_revive_time_to_score is active" +set g_freezetag_revive_clearspeed 1.6 "Speed at which reviving progress gets lost when out of range (if g_freezetag_revive_time_to_score is active reviving progress is not cleared)" set g_freezetag_revive_extra_size 100 "Distance in qu that you can stand from a frozen teammate to keep reviving him" set g_freezetag_revive_nade 1 "Enable reviving from own nade explosion" set g_freezetag_revive_nade_health 40 "Amount of health player has if they revived from their own nade explosion" diff --git a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc index 8f6b800a3..2b87c3453 100644 --- a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc +++ b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc @@ -623,7 +623,10 @@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST) } else if (STAT(FROZEN, player) == FROZEN_NORMAL) // OK, there is at least one teammate reviving us { - STAT(REVIVE_PROGRESS, player) = bound(base_progress, STAT(REVIVE_PROGRESS, player) + frametime * max(1/60, autocvar_g_freezetag_revive_speed * (1 - base_progress)), 1); + float spd = autocvar_g_freezetag_revive_speed_t2s; + if (autocvar_g_freezetag_revive_time_to_score <= 0) + spd = autocvar_g_freezetag_revive_speed * (1 - base_progress); + STAT(REVIVE_PROGRESS, player) = bound(base_progress, STAT(REVIVE_PROGRESS, player) + frametime * max(1/60, spd), 1); if(STAT(REVIVE_PROGRESS, player) >= 1) { diff --git a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qh b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qh index ef8eb64d5..6fdd693cc 100644 --- a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qh +++ b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qh @@ -42,6 +42,7 @@ float autocvar_g_freezetag_revive_auto_reducible_forcefactor = 0.01; float autocvar_g_freezetag_revive_auto_reducible_maxforce; float autocvar_g_freezetag_revive_extra_size; float autocvar_g_freezetag_revive_speed; +float autocvar_g_freezetag_revive_speed_t2s = 0.25; float autocvar_g_freezetag_revive_time_to_score = 1.5; bool autocvar_g_freezetag_revive_nade; float autocvar_g_freezetag_revive_nade_health; -- 2.39.2