From 6ff76309e28603af6e50d62145498ad0ea3160ee Mon Sep 17 00:00:00 2001 From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Fri, 28 Jan 2022 04:50:09 +0100 Subject: [PATCH] give downed players in battle royale some armor so that they don't die immediately --- gamemodes-server.cfg | 1 + qcsrc/common/gamemodes/gamemode/br/sv_br.qc | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gamemodes-server.cfg b/gamemodes-server.cfg index a9cd7ed91..943d76c5c 100644 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@ -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" diff --git a/qcsrc/common/gamemodes/gamemode/br/sv_br.qc b/qcsrc/common/gamemodes/gamemode/br/sv_br.qc index f9dec331f..a6d466356 100644 --- a/qcsrc/common/gamemodes/gamemode/br/sv_br.qc +++ b/qcsrc/common/gamemodes/gamemode/br/sv_br.qc @@ -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) -- 2.39.2