Cleanup and reorganise
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
module Dodge.Creature.SentinelAI
|
||||
where
|
||||
( sentinelAI
|
||||
, sentinelFireType
|
||||
, sentinelExtraWatchUpdate
|
||||
) where
|
||||
import Dodge.Data
|
||||
import Dodge.Base.Collide
|
||||
import Dodge.Creature.Test
|
||||
@@ -7,16 +10,10 @@ import Dodge.Creature.Volition
|
||||
import Dodge.Creature.ReaderUpdate
|
||||
import Dodge.Creature.Strategy
|
||||
import Dodge.Creature.Action
|
||||
--import Dodge.Creature.ChooseTarget
|
||||
import Dodge.Creature.Perception
|
||||
--import Dodge.Creature.State
|
||||
--import Dodge.Creature.State.Data
|
||||
import Geometry.Data
|
||||
--import Picture
|
||||
--import Dodge.RandomHelp
|
||||
|
||||
import Data.Maybe
|
||||
--import qualified Data.IntMap.Strict as IM
|
||||
import Control.Lens
|
||||
import Control.Monad
|
||||
import Control.Monad.Reader
|
||||
@@ -84,38 +81,38 @@ sentinelExtraWatchUpdate xs = performActionsR
|
||||
(\cr -> (&&) <$> crHasTargetR cr <*> crStratConMatchesR (GetTo (V2 0 0)) cr)
|
||||
(pure . (crActionPlan . crStrategy .~ WatchAndWait))
|
||||
|
||||
shootAtAdvance :: Int -> [Action]
|
||||
shootAtAdvance tcid =
|
||||
[ DoActionIfElse NoAction crIsAiming (DoActionThen drawWeapon (WaitThen 50 NoAction))
|
||||
`DoActionThen`
|
||||
lostest `DoActionWhile`
|
||||
advanceShoot `DoActionThen`
|
||||
75 `DoReplicate`
|
||||
advanceShoot `DoActionThen`
|
||||
DoImpulses [ChangeStrategy WatchAndWait]
|
||||
, AimAt
|
||||
{ _targetID = tcid
|
||||
, _targetSeenAt = V2 0 0 -- hack
|
||||
}
|
||||
]
|
||||
where
|
||||
lostest (w,cr') = canSee (_crID cr') tcid w
|
||||
advanceShoot = ImpulsesList [[UseItem, MoveForward 3]]
|
||||
|
||||
shootAtWhileContinueTime :: Int -> World -> Creature -> Strategy
|
||||
shootAtWhileContinueTime tcid _ _ = StrategyActions (ShootAt tcid)
|
||||
[ DoActionIfElse NoAction crIsAiming (DoActionThen drawWeapon (WaitThen 50 NoAction))
|
||||
`DoActionThen`
|
||||
lostest `DoActionWhile`
|
||||
advanceShoot `DoActionThen`
|
||||
75 `DoReplicate`
|
||||
advanceShoot `DoActionThen`
|
||||
DoImpulses [ChangeStrategy WatchAndWait]
|
||||
, AimAt
|
||||
{ _targetID = tcid
|
||||
, _targetSeenAt = V2 0 0 -- hack
|
||||
}
|
||||
]
|
||||
where
|
||||
lostest (w,cr') = canSee (_crID cr') tcid w
|
||||
advanceShoot = ImpulsesList [[UseItem, MoveForward 3]]
|
||||
--shootAtAdvance :: Int -> [Action]
|
||||
--shootAtAdvance tcid =
|
||||
-- [ DoActionIfElse NoAction crIsAiming (DoActionThen drawWeapon (WaitThen 50 NoAction))
|
||||
-- `DoActionThen`
|
||||
-- lostest `DoActionWhile`
|
||||
-- advanceShoot `DoActionThen`
|
||||
-- 75 `DoReplicate`
|
||||
-- advanceShoot `DoActionThen`
|
||||
-- DoImpulses [ChangeStrategy WatchAndWait]
|
||||
-- , AimAt
|
||||
-- { _targetID = tcid
|
||||
-- , _targetSeenAt = V2 0 0 -- hack
|
||||
-- }
|
||||
-- ]
|
||||
-- where
|
||||
-- lostest (w,cr') = canSee (_crID cr') tcid w
|
||||
-- advanceShoot = ImpulsesList [[UseItem, MoveForward 3]]
|
||||
--
|
||||
--shootAtWhileContinueTime :: Int -> World -> Creature -> Strategy
|
||||
--shootAtWhileContinueTime tcid _ _ = StrategyActions (ShootAt tcid)
|
||||
-- [ DoActionIfElse NoAction crIsAiming (DoActionThen drawWeapon (WaitThen 50 NoAction))
|
||||
-- `DoActionThen`
|
||||
-- lostest `DoActionWhile`
|
||||
-- advanceShoot `DoActionThen`
|
||||
-- 75 `DoReplicate`
|
||||
-- advanceShoot `DoActionThen`
|
||||
-- DoImpulses [ChangeStrategy WatchAndWait]
|
||||
-- , AimAt
|
||||
-- { _targetID = tcid
|
||||
-- , _targetSeenAt = V2 0 0 -- hack
|
||||
-- }
|
||||
-- ]
|
||||
-- where
|
||||
-- lostest (w,cr') = canSee (_crID cr') tcid w
|
||||
-- advanceShoot = ImpulsesList [[UseItem, MoveForward 3]]
|
||||
|
||||
Reference in New Issue
Block a user