Some footsteps fixes (#37648)

* Some footsteps fixes

* Not an override anymore
This commit is contained in:
mentgah
2025-05-29 19:31:50 +02:00
committed by GitHub
parent 9b35e420e5
commit 2ff17530f1
3 changed files with 8 additions and 2 deletions

View File

@@ -942,6 +942,7 @@ var/global/maxStackDepth = 10
var/step_sound = ""
var/stepstaken = 1
var/modulo_steps = 2 //if stepstaken is a multiplier of modulo_steps, play the sound. Does not work if modulo_steps < 1
var/footsteps_range = -4
cloth_layer = SHOES_LAYER
cloth_icon = 'icons/mob/feet.dmi'
starting_materials = list(MAT_FABRIC = 1250)

View File

@@ -160,6 +160,7 @@
footprint_type = /obj/effect/decal/cleanable/blood/tracks/footprints/clown
step_sound = "clownstep"
footsteps_range = 0
/obj/item/clothing/shoes/clown_shoes/New()
..()

View File

@@ -177,18 +177,22 @@
modulo = S.modulo_steps<modulo? S.modulo_steps : modulo
if (stepstaken % modulo == 0) //once every other step by default, so that it doesn't spam too much (shoes override)
var/step_volume = 50
var/range = -4
var/list/sounds_to_play
var/turf/T = get_turf(src)
if (!T || !T.footstep_sound || istype(T, /turf/space))
return
if (locate(/obj/machinery/conveyor) in T.contents)
return
if(shoes && istype(shoes, /obj/item/clothing/shoes)) //shoes
var/obj/item/clothing/shoes/S = shoes
if (S.step_sound) //shoes override
sounds_to_play = S.step_sound
range = S.footsteps_range
else //otherwise just use the turf's sound
sounds_to_play = T.footstep_sound
sounds_to_play = T.footstep_sound
else
var/datum/organ/external/foot = has_vulnerable_foot()
if (foot)
@@ -203,7 +207,7 @@
stepstaken = 0
if (!sounds_to_play)
return
playsound(src, pick(sounds_to_play), step_volume, 1, -4)
playsound(src, pick(sounds_to_play), step_volume, 1, range)