From 118e9470e2d0e512d5605f0fc2837feceaca005b Mon Sep 17 00:00:00 2001 From: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Date: Tue, 13 Feb 2024 11:07:16 -0500 Subject: [PATCH] Revenants no longer make noise walking into gibs (#81420) ## About The Pull Request Turns the hardcoded sound that plays when you walk into some gibs into an Element and adds a check for flying to avoid playing the sound, fixing Revenants, Holoparasites, and other mobs that fly from making noise when "walking" into a pool of blood. ## Why It's Good For The Game I was observing a revenant and heard them making noise from walking over blood, thought it was kinda f*cked up ## Changelog :cl: fix: Revenants (and other flying mobs) will not make noise when walking into pools of gibs, /:cl: --------- Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com> (cherry picked from commit d604a87b0666b940cc8332566e037843f31b4a3c) --- code/datums/elements/ELEMENT_TEMPLATE.md | 4 +-- code/datums/elements/squish_sound.dm | 27 +++++++++++++++++++ .../effects/decals/cleanable/humans.dm | 6 +---- tgstation.dme | 1 + 4 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 code/datums/elements/squish_sound.dm diff --git a/code/datums/elements/ELEMENT_TEMPLATE.md b/code/datums/elements/ELEMENT_TEMPLATE.md index 8dedfbaef43..4bc1f72f2dc 100644 --- a/code/datums/elements/ELEMENT_TEMPLATE.md +++ b/code/datums/elements/ELEMENT_TEMPLATE.md @@ -5,8 +5,8 @@ See _element.dm for detailed explanations ```dm /datum/element/myelement - element_flags = ELEMENT_BESPOKE | ELEMENT_COMPLEX_DETACH | ELEMENT_DETACH_ON_HOST_DESTROY | ELEMENT_NOTAREALFLAG // code/__DEFINES/dcs/flags.dm - //argument_hash_start_idx = 2 // Use with ELEMENT_BESPOKE + element_flags = ELEMENT_BESPOKE | ELEMENT_COMPLEX_DETACH | ELEMENT_DETACH_ON_HOST_DESTROY | ELEMENT_NOTAREALFLAG // code/__DEFINES/dcs/flags.dm + //argument_hash_start_idx = 2 // Use with ELEMENT_BESPOKE var/list/myvar = list() /datum/element/myelement/Attach(datum/target) diff --git a/code/datums/elements/squish_sound.dm b/code/datums/elements/squish_sound.dm new file mode 100644 index 00000000000..a245bb48a73 --- /dev/null +++ b/code/datums/elements/squish_sound.dm @@ -0,0 +1,27 @@ +///Plays a sound when walked into, lower sounding if the person walking into it has light stepping. +/datum/element/squish_sound + element_flags = ELEMENT_BESPOKE + argument_hash_start_idx = 2 + ///The sound to play when something holding this element is entered. + var/sound_to_play + +/datum/element/squish_sound/Attach( + datum/target, + sound = 'sound/effects/footstep/gib_step.ogg', +) + . = ..() + sound_to_play = sound + RegisterSignal(target, COMSIG_MOVABLE_CROSS, PROC_REF(on_cross)) + +///Plays the set sound upon being entered, as long as the person walking into it can actually walk. +/datum/element/squish_sound/proc/on_cross(atom/movable/source, atom/movable/crossed) + SIGNAL_HANDLER + + if(!isliving(crossed) || (crossed.movement_type & MOVETYPES_NOT_TOUCHING_GROUND) || crossed.throwing) + return + playsound( + source = source, + soundin = sound_to_play, + vol = HAS_TRAIT(crossed, TRAIT_LIGHT_STEP) ? 20 : 50, + vary = TRUE, + ) diff --git a/code/game/objects/effects/decals/cleanable/humans.dm b/code/game/objects/effects/decals/cleanable/humans.dm index d329de34a5f..20b29328829 100644 --- a/code/game/objects/effects/decals/cleanable/humans.dm +++ b/code/game/objects/effects/decals/cleanable/humans.dm @@ -115,6 +115,7 @@ /obj/effect/decal/cleanable/blood/gibs/Initialize(mapload, list/datum/disease/diseases) . = ..() + AddElement(/datum/element/squish_sound) RegisterSignal(src, COMSIG_MOVABLE_PIPE_EJECTING, PROC_REF(on_pipe_eject)) /obj/effect/decal/cleanable/blood/gibs/Destroy() @@ -133,11 +134,6 @@ /obj/effect/decal/cleanable/blood/gibs/ex_act(severity, target) return FALSE -/obj/effect/decal/cleanable/blood/gibs/on_entered(datum/source, atom/movable/L) - if(isliving(L) && has_gravity(loc)) - playsound(loc, 'sound/effects/footstep/gib_step.ogg', HAS_TRAIT(L, TRAIT_LIGHT_STEP) ? 20 : 50, TRUE) - return ..() - /obj/effect/decal/cleanable/blood/gibs/proc/on_pipe_eject(atom/source, direction) SIGNAL_HANDLER diff --git a/tgstation.dme b/tgstation.dme index 9b05255dd2c..89654c511bb 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1571,6 +1571,7 @@ #include "code\datums\elements\soft_landing.dm" #include "code\datums\elements\spooky.dm" #include "code\datums\elements\squish.dm" +#include "code\datums\elements\squish_sound.dm" #include "code\datums\elements\sticker.dm" #include "code\datums\elements\strippable.dm" #include "code\datums\elements\structure_repair.dm"