12e4a278d0
There are probably possible errors from the use of cutPoly
140 lines
3.7 KiB
Haskell
140 lines
3.7 KiB
Haskell
{-# LANGUAGE StrictData #-}
|
|
{-# LANGUAGE TemplateHaskell #-}
|
|
|
|
module Dodge.Data.Creature.Misc (
|
|
module Dodge.Data.Creature.Misc,
|
|
module Dodge.Data.CamouflageStatus,
|
|
) where
|
|
|
|
import Dodge.Data.Creature.Stance
|
|
import Color
|
|
import Control.Lens
|
|
import Data.Aeson
|
|
import Data.Aeson.TH
|
|
import Dodge.Data.CamouflageStatus
|
|
import Dodge.Data.FloatFunction
|
|
import Dodge.Data.Material
|
|
import Geometry.Data
|
|
import qualified Data.IntSet as IS
|
|
|
|
data Vocalization
|
|
= VocTimer {_vcTime :: Int ,_vcMaxTime :: Int }
|
|
| VocReady
|
|
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
data CrMvType
|
|
= NoMvType
|
|
| MvWalking {_mvSpeed :: Float} -- note this may interact with a friction element
|
|
-- so currently 26.04.03 the actual max speed when walking is twice this
|
|
| JitMvType
|
|
{ _mvSpeed :: Float
|
|
, _mvTurnRad :: FloatFloat
|
|
, _mvTurnJit :: Float
|
|
}
|
|
| StartStopMvType
|
|
{ _mvSpeed :: Float
|
|
, _mvTurnSpeed :: Float
|
|
, _mvPulseTime :: Int
|
|
}
|
|
| BeeMvType
|
|
{ _mvSpeed :: Float
|
|
, _mvTurnSpeed :: Float
|
|
, _mvPulseTime :: Int
|
|
}
|
|
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
data Pulse = PulseStatus
|
|
{ _pulseRate :: Int
|
|
, _pulseProgress :: Int
|
|
}
|
|
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
data CreatureType
|
|
= Avatar
|
|
{ _avatarPulse :: Pulse
|
|
, _avatarMaterial :: Material
|
|
, _avStrength :: Int
|
|
, _avDexterity :: Int
|
|
, _avIntelligence :: Int
|
|
, _avPosture :: AvatarPosture
|
|
, _footForward :: FootForward
|
|
, _strideAmount :: Float
|
|
}
|
|
| ChaseCrit {_meleeCooldown :: Int
|
|
, _footForward :: FootForward
|
|
, _strideAmount :: Float
|
|
}
|
|
| CrabCrit
|
|
{ _meleeCooldownL :: Int
|
|
, _meleeCooldownR :: Int
|
|
, _dodgeCooldown :: Int
|
|
, _lFootPos :: Point2
|
|
, _rFootPos :: Point2
|
|
}
|
|
| HoverCrit {_meleeCooldown :: Int}
|
|
| SlinkCrit
|
|
{ _meleeCooldown :: Int
|
|
, _slinkSpine :: [Point3Q]
|
|
, _slinkHeadPos :: Point3Q
|
|
}
|
|
| SlimeCrit
|
|
{ _slimeSlime :: Int -- note multiplied by 100
|
|
, _slimeSlimeChange :: Int
|
|
-- , _slimeRadWobble :: Float
|
|
--, _slimeSplitTimer :: Int
|
|
, _slimeSplitTimer :: Maybe (Int, [Point2])
|
|
, _slimeCompression :: Float
|
|
, _slimeIsCompressing :: Bool
|
|
, _slimeEngulfProgress :: Float
|
|
}
|
|
| BeeCrit
|
|
{ _beeSlime :: Int
|
|
, _beeHive :: Maybe Int
|
|
, _startStopMv :: Int
|
|
, _beeAggro :: Int
|
|
, _meleeCooldown :: Int
|
|
, _beeRandomMovement :: Maybe FootForward
|
|
, _beeLifespan :: Int
|
|
}
|
|
| HiveCrit
|
|
{ _hiveChildren :: IS.IntSet
|
|
, _hiveGestation :: Int
|
|
, _hiveSlime :: Int
|
|
}
|
|
| SwarmCrit
|
|
| AutoCrit
|
|
| BarrelCrit {_barrelType :: BarrelType}
|
|
| LampCrit {_lampHeight :: Float, _lampColor :: Point3, _lampLSID :: Maybe Int}
|
|
|
|
slimeToRad :: Int -> Float
|
|
slimeToRad x = sqrt $ fromIntegral x * 0.01
|
|
|
|
data AvatarPosture = AvPosture
|
|
|
|
data CreatureShape
|
|
= Humanoid
|
|
{ _skinHead :: Color
|
|
, _skinUpper :: Color
|
|
, _skinLower :: Color
|
|
}
|
|
| Barreloid
|
|
| NoCreatureShape
|
|
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
data BarrelType
|
|
= PlainBarrel
|
|
| ExplosiveBarrel {_piercedPoints :: [Point2]}
|
|
deriving (Eq, Show, Read) --Generic, Flat)
|
|
|
|
makeLenses ''Pulse
|
|
makeLenses ''BarrelType
|
|
makeLenses ''Vocalization
|
|
makeLenses ''CrMvType
|
|
makeLenses ''CreatureType
|
|
makeLenses ''CreatureShape
|
|
deriveJSON defaultOptions ''Pulse
|
|
deriveJSON defaultOptions ''Vocalization
|
|
deriveJSON defaultOptions ''BarrelType
|
|
deriveJSON defaultOptions ''AvatarPosture
|
|
deriveJSON defaultOptions ''CreatureType
|