63 lines
1.4 KiB
Haskell
63 lines
1.4 KiB
Haskell
{-# LANGUAGE DeriveGeneric #-}
|
|
{-# LANGUAGE DeriveAnyClass #-}
|
|
{-# LANGUAGE StrictData #-}
|
|
{-# LANGUAGE TemplateHaskell #-}
|
|
|
|
module Dodge.Data.Creature.State where
|
|
|
|
import Color
|
|
import Control.Lens
|
|
import Data.Aeson
|
|
import Data.Aeson.TH
|
|
import qualified IntSetHelp as IS
|
|
import Dodge.Data.Damage
|
|
import Geometry.Data
|
|
|
|
data CreatureState = CrSt
|
|
{ _csDamage :: [Damage]
|
|
, _csSpState :: CrSpState
|
|
, _csDropsOnDeath :: CreatureDropType
|
|
}
|
|
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
data CreatureDropType
|
|
= DropAll
|
|
| DropAmount Int
|
|
| DropSpecific [Int]
|
|
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
data CrSpState
|
|
= Barrel {_piercedPoints :: [Point2]}
|
|
| GenCr
|
|
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
data Faction
|
|
= GenericFaction Int
|
|
| ZombieFaction
|
|
| EncircleFlock
|
|
| ChaseCritters
|
|
| SpawnedBy Int
|
|
| NoFaction
|
|
| ColorFaction Color
|
|
| PlayerFaction
|
|
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
data CrGroup
|
|
= LoneWolf
|
|
| Swarm
|
|
{ _swarm :: IS.IntSet
|
|
, _crGroupID :: Int
|
|
}
|
|
| CrGroupID {_crGroupID :: Int}
|
|
| ShieldGroup
|
|
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
makeLenses ''CreatureState
|
|
makeLenses ''CrSpState
|
|
makeLenses ''CrGroup
|
|
deriveJSON defaultOptions ''CreatureState
|
|
deriveJSON defaultOptions ''CreatureDropType
|
|
deriveJSON defaultOptions ''CrSpState
|
|
deriveJSON defaultOptions ''Faction
|
|
deriveJSON defaultOptions ''CrGroup
|