]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
give downed players in battle royale some armor so that they don't die immediately
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Fri, 28 Jan 2022 03:50:09 +0000 (04:50 +0100)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Fri, 28 Jan 2022 05:42:14 +0000 (06:42 +0100)
gamemodes-server.cfg
qcsrc/common/gamemodes/gamemode/br/sv_br.qc

index a9cd7ed914ca82e971ccc348f561cd9632e10010..943d76c5ca554bd8f40426902bf688da5aa79bba 100644 (file)
@@ -584,6 +584,7 @@ set g_br_startweapons 0 "when disabled, players land from the dropship without w
 set g_br_bleed 0.02 "amount of health rot while injured"
 set g_br_bleedlinear 1 "linear amount of health rot while injured"
 set g_br_bleeding_health 0.5 "start health mutliplier when injured"
+set g_br_bleeding_armor 50 "start armor when injured"
 set g_br_revive_speed 0.4 "Speed for reviving an injured squadmate"
 set g_br_revive_clearspeed 1.6 "Speed at which reviving progress gets lost when out of range"
 set g_br_revive_extra_size 100 "Distance in qu that you can stand from an injured squadmate to keep reviving them"
index f9dec331f7bceec14e7b6f75216dc9711524771d..a6d466356e542f15d66de640ba9357b336c1182b 100644 (file)
@@ -40,6 +40,7 @@ const float drop_speed_vertical_max = 0.9;
 
 float autocvar_g_br_revive_health = 0.25;
 float autocvar_g_br_bleeding_health = 0.5;
+float autocvar_g_br_bleeding_armor = 50;
 float autocvar_g_br_drop_damage = 0.5;
 float autocvar_g_br_drop_speed_max = 2;
 float autocvar_g_br_drop_speed_min = 1.25;
@@ -691,7 +692,7 @@ MUTATOR_HOOKFUNCTION(br, PlayerDies, CBC_ORDER_FIRST)
     StatusEffects_removeall(frag_target, STATUSEFFECT_REMOVE_NORMAL);
 
     SetResource(frag_target, RES_HEALTH, start_health * max(autocvar_g_br_bleeding_health, 0));
-    SetResource(frag_target, RES_ARMOR, 0);
+    SetResource(frag_target, RES_ARMOR, max(autocvar_g_br_bleeding_armor, 0));
     Send_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_BR_DOWN_WAIT);
     STAT(BLEEDING, frag_target) = true;
 
@@ -805,7 +806,7 @@ MUTATOR_HOOKFUNCTION(br, GetResourceLimit)
             M_ARGV(2, float) *= max(autocvar_g_br_bleeding_health, 0);
             break;
         case RES_ARMOR:
-            M_ARGV(2, float) = 0;
+            M_ARGV(2, float) = max(autocvar_g_br_bleeding_armor, 0);
     }
 }
 
@@ -931,6 +932,7 @@ void br_Revive(entity player)
     }
     player.flags |= FL_PICKUPITEMS;
     SetResource(player, RES_HEALTH, start_health * max(autocvar_g_br_revive_health, 0));
+    SetResource(player, RES_ARMOR, 0);
 
     STAT(WEAPONS, player) = player.br_wepset_old;
     for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)