Move around ammo source checks

This commit is contained in:
2024-06-22 16:23:34 +01:00
parent 25cecb8ea6
commit c723d1b1e1
25 changed files with 218 additions and 263 deletions
+1 -1
View File
@@ -64,7 +64,6 @@ data CraftType
| THERMOMETER
| CREATURESENSOR
| WIRE
| BATTERY
| FUELCELL
| PORTABLEFUSION
| FRAGMODULE
@@ -112,6 +111,7 @@ data AmmoMagType
| DRUMMAG
| BELTMAG
| SHELLMAG
| BATTERY
deriving (Eq, Ord, Show, Read)
+2 -2
View File
@@ -5,7 +5,7 @@
module Dodge.Data.Item.HeldUse where
import Dodge.Data.Item.Use.Consumption.Ammo
--import Dodge.Data.Item.Use.Consumption.Ammo
import Data.Aeson
import Data.Aeson.TH
import Dodge.Data.CamouflageStatus
@@ -49,7 +49,7 @@ data Euse
| EAmmoSource
{ _euseAmmoAmount :: Int
, _euseAmmoMax :: Int
, _euseAmmoSourceType :: AmmoSourceType
-- , _euseAmmoSourceType :: AmmoSourceType
, _euseAmmoLink :: Maybe Int
}
deriving (Eq, Ord, Show, Read) --Generic, Flat)
+4 -1
View File
@@ -32,7 +32,7 @@ data ItemUse
, _heldMods :: HeldMod
, _heldHammer :: HammerPosition
, _heldAim :: AimParams
, _heldConsumption :: HeldConsumption
, _heldConsumption :: [AmmoType]
, _heldParams :: HeldParams
-- , _useTargeting :: Maybe TargetType
}
@@ -64,6 +64,8 @@ data ItemUse
data HeldParams
= DefaultHeldParams
| GasSprayParams
{_gasCreation :: GasCreate}
| BulletShooterParams
{ _muzVel :: Float
, _rifling :: Float
@@ -82,6 +84,7 @@ data AmmoParams = BulletParams {_ampBullet :: Bullet}
, _ampPjDraw :: ProjectileDraw
, _ampPjCreation :: ProjectileCreate
}
| GasParams {_ampCreateGas :: GasCreate}
data ScrollAttachParams
= ZoomScrollParams
-10
View File
@@ -17,14 +17,6 @@ import Data.Aeson.TH
import Dodge.Data.Item.Use.Consumption.Ammo
import Dodge.Data.Item.Use.Consumption.LoadAction
data HeldConsumption
= LoadableAmmo
{ _laAmmoType :: AmmoType
, _laSourceType :: AmmoSourceType
}
| NoConsumption
deriving (Eq, Show, Read) --Generic, Flat)
data ReloadStatus = ReloadStatus
{ _iaMax :: Int
, _iaLoaded :: Int
@@ -54,11 +46,9 @@ newtype ItAmount = ItAmount {_getItAmount :: Int}
-- deriving stock (Generic)
-- deriving anyclass (Flat)
makeLenses ''HeldConsumption
makeLenses ''LeftConsumption
makeLenses ''ItAmount
makeLenses ''ReloadStatus
deriveJSON defaultOptions ''ReloadStatus
deriveJSON defaultOptions ''HeldConsumption
deriveJSON defaultOptions ''LeftConsumption
deriveJSON defaultOptions ''ItAmount
+2 -16
View File
@@ -34,25 +34,12 @@ 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
| SmallBulletAmmo
| LargeBulletAmmo
| BulletAmmo
| ElectricalAmmo
| DroneAmmo
| GasAmmo
{ _amCreateGas :: GasCreate
}
| ForceFieldAmmo
{ _amForceFieldType :: ForceFieldType
}
| GenericAmmo
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data ForceFieldType = DefaultForceField
@@ -69,4 +56,3 @@ deriveJSON defaultOptions ''ProjectileUpdate
deriveJSON defaultOptions ''GasCreate
deriveJSON defaultOptions ''ForceFieldType
deriveJSON defaultOptions ''AmmoType
deriveJSON defaultOptions ''AmmoSourceType