Merge pull request #1836 from Citadel-Station-13/upstream-merge-28916

[MIRROR] Heartbeat fix
This commit is contained in:
LetterJay
2017-06-30 10:48:57 -05:00
committed by GitHub
3 changed files with 35 additions and 1 deletions
+3 -1
View File
@@ -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
+19
View File
@@ -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, "<span class = 'notice'>You feel your heart slow down...</span>")
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)
+13
View File
@@ -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