Make _targetCr an Int id rather than a full creature
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user