Work on crab evasion
This commit is contained in:
@@ -10,6 +10,7 @@ module Dodge.Creature.Action (
|
||||
youDropItem,
|
||||
) where
|
||||
|
||||
import RandomHelp
|
||||
import Dodge.WorldEvent.ThingsHit
|
||||
import Control.Applicative
|
||||
import Control.Monad
|
||||
@@ -103,10 +104,11 @@ performAction cr w ac = case ac of
|
||||
NoAction -> ([], NoAction)
|
||||
|
||||
tryEvadeSideways :: Creature -> World -> Point2 -> Float -> Int -> ActionUpdate
|
||||
tryEvadeSideways _ _ p a i = jumpleft -- (mv,mempty)
|
||||
tryEvadeSideways _ w p a i = jumpleft -- (mv,mempty)
|
||||
where
|
||||
jumpleft = (mv,EvadeAim p a (i-1))
|
||||
mv = [Move (V2 0 3)]
|
||||
jumpleft = (mv,DoReplicate 5 (DoImpulses mv))
|
||||
mv = [Walk (V2 0 d)]
|
||||
d = evalState (takeOne [3,-3]) (w ^. randGen)
|
||||
|
||||
performAimAt :: Creature -> World -> Int -> Point2 -> ActionUpdate
|
||||
performAimAt cr w tcid p = ([TurnToward tpos aimSp], AimAt tcid tpos)
|
||||
|
||||
Reference in New Issue
Block a user