From 134c3f5f39a0a4d1b85d7e6a2d0ce3813981092f Mon Sep 17 00:00:00 2001 From: KorPhaeron Date: Sun, 10 Sep 2017 12:36:42 -0500 Subject: [PATCH 1/5] 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") From beed20c1308a6322315a3858b0febcecd612deee Mon Sep 17 00:00:00 2001 From: LetterJay Date: Mon, 11 Sep 2017 18:52:14 -0500 Subject: [PATCH 2/5] Update life.dm --- code/modules/mob/living/carbon/life.dm | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index d0dd1796bf..8cb7043bad 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -58,13 +58,6 @@ 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 @@ -74,7 +67,6 @@ //Suffocate if(losebreath >= 1) //You've missed a breath, take oxy damage ->>>>>>> d4e09c9... Losebreath (#30580) losebreath-- if(prob(10)) emote("gasp") @@ -126,10 +118,6 @@ 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 From d0451037449a5f8d08b35b4d2891981c5c6aa9a4 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Tue, 12 Sep 2017 00:48:22 -0500 Subject: [PATCH 3/5] Update life.dm --- code/modules/mob/living/carbon/life.dm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 4f6e28ebf2..9065ceb30a 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -65,11 +65,11 @@ 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 + //Suffocate if(losebreath >= 1) //You've missed a breath, take oxy damage losebreath-- - if(prob(10)) - emote("gasp") + if(prob(10)) + emote("gasp") if(istype(loc, /obj/)) var/obj/loc_as_obj = loc loc_as_obj.handle_internal_lifeform(src,0) @@ -117,9 +117,7 @@ loc_as_obj.handle_internal_lifeform(src,0) 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 From 2ae18cd35e65abc116389dcbea0b0473f283b961 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Tue, 12 Sep 2017 00:52:07 -0500 Subject: [PATCH 4/5] Update life.dm --- code/modules/mob/living/carbon/life.dm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 9065ceb30a..60900e298f 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -65,14 +65,14 @@ 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 - losebreath-- - if(prob(10)) - emote("gasp") +//Start of a breath chain, calls breathe() +/mob/living/carbon/handle_breathing(times_fired) + if((times_fired % 4) == 2 || failed_last_breath) + breathe() //Breathe per 4 ticks, unless suffocating + else if(istype(loc, /obj/)) - var/obj/loc_as_obj = loc -loc_as_obj.handle_internal_lifeform(src,0) + var/obj/location_as_object = loc + location_as_object.handle_internal_lifeform(src,0) else //Breathe from internal breath = get_breath_from_internal(BREATH_VOLUME) From fcbebe64235143a218bb1fa116191ec18319fac9 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Tue, 12 Sep 2017 01:03:11 -0500 Subject: [PATCH 5/5] Update life.dm --- code/modules/mob/living/carbon/life.dm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 60900e298f..b2e88e278a 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -65,14 +65,15 @@ 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 -//Start of a breath chain, calls breathe() -/mob/living/carbon/handle_breathing(times_fired) - if((times_fired % 4) == 2 || failed_last_breath) - breathe() //Breathe per 4 ticks, unless suffocating - else + + //Suffocate + if(losebreath >= 1) //You've missed a breath, take oxy damage + losebreath-- + if(prob(10)) + emote("gasp") if(istype(loc, /obj/)) - var/obj/location_as_object = loc - location_as_object.handle_internal_lifeform(src,0) + var/obj/loc_as_obj = loc + loc_as_obj.handle_internal_lifeform(src,0) else //Breathe from internal breath = get_breath_from_internal(BREATH_VOLUME)