mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 02:16:05 +00:00
Some footsteps fixes (#37648)
* Some footsteps fixes * Not an override anymore
This commit is contained in:
@@ -942,6 +942,7 @@ var/global/maxStackDepth = 10
|
|||||||
var/step_sound = ""
|
var/step_sound = ""
|
||||||
var/stepstaken = 1
|
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/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_layer = SHOES_LAYER
|
||||||
cloth_icon = 'icons/mob/feet.dmi'
|
cloth_icon = 'icons/mob/feet.dmi'
|
||||||
starting_materials = list(MAT_FABRIC = 1250)
|
starting_materials = list(MAT_FABRIC = 1250)
|
||||||
|
|||||||
@@ -160,6 +160,7 @@
|
|||||||
footprint_type = /obj/effect/decal/cleanable/blood/tracks/footprints/clown
|
footprint_type = /obj/effect/decal/cleanable/blood/tracks/footprints/clown
|
||||||
|
|
||||||
step_sound = "clownstep"
|
step_sound = "clownstep"
|
||||||
|
footsteps_range = 0
|
||||||
|
|
||||||
/obj/item/clothing/shoes/clown_shoes/New()
|
/obj/item/clothing/shoes/clown_shoes/New()
|
||||||
..()
|
..()
|
||||||
|
|||||||
@@ -177,18 +177,22 @@
|
|||||||
modulo = S.modulo_steps<modulo? S.modulo_steps : modulo
|
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)
|
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/step_volume = 50
|
||||||
|
var/range = -4
|
||||||
var/list/sounds_to_play
|
var/list/sounds_to_play
|
||||||
|
|
||||||
var/turf/T = get_turf(src)
|
var/turf/T = get_turf(src)
|
||||||
if (!T || !T.footstep_sound || istype(T, /turf/space))
|
if (!T || !T.footstep_sound || istype(T, /turf/space))
|
||||||
return
|
return
|
||||||
|
if (locate(/obj/machinery/conveyor) in T.contents)
|
||||||
|
return
|
||||||
|
|
||||||
if(shoes && istype(shoes, /obj/item/clothing/shoes)) //shoes
|
if(shoes && istype(shoes, /obj/item/clothing/shoes)) //shoes
|
||||||
var/obj/item/clothing/shoes/S = shoes
|
var/obj/item/clothing/shoes/S = shoes
|
||||||
if (S.step_sound) //shoes override
|
if (S.step_sound) //shoes override
|
||||||
sounds_to_play = S.step_sound
|
sounds_to_play = S.step_sound
|
||||||
|
range = S.footsteps_range
|
||||||
else //otherwise just use the turf's sound
|
else //otherwise just use the turf's sound
|
||||||
sounds_to_play = T.footstep_sound
|
sounds_to_play = T.footstep_sound
|
||||||
else
|
else
|
||||||
var/datum/organ/external/foot = has_vulnerable_foot()
|
var/datum/organ/external/foot = has_vulnerable_foot()
|
||||||
if (foot)
|
if (foot)
|
||||||
@@ -203,7 +207,7 @@
|
|||||||
stepstaken = 0
|
stepstaken = 0
|
||||||
if (!sounds_to_play)
|
if (!sounds_to_play)
|
||||||
return
|
return
|
||||||
playsound(src, pick(sounds_to_play), step_volume, 1, -4)
|
playsound(src, pick(sounds_to_play), step_volume, 1, range)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user