Change crab footstep sound

This commit is contained in:
2026-04-10 12:40:36 +01:00
parent f19e165571
commit 95a6c90d01
6 changed files with 257 additions and 250 deletions
+5 -5
View File
@@ -377,17 +377,17 @@ updateCreatureStride :: World -> Creature -> World
updateCreatureStride w cr
| Walking <- cr ^. crStance . carriage
, CrabCrit {} <- cr ^. crType
= w & f (g 10) (cr ^?! crType . lFootPos) lFootPos
& f (g (-10)) (cr ^?! crType . rFootPos) rFootPos
| Walking <- cr ^. crStance . carriage
= w & f footPin1S (g 10) (cr ^?! crType . lFootPos) lFootPos
& f footPin2S (g (-10)) (cr ^?! crType . rFootPos) rFootPos
| Walking <- cr ^. crStance . carriage
, isJust $ cr ^? crType . strideAmount = w & tocr . crType . strideAmount +~ d
| otherwise = w
where
tocr = cWorld . lWorld . creatures . ix cid
cid = cr ^. crID
f p q fp
f sn p q fp
| distance p q > 10 = (tocr . crType . fp .~ (p - 9 *^ signorm (q - p)))
. soundStart (CrFootSound cid 0) (p - 9 *^ signorm (q - p)) foot1S Nothing
. soundStart (CrFootSound cid 0) (p - 9 *^ signorm (q - p)) sn Nothing
| otherwise = id
g x = cr ^. crPos . _xy + x *^ vNormal (unitVectorAtAngle (cr ^. crDir))
s = 2 * fromMaybe 1 (crMvType cr ^? mvSpeed)