]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Allow rot and regeneration to be enabled individually in LMS
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Sat, 5 Feb 2022 11:01:52 +0000 (11:01 +0000)
committerterencehill <piuntn@gmail.com>
Sat, 5 Feb 2022 11:01:52 +0000 (11:01 +0000)
gamemodes-server.cfg
qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc

index 09c84f0f85a79cd552eb1e912c8046d9c452c8d5..1d2a0d70a945168d319ccda9b4e1a08dcb8675a2 100644 (file)
@@ -445,7 +445,8 @@ set g_keyhunt_team_spawns 0 "when 1, players spawn from the team spawnpoints of
 set g_lms 0 "Last Man Standing: everyone starts with a certain amount of lives, and the survivor wins"
 set g_lms_lives_override -1
 set g_lms_extra_lives 0
-set g_lms_regenerate 0
+set g_lms_regenerate 0 "health and/or armor regeneration, according to g_balance_health_regen and g_balance_armor_regen"
+set g_lms_rot 0 "health and/or armor rotting, according to g_balance_health_rot and g_balance_armor_rot"
 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_items 0 "enables items to spawn, weaponarena still disables weapons and ammo (to force all items to spawn, use g_pickup_items 1 instead)"
index c8cc0e6e565751b75aa3919ffeb4b4ddf3095f51..b1252794cd0d5de92e911827b2bf63763b9ea79b 100644 (file)
@@ -11,6 +11,7 @@ bool autocvar_g_lms_join_anytime;
 int autocvar_g_lms_last_join;
 bool autocvar_g_lms_items;
 bool autocvar_g_lms_regenerate;
+bool autocvar_g_lms_rot;
 
 // main functions
 int LMS_NewPlayerLives()
@@ -358,9 +359,11 @@ MUTATOR_HOOKFUNCTION(lms, PlayerPreThink)
 
 MUTATOR_HOOKFUNCTION(lms, PlayerRegen)
 {
-       if(autocvar_g_lms_regenerate)
-               return false;
-       return true;
+       if(!autocvar_g_lms_regenerate)
+               M_ARGV(2, float) = 0;
+       if(!autocvar_g_lms_rot)
+               M_ARGV(3, float) = 0;
+       return (!autocvar_g_lms_regenerate && !autocvar_g_lms_rot);
 }
 
 MUTATOR_HOOKFUNCTION(lms, ForbidThrowCurrentWeapon)