Refactor launcherCrit ai
This commit is contained in:
@@ -9,6 +9,7 @@ module Dodge.Creature.ActionRat
|
||||
, reloadOverride
|
||||
, reloadOverrideNoHolster
|
||||
, shootAdvanceStrat
|
||||
, shootMoveStrat
|
||||
, watchUpdateStrat
|
||||
, goToPostStrat
|
||||
, overrideInternal
|
||||
@@ -110,6 +111,26 @@ aimThenShootStrat tcid _ _ = StrategyActions (ShootAt tcid)
|
||||
lostest (w,cr') = canSee (_crID cr') tcid w
|
||||
advanceShoot = ImpulsesList [[UseItem, MoveForward 3]]
|
||||
|
||||
shootMoveStrat :: Point2 -> Int -> World -> Creature -> Strategy
|
||||
shootMoveStrat moveV tcid _ _ = StrategyActions (ShootAt tcid)
|
||||
[ DoActionIfElse NoAction crIsAiming (DoActionThen DrawWeapon (WaitThen 50 NoAction))
|
||||
`DoActionThen`
|
||||
(DoActionWhileThen advanceShoot lostest
|
||||
. DoReplicateThen advanceShoot 75
|
||||
$ DoImpulses [ChangeStrategy WatchAndWait]
|
||||
)
|
||||
, AimAtCloseSlow
|
||||
{ _targetID = tcid
|
||||
, _targetSeenAt = (0,0) -- hack
|
||||
, _aimSpeed = 0.2
|
||||
, _slowAimSpeed = 0.01
|
||||
, _slowAimAngle = pi/8
|
||||
}
|
||||
]
|
||||
where
|
||||
lostest (w,cr') = canSee (_crID cr') tcid w
|
||||
advanceShoot = ImpulsesList [[UseItem, Move moveV]]
|
||||
|
||||
shootAdvanceStrat :: Int -> World -> Creature -> Strategy
|
||||
shootAdvanceStrat tcid _ _ = StrategyActions (ShootAt tcid)
|
||||
[ DoActionIfElse NoAction crIsAiming (DoActionThen DrawWeapon (WaitThen 50 NoAction))
|
||||
|
||||
Reference in New Issue
Block a user