Work towards adding external ammo sources
This commit is contained in:
@@ -20,17 +20,26 @@ import Dodge.Data.Item.Use.Consumption.LoadAction
|
||||
data HeldConsumption
|
||||
= LoadableAmmo
|
||||
{ _laAmmoType :: AmmoType
|
||||
, _laMax :: Int
|
||||
, _laLoaded :: Int
|
||||
, _laPrimed :: Bool
|
||||
, _laCycle :: [LoadAction]
|
||||
, _laProgress :: Maybe [LoadAction]
|
||||
, _laSource :: AmmoSource
|
||||
, _laSourceType :: AmmoSourceType
|
||||
}
|
||||
| ChargingAmmo { _caCharge :: Int
|
||||
, _caMax :: Int }
|
||||
| NoConsumption
|
||||
deriving (Eq, Show, Read) --Generic, Flat)
|
||||
|
||||
data AmmoSource
|
||||
= InternalSource InternalAmmo
|
||||
| ExternalSource { _eaAttachment :: Maybe Int }
|
||||
deriving (Eq, Show, Read) --Generic, Flat)
|
||||
|
||||
data InternalAmmo = InternalAmmo
|
||||
{ _iaMax :: Int
|
||||
, _iaLoaded :: Int
|
||||
, _iaPrimed :: Bool
|
||||
, _iaCycle :: [LoadAction]
|
||||
, _iaProgress :: Maybe [LoadAction]
|
||||
}
|
||||
deriving (Eq, Show, Read) --Generic, Flat)
|
||||
|
||||
data LeftConsumption
|
||||
= AutoRecharging
|
||||
{ _arLoaded :: Int
|
||||
@@ -53,6 +62,10 @@ newtype ItAmount = ItAmount {_getItAmount :: Int}
|
||||
makeLenses ''HeldConsumption
|
||||
makeLenses ''LeftConsumption
|
||||
makeLenses ''ItAmount
|
||||
makePrisms ''AmmoSource
|
||||
makeLenses ''InternalAmmo
|
||||
deriveJSON defaultOptions ''InternalAmmo
|
||||
deriveJSON defaultOptions ''AmmoSource
|
||||
deriveJSON defaultOptions ''HeldConsumption
|
||||
deriveJSON defaultOptions ''LeftConsumption
|
||||
deriveJSON defaultOptions ''ItAmount
|
||||
|
||||
@@ -34,6 +34,13 @@ data ProjectileUpdate
|
||||
| PJRemoteShellCollisionCheck
|
||||
deriving (Show, Eq, Ord, Read) --Generic, Flat)
|
||||
|
||||
data AmmoSourceType
|
||||
= BulletSource
|
||||
| ChargeSource
|
||||
| ChemfuelSource
|
||||
| BombSource
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
data AmmoType
|
||||
= ProjectileAmmo
|
||||
{ _amPayload :: Payload
|
||||
@@ -71,3 +78,4 @@ deriveJSON defaultOptions ''ProjectileUpdate
|
||||
deriveJSON defaultOptions ''GasCreate
|
||||
deriveJSON defaultOptions ''ForceFieldType
|
||||
deriveJSON defaultOptions ''AmmoType
|
||||
deriveJSON defaultOptions ''AmmoSourceType
|
||||
|
||||
Reference in New Issue
Block a user