This commit is contained in:
2024-09-30 12:54:31 +01:00
parent 65564c993b
commit fc5539cb38
58 changed files with 802 additions and 1255 deletions
+10 -13
View File
@@ -1,5 +1,3 @@
--{-# LANGUAGE DeriveGeneric #-}
--{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
@@ -16,23 +14,23 @@ module Dodge.Data.Item (
module Dodge.Data.Item.Location,
) where
import NewInt
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
import Data.Set (Set)
import Dodge.Data.Item.Combine
import Dodge.Data.Item.Effect
import Dodge.Data.Item.Scope
import Dodge.Data.Item.CurseStatus
import Dodge.Data.Item.Effect
import Dodge.Data.Item.Location
import Dodge.Data.Item.Misc
import Dodge.Data.Item.Params
import Dodge.Data.Item.Scope
import Dodge.Data.Item.Tweak
import Dodge.Data.Item.Use
import Dodge.Data.Item.Location
import Data.Set (Set)
import NewInt
data ItID = ItID
deriving (Eq,Ord,Show,Read)
deriving (Eq, Ord, Show, Read)
data Item = Item
{ _itUse :: ItemUse
@@ -40,22 +38,21 @@ data Item = Item
, _itID :: NewInt ItmInt
, _itLocation :: ItemLocation
, _itEffect :: ItEffect
, _itInvSize :: Float
, _itInvSize :: Int
, _itDimension :: ItemDimension
, _itCurseStatus :: CurseStatus
, _itTweaks :: ItemTweaks
-- , _itScope :: Scope
, _itParams :: ItemParams
, _itAttachments :: Set ItemAttachment
}
--deriving (Eq, Show, Read) --Generic, Flat)
data ItemAttachment = ScopeAttachment
data ItemAttachment
= ScopeAttachment
| BulletClipAttachment
| BulletBeltAttachment
| StandAttachment
| PowerSourceAttachment
deriving (Eq,Ord)
deriving (Eq, Ord)
_itUseAimStance :: Item -> AimStance
_itUseAimStance = _aimStance . _heldAim . _itUse
+16 -28
View File
@@ -5,18 +5,23 @@
module Dodge.Data.Item.Combine where
import Dodge.Data.Item.BulletMod
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
import qualified Data.Map.Strict as M
import Dodge.Data.Equipment.Misc
import Dodge.Data.Item.BulletMod
import Dodge.Data.Item.Targeting
import Dodge.Data.Item.Use.Consumption
data ItemType = ItemType
{ _iyBase :: ItemBaseType
}
data ItemType
= HELD {_ibtHeld :: HeldItemType}
| LEFT {_ibtLeft :: LeftItemType}
| EQUIP {_ibtEquip :: EquipItemType}
| CONSUMABLE {_ibtConsumable :: ConsumableItemType}
| CRAFT {_ibtCraft :: CraftType}
| ATTACH {_ibtAttach :: AttachType}
| AMMOMAG {_ibtAmmoMag :: AmmoMagType}
| TARGETING {_ibtTargeting :: TargetingType}
| BULLETMOD {_ibtBulletMod :: BulletMod}
deriving (Eq, Ord, Show, Read)
data CraftType
@@ -64,25 +69,13 @@ data CraftType
| GASINJECTOR
| FLAKCRAFT
| FRAGCRAFT
-- | ENERGYBALLCRAFT EnergyBallType
-- | BULBODYCRAFT BulletEffect
| TELEPORTMODULE
| -- | ENERGYBALLCRAFT EnergyBallType
-- | BULBODYCRAFT BulletEffect
TELEPORTMODULE
| TIMEMODULE
| SIZEMODULE
| GRAVITYMODULE
-- | TARGETMODULE TargetingType
deriving (Eq, Ord, Show, Read)
data ItemBaseType
= HELD {_ibtHeld :: HeldItemType}
| LEFT {_ibtLeft :: LeftItemType}
| EQUIP {_ibtEquip :: EquipItemType}
| CONSUMABLE {_ibtConsumable :: ConsumableItemType}
| CRAFT CraftType
| ATTACH {_ibtAttach :: AttachType}
| AMMOMAG {_ibtAmmoMag :: AmmoMagType}
| TARGETING {_ibtTargeting :: TargetingType}
| BULLETMOD {_ibtBulletMod :: BulletMod}
-- | TARGETMODULE TargetingType
deriving (Eq, Ord, Show, Read)
data AttachType
@@ -94,8 +87,7 @@ data AttachType
deriving (Eq, Ord, Show, Read)
data AmmoMagType
= REVOLVEMAG
| TINMAG
= TINMAG
| DRUMMAG
| BELTMAG
| SHELLMAG
@@ -103,7 +95,6 @@ data AmmoMagType
| CHEMFUELPOUCH
deriving (Eq, Ord, Show, Read)
data ConsumableItemType
= MEDKIT Int
| EXPLOSIVES
@@ -117,7 +108,6 @@ data EquipItemType
| INVISIBILITYEQUIPMENT EquipSite
| BRAINHAT
| HAT
| TARGETINGHAT TargetingType
| HEADLAMP
| POWERLEGS
| SPEEDLEGS
@@ -188,7 +178,6 @@ data Detector
deriving (Eq, Ord, Show, Read) --Generic, Flat)
makeLenses ''ItemType
makeLenses ''ItemBaseType
makeLenses ''HeldItemType
makeLenses ''AttachType
deriveJSON defaultOptions ''CraftType
@@ -199,7 +188,6 @@ deriveJSON defaultOptions ''Detector
deriveJSON defaultOptions ''EquipItemType
deriveJSON defaultOptions ''LeftItemType
deriveJSON defaultOptions ''HeldItemType
deriveJSON defaultOptions ''ItemBaseType
deriveJSON defaultOptions ''ItemType
--instance ToJSONKey ModuleSlot
-1
View File
@@ -20,7 +20,6 @@ import Dodge.Data.Item.Use.Consumption.LoadAction
data ReloadStatus = ReloadStatus
{ _iaMax :: Int
, _iaLoaded :: Int
-- , _iaPrimed :: Bool
}
deriving (Eq, Show, Read) --Generic, Flat)
+1 -1
View File
@@ -31,7 +31,7 @@ data Sensor
data ProximityRequirement
= RequireHealth {_proxReqMinHealth :: Int}
| RequireEquipment {_proxReqEquipment :: ItemBaseType}
| RequireEquipment {_proxReqEquipment :: ItemType}
| RequireImpossible
deriving (Show)
--deriving (Eq, Ord, Show, Read) --Generic, Flat)