Simplify creature update

This commit is contained in:
2022-04-07 19:40:12 +01:00
parent 7ca9afeb5f
commit ac74ae0ed1
17 changed files with 104 additions and 45 deletions
+8 -6
View File
@@ -11,6 +11,7 @@ module Dodge.Creature
, smallChaseCrit
) where
import Dodge.Creature.State.Data
import Dodge.Creature.Update
--import Dodge.Item.Weapon.Grenade
import Dodge.Item.Weapon.Booster
import Dodge.Item.Weapon.Utility
@@ -20,7 +21,7 @@ import Dodge.Item.Craftable
--import Dodge.Creature.SetTarget
import Dodge.Creature.Volition
import Dodge.Creature.Test
import Dodge.Creature.Impulse
--import Dodge.Creature.Impulse
import Dodge.Creature.SentinelAI
import Dodge.Creature.LauncherCrit
import Dodge.Creature.PistolCrit
@@ -66,8 +67,8 @@ spawnerCrit = defaultCreature
miniGunCrit :: Creature
miniGunCrit = defaultCreature
{ _crPict = basicCrPict red
, _crUpdate = stateUpdate $ impulsiveAI $
sentinelFireType (const shootTillEmpty)
, _crUpdate = defaultImpulsive $
[sentinelFireType (const shootTillEmpty)]
, _crActionPlan = ActionPlan
{ _crImpulse = []
, _crAction = []
@@ -87,7 +88,7 @@ longCrit :: Creature
longCrit = defaultCreature
{ _crPict = basicCrPict red
-- , _crUpdate = stateUpdate sniperAI
, _crUpdate = stateUpdate $ impulsiveAI $ sentinelFireType $ const shootTillEmpty
, _crUpdate = defaultImpulsive $ [sentinelFireType $ const shootTillEmpty]
, _crActionPlan = ActionPlan
{ _crImpulse = []
, _crAction = []
@@ -107,7 +108,7 @@ multGunCrit = defaultCreature
, _crInvSel = 0
, _crRad = 10
, _crHP = 300
, _crUpdate = stateUpdate $ impulsiveAI $ sentinelExtraWatchUpdate
, _crUpdate = defaultImpulsive $ [sentinelExtraWatchUpdate
[ ( const $ not . crHasAmmo
, \_ _ -> StrategyActions Reload reloadActions
)
@@ -120,6 +121,7 @@ multGunCrit = defaultCreature
[ drawwp `DoActionThen` shootFirstMiss `DoActionThen` DoImpulses [ChangeStrategy WatchAndWait] ]
)
]
]
, _crActionPlan = ActionPlan
{ _crImpulse = []
, _crAction = []
@@ -148,7 +150,7 @@ startCr = defaultCreature
, _crMvDir = pi/2
, _crID = 0
, _crPict = basicCrPict black
, _crUpdate = stateUpdate yourControl
, _crUpdate = stateUpdate' yourControl'
, _crRad = 10
, _crMass = 10
, _crHP = 1000