Start moving creature properties out of records
This commit is contained in:
@@ -1,56 +1,59 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE DeriveAnyClass #-}
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.Projectile where
|
||||
|
||||
import Dodge.Data.Wall.Structure
|
||||
import Dodge.Data.Item.Location
|
||||
import NewInt
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import Dodge.Data.Item.Use.Consumption.Ammo
|
||||
import Dodge.Data.Item.Location
|
||||
import Dodge.Data.Wall.Structure
|
||||
import Geometry.Data
|
||||
import NewInt
|
||||
import Dodge.Data.Payload
|
||||
|
||||
data Projectile
|
||||
= Shell
|
||||
{ _pjPos :: Point2
|
||||
, _pjVel :: Point2
|
||||
, _pjDir :: Float
|
||||
, _pjSpin :: Float
|
||||
, _pjSpinFactor :: Float
|
||||
, _pjID :: Int
|
||||
, _pjPayload :: Payload
|
||||
, _pjTimer :: Int
|
||||
, _pjZ :: Float
|
||||
, _pjZVel :: Float
|
||||
, _pjUpdates :: [ProjectileUpdate]
|
||||
, _pjType :: ProjectileType
|
||||
, _pjDetonatorID :: Maybe (NewInt ItmInt)
|
||||
, _pjScreenID :: Maybe (NewInt ItmInt)
|
||||
}
|
||||
data Projectile = Shell
|
||||
{ _pjPos :: Point2
|
||||
, _pjVel :: Point2
|
||||
, _pjDir :: Float
|
||||
, _pjSpin :: Float
|
||||
, _pjSpinFactor :: Float
|
||||
, _pjID :: Int
|
||||
, _pjPayload :: Payload
|
||||
, _pjTimer :: Int
|
||||
, _pjZ :: Float
|
||||
, _pjZVel :: Float
|
||||
, _pjUpdates :: [ProjectileUpdate]
|
||||
, _pjType :: ProjectileType
|
||||
, _pjDetonatorID :: Maybe (NewInt ItmInt)
|
||||
, _pjScreenID :: Maybe (NewInt ItmInt)
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
data ProjectileUpdate
|
||||
= ThrustPU {_pjuStart :: Int, _pjuEnd :: Int}
|
||||
| StartSpinPU {_pjuTime :: Int, _pjuCID :: Int, _pjuSpinAmound :: Int}
|
||||
| RemoteDirectionPU {_pjuStart :: Int, _pjuEnd :: Int}
|
||||
deriving (Show, Eq, Ord, Read) --Generic, Flat)
|
||||
|
||||
data ProjectileType
|
||||
= Grenade
|
||||
{ _gnHitEffect :: GrenadeHitEffect
|
||||
}
|
||||
| Rocket
|
||||
{_rkHoming :: RocketHoming
|
||||
,_rkSmoke :: Maybe RocketSmoke
|
||||
= Grenade { _gnHitEffect :: GrenadeHitEffect }
|
||||
| Rocket
|
||||
{ _rkHoming :: RocketHoming
|
||||
, _rkSmoke :: Maybe RocketSmoke
|
||||
}
|
||||
| RetiredProjectile
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
data RocketHoming
|
||||
= NoHoming
|
||||
data RocketHoming
|
||||
= NoHoming
|
||||
| HomeUsingRemoteScreen {_phRemoteID :: NewInt ItmInt}
|
||||
| HomeUsingTargeting {_phTargetingID :: NewInt ItmInt}
|
||||
deriving (Show, Eq, Ord, Read) --Generic, Flat)
|
||||
|
||||
data GrenadeHitEffect
|
||||
data GrenadeHitEffect
|
||||
= GBounce {_bounceTolerance :: Float}
|
||||
| GStick
|
||||
| GStuckCreature {_stuckCrID :: Int, _stuckCrOffset :: Point2, _stuckCrRot :: Float}
|
||||
@@ -58,14 +61,15 @@ data GrenadeHitEffect
|
||||
deriving (Show, Eq, Ord, Read) --Generic, Flat)
|
||||
|
||||
data RocketSmoke
|
||||
= ReducedRocketSmoke
|
||||
= ReducedRocketSmoke
|
||||
deriving (Show, Eq, Ord, Read) --Generic, Flat)
|
||||
|
||||
|
||||
makeLenses ''ProjectileUpdate
|
||||
makeLenses ''Projectile
|
||||
makeLenses ''ProjectileType
|
||||
makeLenses ''RocketHoming
|
||||
makeLenses ''GrenadeHitEffect
|
||||
deriveJSON defaultOptions ''ProjectileUpdate
|
||||
deriveJSON defaultOptions ''GrenadeHitEffect
|
||||
deriveJSON defaultOptions ''RocketHoming
|
||||
deriveJSON defaultOptions ''RocketSmoke
|
||||
|
||||
Reference in New Issue
Block a user