Start work on clouds, damage, sensors
This commit is contained in:
@@ -45,10 +45,10 @@ digraph {
|
|||||||
,label="HELD {_ibtHeld = FLAMESPITTER}"];
|
,label="HELD {_ibtHeld = FLAMESPITTER}"];
|
||||||
57 [shape=box
|
57 [shape=box
|
||||||
,label="HELD {_ibtHeld = BLOWTORCH}"];
|
,label="HELD {_ibtHeld = BLOWTORCH}"];
|
||||||
60 [shape=box
|
59 [shape=box
|
||||||
,label="HELD {_ibtHeld = FLAMEWALL}"];
|
|
||||||
61 [shape=box
|
|
||||||
,label="HELD {_ibtHeld = FLAMETHROWER}"];
|
,label="HELD {_ibtHeld = FLAMETHROWER}"];
|
||||||
|
61 [shape=box
|
||||||
|
,label="HELD {_ibtHeld = FLAMEWALL}"];
|
||||||
63 [shape=box
|
63 [shape=box
|
||||||
,label="HELD {_ibtHeld = FLAMETORRENT}"];
|
,label="HELD {_ibtHeld = FLAMETORRENT}"];
|
||||||
65 [shape=box
|
65 [shape=box
|
||||||
@@ -109,7 +109,7 @@ digraph {
|
|||||||
52 [shape=point];
|
52 [shape=point];
|
||||||
56 [shape=point];
|
56 [shape=point];
|
||||||
58 [shape=point];
|
58 [shape=point];
|
||||||
59 [shape=point];
|
60 [shape=point];
|
||||||
62 [shape=point];
|
62 [shape=point];
|
||||||
64 [shape=point];
|
64 [shape=point];
|
||||||
68 [shape=point];
|
68 [shape=point];
|
||||||
@@ -235,14 +235,14 @@ digraph {
|
|||||||
,arrowhead=onone
|
,arrowhead=onone
|
||||||
,headport=w];
|
,headport=w];
|
||||||
56 -> 57 [xlabel="",tailport=e];
|
56 -> 57 [xlabel="",tailport=e];
|
||||||
58 -> 13 [xlabel="",tailport=e];
|
58 -> 59 [xlabel="",tailport=e];
|
||||||
59 -> 60 [xlabel="",tailport=e];
|
59 -> 60 [xlabel=1
|
||||||
61 -> 59 [xlabel=1
|
|
||||||
,arrowhead=onone
|
,arrowhead=onone
|
||||||
,headport=w];
|
,headport=w];
|
||||||
61 -> 62 [xlabel=1
|
59 -> 62 [xlabel=1
|
||||||
,arrowhead=onone
|
,arrowhead=onone
|
||||||
,headport=w];
|
,headport=w];
|
||||||
|
60 -> 61 [xlabel="",tailport=e];
|
||||||
62 -> 63 [xlabel="",tailport=e];
|
62 -> 63 [xlabel="",tailport=e];
|
||||||
64 -> 65 [xlabel="",tailport=e];
|
64 -> 65 [xlabel="",tailport=e];
|
||||||
68 -> 69 [xlabel="",tailport=e];
|
68 -> 69 [xlabel="",tailport=e];
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ Corridor-4
|
|||||||
|
|
|
|
||||||
autoDoor-5
|
autoDoor-5
|
||||||
|
|
|
|
||||||
ELECautoRect-6
|
ElecautoRect-6
|
||||||
|
|
|
|
||||||
+- triggerDoorRoom-7
|
+- triggerDoorRoom-7
|
||||||
| |
|
| |
|
||||||
|
|||||||
+1
-1
@@ -77,7 +77,7 @@ Seed: 7114951007332849727
|
|||||||
|
|
||||||
2:0:0:0:0:autoDoor
|
2:0:0:0:0:autoDoor
|
||||||
|
|
|
|
||||||
2:0:0:0:1:ELECautoRect
|
2:0:0:0:1:ElecautoRect
|
||||||
|
|
|
|
||||||
+- 2:0:0:0:2:triggerDoorRoom
|
+- 2:0:0:0:2:triggerDoorRoom
|
||||||
| |
|
| |
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
+17
-13
@@ -1,26 +1,30 @@
|
|||||||
{-# LANGUAGE TemplateHaskell #-}
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
|
|
||||||
--{-# LANGUAGE StrictData #-}
|
--{-# LANGUAGE StrictData #-}
|
||||||
module Data.Tile where
|
module Data.Tile where
|
||||||
import Geometry.Data
|
|
||||||
import Data.Aeson
|
|
||||||
import Data.Aeson.TH
|
|
||||||
|
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
|
import Data.Aeson
|
||||||
|
import Data.Aeson.TH
|
||||||
|
import Geometry.Data
|
||||||
|
|
||||||
data Floor
|
data Floor
|
||||||
= InheritFloor
|
= InheritFloor
|
||||||
-- | TileWith Float
|
| -- | TileWith Float
|
||||||
| Tiled { _tiles :: [Tile]}
|
Tiled {_tiles :: [Tile]}
|
||||||
|
|
||||||
data Tile = Tile
|
data Tile = Tile
|
||||||
{ _tilePoly :: [Point2]
|
{ _tilePoly :: [Point2]
|
||||||
, _tileZero :: Point2 -- ^ point in the world where tile texture is 0,0
|
, -- | point in the world where tile texture is 0,0
|
||||||
, _tileTangentPos :: Point2
|
_tileZero :: Point2
|
||||||
-- ^ world position one along in the X direction, note this also set the scale of the
|
, -- | world position one along in the X direction, note this also set the scale of the
|
||||||
-- texture
|
-- texture
|
||||||
-- this has to be a position because it is shifted
|
-- this has to be a position because it is shifted
|
||||||
, _tileArrayZ :: Float
|
_tileTangentPos :: Point2
|
||||||
|
, _tileArrayZ :: Float
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show)
|
deriving (Eq, Ord, Show)
|
||||||
|
|
||||||
makeLenses ''Floor
|
makeLenses ''Floor
|
||||||
makeLenses ''Tile
|
makeLenses ''Tile
|
||||||
deriveJSON defaultOptions ''Tile
|
deriveJSON defaultOptions ''Tile
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
{-# LANGUAGE StrictData #-}
|
{-# LANGUAGE StrictData #-}
|
||||||
{-# LANGUAGE TemplateHaskell #-}
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
|
|
||||||
module Dodge.Data.AimStance (module Dodge.Data.AimStance) where
|
module Dodge.Data.AimStance where
|
||||||
|
|
||||||
import Data.Aeson
|
|
||||||
import Data.Aeson.TH
|
|
||||||
|
|
||||||
data AimStance
|
data AimStance
|
||||||
= TwoHandUnder
|
= TwoHandUnder
|
||||||
@@ -12,5 +9,3 @@ data AimStance
|
|||||||
| TwoHandFlat
|
| TwoHandFlat
|
||||||
| OneHand
|
| OneHand
|
||||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||||
|
|
||||||
deriveJSON defaultOptions ''AimStance
|
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
{-# LANGUAGE StrictData #-}
|
{-# LANGUAGE StrictData #-}
|
||||||
--{-# LANGUAGE TemplateHaskell #-}
|
|
||||||
|
|
||||||
module Dodge.Data.AmmoType where
|
module Dodge.Data.AmmoType where
|
||||||
|
|
||||||
--import Data.Aeson
|
|
||||||
--import Data.Aeson.TH
|
|
||||||
|
|
||||||
data AmmoType
|
data AmmoType
|
||||||
= LauncherAmmo
|
= LauncherAmmo
|
||||||
| BulletAmmo
|
| BulletAmmo
|
||||||
@@ -16,5 +12,3 @@ data AmmoType
|
|||||||
| PrintMaterial
|
| PrintMaterial
|
||||||
| ExplosivePutty
|
| ExplosivePutty
|
||||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||||
|
|
||||||
--deriveJSON defaultOptions ''AmmoType
|
|
||||||
|
|||||||
@@ -1,16 +1,10 @@
|
|||||||
{-# LANGUAGE DeriveGeneric #-}
|
|
||||||
{-# LANGUAGE DeriveAnyClass #-}
|
|
||||||
{-# LANGUAGE StrictData #-}
|
{-# LANGUAGE StrictData #-}
|
||||||
{-# LANGUAGE TemplateHaskell #-}
|
|
||||||
|
|
||||||
module Dodge.Data.CamouflageStatus where
|
module Dodge.Data.CamouflageStatus where
|
||||||
|
|
||||||
import Data.Aeson
|
|
||||||
import Data.Aeson.TH
|
|
||||||
|
|
||||||
data CamouflageStatus
|
data CamouflageStatus
|
||||||
= FullyVisible
|
= FullyVisible
|
||||||
| Invisible
|
| Invisible
|
||||||
deriving (Eq, Ord, Enum, Show, Bounded, Read) --Generic, Flat)
|
deriving (Eq, Ord, Enum, Show, Bounded, Read) --Generic, Flat)
|
||||||
|
|
||||||
deriveJSON defaultOptions ''CamouflageStatus
|
--deriveJSON defaultOptions ''CamouflageStatus
|
||||||
|
|||||||
@@ -28,7 +28,11 @@ data Cloud = Cloud
|
|||||||
|
|
||||||
data CloudType
|
data CloudType
|
||||||
= SmokeCloud
|
= SmokeCloud
|
||||||
|
| FlamerSmokeCloud
|
||||||
|
| RocketCloud
|
||||||
|
| CryoReleaseCloud
|
||||||
| GasCloud
|
| GasCloud
|
||||||
|
| StoneDust
|
||||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||||
|
|
||||||
makeLenses ''Cloud
|
makeLenses ''Cloud
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ module Dodge.Data.ComposedItem where
|
|||||||
import Dodge.Data.AmmoType
|
import Dodge.Data.AmmoType
|
||||||
import Dodge.Data.DoubleTree
|
import Dodge.Data.DoubleTree
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
--import Data.Aeson
|
|
||||||
--import Data.Aeson.TH
|
|
||||||
import Dodge.Data.Item
|
import Dodge.Data.Item
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
import Linear.Quaternion (Quaternion (..))
|
import Linear.Quaternion (Quaternion (..))
|
||||||
|
|||||||
@@ -17,13 +17,6 @@ import Dodge.Data.FloatFunction
|
|||||||
import Dodge.Data.Material
|
import Dodge.Data.Material
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
|
|
||||||
--data CreatureStatistics = CreatureStatistics
|
|
||||||
-- { _strength :: Int
|
|
||||||
-- , _dexterity :: Int
|
|
||||||
-- , _intelligence :: Int
|
|
||||||
-- }
|
|
||||||
-- deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
||||||
|
|
||||||
data Vocalization
|
data Vocalization
|
||||||
= Mute
|
= Mute
|
||||||
| Vocalization
|
| Vocalization
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
module Dodge.Data.DoubleTree where
|
module Dodge.Data.DoubleTree where
|
||||||
|
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
--import Data.Aeson
|
||||||
import Data.Aeson.TH
|
--import Data.Aeson.TH
|
||||||
import Data.Bifunctor
|
import Data.Bifunctor
|
||||||
|
|
||||||
--import qualified Data.Map.Strict as M
|
--import qualified Data.Map.Strict as M
|
||||||
@@ -90,5 +90,5 @@ makeLenses ''DoubleTree
|
|||||||
makeLenses ''LabelDoubleTree
|
makeLenses ''LabelDoubleTree
|
||||||
makeLenses ''LocationLDT
|
makeLenses ''LocationLDT
|
||||||
makeLenses ''ContextLDT
|
makeLenses ''ContextLDT
|
||||||
deriveJSON defaultOptions ''DoubleTree
|
--deriveJSON defaultOptions ''DoubleTree
|
||||||
deriveJSON defaultOptions ''LabelDoubleTree
|
--deriveJSON defaultOptions ''LabelDoubleTree
|
||||||
|
|||||||
@@ -5,15 +5,15 @@
|
|||||||
|
|
||||||
module Dodge.Data.GenParams where
|
module Dodge.Data.GenParams where
|
||||||
|
|
||||||
|
import Dodge.Data.Machine.Sensor.Type
|
||||||
import Color
|
import Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
import qualified Data.Map.Strict as M
|
import qualified Data.Map.Strict as M
|
||||||
import Dodge.Data.Damage.Type
|
|
||||||
|
|
||||||
newtype GenParams = GenParams
|
newtype GenParams = GenParams
|
||||||
{ _sensorCoding :: M.Map DamageType (PaletteColor, DecorationShape)
|
{ _sensorCoding :: M.Map SensorType (PaletteColor, DecorationShape)
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||||
|
|
||||||
|
|||||||
@@ -1,23 +1,27 @@
|
|||||||
{-# LANGUAGE DeriveGeneric #-}
|
|
||||||
{-# LANGUAGE DeriveAnyClass #-}
|
{-# LANGUAGE DeriveAnyClass #-}
|
||||||
|
{-# LANGUAGE DeriveGeneric #-}
|
||||||
{-# LANGUAGE StrictData #-}
|
{-# LANGUAGE StrictData #-}
|
||||||
{-# LANGUAGE TemplateHaskell #-}
|
{-# 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 Color
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
|
import Dodge.Data.GenParams
|
||||||
import Dodge.Data.Item.Combine
|
import Dodge.Data.Item.Combine
|
||||||
import Dodge.Data.Damage.Type
|
import Dodge.Data.Machine.Sensor.Type
|
||||||
|
|
||||||
data Sensor
|
data Sensor
|
||||||
= DamageSensor
|
= DamageSensor
|
||||||
{ _sensToggle :: Bool
|
{ _sensToggle :: Bool
|
||||||
, _sensAmount :: Int
|
, _sensAmount :: Int
|
||||||
, _sensType :: DamageType
|
, -- , _sensType :: DamageType
|
||||||
|
_sensType :: SensorType
|
||||||
, _sensDraw :: (PaletteColor, DecorationShape)
|
, _sensDraw :: (PaletteColor, DecorationShape)
|
||||||
, _sensThreshold :: Int
|
, _sensThreshold :: Int
|
||||||
}
|
}
|
||||||
@@ -27,18 +31,21 @@ data Sensor
|
|||||||
, _proxRequirement :: ProximityRequirement
|
, _proxRequirement :: ProximityRequirement
|
||||||
, _sensToggle :: Bool
|
, _sensToggle :: Bool
|
||||||
}
|
}
|
||||||
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
||||||
|
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||||
|
|
||||||
data ProximityRequirement
|
data ProximityRequirement
|
||||||
= RequireHealth {_proxReqMinHealth :: Int}
|
= RequireHealth {_proxReqMinHealth :: Int}
|
||||||
| RequireEquipment {_proxReqEquipment :: ItemType}
|
| RequireEquipment {_proxReqEquipment :: ItemType}
|
||||||
| RequireImpossible
|
| RequireImpossible
|
||||||
deriving (Show)
|
deriving (Show)
|
||||||
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
||||||
|
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||||
|
|
||||||
data CloseToggle = NotClose | IsClose
|
data CloseToggle = NotClose | IsClose
|
||||||
deriving (Show)
|
deriving (Show)
|
||||||
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
||||||
|
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||||
|
|
||||||
makeLenses ''Sensor
|
makeLenses ''Sensor
|
||||||
makeLenses ''ProximityRequirement
|
makeLenses ''ProximityRequirement
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ initialAnoTree =
|
|||||||
[ IntAnno $ AnTree . startRoom
|
[ IntAnno $ AnTree . startRoom
|
||||||
, IntAnno $
|
, IntAnno $
|
||||||
PassthroughLockKeyLists
|
PassthroughLockKeyLists
|
||||||
[(sensorRoomRunPast ELECTRICAL, takeOne
|
[(sensorRoomRunPast ElectricSensor, takeOne
|
||||||
[-- CRAFT (ENERGYBALLCRAFT TeslaBall) ,
|
[-- CRAFT (ENERGYBALLCRAFT TeslaBall) ,
|
||||||
HELD SPARKGUN])]
|
HELD SPARKGUN])]
|
||||||
itemRooms
|
itemRooms
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ flameWall =
|
|||||||
flameThrower :: Item
|
flameThrower :: Item
|
||||||
flameThrower =
|
flameThrower =
|
||||||
defaultHeldItem
|
defaultHeldItem
|
||||||
|
& itType .~ HELD FLAMETHROWER
|
||||||
& itParams .~ NozzleAngle 0
|
& itParams .~ NozzleAngle 0
|
||||||
-- & itUse . heldDelay .~ NoDelay
|
-- & itUse . heldDelay .~ NoDelay
|
||||||
-- & itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 5, _izMin = 1.5}
|
-- & itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 5, _izMin = 1.5}
|
||||||
@@ -78,7 +79,6 @@ flameThrower =
|
|||||||
-- 0
|
-- 0
|
||||||
-- ]
|
-- ]
|
||||||
-- & itAmmoSlots .~ singleAmmo GasAmmo
|
-- & itAmmoSlots .~ singleAmmo GasAmmo
|
||||||
-- & itType .~ HELD FLAMETHROWER
|
|
||||||
-- & itUse . heldParams .~ GasSprayParams
|
-- & itUse . heldParams .~ GasSprayParams
|
||||||
-- { _weaponInvLock = 0
|
-- { _weaponInvLock = 0
|
||||||
---- , _weaponRepeat = mempty
|
---- , _weaponRepeat = mempty
|
||||||
|
|||||||
@@ -26,5 +26,5 @@ generateGenParams = do
|
|||||||
return
|
return
|
||||||
. GenParams
|
. GenParams
|
||||||
. M.fromList
|
. M.fromList
|
||||||
. zip [FLAMING, LASERING, ELECTRICAL]
|
. zip [LaserSensor ..]
|
||||||
$ zip cols shps
|
$ zip cols shps
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ lockRoomMultiItems =
|
|||||||
lockRoomKeyItems :: RandomGen g => [(Int -> State g (MetaTree Room String), State g ItemType)]
|
lockRoomKeyItems :: RandomGen g => [(Int -> State g (MetaTree Room String), State g ItemType)]
|
||||||
lockRoomKeyItems =
|
lockRoomKeyItems =
|
||||||
[ (lasCenSensEdge, takeOne [HELD RLAUNCHER, HELD LASER, HELD SPARKGUN, HELD FLATSHIELD])
|
[ (lasCenSensEdge, takeOne [HELD RLAUNCHER, HELD LASER, HELD SPARKGUN, HELD FLATSHIELD])
|
||||||
, (sensorRoomRunPast LASERING, return $ HELD LASER)
|
, (sensorRoomRunPast LaserSensor, return $ HELD LASER)
|
||||||
, (const slowDoorRoomRunPast, return $ HELD (MINIGUNX 3))
|
, (const slowDoorRoomRunPast, return $ HELD (MINIGUNX 3))
|
||||||
, (const longRoomRunPast, takeOne [HELD SNIPERRIFLE, HELD FLATSHIELD])
|
, (const longRoomRunPast, takeOne [HELD SNIPERRIFLE, HELD FLATSHIELD])
|
||||||
, (const glassLessonRunPast, takeOne [HELD LASER])
|
, (const glassLessonRunPast, takeOne [HELD LASER])
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
{-# LANGUAGE LambdaCase #-}
|
||||||
module Dodge.Machine.Update (
|
module Dodge.Machine.Update (
|
||||||
updateMachine,
|
updateMachine,
|
||||||
) where
|
) where
|
||||||
@@ -151,7 +152,8 @@ mcProxTest mc w = case mc ^? mcType . _McSensor . proxRequirement of
|
|||||||
where
|
where
|
||||||
cr = you w
|
cr = you w
|
||||||
|
|
||||||
senseDamage :: Int -> DamageType -> Machine -> World -> World
|
--senseDamage :: Int -> DamageType -> Machine -> World -> World
|
||||||
|
senseDamage :: Int -> SensorType -> Machine -> World -> World
|
||||||
senseDamage threshold dt mc =
|
senseDamage threshold dt mc =
|
||||||
(cWorld . lWorld . machines . ix mcid %~ upmc)
|
(cWorld . lWorld . machines . ix mcid %~ upmc)
|
||||||
. updatels
|
. updatels
|
||||||
@@ -162,12 +164,21 @@ senseDamage threshold dt mc =
|
|||||||
| x > 0 = x
|
| x > 0 = x
|
||||||
| otherwise = -5
|
| otherwise = -5
|
||||||
where
|
where
|
||||||
x = sum . map _dmAmount $ filter ((== dt) . _dmType) (_mcDamage mc)
|
f d = d `elem` sensorTypeDamages dt
|
||||||
|
x = sum . map _dmAmount $ filter (f . _dmType) (_mcDamage mc)
|
||||||
ni = fromIntegral (mc ^?! mcType . _McSensor . sensAmount) / fromIntegral threshold
|
ni = fromIntegral (mc ^?! mcType . _McSensor . sensAmount) / fromIntegral threshold
|
||||||
updatels = fromMaybe id $ do
|
updatels = fromMaybe id $ do
|
||||||
lsid <- mc ^? mcMounts . ix ObLightSource
|
lsid <- mc ^? mcMounts . ix ObLightSource
|
||||||
return $ cWorld . lWorld . lightSources . ix lsid . lsParam . lsCol .~ V3 ni ni ni
|
return $ cWorld . lWorld . lightSources . ix lsid . lsParam . lsCol .~ V3 ni ni ni
|
||||||
|
|
||||||
|
sensorTypeDamages :: SensorType -> [DamageType]
|
||||||
|
sensorTypeDamages = \case
|
||||||
|
LaserSensor -> [LASERING]
|
||||||
|
ElectricSensor -> [ELECTRICAL]
|
||||||
|
ThermalSensor -> [FLAMING,SPARKING,EXPLOSIVE]
|
||||||
|
PhysicalSensor -> [PIERCING,BLUNT,CUTTING,CRUSHING,EXPLOSIVE,CONCUSSIVE]
|
||||||
|
|
||||||
|
|
||||||
--damageUsing :: DamageType -> Damage -> Either Int Int
|
--damageUsing :: DamageType -> Damage -> Either Int Int
|
||||||
--damageUsing dt dm
|
--damageUsing dt dm
|
||||||
-- | _dmType dm == dt = Left $ _dmAmount dm
|
-- | _dmType dm == dt = Left $ _dmAmount dm
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import Dodge.LightSource
|
|||||||
import Geometry
|
import Geometry
|
||||||
|
|
||||||
damageSensor ::
|
damageSensor ::
|
||||||
DamageType ->
|
SensorType ->
|
||||||
Float ->
|
Float ->
|
||||||
Maybe Int ->
|
Maybe Int ->
|
||||||
PlacementSpot ->
|
PlacementSpot ->
|
||||||
@@ -42,16 +42,16 @@ damageSensor dt wdth mtrid ps = pContID ps (PutLS $ lsPosCol (V3 0 0 30) 0.1) $
|
|||||||
defaultSensorWall
|
defaultSensorWall
|
||||||
)
|
)
|
||||||
|
|
||||||
damageTypeThreshold :: DamageType -> Int
|
damageTypeThreshold :: SensorType -> Int
|
||||||
damageTypeThreshold dt = case dt of
|
damageTypeThreshold dt = case dt of
|
||||||
FLAMING -> 1000
|
LaserSensor -> 1000
|
||||||
LASERING -> 1000
|
ElectricSensor -> 500
|
||||||
ELECTRICAL -> 500
|
ThermalSensor -> 1000
|
||||||
_ -> undefined
|
PhysicalSensor -> 1000
|
||||||
|
|
||||||
lightSensor ::
|
lightSensor ::
|
||||||
Float ->
|
Float ->
|
||||||
Maybe Int ->
|
Maybe Int ->
|
||||||
PlacementSpot ->
|
PlacementSpot ->
|
||||||
Placement
|
Placement
|
||||||
lightSensor = damageSensor LASERING
|
lightSensor = damageSensor LaserSensor
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ lightSensInsideDoor outplid rm =
|
|||||||
, psPt atFstLnkOut (PutForeground $ floorWire (V2 0 (-100)) (V2 20 (-100)))
|
, psPt atFstLnkOut (PutForeground $ floorWire (V2 0 (-100)) (V2 20 (-100)))
|
||||||
, psPt atFstLnkOut (PutForeground $ verticalWire (V2 20 0) 0 80)
|
, psPt atFstLnkOut (PutForeground $ verticalWire (V2 20 0) 0 80)
|
||||||
]
|
]
|
||||||
& rmOutPmnt .~ [OutPlacement (sensAboveDoor LASERING 10 (atFstLnkOutShiftInward 100)) outplid]
|
& rmOutPmnt .~ [OutPlacement (sensAboveDoor LaserSensor 10 (atFstLnkOutShiftInward 100)) outplid]
|
||||||
|
|
||||||
lightSensByDoor :: Int -> Room -> Room
|
lightSensByDoor :: Int -> Room -> Room
|
||||||
lightSensByDoor outplid rm =
|
lightSensByDoor outplid rm =
|
||||||
@@ -51,7 +51,7 @@ lightSensByDoor outplid rm =
|
|||||||
, heightWallPS (atNthLnkOutShiftInward 1 100) 30 covershape
|
, heightWallPS (atNthLnkOutShiftInward 1 100) 30 covershape
|
||||||
, heightWallPS (atFstLnkOutShiftInward 100) 30 covershape
|
, heightWallPS (atFstLnkOutShiftInward 100) 30 covershape
|
||||||
]
|
]
|
||||||
& rmOutPmnt .~ [OutPlacement (sensAboveDoor LASERING 20 (atFstLnkOutShiftBy sensorshift)) outplid]
|
& rmOutPmnt .~ [OutPlacement (sensAboveDoor LaserSensor 20 (atFstLnkOutShiftBy sensorshift)) outplid]
|
||||||
where
|
where
|
||||||
covershape = rectNSWE 10 (-10) (-20) 20
|
covershape = rectNSWE 10 (-10) (-20) 20
|
||||||
sensorshift (p, a) = (p +.+ rotateV a (V2 60 (-20)), a)
|
sensorshift (p, a) = (p +.+ rotateV a (V2 60 (-20)), a)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import RandomHelp
|
|||||||
|
|
||||||
-- TODO fix case where the sensor created by sensInsideDoor blocks another door
|
-- TODO fix case where the sensor created by sensInsideDoor blocks another door
|
||||||
-- for roomRectAutoLinks-- make the locked door a center door?
|
-- for roomRectAutoLinks-- make the locked door a center door?
|
||||||
sensorRoom :: RandomGen g => DamageType -> Int -> State g (Tree Room)
|
sensorRoom :: RandomGen g => SensorType -> Int -> State g (Tree Room)
|
||||||
sensorRoom senseType n = do
|
sensorRoom senseType n = do
|
||||||
rm <- takeOne [roomNgon 8 200, roomRectAutoLinks 200 200]
|
rm <- takeOne [roomNgon 8 200, roomRectAutoLinks 200 200]
|
||||||
cenroom <- shuffleLinks $ sensInsideDoor senseType n rm
|
cenroom <- shuffleLinks $ sensInsideDoor senseType n rm
|
||||||
@@ -45,7 +45,7 @@ sensorRoom senseType n = do
|
|||||||
p' = p +.+ rotateV d (V2 0 (negate 100))
|
p' = p +.+ rotateV d (V2 0 (negate 100))
|
||||||
isclose = dist (_rlPos rl) p' < 30
|
isclose = dist (_rlPos rl) p' < 30
|
||||||
|
|
||||||
sensorRoomRunPast :: RandomGen g => DamageType -> Int -> State g MTRS
|
sensorRoomRunPast :: RandomGen g => SensorType -> Int -> State g MTRS
|
||||||
sensorRoomRunPast dt n = do
|
sensorRoomRunPast dt n = do
|
||||||
t <- sensorRoom dt n
|
t <- sensorRoom dt n
|
||||||
rToOnward "sensorRoomRunPast" $
|
rToOnward "sensorRoomRunPast" $
|
||||||
@@ -60,13 +60,13 @@ sensorRoomRunPast dt n = do
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
sensAboveDoor :: DamageType -> Float -> PlacementSpot -> Placement
|
sensAboveDoor :: SensorType -> Float -> PlacementSpot -> Placement
|
||||||
sensAboveDoor sensetype wth ps =
|
sensAboveDoor sensetype wth ps =
|
||||||
extTrigLitPos
|
extTrigLitPos
|
||||||
(atFstLnkOutShiftBy (\(p, a) -> (p +.+ rotateV a (V2 18.5 (-2.5)), a)))
|
(atFstLnkOutShiftBy (\(p, a) -> (p +.+ rotateV a (V2 18.5 (-2.5)), a)))
|
||||||
(\tp -> Just $ damageSensor sensetype wth (_plMID tp) ps)
|
(\tp -> Just $ damageSensor sensetype wth (_plMID tp) ps)
|
||||||
|
|
||||||
sensInsideDoor :: DamageType -> Int -> Room -> Room
|
sensInsideDoor :: SensorType -> Int -> Room -> Room
|
||||||
sensInsideDoor senseType outplid rm =
|
sensInsideDoor senseType outplid rm =
|
||||||
rm
|
rm
|
||||||
& rmName .++~ take 4 (show senseType)
|
& rmName .++~ take 4 (show senseType)
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ toggleCommand =
|
|||||||
, _tcEffect = TerminalCommandEffectLinkedObject -- \tm _ -> OneArgument "A LINKED OBJECT" (togglesToEffects tm)
|
, _tcEffect = TerminalCommandEffectLinkedObject -- \tm _ -> OneArgument "A LINKED OBJECT" (togglesToEffects tm)
|
||||||
}
|
}
|
||||||
|
|
||||||
decodedtmap :: M.Map DamageType (PaletteColor, DecorationShape) -> M.Map String [TerminalLine]
|
decodedtmap :: M.Map SensorType (PaletteColor, DecorationShape) -> M.Map String [TerminalLine]
|
||||||
decodedtmap = M.mapKeys show . M.map ((: []) . makeTermLine . show)
|
decodedtmap = M.mapKeys show . M.map ((: []) . makeTermLine . show)
|
||||||
|
|
||||||
sensorCommand :: TerminalCommand
|
sensorCommand :: TerminalCommand
|
||||||
|
|||||||
@@ -734,7 +734,10 @@ mvGust _ gu
|
|||||||
cloudEffect :: Cloud -> World -> World
|
cloudEffect :: Cloud -> World -> World
|
||||||
cloudEffect cl = case _clType cl of
|
cloudEffect cl = case _clType cl of
|
||||||
GasCloud -> cloudPoisonDamage cl
|
GasCloud -> cloudPoisonDamage cl
|
||||||
|
RocketCloud -> id
|
||||||
|
CryoReleaseCloud -> id
|
||||||
SmokeCloud -> id
|
SmokeCloud -> id
|
||||||
|
_ -> id
|
||||||
|
|
||||||
updateCloud :: World -> Cloud -> (World, Maybe Cloud)
|
updateCloud :: World -> Cloud -> (World, Maybe Cloud)
|
||||||
updateCloud w c
|
updateCloud w c
|
||||||
|
|||||||
Reference in New Issue
Block a user