From: terencehill Date: Wed, 21 Apr 2021 08:39:44 +0000 (+0200) Subject: Merge branch 'master' into terencehill/freezetag_updates X-Git-Tag: xonotic-v0.8.5~405^2~32^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=579b98f2d87d5d2753618322ade31af1422d91ec;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into terencehill/freezetag_updates # Conflicts: # qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc --- 579b98f2d87d5d2753618322ade31af1422d91ec diff --cc qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc index 9bba0b3e5,54fac9a5a..8f6b800a3 --- a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc +++ b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc @@@ -583,24 -571,11 +601,24 @@@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink if (!n) // no teammate nearby { float clearspeed = autocvar_g_freezetag_revive_clearspeed; - if (autocvar_g_freezetag_revive_time_to_score > 0) - clearspeed = 0; // prevent stacking points by entering and exiting the revival zone many times if (STAT(FROZEN, player) == FROZEN_NORMAL) - STAT(REVIVE_PROGRESS, player) = bound(base_progress, STAT(REVIVE_PROGRESS, player) - frametime * clearspeed * (1 - base_progress), 1); + { + if (autocvar_g_freezetag_revive_time_to_score > 0) + { + if (STAT(REVIVE_PROGRESS, player) > base_progress) + { + // reduce auto-revival time based on manual revival progress + base_progress = STAT(REVIVE_PROGRESS, player); + player.freezetag_frozen_timeout = time + autocvar_g_freezetag_frozen_maxtime * (1 - STAT(REVIVE_PROGRESS, player)); + } + // don't clear revive progress, it would allow stacking points + // by entering and exiting the revival zone many times + STAT(REVIVE_PROGRESS, player) = base_progress; + } + else + STAT(REVIVE_PROGRESS, player) = bound(base_progress, STAT(REVIVE_PROGRESS, player) - frametime * clearspeed * (1 - base_progress), 1); + } - else if (!STAT(FROZEN, player)) + else if (!STAT(FROZEN, player) && !player_is_reviving) STAT(REVIVE_PROGRESS, player) = base_progress; // thawing nobody } else if (STAT(FROZEN, player) == FROZEN_NORMAL) // OK, there is at least one teammate reviving us @@@ -623,11 -599,10 +643,11 @@@ } // EVERY team mate nearby gets a point (even if multiple!) - for(entity it = reviving_players_first; it; it = it.chain) + for(entity it = revivers_first; it; it = it.chain) { GameRules_scoring_add(it, FREEZETAG_REVIVALS, +1); - GameRules_scoring_add(it, SCORE, +1); + if (autocvar_g_freezetag_revive_time_to_score <= 0) + GameRules_scoring_add(it, SCORE, +1); nades_GiveBonus(it, autocvar_g_nades_bonus_score_low); }