From 4325c025efe99dc9737a816e2f361fd976d52395 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Thu, 13 Aug 2020 05:37:02 +0200 Subject: [PATCH] [MIRROR] Fixes staminacrit not paralyzing (#331) * Fixes staminacrit not paralyzing (#52906) Additionally removes the now-superfluous stam_paralyzed variable. We can already track this with the incapacitated effect from the stamina source. * Fixes staminacrit not paralyzing Co-authored-by: Rohesie Co-authored-by: Useroth <37159550+Useroth@users.noreply.github.com> --- code/datums/components/embedded.dm | 2 +- code/modules/mob/living/carbon/carbon.dm | 7 ++++--- code/modules/mob/living/carbon/carbon_defines.dm | 1 - code/modules/mob/living/carbon/life.dm | 2 +- code/modules/mob/living/carbon/status_procs.dm | 13 +++++++------ 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/code/datums/components/embedded.dm b/code/datums/components/embedded.dm index 039486a2bd3..cbb7c39a83d 100644 --- a/code/datums/components/embedded.dm +++ b/code/datums/components/embedded.dm @@ -133,7 +133,7 @@ var/damage = weapon.w_class * pain_mult var/pain_chance_current = pain_chance - if(pain_stam_pct && victim.stam_paralyzed) //if it's a less-lethal embed, give them a break if they're already stamcritted + if(pain_stam_pct && HAS_TRAIT_FROM(victim, TRAIT_INCAPACITATED, STAMINA)) //if it's a less-lethal embed, give them a break if they're already stamcritted pain_chance_current *= 0.2 damage *= 0.5 else if(victim.mobility_flags & ~MOBILITY_STAND) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 16cb4702b25..59a729057e4 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -554,9 +554,10 @@ var/stam = getStaminaLoss() if(stam > DAMAGE_PRECISION && (maxHealth - stam) <= crit_threshold && !stat) enter_stamcrit() - else if(stam_paralyzed) - stam_paralyzed = FALSE - REMOVE_TRAIT(src,TRAIT_INCAPACITATED, STAMINA) + else if(HAS_TRAIT_FROM(src, TRAIT_INCAPACITATED, STAMINA)) + REMOVE_TRAIT(src, TRAIT_INCAPACITATED, STAMINA) + REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, STAMINA) + REMOVE_TRAIT(src, TRAIT_FLOORED, STAMINA) else return update_health_hud() diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index d036c1613e3..77002d61400 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -62,7 +62,6 @@ var/drunkenness = 0 ///Overall drunkenness var/stam_regen_start_time = 0 ///used to halt stamina regen temporarily - var/stam_paralyzed = FALSE ///knocks you down /// Protection (insulation) from the heat, Value 0-1 corresponding to the percentage of protection var/heat_protection = 0 // No heat protection diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 35d38343cd0..23677909bb3 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -333,7 +333,7 @@ var/stam_regen = FALSE if(stam_regen_start_time <= world.time) stam_regen = TRUE - if(stam_paralyzed) + if(HAS_TRAIT_FROM(src, TRAIT_INCAPACITATED, STAMINA)) . |= BODYPART_LIFE_UPDATE_HEALTH //make sure we remove the stamcrit for(var/I in bodyparts) var/obj/item/bodypart/BP = I diff --git a/code/modules/mob/living/carbon/status_procs.dm b/code/modules/mob/living/carbon/status_procs.dm index efe07be2f79..92bcd7685ce 100644 --- a/code/modules/mob/living/carbon/status_procs.dm +++ b/code/modules/mob/living/carbon/status_procs.dm @@ -4,19 +4,20 @@ /mob/living/carbon/IsParalyzed(include_stamcrit = TRUE) - return ..() || (include_stamcrit && stam_paralyzed) + return ..() || (include_stamcrit && HAS_TRAIT_FROM(src, TRAIT_INCAPACITATED, STAMINA)) /mob/living/carbon/proc/enter_stamcrit() if(!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)) return + if(HAS_TRAIT_FROM(src, TRAIT_INCAPACITATED, STAMINA)) //Already in stamcrit + return if(absorb_stun(0)) //continuous effect, so we don't want it to increment the stuns absorbed. return - if(!IsParalyzed()) - to_chat(src, "You're too exhausted to keep going...") - var/prev = stam_paralyzed - stam_paralyzed = TRUE + to_chat(src, "You're too exhausted to keep going...") ADD_TRAIT(src, TRAIT_INCAPACITATED, STAMINA) - if(!prev && getStaminaLoss() < 120) // Puts you a little further into the initial stamcrit, makes stamcrit harder to outright counter with chems. + ADD_TRAIT(src, TRAIT_IMMOBILIZED, STAMINA) + ADD_TRAIT(src, TRAIT_FLOORED, STAMINA) + if(getStaminaLoss() < 120) // Puts you a little further into the initial stamcrit, makes stamcrit harder to outright counter with chems. adjustStaminaLoss(30, FALSE) update_mobility()