Start work on clouds, damage, sensors

This commit is contained in:
2025-06-06 22:53:41 +01:00
parent d2d4642380
commit 7bee1549bf
25 changed files with 325 additions and 312 deletions
+1 -6
View File
@@ -1,10 +1,7 @@
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.AimStance (module Dodge.Data.AimStance) where
import Data.Aeson
import Data.Aeson.TH
module Dodge.Data.AimStance where
data AimStance
= TwoHandUnder
@@ -12,5 +9,3 @@ data AimStance
| TwoHandFlat
| OneHand
deriving (Eq, Ord, Show, Read) --Generic, Flat)
deriveJSON defaultOptions ''AimStance
-6
View File
@@ -1,11 +1,7 @@
{-# LANGUAGE StrictData #-}
--{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.AmmoType where
--import Data.Aeson
--import Data.Aeson.TH
data AmmoType
= LauncherAmmo
| BulletAmmo
@@ -16,5 +12,3 @@ data AmmoType
| PrintMaterial
| ExplosivePutty
deriving (Eq, Ord, Show, Read) --Generic, Flat)
--deriveJSON defaultOptions ''AmmoType
+1 -7
View File
@@ -1,16 +1,10 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.CamouflageStatus where
import Data.Aeson
import Data.Aeson.TH
data CamouflageStatus
= FullyVisible
| Invisible
deriving (Eq, Ord, Enum, Show, Bounded, Read) --Generic, Flat)
deriveJSON defaultOptions ''CamouflageStatus
--deriveJSON defaultOptions ''CamouflageStatus
+4
View File
@@ -28,7 +28,11 @@ data Cloud = Cloud
data CloudType
= SmokeCloud
| FlamerSmokeCloud
| RocketCloud
| CryoReleaseCloud
| GasCloud
| StoneDust
deriving (Eq, Ord, Show, Read) --Generic, Flat)
makeLenses ''Cloud
-2
View File
@@ -8,8 +8,6 @@ module Dodge.Data.ComposedItem where
import Dodge.Data.AmmoType
import Dodge.Data.DoubleTree
import Control.Lens
--import Data.Aeson
--import Data.Aeson.TH
import Dodge.Data.Item
import Geometry.Data
import Linear.Quaternion (Quaternion (..))
-7
View File
@@ -17,13 +17,6 @@ import Dodge.Data.FloatFunction
import Dodge.Data.Material
import Geometry.Data
--data CreatureStatistics = CreatureStatistics
-- { _strength :: Int
-- , _dexterity :: Int
-- , _intelligence :: Int
-- }
-- deriving (Eq, Ord, Show, Read) --Generic, Flat)
data Vocalization
= Mute
| Vocalization
+4 -4
View File
@@ -6,8 +6,8 @@
module Dodge.Data.DoubleTree where
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
--import Data.Aeson
--import Data.Aeson.TH
import Data.Bifunctor
--import qualified Data.Map.Strict as M
@@ -90,5 +90,5 @@ makeLenses ''DoubleTree
makeLenses ''LabelDoubleTree
makeLenses ''LocationLDT
makeLenses ''ContextLDT
deriveJSON defaultOptions ''DoubleTree
deriveJSON defaultOptions ''LabelDoubleTree
--deriveJSON defaultOptions ''DoubleTree
--deriveJSON defaultOptions ''LabelDoubleTree
+2 -2
View File
@@ -5,15 +5,15 @@
module Dodge.Data.GenParams where
import Dodge.Data.Machine.Sensor.Type
import Color
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
import qualified Data.Map.Strict as M
import Dodge.Data.Damage.Type
newtype GenParams = GenParams
{ _sensorCoding :: M.Map DamageType (PaletteColor, DecorationShape)
{ _sensorCoding :: M.Map SensorType (PaletteColor, DecorationShape)
}
deriving (Eq, Ord, Show, Read) --Generic, Flat)
+15 -8
View File
@@ -1,23 +1,27 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.Machine.Sensor where
module Dodge.Data.Machine.Sensor (
module Dodge.Data.Machine.Sensor,
module Dodge.Data.Machine.Sensor.Type,
) where
import Dodge.Data.GenParams
import Color
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
import Dodge.Data.GenParams
import Dodge.Data.Item.Combine
import Dodge.Data.Damage.Type
import Dodge.Data.Machine.Sensor.Type
data Sensor
= DamageSensor
{ _sensToggle :: Bool
, _sensAmount :: Int
, _sensType :: DamageType
, -- , _sensType :: DamageType
_sensType :: SensorType
, _sensDraw :: (PaletteColor, DecorationShape)
, _sensThreshold :: Int
}
@@ -27,18 +31,21 @@ data Sensor
, _proxRequirement :: ProximityRequirement
, _sensToggle :: Bool
}
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
data ProximityRequirement
= RequireHealth {_proxReqMinHealth :: Int}
| RequireEquipment {_proxReqEquipment :: ItemType}
| RequireImpossible
deriving (Show)
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
data CloseToggle = NotClose | IsClose
deriving (Show)
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
makeLenses ''Sensor
makeLenses ''ProximityRequirement