From: terencehill Date: Mon, 15 Nov 2021 16:53:11 +0000 (+0100) Subject: LMS: add max player respawn delay setting X-Git-Tag: xonotic-v0.8.6~426^2~7 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e821c05a599de7b9e1d74f4de225a384c9a02718;p=xonotic%2Fxonotic-data.pk3dir.git LMS: add max player respawn delay setting --- diff --git a/gamemodes-server.cfg b/gamemodes-server.cfg index d89511ab1..b821cb38c 100644 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@ -456,6 +456,7 @@ set g_lms_leader_wp_time_repeat 30 "periodically show again waypoints for leader set g_lms_dynamic_respawn_delay 1 "increase player respawn delay based on the number of lives less than the leader (NOTE: delay doesn't increase when only 2 players are left alive)" set g_lms_dynamic_respawn_delay_base 2 "base player respawn delay" set g_lms_dynamic_respawn_delay_increase 3 "increase base player respawn delay by this amount of time for each life less than the leader" +set g_lms_dynamic_respawn_delay_max 20 "max player respawn delay" set g_lms_dynamic_vampire 1 "attackers receive a fraction of health removed from enemies based on the number of lives less than the enemy" set g_lms_dynamic_vampire_factor_base 0.1 "base vampire factor" set g_lms_dynamic_vampire_factor_increase 0.1 "increase vampire factor by this fraction for each life less than the enemy" diff --git a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc index e3a41c9f8..db02ab184 100644 --- a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc +++ b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc @@ -17,6 +17,7 @@ float autocvar_g_lms_leader_wp_time_repeat; float autocvar_g_lms_dynamic_respawn_delay; float autocvar_g_lms_dynamic_respawn_delay_base; float autocvar_g_lms_dynamic_respawn_delay_increase; +float autocvar_g_lms_dynamic_respawn_delay_max; bool autocvar_g_lms_dynamic_vampire; float autocvar_g_lms_dynamic_vampire_factor_base; float autocvar_g_lms_dynamic_vampire_factor_increase; @@ -547,8 +548,9 @@ MUTATOR_HOOKFUNCTION(lms, CalculateRespawnTime) if (pl_cnt == 1) // player wasn't counted max_lives = 0; - player.respawn_time = time + autocvar_g_lms_dynamic_respawn_delay_base + + float dlay = autocvar_g_lms_dynamic_respawn_delay_base + autocvar_g_lms_dynamic_respawn_delay_increase * max(0, max_lives - pl_lives); + player.respawn_time = time + min(autocvar_g_lms_dynamic_respawn_delay_max, dlay); return true; }