From dd0bea114ad68084a5afdfd962d8c64c5183e386 Mon Sep 17 00:00:00 2001 From: Yoshax Date: Tue, 16 Aug 2016 17:55:08 +0100 Subject: [PATCH] Actually fixes lung rupturing and does so with less runtimes --- code/modules/mob/living/carbon/human/life.dm | 16 ++++++++++------ code/modules/organs/internal/lungs.dm | 7 +++---- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 1b55436106..b9bb3f07c7 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -332,12 +332,6 @@ adjustOxyLoss(-5) return - if(should_have_organ(O_LUNGS)) - var/obj/item/organ/internal/lungs/L = internal_organs_by_name[O_LUNGS] - if(breath.total_moles < BREATH_MOLES / 5 || breath.total_moles > BREATH_MOLES * 5) - if(!L.is_bruised() && prob(5)) - rupture_lung() - if(!breath || (breath.total_moles == 0) || suiciding) failed_last_breath = 1 if(suiciding) @@ -349,12 +343,22 @@ else adjustOxyLoss(HUMAN_CRIT_MAX_OXYLOSS) + if(should_have_organ(O_LUNGS)) + var/obj/item/organ/internal/lungs/L = internal_organs_by_name[O_LUNGS] + if(!L.is_bruised() && prob(5)) + if(breath.total_moles) + if(breath.total_moles < BREATH_MOLES / 5 || breath.total_moles > BREATH_MOLES * 5) + rupture_lung() + else + rupture_lung() + oxygen_alert = max(oxygen_alert, 1) return 0 var/safe_pressure_min = 16 // Minimum safe partial pressure of breathable gas in kPa + // Lung damage increases the minimum safe pressure. if(should_have_organ(O_LUNGS)) var/obj/item/organ/internal/lungs/L = internal_organs_by_name[O_LUNGS] diff --git a/code/modules/organs/internal/lungs.dm b/code/modules/organs/internal/lungs.dm index b8df5d4fde..ab0b10ddf8 100644 --- a/code/modules/organs/internal/lungs.dm +++ b/code/modules/organs/internal/lungs.dm @@ -18,16 +18,15 @@ owner.emote("cough") //respitory tract infection if(is_bruised()) - if(prob(2)) + if(prob(4)) spawn owner.emote("me", 1, "coughs up blood!") owner.drip(10) - if(prob(4)) + if(prob(8)) spawn owner.emote("me", 1, "gasps for air!") owner.losebreath += 15 - /obj/item/organ/internal/lungs/proc/rupture() var/obj/item/organ/external/parent = owner.get_organ(parent_organ) if(istype(parent)) owner.custom_pain("You feel a stabbing pain in your [parent.name]!", 1) - parent.bruise() \ No newline at end of file + bruise() \ No newline at end of file