Merge pull request #2685 from Citadel-Station-13/upstream-merge-30580

[MIRROR] Fixes breathing from softcrit (hopefully)
This commit is contained in:
LetterJay
2017-09-12 01:09:54 -05:00
committed by GitHub
2 changed files with 18 additions and 13 deletions
+10 -9
View File
@@ -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")
+8 -4
View File
@@ -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")