Cleanup actions/impulses

This commit is contained in:
2025-10-18 18:01:14 +01:00
parent 4542a6cea6
commit b8f6a29e28
4 changed files with 79 additions and 82 deletions
+3 -2
View File
@@ -1,3 +1,4 @@
{-# LANGUAGE LambdaCase #-}
--{-# LANGUAGE TupleSections #-}
module Dodge.Creature.Impulse (followImpulse) where
@@ -21,7 +22,7 @@ import System.Random
-- note SwitchToItem doesn't necessarily update the root item correctly
followImpulse :: Int -> World -> Impulse -> World
followImpulse cid w imp = case imp of
followImpulse cid w = \case
ImpulseNothing -> w
RandomImpulse rimp ->
let (newimp, newgen) = runState (doRandImpulse rimp) (_randGen w)
@@ -41,7 +42,7 @@ followImpulse cid w imp = case imp of
Melee cid' ->
hitCr cid' $
crup
( (crMvAbsolute (w ^. cWorld . lWorld) (10 *.* normalizeV (posFromID cid' -.- cpos))) . (crType . meleeCooldown .~ 20)
( crMvAbsolute (w ^. cWorld . lWorld) (10 *.* normalizeV (posFromID cid' -.- cpos)) . (crType . meleeCooldown .~ 20)
)
RandomTurn a ->
let (aa, g) = rr a