Make creature update an external function
This commit is contained in:
@@ -4,18 +4,7 @@ module Dodge.Creature.LauncherCrit
|
||||
where
|
||||
import Dodge.Data
|
||||
import Dodge.Default
|
||||
--import Dodge.Creature.ChainUpdates
|
||||
import Dodge.Creature.Test
|
||||
import Dodge.Creature.Volition
|
||||
import Dodge.Creature.Strategy
|
||||
import Dodge.Creature.ReaderUpdate
|
||||
import Dodge.Creature.Perception
|
||||
--import Dodge.Creature.State
|
||||
import Dodge.Creature.Update
|
||||
import Dodge.Item.Weapon.Launcher
|
||||
--import Dodge.Creature.Impulse
|
||||
import Dodge.Creature.Action
|
||||
import Geometry.Data
|
||||
import Picture
|
||||
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
@@ -23,53 +12,13 @@ import Control.Lens
|
||||
|
||||
launcherCrit :: Creature
|
||||
launcherCrit = defaultCreature
|
||||
{ _crUpdate = defaultImpulsive
|
||||
[ performActions
|
||||
, watchUpdateStrat
|
||||
[ (crHasTargetLOS, \_ _ -> StrategyActions (ShootAt 0) [retreatFire])
|
||||
, (const crAwayFromPost, const goToPostStrat)
|
||||
]
|
||||
, perceptionUpdate [0]
|
||||
, const doStrategyActions
|
||||
, const reloadOverride
|
||||
, targetYouWhenCognizant
|
||||
, const $ overrideInternal
|
||||
(\cr -> crHasTarget cr && crStratConMatches (GetTo (V2 0 0)) cr)
|
||||
(crActionPlan . apStrategy .~ WatchAndWait)
|
||||
]
|
||||
, _crInv = IM.fromList [(0,launcher)]
|
||||
{ _crInv = IM.fromList [(0,launcher)]
|
||||
, _crRad = 10
|
||||
, _crState = defaultState
|
||||
, _crHP = 300
|
||||
}
|
||||
& crType . skinUpper .~ light4 red
|
||||
& crType . humanoidAI .~ LauncherAI
|
||||
|
||||
retreatFire :: Action
|
||||
retreatFire = ImpulsesList ( [ UseItem ] : replicate 20 [ Turn 0.16 ])
|
||||
`DoActionThen`
|
||||
holsterWeapon
|
||||
`DoActionThen`
|
||||
ImpulsesList ( replicate 30 [ MoveForward 3 ])
|
||||
`DoActionThen`
|
||||
drawWeapon
|
||||
`DoActionThen`
|
||||
ImpulsesList ( [UseItem] : replicate 20 [ Turn $ negate 0.16 ] )
|
||||
`DoActionThen`
|
||||
holsterWeapon
|
||||
`DoActionThen`
|
||||
ImpulsesList ( replicate 15 [ MoveForward 3 ] )
|
||||
`DoActionThen`
|
||||
drawWeapon
|
||||
`DoActionThen`
|
||||
ImpulsesList (
|
||||
replicate 100 [UseItem, ImpulseUseTarget $ \tcr -> TurnToward (_crPos tcr) (pi/16) ] )
|
||||
`DoActionThen`
|
||||
20
|
||||
`WaitThen`
|
||||
holsterWeapon
|
||||
`DoActionThen`
|
||||
ImpulsesList ( replicate 15 [ MoveForward 3 ] )
|
||||
`DoActionThen`
|
||||
DoImpulses [ChangeStrategy WatchAndWait]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user