diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 84a9b6f552..8c84024401 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -16,11 +16,12 @@ for(var/V in internal_organs) var/obj/item/organ/O = V O.on_life() + if(stat == DEAD) + stop_sound_channel(CHANNEL_HEARTBEAT) //Updates the number of stored chemicals for powers handle_changeling() - if(stat != DEAD) return 1 @@ -29,6 +30,7 @@ /////////////// //Start of a breath chain, calls breathe() + /mob/living/carbon/handle_breathing(times_fired) if((times_fired % 4) == 2 || failed_last_breath) breathe() //Breathe per 4 ticks, unless suffocating diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm index 500bb9ac40..223345cd81 100644 --- a/code/modules/surgery/organs/heart.dm +++ b/code/modules/surgery/organs/heart.dm @@ -48,6 +48,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/on_life() if(owner.client) diff --git a/code/modules/surgery/organs/heart.dm.rej b/code/modules/surgery/organs/heart.dm.rej new file mode 100644 index 0000000000..8ba9e69848 --- /dev/null +++ b/code/modules/surgery/organs/heart.dm.rej @@ -0,0 +1,13 @@ +diff a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm (rejected hunks) +@@ -51,9 +51,9 @@ + + /obj/item/organ/heart/on_life() + if(owner.client) +- var/sound/slowbeat = sound('sound/health/slowbeat.ogg', repeat = 1) ++ var/sound/slowbeat = sound('sound/health/slowbeat.ogg', repeat = TRUE) + +- var/sound/fastbeat = sound('sound/health/fastbeat.ogg', repeat = 1) ++ 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