From: terencehill Date: Tue, 16 Nov 2021 13:17:30 +0000 (+0100) Subject: LMS: improve some cvar names and descriptions X-Git-Tag: xonotic-v0.8.6~426^2~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3fbd1a41b5b9a66c9cba7d66ac1be0a4970229ee;p=xonotic%2Fxonotic-data.pk3dir.git LMS: improve some cvar names and descriptions --- diff --git a/gamemodes-server.cfg b/gamemodes-server.cfg index cbd4b4062..41744478c 100644 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@ -449,11 +449,11 @@ set g_lms_regenerate 0 set g_lms_last_join 3 "if g_lms_join_anytime is 0, new players can only join if the worst active player has (fraglimit - g_lms_last_join) or more lives; in other words, new players can no longer join once the worst player loses more than g_lms_last_join lives" set g_lms_join_anytime 1 "1: new players can join, but get same amount of lives as the worst player; 0: new players can only join if the worst active player has (fraglimit - g_lms_last_join) or more lives" set g_lms_weaponarena "most_available" "starting weapons - takes the same options as g_weaponarena" -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_lives_diff 2 "players leading by at least this number of lives are considered leaders and are more visible" +set g_lms_leader_minpercent 0.5 "leading players are not considered leaders only if they are more than this percentage 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_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_leader_wp_interval 25 "periodically show again waypoints for leaders after this amount of time" +set g_lms_leader_wp_interval_jitter 10 "jitter waypoint interval by 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 aa8cdc538..5742b28a5 100644 --- a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc +++ b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc @@ -10,11 +10,11 @@ int autocvar_g_lms_extra_lives; bool autocvar_g_lms_join_anytime; int autocvar_g_lms_last_join; bool autocvar_g_lms_regenerate; -int autocvar_g_lms_leader_wp_lives = 2; -float autocvar_g_lms_leader_wp_max_relative = 0.5; +int autocvar_g_lms_leader_lives_diff = 2; +float autocvar_g_lms_leader_minpercent = 0.5; +float autocvar_g_lms_leader_wp_interval = 25; +float autocvar_g_lms_leader_wp_interval_jitter = 10; float autocvar_g_lms_leader_wp_time = 5; -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; @@ -29,7 +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; +float lms_leader_interval_jitter; // main functions int LMS_NewPlayerLives() @@ -168,8 +168,8 @@ void lms_UpdateLeaders() second_max_lives = lives; }); - int lives_diff = autocvar_g_lms_leader_wp_lives; - if (max_lives - second_max_lives >= lives_diff && pl_cnt_with_max_lives <= pl_cnt * autocvar_g_lms_leader_wp_max_relative) + int lives_diff = autocvar_g_lms_leader_lives_diff; + if (max_lives - second_max_lives >= lives_diff && pl_cnt_with_max_lives <= pl_cnt * autocvar_g_lms_leader_minpercent) FOREACH_CLIENT(IS_PLAYER(it) && it.frags != FRAGS_PLAYER_OUT_OF_GAME, { int lives = GameRules_scoring_add(it, LMS_LIVES, 0); if (lives == max_lives) @@ -356,7 +356,7 @@ void lms_RemovePlayer(entity player) player.frags = FRAGS_PLAYER_OUT_OF_GAME; TRANSMUTE(Observer, player); } - if (autocvar_g_lms_leader_wp_lives > 0) + if (autocvar_g_lms_leader_lives_diff > 0) lms_UpdateLeaders(); } @@ -425,12 +425,12 @@ MUTATOR_HOOKFUNCTION(lms, PlayerPreThink) MUTATOR_HOOKFUNCTION(lms, SV_StartFrame) { float leader_time = autocvar_g_lms_leader_wp_time; - float leader_repeat_time = leader_time + autocvar_g_lms_leader_wp_time_repeat; + float leader_interval = leader_time + autocvar_g_lms_leader_wp_interval; lms_visible_leaders_prev = lms_visible_leaders; - lms_visible_leaders = (time % leader_repeat_time < leader_time); + lms_visible_leaders = (time % leader_interval < 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_leader_interval_jitter = random() * autocvar_g_lms_leader_wp_interval_jitter; + leader_interval += lms_leader_interval_jitter; lms_leaders = 0; FOREACH_CLIENT(true, { @@ -519,7 +519,7 @@ MUTATOR_HOOKFUNCTION(lms, Damage_Calculate) MUTATOR_HOOKFUNCTION(lms, PlayerDied) { - if (!warmup_stage && autocvar_g_lms_leader_wp_lives > 0) + if (!warmup_stage && autocvar_g_lms_leader_lives_diff > 0) lms_UpdateLeaders(); }