Make creature update an external function

This commit is contained in:
2022-07-20 01:22:17 +01:00
parent db44d5d6ce
commit 1f79fe157f
31 changed files with 562 additions and 462 deletions
+2 -18
View File
@@ -4,30 +4,13 @@ module Dodge.Creature.SwarmCrit
import Dodge.Data
import Dodge.Default
import Dodge.Creature.Picture
import Dodge.Creature.Update
--import Dodge.Creature.ChainUpdates
import Dodge.Creature.Boid
import Dodge.Creature.ReaderUpdate
import Dodge.Creature.Perception
--import Dodge.Creature.Impulse
--import Dodge.Creature.State
import Picture
import Control.Lens
swarmCrit :: Creature
swarmCrit = defaultCreature
{ _crUpdate = defaultImpulsive
[ flockToPointUsing' (encircleDistP 100) (meleeHeadingMove 0.1 0.1 (pi/4) 3.9)
, const (crMeleeCooldown %~ max 0 . subtract 1)
, perceptionUpdate [0]
, const doStrategyActions
, targetYouWhenCognizant
]
-- , doStrategyActions
-- , targetYouWhenCognizant
, _crHP = 1
{ _crHP = 1
, _crRad = 2
, _crMass = 2
, _crCorpse = basicCrCorpse
@@ -35,6 +18,7 @@ swarmCrit = defaultCreature
, _crMeleeCooldown = 0
}
& crType . skinUpper .~ light4 yellow
& crType . humanoidAI .~ SwarmAI
--swarmCritMoveFunc :: Creature -> Point2 -> Creature -> Point2
--swarmCritMoveFunc tcr cenp cr