Change crab footstep sound
This commit is contained in:
+5
-5
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user