From: terencehill Date: Tue, 16 Nov 2021 11:03:47 +0000 (+0100) Subject: LMS: jitter waypoint repeat time to make it less predictable X-Git-Tag: xonotic-v0.8.6~426^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5e944a1d92e3b6511c3d1c0474daee4e97110d76;p=xonotic%2Fxonotic-data.pk3dir.git LMS: jitter waypoint repeat time to make it less predictable --- diff --git a/gamemodes-server.cfg b/gamemodes-server.cfg index b821cb38c..cbd4b4062 100644 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@ -452,7 +452,8 @@ set g_lms_weaponarena "most_available" "starting weapons - takes the same option set g_lms_leader_wp_lives 2 "show waypoints for players leading by this number of lives" set g_lms_leader_wp_max_relative 0.5 "show waypoints for leaders only if they are max this fraction of total players" set g_lms_leader_wp_time 5 "show waypoints for leaders only for this amount of time" -set g_lms_leader_wp_time_repeat 30 "periodically show again waypoints for leaders after this amount of time" +set g_lms_leader_wp_time_jitter 10 "jitter waypoint repeat time by this amount of time" +set g_lms_leader_wp_time_repeat 25 "periodically show again waypoints for leaders after this amount of time" 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" diff --git a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc index 3d609a5a3..aa8cdc538 100644 --- a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc +++ b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc @@ -13,7 +13,8 @@ bool autocvar_g_lms_regenerate; int autocvar_g_lms_leader_wp_lives = 2; float autocvar_g_lms_leader_wp_max_relative = 0.5; float autocvar_g_lms_leader_wp_time = 5; -float autocvar_g_lms_leader_wp_time_repeat = 30; +float autocvar_g_lms_leader_wp_time_jitter = 10; +float autocvar_g_lms_leader_wp_time_repeat = 25; float autocvar_g_lms_dynamic_respawn_delay = 1; float autocvar_g_lms_dynamic_respawn_delay_base = 2; float autocvar_g_lms_dynamic_respawn_delay_increase = 3; @@ -28,6 +29,7 @@ int autocvar_g_lms_dynamic_vampire_min_lives_diff = 2; int lms_leaders; bool lms_visible_leaders; bool lms_visible_leaders_prev; +float lms_leader_time_jitter; // main functions int LMS_NewPlayerLives() @@ -426,6 +428,9 @@ MUTATOR_HOOKFUNCTION(lms, SV_StartFrame) float leader_repeat_time = leader_time + autocvar_g_lms_leader_wp_time_repeat; lms_visible_leaders_prev = lms_visible_leaders; lms_visible_leaders = (time % leader_repeat_time < leader_time); + if (lms_visible_leaders_prev && !lms_visible_leaders) + lms_leader_time_jitter = random() * autocvar_g_lms_leader_wp_time_jitter; + leader_repeat_time += lms_leader_time_jitter; lms_leaders = 0; FOREACH_CLIENT(true, {