diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index b44c823df16..1cf9176f0f9 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -434,3 +434,10 @@ GLOBAL_LIST_INIT(ghost_others_options, list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE //for obj explosion block calculation #define EXPLOSION_BLOCK_PROC -1 + +//for determining which type of heartbeat sound is playing +#define BEAT_FAST 1 +#define BEAT_SLOW 2 +#define BEAT_NONE 0 + + diff --git a/code/__DEFINES/sound.dm b/code/__DEFINES/sound.dm index abeb7e67047..7b4de823ea4 100644 --- a/code/__DEFINES/sound.dm +++ b/code/__DEFINES/sound.dm @@ -4,9 +4,10 @@ #define CHANNEL_VOX 1022 #define CHANNEL_JUKEBOX 1021 #define CHANNEL_JUSTICAR_ARK 1020 +#define CHANNEL_HEARTBEAT 1019 //sound channel for heartbeats //THIS SHOULD ALWAYS BE THE LOWEST ONE! //KEEP IT UPDATED -#define CHANNEL_HIGHEST_AVAILABLE 1019 +#define CHANNEL_HIGHEST_AVAILABLE 1018 diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index 5193539cecf..1acc2a92647 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -44,6 +44,6 @@ //Gets filled up in create_bodyparts() var/list/hand_bodyparts = list() //a collection of arms (or actually whatever the fug /bodyparts you monsters use to wreck my systems) - + var/icon_render_key = "" var/static/list/limb_icon_cache = list() diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index c20aacca01f..6829050363f 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -20,6 +20,7 @@ //Updates the number of stored chemicals for powers handle_changeling() + if(stat != DEAD) return 1 @@ -300,7 +301,6 @@ //this updates all special effects: stun, sleeping, knockdown, druggy, stuttering, etc.. /mob/living/carbon/handle_status_effects() ..() - if(staminaloss) adjustStaminaLoss(-3) @@ -347,7 +347,7 @@ AdjustSleeping(20) Unconscious(100) - //Jitteryness + //Jitteriness if(jitteriness) do_jitter_animation(jitteriness) jitteriness = max(jitteriness - restingpwr, 0) diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm index 9ffe8b6d064..500bb9ac40f 100644 --- a/code/modules/surgery/organs/heart.dm +++ b/code/modules/surgery/organs/heart.dm @@ -8,6 +8,7 @@ var/beating = 1 var/icon_base = "heart" attack_verb = list("beat", "thumped") + var/beat = BEAT_NONE//is this mob having a heatbeat sound played? if so, which? /obj/item/organ/heart/update_icon() if(beating) @@ -48,6 +49,21 @@ S.icon_state = "heart-off" return S +/obj/item/organ/heart/on_life() + if(owner.client) + var/mob/living/carbon/H = owner + if(H.health <= HEALTH_THRESHOLD_CRIT && beat != BEAT_SLOW) + beat = BEAT_SLOW + H.playsound_local(get_turf(H),'sound/health/slowbeat.ogg',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),'sound/health/fastbeat.ogg',40,0, channel = CHANNEL_HEARTBEAT) + beat = BEAT_FAST /obj/item/organ/heart/cursed name = "cursed heart" diff --git a/sound/health/fastbeat.ogg b/sound/health/fastbeat.ogg new file mode 100644 index 00000000000..29df92812b1 Binary files /dev/null and b/sound/health/fastbeat.ogg differ diff --git a/sound/health/slowbeat.ogg b/sound/health/slowbeat.ogg new file mode 100644 index 00000000000..a44b609eeb7 Binary files /dev/null and b/sound/health/slowbeat.ogg differ