diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 38e13f41d0..b2e88e278a 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -58,14 +58,17 @@ var/datum/gas_mixture/breath - if(health <= HEALTH_THRESHOLD_FULLCRIT || (pulledby && pulledby.grab_state >= GRAB_KILL && !getorganslot("breathing_tube"))) - losebreath++ + 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 - else if(health <= HEALTH_THRESHOLD_CRIT) - losebreath += 0.25 //Suffocate - if(losebreath > 0) + if(losebreath >= 1) //You've missed a breath, take oxy damage + losebreath-- if(prob(10)) emote("gasp") if(istype(loc, /obj/)) @@ -115,9 +118,7 @@ if(!breath || (breath.total_moles() == 0) || !lungs) if(reagents.has_reagent("epinephrine") && lungs) return - var/oxy_loss = min(losebreath, 1) - adjustOxyLoss(oxy_loss) - losebreath -= oxy_loss + adjustOxyLoss(1) failed_last_breath = 1 throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy) return 0 @@ -154,7 +155,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 27b0406a04..834a99d1ec 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")