Files
loop/src/Dodge/Data/Item/Use/Consumption/Ammo.hs
T
2022-08-21 12:21:05 +01:00

85 lines
2.7 KiB
Haskell

{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.Item.Use.Consumption.Ammo (
module Dodge.Data.Item.Use.Consumption.Ammo,
module Dodge.Data.Bullet,
module Dodge.Data.Payload,
) where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
import Dodge.Data.Bullet
import Dodge.Data.Payload
data ProjectileDraw = DrawShell | DrawRemoteShell | DrawDrone | DrawBlankProjectile
deriving (Show, Read, Eq, Ord, Enum, Bounded, Generic, Flat)
data ProjectileCreate = CreateShell | CreateTrackingShell
deriving (Show, Read, Eq, Ord, Enum, Bounded, Generic, Flat)
data ProjectileUpdate
= PJThrust {_pjuStart :: Int, _pjuEnd :: Int}
| PJSpin {_pjuTime :: Int, _pjuCID :: Int, _pjuSpinAmound :: Int}
| PJTrack {_pjuStart :: Int, _pjuEnd :: Int, _pjuITID :: Int}
| PJReduceSpin {_pjuReduceSpin :: Float}
| PJRemoteDirection {_pjuStart :: Int, _pjuEnd :: Int, _pjuCID :: Int, _pjuITID :: Int}
| PJSetScope {_pjuITID :: Int}
| PJRetireRemote {_pjuITID :: Int, _pjuTimer :: Int, _pjuPJID :: Int}
| PJDecTimMvVel
| PJShellCollisionCheck
| PJRemoteShellCollisionCheck
deriving (Show, Read, Eq, Ord, Generic, Flat)
data AmmoType
= ProjectileAmmo
{ _amPayload :: Payload
, _amString :: String
, _amPjDraw :: ProjectileDraw
, _amPjCreation :: ProjectileCreate
}
| BulletAmmo
{ _amString :: String
, _amBullet :: Bullet
}
| DroneAmmo
{_amString :: String}
| GasAmmo
{ _amString :: String
, _amCreateGas :: GasCreate
}
| ForceFieldAmmo
{ _amForceFieldType :: ForceFieldType
}
| GenericAmmo
deriving (Eq, Ord, Show, Read, Generic, Flat)
data ForceFieldType = DefaultForceField
| HackForceFieldType
deriving (Eq, Ord, Show, Read, Generic, Flat)
data GasCreate = CreatePoisonGas | CreateFlame
deriving (Eq, Ord, Show, Enum, Bounded, Read, Generic, Flat)
makeLenses ''ProjectileUpdate
makeLenses ''AmmoType
deriveJSON defaultOptions ''ProjectileDraw
deriveJSON defaultOptions ''ProjectileCreate
deriveJSON defaultOptions ''ProjectileUpdate
deriveJSON defaultOptions ''AmmoType
deriveJSON defaultOptions ''GasCreate
deriveJSON defaultOptions ''ForceFieldType
$($(derive [d| instance Deriving (Store AmmoType) |]))
$($(derive [d| instance Deriving (Store ProjectileDraw ) |]))
$($(derive [d| instance Deriving (Store ProjectileCreate ) |]))
$($(derive [d| instance Deriving (Store ProjectileUpdate) |]))
$($(derive [d| instance Deriving (Store ForceFieldType ) |]))
$($(derive [d| instance Deriving (Store GasCreate ) |]))