module Dodge.Creature.ArmourChase
    ( armourChaseCrit
    )
    where
import Dodge.Data
import Dodge.Default
import Dodge.Creature.State
import Dodge.Creature.ReaderUpdate
import Dodge.Creature.Perception
import Dodge.Creature.Picture
import Dodge.Creature.Impulse
import Dodge.Creature.Action
import Dodge.Item.Equipment
import Dodge.Item.Consumable
import Picture

import qualified Data.IntMap.Strict as IM
import Control.Lens
import Control.Monad.Reader

armourChaseCrit :: Creature
armourChaseCrit = defaultCreature
    { _crUpdate = stateUpdate $ impulsiveAIR $ 
        watchUpdateStratR [] >=>
        doStrategyActionsR >=>
        performActionsR >=>
        targetYouWhenCognizantR  >=>
        setTargetMv (pure . _targetCr . _crIntention) >=> -- should be able to remove this?
        flockACCR >=>
        perceptionUpdate [0] >=>
        goToTarget >=>
        overrideMeleeCloseTargetR >=>
        return . (crMeleeCooldown %~ max 0 . subtract 1)
    , _crHP = 300
    , _crPict = basicCrPict green
    , _crInv = IM.fromList 
        [(0,frontArmour)
        ,(1,medkit 200)
        ]
    , _crActionPlan = ActionPlan
        {_crImpulse     = []
        ,_crAction      = []
        ,_crStrategy    = FollowImpulses
        ,_crGoal        = [Kill 0]
        }
    , _crMeleeCooldown = 0
    , _crGroup = ShieldGroup
    , _crMvType = defaultChaseMvType
    }  
