Skip to content
This repository has been archived by the owner on Oct 15, 2023. It is now read-only.

Commit

Permalink
feat: Crawling sound
Browse files Browse the repository at this point in the history
  • Loading branch information
larentoun committed Jul 12, 2023
1 parent beb864d commit 135e82d
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions code/datums/components/footstep.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,9 @@
return

var/mob/living/LM = parent
if(!T.footstep || LM.lying || !LM.canmove || LM.resting || LM.buckled || LM.throwing || LM.flying || istype(LM.loc, /obj/machinery/atmospherics))
if(!T.footstep || !LM.canmove || 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)
Expand All @@ -72,6 +66,18 @@

if(steps != 0 && !has_gravity(LM, T)) // don't need to step as often when you hop around
return

if(LM.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()
Expand Down

0 comments on commit 135e82d

Please sign in to comment.