Make _targetCr an Int id rather than a full creature

This commit is contained in:
2025-10-15 20:09:17 +01:00
parent 57ca53638a
commit 5e6ed1d793
13 changed files with 122 additions and 123 deletions
+5 -9
View File
@@ -44,8 +44,8 @@ doWdCrBl wcb = case wcb of
maybe
False
(\cid -> canSee (_crID cr) cid w)
(_crID <$> _targetCr (_crIntention cr))
WdCrSafeDistFromTarget x -> \_ -> crSafeDistFromTarg x -- currently ignores walls etc
(_targetCr (_crIntention cr))
WdCrSafeDistFromTarget x -> \w -> crSafeDistFromTarg w x -- currently ignores walls etc
doCrBl :: CrBl -> Creature -> Bool
doCrBl cb = case cb of
@@ -55,18 +55,14 @@ doCrBl cb = case cb of
CrIsAiming -> crIsAiming
CrIsAnimate -> isAnimate
doMCrAc :: MCrAc -> Maybe Creature -> Action
doMCrAc mca = case mca of
MCrNoAction -> const ActionNothing
doCrAc :: CrAc -> Creature -> Action
doCrAc ca = case ca of
CrTurnAround -> \cr -> TurnToPoint
(cr ^. crPos . _xy -.- 10 *.* unitVectorAtAngle (_crDir cr))
CrFleeFromTarget -> fleeFromTarget
-- CrFleeFromTarget -> fleeFromTarget
fleeFromTarget :: Creature -> Action
fleeFromTarget cr = fleeFrom cr (_targetCr (_crIntention cr))
--fleeFromTarget :: Creature -> Action
--fleeFromTarget cr = fleeFrom cr (_targetCr (_crIntention cr))
doP2Ac :: P2Ac -> Point2 -> Action
doP2Ac p2a = case p2a of