From 8847c5eb4fdd2d09c85855e285e2f71f24397a1f Mon Sep 17 00:00:00 2001 From: wesoda25 <37246588+wesoda25@users.noreply.github.com> Date: Tue, 4 Feb 2020 16:07:59 -0500 Subject: [PATCH] Lung damage makes you cough (#49014) * Update lungs.dm * Update tgstation.dme * brain * onprocess not onspawn oops * Update tgstation.dme * please * Update lungs.dm * hopefully less shitcode * thx bro --- code/modules/surgery/organs/lungs.dm | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm index 1a2496bbb05..57879cd6203 100644 --- a/code/modules/surgery/organs/lungs.dm +++ b/code/modules/surgery/organs/lungs.dm @@ -11,8 +11,10 @@ healing_factor = STANDARD_ORGAN_HEALING decay_factor = STANDARD_ORGAN_DECAY + low_threshold_passed = "You feel short of breath." high_threshold_passed = "You feel some sort of constriction around your chest as your breathing becomes shallow and rapid." now_fixed = "Your lungs seem to once again be able to hold air." + low_threshold_cleared = "You can breathe normally again." high_threshold_cleared = "The constriction around your chest loosens as your breathing calms down." @@ -395,15 +397,17 @@ breath.temperature = H.bodytemperature /obj/item/organ/lungs/on_life() - ..() - if((!failed) && ((organ_flags & ORGAN_FAILING))) - if(owner.stat == CONSCIOUS) - owner.visible_message("[owner] grabs [owner.p_their()] throat, struggling for breath!", \ - "You suddenly feel like you can't breathe!") - failed = TRUE - else if(!(organ_flags & ORGAN_FAILING)) + . = ..() + if(failed && !(organ_flags & ORGAN_FAILING)) failed = FALSE - return + return + if(damage >= low_threshold) + var/do_i_cough = damage < high_threshold ? prob(5) : prob(10) // between : past high + if(do_i_cough) + owner.emote("cough") + if(organ_flags & ORGAN_FAILING && owner.stat == CONSCIOUS) + owner.visible_message("[owner] grabs [owner.p_their()] throat, struggling for breath!", "You suddenly feel like you can't breathe!") + failed = TRUE /obj/item/organ/lungs/plasmaman