Work on crab
This commit is contained in:
@@ -86,8 +86,7 @@ performAction cr w ac = case ac of
|
||||
-- in (imps, newAcs)
|
||||
StartSentinelPost -> ([AddGoal $ SentinelAt (cr ^. crPos . _xy) (_crDir cr)], NoAction)
|
||||
PathTo p a -> performPathTo a cr w p
|
||||
EvadeAim _ _ 0 -> (mempty,NoAction)
|
||||
EvadeAim p a i -> tryEvadeSideways cr w p a i
|
||||
EvadeAim -> tryEvadeSideways cr w
|
||||
TurnToPoint p -> performTurnToA cr p
|
||||
LeadTarget p -> fromMaybe ([], NoAction) $ do
|
||||
i <- cr ^? crIntention . targetCr . _Just
|
||||
@@ -103,8 +102,8 @@ performAction cr w ac = case ac of
|
||||
(imps, nextac) -> (imps, DoReplicatePartial startac t nextac)
|
||||
NoAction -> ([], NoAction)
|
||||
|
||||
tryEvadeSideways :: Creature -> World -> Point2 -> Float -> Int -> ActionUpdate
|
||||
tryEvadeSideways _ w p a i = jumpleft -- (mv,mempty)
|
||||
tryEvadeSideways :: Creature -> World -> ActionUpdate
|
||||
tryEvadeSideways _ w = jumpleft -- (mv,mempty)
|
||||
where
|
||||
jumpleft = (mv,DoReplicate 5 (DoImpulses mv))
|
||||
mv = [Walk (V2 0 d)]
|
||||
|
||||
Reference in New Issue
Block a user