module Dodge.Creature.ChaseCrit
    (smallChaseCrit
    ,invisibleChaseCrit
    ,chaseCrit
    ) where
import Dodge.Data
import Dodge.Default
import Dodge.Creature.Picture
import Dodge.Creature.Update
import Dodge.Creature.ReaderUpdate
import Dodge.Creature.Action
import Dodge.Creature.Perception
import Dodge.Item.Consumable
import Dodge.Item.Equipment
import Dodge.SoundLogic
--import Geometry
import Picture
--import Dodge.RandomHelp

--import Data.Maybe
import qualified Data.IntMap.Strict as IM
import Control.Lens
--import System.Random

smallChaseCrit :: Creature
smallChaseCrit = chaseCrit
    { _crHP = 1
    , _crRad = 4
    , _crPict = basicCrPict
    , _crInv = IM.fromList [(0,medkit 200)]
    , _crCorpse = basicCrCorpse
    }
invisibleChaseCrit :: Creature
invisibleChaseCrit = chaseCrit
    & crCamouflage .~ Invisible
    & crInv . at 0 ?~ wristInvisibility
    & crEquipment . at OnLeftWrist ?~ 0
    & crInvEquipped . at 0 ?~ OnLeftWrist
chaseCrit :: Creature
chaseCrit = defaultCreature
    { _crUpdate = defaultImpulsive
        [ const doStrategyActions
        , performActions
        , const overrideMeleeCloseTarget
        , const setViewPos
        , setMvPos
        , chaseCritMv
        , chaseCritPerceptionUpdate [0]
        , targetYouWhenCognizant
        , const turnIfDamaged
        , const (crMeleeCooldown %~ max 0 . subtract 1)
        ]
    , _crName = "chaseCrit"
    , _crHP = 150
    , _crPict = basicCrPict
    , _crInv = IM.fromList [(0,medkit 200)]
    , _crMeleeCooldown = 0
    , _crFaction = ColorFaction green
    , _crVocalization = Vocalization seagullChatterS 
        [seagullBarkS
        ,seagullChatterS
        ,seagullChatter1S
        ,seagullWhistleS
        ,seagullWhistle1S
        ,seagullCryS
        ,seagullCry1S
        ,seagullCry2S
        ] 50 0
    , _crMvType = defaultChaseMvType
    }
