Add destruction to mounted lights
This commit is contained in:
+29
-48
@@ -1,13 +1,9 @@
|
||||
{-# LANGUAGE TupleSections #-}
|
||||
|
||||
-- | Rooms containing long doors, probably with a big reveal behind them.
|
||||
module Dodge.Room.LongDoor where
|
||||
|
||||
import ShapePicture
|
||||
import Linear
|
||||
import Dodge.Door.PutSlideDoor
|
||||
import Dodge.Default.Wall
|
||||
import Control.Monad
|
||||
import Dodge.LevelGen.Switch
|
||||
import Data.Maybe
|
||||
import qualified Data.Set as S
|
||||
import Dodge.Cleat
|
||||
@@ -15,7 +11,10 @@ import Dodge.Creature
|
||||
import Dodge.Data.GenWorld
|
||||
import Dodge.Default.Door
|
||||
import Dodge.Default.Room
|
||||
import Dodge.Default.Wall
|
||||
import Dodge.Door.PutSlideDoor
|
||||
import Dodge.LevelGen.PlacementHelper
|
||||
import Dodge.LevelGen.Switch
|
||||
import Dodge.LightSource
|
||||
import Dodge.Placement.Instance
|
||||
import Dodge.PlacementSpot
|
||||
@@ -27,8 +26,10 @@ import Dodge.Terminal
|
||||
import Dodge.Tree
|
||||
import Geometry
|
||||
import LensHelp
|
||||
import Linear
|
||||
import Picture
|
||||
import RandomHelp
|
||||
import ShapePicture
|
||||
|
||||
twinSlowDoorRoom ::
|
||||
-- | Half width
|
||||
@@ -104,58 +105,38 @@ addButtonSlowDoor x h rm = do
|
||||
f g y = g $ y ^. _1 . _y
|
||||
theterminal =
|
||||
putMessageTerminal terminalColor (simpleTermMessage themessage)
|
||||
& plSpot .~ rprBoolShift (isUnusedLnkType InLink)
|
||||
(shiftByV2 (V2 0 (-10)) <&> (,S.singleton UsedPosLow))
|
||||
themessage = [ "WARNING:" , "LARGE BIOMASS DETECTED" ]
|
||||
& plSpot
|
||||
.~ rprBoolShift
|
||||
(isUnusedLnkType InLink)
|
||||
(shiftByV2 (V2 0 (-10)) <&> (,S.singleton UsedPosLow))
|
||||
themessage = ["WARNING:", "LARGE BIOMASS DETECTED"]
|
||||
openDoorBound = reverse $ rectNSWE (h + 5) (h - 5) (3 * x / 2) (- x / 2)
|
||||
-- amountedlight dr xoff mpl = Just
|
||||
-- . moveLSThen
|
||||
-- (WdP2fDoorPosition (fromJust $ _plMID dr))
|
||||
-- (V3 15 xoff 89)
|
||||
-- (aShape (V2 15 0) (V3 15 xoff 90))
|
||||
-- $ \plls plpr ->
|
||||
-- Just $
|
||||
-- ptCont (PutWorldUpdate (const $ const $ over gwWorld $ setmount dr plls plpr)) $
|
||||
-- const mpl
|
||||
-- setmount pldr plls plpr =
|
||||
-- cWorld . lWorld . doors . ix (fromJust $ _plMID pldr) . drMounts
|
||||
-- <>~ [MountedLS (fromJust $ _plMID plls), MountedProp (fromJust $ _plMID plpr)]
|
||||
butDoor = putLitButOnPos
|
||||
(dim $ light red)
|
||||
(dim $ light red)
|
||||
(rprBool (isUnusedLnkType InLink))
|
||||
$ \btplmnt -> Just $
|
||||
putDoubleDoorThen
|
||||
$ \btplmnt -> Just
|
||||
. putDoubleDoorThen
|
||||
defaultDoorWall
|
||||
(WdBlBtOn $ fromJust $ _plMID btplmnt)
|
||||
30
|
||||
(V2 0 h)
|
||||
(V2 x h)
|
||||
0.5
|
||||
$ \dr1 dr2 ->
|
||||
Just
|
||||
$ sps0 $ PutWorldUpdate $ const $ const
|
||||
$ (gwWorld . cWorld . lWorld . doors . ix (dr1 ^?! plMID . _Just)
|
||||
. drMounts .~
|
||||
[MountedSPic (noPic $ aShape (V2 25 0) (V3 25 50 50))
|
||||
, MountedSPic (noPic $ aShape (V2 25 0) (V3 25 (-50) 50))
|
||||
, MountedLight (V3 25 (-50) 50) 200 0.5
|
||||
, MountedLight (V3 25 50 50) 200 0.5
|
||||
])
|
||||
|
||||
. (gwWorld . cWorld . lWorld . doors . ix (dr2 ^?! plMID . _Just)
|
||||
. drMounts .~
|
||||
[MountedSPic (noPic $ aShape (V2 (-25) 0) (V3 (-25) 50 50))
|
||||
, MountedSPic (noPic $ aShape (V2 (-25) 0) (V3 (-25) (-50) 50))
|
||||
, MountedLight (V3 (-25) (-50) 50) 200 0.5
|
||||
, MountedLight (V3 (-25) 50 50) 200 0.5
|
||||
])
|
||||
-- amountedlight dr1 50 $
|
||||
-- amountedlight dr1 (-50) $
|
||||
-- amountedlight dr2 50 $
|
||||
-- amountedlight
|
||||
-- dr2
|
||||
-- (-50)
|
||||
-- Nothing
|
||||
$ \dr1 dr2 ->
|
||||
Just
|
||||
. sps0
|
||||
. PutWorldUpdate
|
||||
. const
|
||||
. const
|
||||
$ domount dr1 id . domount dr2 negate
|
||||
domount drx g =
|
||||
gwWorld . cWorld . lWorld . doors . ix (drx ^?! plMID . _Just)
|
||||
. drMounts
|
||||
.~ [ MountedSPic (noPic $ aBar 50 $ g <$> [V2 lsx 9, V2 lsx ly, lp])
|
||||
, MountedLight (V3 (lx - 1) ly 50 & _xy %~ g) 200 0.5
|
||||
]
|
||||
lsx = 30
|
||||
lp@(V2 lx ly) = V2 100 (-20)
|
||||
|
||||
slowDoorRoom :: RandomGen g => State g Room
|
||||
slowDoorRoom = do
|
||||
|
||||
Reference in New Issue
Block a user