Fix runtimes in lungs.dm

This commit is contained in:
Atermonera
2020-03-27 00:17:32 -07:00
committed by VirgoBot
parent c56a3dce6e
commit c49c1e40f3

View File

@@ -15,31 +15,43 @@
if(is_bruised()) if(is_bruised())
if(prob(4)) if(prob(4))
<<<<<<< HEAD
spawn() spawn()
owner?.emote("me", 1, "coughs up blood!") owner?.emote("me", 1, "coughs up blood!")
owner.drip(10) owner.drip(10)
if(prob(8)) if(prob(8))
spawn() spawn()
owner?.emote("me", 1, "gasps for air!") owner?.emote("me", 1, "gasps for air!")
=======
spawn owner?.emote("me", 1, "coughs up blood!")
owner.drip(10)
if(prob(8))
spawn owner?.emote("me", 1, "gasps for air!")
>>>>>>> 6f2aec5... Merge pull request #6906 from Meghan-Rossi/lungfix
owner.AdjustLosebreath(15) owner.AdjustLosebreath(15)
if(owner.internal_organs_by_name[O_BRAIN]) // As the brain starts having Trouble, the lungs start malfunctioning. if(owner.internal_organs_by_name[O_BRAIN]) // As the brain starts having Trouble, the lungs start malfunctioning.
var/obj/item/organ/internal/brain/Brain = owner.internal_organs_by_name[O_BRAIN] var/obj/item/organ/internal/brain/Brain = owner.internal_organs_by_name[O_BRAIN]
if(Brain.get_control_efficiency() <= 0.8) if(Brain.get_control_efficiency() <= 0.8)
if(prob(4 / max(0.1,Brain.get_control_efficiency()))) if(prob(4 / max(0.1,Brain.get_control_efficiency())))
<<<<<<< HEAD
spawn() spawn()
owner?.emote("me", 1, "gasps for air!") owner?.emote("me", 1, "gasps for air!")
=======
spawn owner?.emote("me", 1, "gasps for air!")
>>>>>>> 6f2aec5... Merge pull request #6906 from Meghan-Rossi/lungfix
owner.AdjustLosebreath(round(3 / max(0.1,Brain.get_control_efficiency()))) owner.AdjustLosebreath(round(3 / max(0.1,Brain.get_control_efficiency())))
/obj/item/organ/internal/lungs/proc/rupture() /obj/item/organ/internal/lungs/proc/rupture()
var/obj/item/organ/external/parent = owner.get_organ(parent_organ) if(owner)
if(istype(parent)) var/obj/item/organ/external/parent = owner.get_organ(parent_organ)
owner.custom_pain("You feel a stabbing pain in your [parent.name]!", 50) if(istype(parent))
owner.custom_pain("You feel a stabbing pain in your [parent.name]!", 50)
bruise() bruise()
/obj/item/organ/internal/lungs/handle_germ_effects() /obj/item/organ/internal/lungs/handle_germ_effects()
. = ..() //Up should return an infection level as an integer . = ..() //Up should return an infection level as an integer
if(!.) return if(!. || !owner) return
//Bacterial pneumonia //Bacterial pneumonia
if (. >= 1) if (. >= 1)
@@ -57,6 +69,6 @@
..() ..()
var/mob/living/carbon/human/H = null var/mob/living/carbon/human/H = null
spawn(15) spawn(15)
if(ishuman(owner)) if(owner && ishuman(owner))
H = owner H = owner
color = H.species.blood_color color = H.species.blood_color