From 134c3f5f39a0a4d1b85d7e6a2d0ce3813981092f Mon Sep 17 00:00:00 2001 From: KorPhaeron Date: Sun, 10 Sep 2017 12:36:42 -0500 Subject: [PATCH] Losebreath --- code/modules/mob/living/carbon/life.dm | 18 +++++++++++++++++- code/modules/surgery/organs/lungs.dm | 12 ++++++++---- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index d6d6084380..d0dd1796bf 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -58,11 +58,23 @@ var/datum/gas_mixture/breath +<<<<<<< HEAD if(health <= HEALTH_THRESHOLD_CRIT || (pulledby && pulledby.grab_state >= GRAB_KILL && !getorganslot("breathing_tube"))) losebreath++ //Suffocate if(losebreath > 0) +======= + if(!getorganslot("breathing_tube")) + if(health <= HEALTH_THRESHOLD_FULLCRIT || (pulledby && pulledby.grab_state >= GRAB_KILL)) + losebreath++ //You can't breath at all when in critical or when being choked, so you're going to miss a breath + + else if(health <= HEALTH_THRESHOLD_CRIT) + losebreath += 0.25 //You're having trouble breathing in soft crit, so you'll miss a breath one in four times + + //Suffocate + if(losebreath >= 1) //You've missed a breath, take oxy damage +>>>>>>> d4e09c9... Losebreath (#30580) losebreath-- if(prob(10)) emote("gasp") @@ -114,6 +126,10 @@ if(reagents.has_reagent("epinephrine") && lungs) return adjustOxyLoss(1) +<<<<<<< HEAD +======= + +>>>>>>> d4e09c9... Losebreath (#30580) failed_last_breath = 1 throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy) return 0 @@ -150,7 +166,7 @@ else //Enough oxygen failed_last_breath = 0 - if(oxyloss) + if(health >= HEALTH_THRESHOLD_CRIT) adjustOxyLoss(-5) oxygen_used = breath_gases["o2"][MOLES] clear_alert("not_enough_oxy") diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm index f95e2cd996..9ff80e760c 100644 --- a/code/modules/surgery/organs/lungs.dm +++ b/code/modules/surgery/organs/lungs.dm @@ -122,7 +122,8 @@ H.throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy) else H.failed_last_breath = FALSE - H.adjustOxyLoss(-5) + if(H.health >= HEALTH_THRESHOLD_CRIT) + H.adjustOxyLoss(-5) gas_breathed = breath_gases["o2"][MOLES] H.clear_alert("not_enough_oxy") @@ -149,7 +150,8 @@ H.throw_alert("nitro", /obj/screen/alert/not_enough_nitro) else H.failed_last_breath = FALSE - H.adjustOxyLoss(-5) + if(H.health >= HEALTH_THRESHOLD_CRIT) + H.adjustOxyLoss(-5) gas_breathed = breath_gases["n2"][MOLES] H.clear_alert("nitro") @@ -185,7 +187,8 @@ H.throw_alert("not_enough_co2", /obj/screen/alert/not_enough_co2) else H.failed_last_breath = FALSE - H.adjustOxyLoss(-5) + if(H.health >= HEALTH_THRESHOLD_CRIT) + H.adjustOxyLoss(-5) gas_breathed = breath_gases["co2"][MOLES] H.clear_alert("not_enough_co2") @@ -214,7 +217,8 @@ H.throw_alert("not_enough_tox", /obj/screen/alert/not_enough_tox) else H.failed_last_breath = FALSE - H.adjustOxyLoss(-5) + if(H.health >= HEALTH_THRESHOLD_CRIT) + H.adjustOxyLoss(-5) gas_breathed = breath_gases["plasma"][MOLES] H.clear_alert("not_enough_tox")