Make _targetCr an Int id rather than a full creature
This commit is contained in:
@@ -125,10 +125,10 @@ performAction cr w ac = case ac of
|
||||
StartSentinelPost -> ([AddGoal $ SentinelAt (cr ^. crPos . _xy) (_crDir cr)], Nothing)
|
||||
PathTo p -> performPathTo cr w p
|
||||
TurnToPoint p -> performTurnToA cr p
|
||||
LeadTarget p -> case cr ^? crIntention . targetCr . _Just of
|
||||
Just tcr -> ([TurnTo (tcr ^. crPos . _xy +.+ rotateV (_crDir tcr) p)], Nothing)
|
||||
_ -> ([], Nothing)
|
||||
UseTarget f -> performAction cr w $ doMCrAc f $ cr ^? crIntention . targetCr . _Just
|
||||
LeadTarget p -> fromMaybe ([],Nothing) $ do
|
||||
i <- cr ^? crIntention . targetCr . _Just
|
||||
tcr <- w ^? cWorld . lWorld . creatures . ix i
|
||||
return $ ([TurnTo (tcr ^. crPos . _xy +.+ rotateV (_crDir tcr) p)], Nothing)
|
||||
UseSelf f -> performAction cr w $ doCrAc f cr
|
||||
UseAheadPos f -> performAction cr w (doP2Ac f (cr ^. crPos . _xy +.+ 20 *.* unitVectorAtAngle (_crDir cr)))
|
||||
UseMvTargetPos f -> performAction cr w $ doMP2Ac f $ _mvToPoint $ _crIntention cr
|
||||
|
||||
Reference in New Issue
Block a user