Cleanup. Add room-wise random placement spots

This commit is contained in:
2021-11-07 19:46:14 +00:00
parent f380e140e1
commit 5681a37953
18 changed files with 179 additions and 141 deletions
+23 -11
View File
@@ -1,15 +1,16 @@
{-
Connecting rooms designed with a pass-through technique in mind.
-}
{- Connecting rooms designed with a pass-through technique in mind. -}
module Dodge.Room.RoadBlock
where
import Geometry
--import Dodge.Data
import Dodge.Default.Room
import Dodge.Room.Data
import Dodge.Room.Link
import Dodge.Placements
import Dodge.Room.Corridor
import Dodge.Room.Furniture
import Dodge.LevelGen.Data
--import Dodge.Default.Wall
--import Dodge.RandomHelp
import Dodge.Creature
import Dodge.Layout.Tree.Polymorphic
@@ -42,7 +43,7 @@ litCorridor90 = do
]
, _rmPS =
[ sPS (V2 20 (h-5)) 0 putLamp
, spanLightI 70 (V2 0 (0.4*h)) (V2 40 (0.4*h))
, spanLightI (V2 0 (0.4*h)) (V2 40 (0.4*h))
, windowLine (V2 0 (h-20)) (V2 40 (h-20))
, sPS (V2 (-50) (h-85)) 0 putLamp
, windowLine (V2 (-40) (h-60)) (V2 (-40) (h-100))
@@ -52,11 +53,7 @@ litCorridor90 = do
, _rmBound = [poly]
}
noWeaponTest :: State g (Tree (Either Room Room))
noWeaponTest = do
undefined
-- | A random length corridor with a descrutible block blocking it.
-- | A random length corridor with a destructible block blocking it.
longBlockedCorridor :: RandomGen g => State g (Tree (Either Room Room))
longBlockedCorridor = do
r <- state $ randomR (0,pi)
@@ -68,13 +65,28 @@ longBlockedCorridor = do
sequence $ treeFromPost (replicate n $ Left <$> randomiseOutLinks corridor)
$ return $ Right $ set rmPS plmnts corridor
-- | A single corridor with a descrutible block blocking it.
-- | A single corridor with a destructible block blocking it.
blockedCorridor :: RandomGen g => State g (Tree (Either Room Room))
blockedCorridor = do
r <- state $ randomR (0,pi)
let plmnts =
[sPS (V2 20 40) r $ PutBlock [5,5,5] (V4 (150/256) ( 75/256) 0 ( 250/256))
$ reverse $ rectNSWE 10 (-10) (-10) 10
,spanLightI 55 (V2 0 15) (V2 40 15)
,spanLightI (V2 0 15) (V2 40 15)
]
sequence $ treeFromPost [] $ return $ Right $ set rmPS plmnts corridor
lasTunnel :: Room
lasTunnel = defaultRoom
{ _rmPolys = polys
, _rmBound = polys
, _rmLinks = [(V2 20 190,1.5* pi),(V2 0 20,0.5* pi)]
, _rmPS = [putLasTurret & placementSpot .~ PS (V2 10 240) (1.5*pi)
, lowWall (rectNSEW 65 40 0 25)
, mountLightV (V2 50 10) (V3 40 20 50)
]
}
where
polys = [rectNSWE 250 0 0 20
, rectNSWE 80 0 0 60
]