Per-source movement sounds. (#22800)

Movement sounds for mobs are now handled by a single component. Movement
sounds are fed into it through signals, which contain both a movement
source (like an item for a mob, causing the sound) and a list of sounds
to pick from.

To-do:

- [x] Figure out how to do barefoot species sounds
- [x] Maybe movement sounds for simple mobs
- [x] More movement sounds for other items

---------

Signed-off-by: Matt Atlas <mattiathebest2000@hotmail.it>
Co-authored-by: Matt Atlas <liermattia@gmail.com>
Co-authored-by: VMSolidus <evilexecutive@gmail.com>
This commit is contained in:
Matt Atlas
2026-07-23 18:29:50 +00:00
committed by GitHub
co-authored by Matt Atlas VMSolidus
parent 901ad7f0cb
commit 5682f3c651
68 changed files with 365 additions and 43 deletions
+8 -4
View File
@@ -150,6 +150,11 @@
var/pickup_sound = SFX_PICKUP
/// Sound uses when dropping the item, or when its thrown.
var/drop_sound = SFX_DROP
/// Sound played on movement. This is a list. If the list has ONE item, then it's treated as ONE sound. If the list has more than one item, then it's treated as a list where
/// the system will randomly play one of these sounds.
var/list/movement_sounds = null
/// The volume we want movement sounds to happen at for this object. Remember that on run intent, it's raised by 30.
var/movement_sound_volume = 40
//Item_state definition moved to /obj
//var/item_state = null // Used to specify the item state for the on-mob overlays.
@@ -508,6 +513,8 @@
SEND_SIGNAL(src, COMSIG_ITEM_DROPPED, user)
in_inventory = FALSE
SEND_SIGNAL(user, COMSIG_MOB_REMOVE_FOOTSTEP_SOUND, src, movement_sounds)
user?.update_equipment_speed_mods()
try_make_persistent_trash()
@@ -601,9 +608,9 @@
equipped(user, slot, initial)
if(SEND_SIGNAL(src, COMSIG_ITEM_POST_EQUIPPED, user, slot) && COMPONENT_EQUIPPED_FAILED)
return FALSE
SEND_SIGNAL(user, COMSIG_MOB_ADD_FOOTSTEP_SOUND, src, movement_sounds, movement_sound_volume)
return TRUE
/**
* Called by on_equipped. Don't call this directly, we want the ITEM_POST_EQUIPPED signal to be sent after everything else.
*
@@ -641,9 +648,6 @@
else
remove_item_verbs(user)
//Ěent for observable
SEND_SIGNAL(src, COMSIG_ITEM_REMOVE, src)
user.update_equipment_speed_mods()
/obj/item/proc/check_equipped(var/mob/user, var/slot, var/assisted_equip = FALSE)