From 33be2a8e76468ec14b5e67ec3114c501c3dbf9d5 Mon Sep 17 00:00:00 2001 From: IndexLP Date: Thu, 21 Aug 2014 18:39:12 -0400 Subject: [PATCH] Moves try_rupture_lung() to Human.DM next to the code for rupturing a lung, and makes it a proc for mob/living/carbon/human --- code/modules/mob/living/carbon/human/human.dm | 20 ++++++++++++++++++ code/modules/mob/living/carbon/human/life.dm | 21 ------------------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 1d6816d4445..828d105a5e0 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1111,6 +1111,26 @@ src.custom_pain("You feel a stabbing pain in your chest!", 1) L.damage = L.min_bruised_damage +//Gave the rupture_lung() call it's own proc to have much more control over it. +/mob/living/carbon/human/proc/try_lung_rupture(argBreath) + var/datum/gas_mixture/environment = loc.return_air() + var/datum/gas_mixture/breath = argBreath + var/pressure = environment.return_pressure() + var/adjusted_pressure = calculate_affecting_pressure(pressure) + + //High kPa + if(!is_lung_ruptured() && breath.total_moles > BREATH_MOLES * 5) + if(prob(5)) + rupture_lung() + return + //Low kPa + else if(!is_lung_ruptured() && internal && adjusted_pressure <= species.hazard_low_pressure) + if(internal.distribute_pressure >= species.warning_low_pressure) + if(prob(33)) + rupture_lung() + return + else + return /* /mob/living/carbon/human/verb/simulate() set name = "sim" diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index c21bf36795d..386b8d3008d 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -395,27 +395,6 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc if(damage && organs.len) var/datum/organ/external/O = pick(organs) if(istype(O)) O.add_autopsy_data("Radiation Poisoning", damage) - - //Gave the rupture_lung() call it's own proc to have much more control over it. - proc/try_lung_rupture(argBreath) - var/datum/gas_mixture/environment = loc.return_air() - var/datum/gas_mixture/breath = argBreath - var/pressure = environment.return_pressure() - var/adjusted_pressure = calculate_affecting_pressure(pressure) - - //High kPa - if(!is_lung_ruptured() && breath.total_moles > BREATH_MOLES * 5) - if(prob(5)) - rupture_lung() - return - //Low kPa - else if(!is_lung_ruptured() && internal && adjusted_pressure <= species.hazard_low_pressure) - if(internal.distribute_pressure >= species.warning_low_pressure) - if(prob(33)) - rupture_lung() - return - else - return proc/breathe() if(reagents.has_reagent("lexorin")) return