Commit on returning to work

This commit is contained in:
2023-09-21 09:17:49 +01:00
parent b8f03f7d8c
commit 9ee925f13a
17 changed files with 56 additions and 32 deletions
+10
View File
@@ -29,6 +29,7 @@ import Dodge.Data.Item.Params
import Dodge.Data.Item.Tweak
import Dodge.Data.Item.Use
import Dodge.Data.Item.Location
import Data.Set (Set)
data Item = Item
{ _itUse :: ItemUse
@@ -44,11 +45,20 @@ data Item = Item
, _itTweaks :: ItemTweaks
, _itScope :: Scope
, _itParams :: ItemParams
, _itAttachments :: Set ItemAttachment
}
--deriving (Eq, Show, Read) --Generic, Flat)
data ItemAttachment = ScopeAttachment
| BulletClipAttachment
| BulletBeltAttachment
| StandAttachment
| PowerSourceAttachment
deriving (Eq,Ord)
_itUseAimStance :: Item -> AimStance
_itUseAimStance = _aimStance . _heldAim . _itUse
makeLenses ''Item
deriveJSON defaultOptions ''ItemAttachment
deriveJSON defaultOptions ''Item
+7 -2
View File
@@ -91,10 +91,15 @@ data ItemBaseType
| AMMO {_ibtAmmo :: AmmoItemType}
| Consumable {_ibtConsumable :: ConsumableItemType}
| CRAFT CraftType
| ATTACH AttachType
deriving (Eq, Ord, Show, Read)
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
data AttachType
= ZOOMSCOPE
deriving (Eq, Ord, Show, Read)
data ConsumableItemType
= MEDKIT Int
| EXPLOSIVES
@@ -188,12 +193,11 @@ data HeldItemType
data AmmoItemType
= TINMAGAZINE
| DRUMMAGAZINE
| BULLETBELT
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data ItemModuleType
= EMPTYMODULE
| DRUMMAG
| BELTMAG
| MAGNETMAG
| BULPAY BulletSpawn
| BULBODY BulletEffect
@@ -235,6 +239,7 @@ makeLenses ''ItemModuleType
deriveJSON defaultOptions ''Stack
deriveJSON defaultOptions ''CraftType
deriveJSON defaultOptions ''ConsumableItemType
deriveJSON defaultOptions ''AttachType
deriveJSON defaultOptions ''Detector
deriveJSON defaultOptions ''EquipItemType
deriveJSON defaultOptions ''LeftItemType
-2
View File
@@ -25,8 +25,6 @@ data Scope
-- , _scopeZoomChange :: Int
, _scopeZoom :: Float
, _scopeDefaultZoom :: Float
, -- | if the camera offset is also the center of vision
_scopeIsCamera :: Bool
}
deriving (Eq, Show, Read) --Generic, Flat)
+6
View File
@@ -54,8 +54,13 @@ data ItemUse
}
| CraftUse
{_useAmount :: ItAmount}
| AttachUse
{_attachParams :: AttachParams}
--deriving (Eq, Show, Read) --Generic, Flat)
data AttachParams
= ZoomScopeParams
data ItemUse'
= ItemHeld HeldUse'
| ItemEquip EquipUse'
@@ -106,6 +111,7 @@ makeLenses ''ItZoom
makeLenses ''Muzzle
deriveJSON defaultOptions ''Muzzle
deriveJSON defaultOptions ''AimStance
deriveJSON defaultOptions ''AttachParams
deriveJSON defaultOptions ''ItZoom
deriveJSON defaultOptions ''AimParams
deriveJSON defaultOptions ''ItemUse
+5
View File
@@ -31,6 +31,11 @@ data AmmoSource
| AboveSource
deriving (Eq, Show, Read) --Generic, Flat)
data ExternalSourceType = BulletClip
| BulletBelt
| ElectricPower
deriving (Eq, Show, Read) --Generic, Flat)
data InternalAmmo = InternalAmmo
{ _iaMax :: Int
, _iaLoaded :: Int