This commit is contained in:
2022-07-28 12:35:19 +01:00
parent 160560af5f
commit 8aeabf3f6c
16 changed files with 123 additions and 365 deletions
+16 -18
View File
@@ -26,43 +26,41 @@ import Dodge.Data.ObjectType
import Geometry.Data
import Sound.Data
data MachineDraw
= MachineDrawMempty
| MachineDrawTerminal
| MachineDrawTurret
| MachineDrawDamageSensor Float (PaletteColor, DecorationShape)
deriving (Eq, Show, Read)
data Machine = Machine
{ _mcID :: Int
, _mcWallIDs :: IS.IntSet
, _mcDraw :: MachineDraw
, _mcMaterial :: Material
, _mcPos :: Point2
, _mcDir :: Float
, _mcColor :: Color
, _mcHP :: Int
, _mcSensor :: Sensor
, _mcDamage :: [Damage]
, _mcType :: MachineType
, _mcMounts :: M.Map ObjectType Int
, _mcName :: String
, _mcCloseSound :: Maybe SoundID
, _mcWidth :: Float
}
deriving (Eq, Show, Read)
data MachineType
= StaticMachine
| Turret
{ _tuWeapon :: Item
, _tuTurnSpeed :: Float
, _tuFireTime :: Int
, _tuMCrID :: Maybe Int
}
= McStatic
| McTerminal
| McSensor Sensor
| McTurret Turret
deriving (Eq, Show, Read)
data Turret = Turret
{ _tuWeapon :: Item
, _tuTurnSpeed :: Float
, _tuFireTime :: Int
, _tuDir :: Float
}
deriving (Eq, Show, Read)
makeLenses ''Machine
makeLenses ''MachineType
deriveJSON defaultOptions ''MachineDraw
makeLenses ''Turret
makePrisms ''MachineType
deriveJSON defaultOptions ''Machine
deriveJSON defaultOptions ''MachineType
deriveJSON defaultOptions ''Turret
+4 -2
View File
@@ -3,6 +3,8 @@
module Dodge.Data.Machine.Sensor where
import Dodge.Data.GenParams
import Color
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
@@ -10,11 +12,11 @@ import Dodge.Data.Item.Combine
import Dodge.Data.Damage.Type
data Sensor
= NoSensor
| DamageSensor
= DamageSensor
{ _sensToggle :: Bool
, _sensAmount :: Int
, _sensType :: DamageType
, _sensDraw :: (PaletteColor, DecorationShape)
}
| ProximitySensor
{ _proxStatus :: CloseToggle