Custom Footstep sounds (#8695)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
Guti
2024-07-29 20:51:13 +02:00
committed by GitHub
parent a838d5b118
commit f9abe972d2
16 changed files with 53 additions and 39 deletions

View File

@@ -51,6 +51,8 @@
footstep_ret = GLOB.footstep
if(FOOTSTEP_MOB_SLIME)
footstep_ret = 'modular_chomp/sound/effects/footstep/slime1.ogg'
if(FOOTSTEP_MOB_SLITHER)
footstep_ret = 'modular_chomp/sound/effects/footstep/crawl1.ogg'
return footstep_ret
/datum/element/footstep/Detach(atom/movable/source)
@@ -94,7 +96,14 @@
if(steps != 0 && !has_gravity(source)) // don't need to step as often when you hop around
return
. = list(FOOTSTEP_MOB_SHOE = turf.footstep, FOOTSTEP_MOB_BAREFOOT = turf.barefootstep, FOOTSTEP_MOB_HEAVY = turf.heavyfootstep, FOOTSTEP_MOB_CLAW = turf.clawfootstep, STEP_SOUND_PRIORITY = STEP_SOUND_NO_PRIORITY)
. = list(
FOOTSTEP_MOB_SHOE = turf.footstep,
FOOTSTEP_MOB_BAREFOOT = turf.barefootstep,
FOOTSTEP_MOB_HEAVY = turf.heavyfootstep,
FOOTSTEP_MOB_CLAW = turf.clawfootstep,
STEP_SOUND_PRIORITY = STEP_SOUND_NO_PRIORITY
)
var/overriden = SEND_SIGNAL(turf, COMSIG_TURF_PREPARE_STEP_SOUND, .) & FOOTSTEP_OVERRIDEN
//The turf has no footstep sound (e.g. open space) and none of the objects on that turf (e.g. catwalks) overrides it
if(!overriden && isnull(turf.footstep))
@@ -104,6 +113,8 @@
/datum/element/footstep/proc/play_simplestep(mob/living/source, atom/oldloc, direction, forced, list/old_locs, momentum_change)
SIGNAL_HANDLER
var/volume_multiplier = 0.3
if(!isturf(source.loc))
return
@@ -112,7 +123,7 @@
return
if(isfile(footstep_sounds) || istext(footstep_sounds))
playsound(source.loc, footstep_sounds, volume, falloff = 1, vary = sound_vary)
playsound(source.loc, footstep_sounds, volume * volume_multiplier, falloff = 1, vary = sound_vary)
return
var/turf_footstep = prepared_steps[footstep_type]
@@ -123,7 +134,7 @@
/datum/element/footstep/proc/play_humanstep(mob/living/carbon/human/source, atom/oldloc, direction, forced, list/old_locs, momentum_change)
SIGNAL_HANDLER
var/volume_multiplier = 0.5
var/volume_multiplier = 0.3
var/range_adjustment = 0
var/list/prepared_steps = prepare_step(source)
@@ -149,11 +160,13 @@
playsound(source.loc, pick(source.species.special_step_sounds), volume, TRUE, falloff = 1, vary = sound_vary)
else if (istype(source.species, /datum/species/shapeshifter/promethean))
playsound(source.loc, 'modular_chomp/sound/effects/footstep/slime1.ogg', volume, TRUE, falloff = 1)
else if (source.custom_footstep == FOOTSTEP_MOB_SLITHER)
playsound(source.loc, 'modular_chomp/sound/effects/footstep/crawl1.ogg', 15 * volume, falloff = 1, vary = sound_vary)
else
var/barefoot_type = prepared_steps[FOOTSTEP_MOB_BAREFOOT]
var/bare_footstep_sounds
if(source.species.footstep != FOOTSTEP_MOB_HUMAN)
bare_footstep_sounds = check_footstep_type(source.species.footstep)
if(source.custom_footstep != FOOTSTEP_MOB_HUMAN)
bare_footstep_sounds = check_footstep_type(source.custom_footstep)
else
bare_footstep_sounds = GLOB.barefootstep
if(!isnull(barefoot_type) && bare_footstep_sounds[barefoot_type]) // barefoot_type can be null

View File

@@ -10,7 +10,7 @@
if(!isliving(target))
return ELEMENT_INCOMPATIBLE
RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(handle_footstep))
RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(handle_sloshstep), override = TRUE)
step_count = 0
vore_organs_reagents = list()
vore_footstep_volume = 0
@@ -21,7 +21,7 @@
UnregisterSignal(source, COMSIG_MOVABLE_MOVED)
return ..()
/datum/element/slosh/proc/handle_footstep(mob/living/source)
/datum/element/slosh/proc/handle_sloshstep(mob/living/source)
SIGNAL_HANDLER
if(ishuman(source))