Crawling sounds (#19902)

* ports crawlingsound

* hal review

* as above

* fixes people with no legs making no crawling sound
This commit is contained in:
Bm0n
2022-12-19 18:44:07 -05:00
committed by GitHub
parent 1cfc5a04f1
commit 2ca533cbdf
+13 -7
View File
@@ -53,15 +53,9 @@
return
var/mob/living/LM = parent
if(!T.footstep || IS_HORIZONTAL(LM) || !(LM.mobility_flags & MOBILITY_MOVE) || LM.buckled || LM.throwing || LM.flying || istype(LM.loc, /obj/machinery/atmospherics))
if(!T.footstep || !(LM.mobility_flags & MOBILITY_MOVE) || LM.buckled || LM.throwing || LM.flying || istype(LM.loc, /obj/machinery/atmospherics))
return
if(ishuman(LM))
var/mob/living/carbon/human/H = LM
if(!H.get_organ(BODY_ZONE_L_LEG) && !H.get_organ(BODY_ZONE_R_LEG))
return
if(H.m_intent == MOVE_INTENT_WALK)
return// stealth
steps++
if(steps >= 6)
@@ -72,6 +66,18 @@
if(steps != 0 && !has_gravity(LM, T)) // don't need to step as often when you hop around
return
if(IS_HORIZONTAL(LM)) //play crawling sound if we're lying
playsound(T, 'sound/effects/footstep/crawl1.ogg', 15 * volume, falloff_distance = 1, vary = sound_vary)
return
if(ishuman(LM))
var/mob/living/carbon/human/H = LM
if(!H.get_organ(BODY_ZONE_L_LEG) && !H.get_organ(BODY_ZONE_R_LEG))
return
if(H.m_intent == MOVE_INTENT_WALK)
return// stealth
return T
/datum/component/footstep/proc/play_simplestep()