From 0390dce2e6f95b9a1efa775e098419cd85e5ef2c Mon Sep 17 00:00:00 2001 From: LetterJay Date: Fri, 30 Jun 2017 10:35:24 -0500 Subject: [PATCH] Update heart.dm --- code/modules/surgery/organs/heart.dm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm index 9ffe8b6d06..1e81c1c609 100644 --- a/code/modules/surgery/organs/heart.dm +++ b/code/modules/surgery/organs/heart.dm @@ -47,6 +47,25 @@ var/obj/S = ..() S.icon_state = "heart-off" return S + +/obj/item/organ/heart/on_life() + if(owner.client) + var/sound/slowbeat = sound('sound/health/slowbeat.ogg', repeat = TRUE) + + var/sound/fastbeat = sound('sound/health/fastbeat.ogg', repeat = TRUE) + var/mob/living/carbon/H = owner + if(H.health <= HEALTH_THRESHOLD_CRIT && beat != BEAT_SLOW) + beat = BEAT_SLOW + H.playsound_local(get_turf(H), slowbeat,40,0, channel = CHANNEL_HEARTBEAT) + to_chat(owner, "You feel your heart slow down...") + if(beat == BEAT_SLOW && H.health > HEALTH_THRESHOLD_CRIT) + H.stop_sound_channel(CHANNEL_HEARTBEAT) + beat = BEAT_NONE + + if(H.jitteriness) + if(!beat || beat == BEAT_SLOW) + H.playsound_local(get_turf(H),fastbeat,40,0, channel = CHANNEL_HEARTBEAT) + beat = BEAT_FAST /obj/item/organ/heart/cursed