Tweak ledge room, rename roomRectAutoLinks
This commit is contained in:
+1
-1
@@ -55,7 +55,7 @@ initialRoomTree =
|
|||||||
, intAnno $ warningRooms "INVISIBLE CREATURE AHEAD"
|
, intAnno $ warningRooms "INVISIBLE CREATURE AHEAD"
|
||||||
, rToOnward "chaseCrit+armourChaseCrit rectRoom" .
|
, rToOnward "chaseCrit+armourChaseCrit rectRoom" .
|
||||||
return . cleatOnward =<<
|
return . cleatOnward =<<
|
||||||
(roomRectAutoLinks 400 400 <&> rmPmnts
|
(roomRectAutoLights 400 400 <&> rmPmnts
|
||||||
.++~ [ psPtPl anyUnusedSpot (PutCrit invisibleChaseCrit)
|
.++~ [ psPtPl anyUnusedSpot (PutCrit invisibleChaseCrit)
|
||||||
, psPtPl anyUnusedSpot (PutCrit armourChaseCrit)
|
, psPtPl anyUnusedSpot (PutCrit armourChaseCrit)
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ import System.Random
|
|||||||
|
|
||||||
blinkAcrossChallenge :: RandomGen g => State g (MetaTree Room String)
|
blinkAcrossChallenge :: RandomGen g => State g (MetaTree Room String)
|
||||||
blinkAcrossChallenge = do
|
blinkAcrossChallenge = do
|
||||||
teleFromRoom <- shuffleLinks =<< roomRectAutoLinks 200 200
|
teleFromRoom <- shuffleLinks =<< roomRectAutoLights 200 200
|
||||||
teleToRoom <- shuffleLinks =<< roomRectAutoLinks 200 200
|
teleToRoom <- shuffleLinks =<< roomRectAutoLights 200 200
|
||||||
emptylink <- shuffleLinks emptyCorridor
|
emptylink <- shuffleLinks emptyCorridor
|
||||||
rToOnward "blinkAcrossChallenge" $
|
rToOnward "blinkAcrossChallenge" $
|
||||||
treePost [teleFromRoom, emptylink, cleatOnward teleToRoom]
|
treePost [teleFromRoom, emptylink, cleatOnward teleToRoom]
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ branchRectWith t = do
|
|||||||
x <- state $ randomR (100, 200)
|
x <- state $ randomR (100, 200)
|
||||||
y <- state $ randomR (100, 200)
|
y <- state $ randomR (100, 200)
|
||||||
b <- t
|
b <- t
|
||||||
rt <- shuffleLinks =<< roomRectAutoLinks x y
|
rt <- shuffleLinks =<< roomRectAutoLights x y
|
||||||
return $
|
return $
|
||||||
Node
|
Node
|
||||||
rt
|
rt
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ pedestalRoom it = do
|
|||||||
r <-
|
r <-
|
||||||
takeOne
|
takeOne
|
||||||
[ shuffleLinks =<< (centerVaultRoom x x 50 <&> rmPmnts .:~ sps0 flit)
|
[ shuffleLinks =<< (centerVaultRoom x x 50 <&> rmPmnts .:~ sps0 flit)
|
||||||
, shuffleLinks =<< (roomRectAutoLinks (2 * x) (2 * x) <&> rmPmnts .:~ sPS (V2 x x) 0 flit)
|
, shuffleLinks =<< (roomRectAutoLights (2 * x) (2 * x) <&> rmPmnts .:~ sPS (V2 x x) 0 flit)
|
||||||
, shuffleLinks =<< (roomNgon ngon x <&> rmPmnts .:~ sps0 flit)
|
, shuffleLinks =<< (roomNgon ngon x <&> rmPmnts .:~ sps0 flit)
|
||||||
]
|
]
|
||||||
r <&> rmName .++~ "ped-"
|
r <&> rmName .++~ "ped-"
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ twinSlowDoorChasers = do
|
|||||||
return $ twinSlowDoorRoom 80 200 40 & rmPmnts %~ (plmnts ++)
|
return $ twinSlowDoorRoom 80 200 40 & rmPmnts %~ (plmnts ++)
|
||||||
|
|
||||||
southPillarsRoom :: RandomGen g => Float -> Float -> Float -> State g Room
|
southPillarsRoom :: RandomGen g => Float -> Float -> Float -> State g Room
|
||||||
southPillarsRoom x y h = addSouthPillars x h =<< roomRectAutoLinks x y
|
southPillarsRoom x y h = addSouthPillars x h =<< roomRectAutoLights x y
|
||||||
|
|
||||||
addSouthPillars :: RandomGen g => Float -> Float -> Room -> State g Room
|
addSouthPillars :: RandomGen g => Float -> Float -> Room -> State g Room
|
||||||
addSouthPillars x h r = do
|
addSouthPillars x h r = do
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ smallPillar = PutBlock defaultBlock baseBlockPane $ reverse $ square 5
|
|||||||
|
|
||||||
roomPillarsSquare :: RandomGen g => State g Room
|
roomPillarsSquare :: RandomGen g => State g Room
|
||||||
roomPillarsSquare = do
|
roomPillarsSquare = do
|
||||||
rm' <- roomRectAutoLinks 300 300
|
rm' <- roomRectAutoLights 300 300
|
||||||
let nlew = _numLinkEW (_rmType rm')
|
let nlew = _numLinkEW (_rmType rm')
|
||||||
nlns = _numLinkNS (_rmType rm')
|
nlns = _numLinkNS (_rmType rm')
|
||||||
thelight <- mntLightLnkCond $ resetPLUse $ rprBool $ \rp _ -> isOutLnk rp
|
thelight <- mntLightLnkCond $ resetPLUse $ rprBool $ \rp _ -> isOutLnk rp
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
-- | Procedural creation of rooms and subroom parts.
|
-- | Procedural creation of rooms and subroom parts.
|
||||||
module Dodge.Room.Procedural (
|
module Dodge.Room.Procedural (
|
||||||
roomRect,
|
roomRect,
|
||||||
roomRectAutoLinks,
|
roomRectAutoLights,
|
||||||
randomFourCornerRoom,
|
randomFourCornerRoom,
|
||||||
randomFourCornerRoomCrsIts,
|
randomFourCornerRoomCrsIts,
|
||||||
centerVaultRoom,
|
centerVaultRoom,
|
||||||
@@ -116,8 +116,8 @@ gridRoomPos xs ys = map makeonpos (grid xs ys) <> map makeoffpos (grid (mids xs)
|
|||||||
{- Creates a rectangular room, automatically creates links and pathfinding graph at a sensible size. -}
|
{- Creates a rectangular room, automatically creates links and pathfinding graph at a sensible size. -}
|
||||||
-- it is not clear to me that this works for very small rooms (but it does seem
|
-- it is not clear to me that this works for very small rooms (but it does seem
|
||||||
-- to do so)
|
-- to do so)
|
||||||
roomRectAutoLinks :: RandomGen g => Float -> Float -> State g Room
|
roomRectAutoLights :: RandomGen g => Float -> Float -> State g Room
|
||||||
roomRectAutoLinks x y = do
|
roomRectAutoLights x y = do
|
||||||
l1 <- mntLightLnkCond $ resetPLUse $ rprBool $ \rp _ -> isInLnk rp
|
l1 <- mntLightLnkCond $ resetPLUse $ rprBool $ \rp _ -> isInLnk rp
|
||||||
l2 <- mntLightLnkCond $ resetPLUse $ rprBool $ \rp _ -> isOutLnk rp
|
l2 <- mntLightLnkCond $ resetPLUse $ rprBool $ \rp _ -> isOutLnk rp
|
||||||
return $ roomRect x y (f x) (f y)
|
return $ roomRect x y (f x) (f y)
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ rezBoxesWpCrit = do
|
|||||||
theweapon <- randBlockBreakWeapon
|
theweapon <- randBlockBreakWeapon
|
||||||
let bottomEdgeTest (V2 _ y, _) = y < 1
|
let bottomEdgeTest (V2 _ y, _) = y < 1
|
||||||
aroom = rezInvBox thecol
|
aroom = rezInvBox thecol
|
||||||
centralRoom <- roomRectAutoLinks w h <&> rmPmnts .~ []
|
centralRoom <- roomRectAutoLights w h <&> rmPmnts .~ []
|
||||||
onwardpassage <-
|
onwardpassage <-
|
||||||
over root (rmConnectsTo .~ S.member (OnEdge West)) <$> maybeBlockedPassage
|
over root (rmConnectsTo .~ S.member (OnEdge West)) <$> maybeBlockedPassage
|
||||||
let n = length $ filter bottomEdgeTest $ map (\rl -> (rl ^. rlPos, rl ^. rlDir))
|
let n = length $ filter bottomEdgeTest $ map (\rl -> (rl ^. rlPos, rl ^. rlDir))
|
||||||
@@ -127,7 +127,7 @@ rezBoxes = do
|
|||||||
[door & rmConnectsTo .~ S.member (OnEdge South)]
|
[door & rmConnectsTo .~ S.member (OnEdge South)]
|
||||||
(rezInvBox thecol)
|
(rezInvBox thecol)
|
||||||
centralRoom <-
|
centralRoom <-
|
||||||
shuffleLinks =<< (roomRectAutoLinks w h <&> rmPmnts .~ []
|
shuffleLinks =<< (roomRectAutoLights w h <&> rmPmnts .~ []
|
||||||
<&> rmLinks %~ setInLinks bottomEdgeTest)
|
<&> rmLinks %~ setInLinks bottomEdgeTest)
|
||||||
let n = length $ filter bottomEdgeTest $ _rmLinks centralRoom
|
let n = length $ filter bottomEdgeTest $ _rmLinks centralRoom
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ roomC w h = do
|
|||||||
maybeaddgird <- takeOne [return, addRandomGirderFrom West 0, addRandomGirderFrom North 0]
|
maybeaddgird <- takeOne [return, addRandomGirderFrom West 0, addRandomGirderFrom North 0]
|
||||||
maybeaddgird
|
maybeaddgird
|
||||||
=<< shuffleLinks
|
=<< shuffleLinks
|
||||||
=<< ( roomRectAutoLinks w h
|
=<< ( roomRectAutoLights w h
|
||||||
<&> rmLinks
|
<&> rmLinks
|
||||||
%~ ( setInLinks (\rl -> S.fromList [FromEdge East 0, OnEdge South] `S.isSubsetOf` _rlType rl)
|
%~ ( setInLinks (\rl -> S.fromList [FromEdge East 0, OnEdge South] `S.isSubsetOf` _rlType rl)
|
||||||
. setOutLinks (\rl -> OnEdge West `S.member` _rlType rl)
|
. setOutLinks (\rl -> OnEdge West `S.member` _rlType rl)
|
||||||
@@ -320,7 +320,7 @@ shootersRoom' = do
|
|||||||
, spanLightI (V2 (w / 2) 200) (V2 (w + 10) 200)
|
, spanLightI (V2 (w / 2) 200) (V2 (w + 10) 200)
|
||||||
]
|
]
|
||||||
toPS x y = return (V2 x y, -0.5 * pi)
|
toPS x y = return (V2 x y, -0.5 * pi)
|
||||||
roomRectAutoLinks w 600
|
roomRectAutoLights w 600
|
||||||
<&> rmPmnts .~ plmnts
|
<&> rmPmnts .~ plmnts
|
||||||
<&> rmRandPSs .~ [toPS x1 y1, toPS x2 y2, toPS x3 y3]
|
<&> rmRandPSs .~ [toPS x1 y1, toPS x2 y2, toPS x3 y3]
|
||||||
|
|
||||||
@@ -423,7 +423,7 @@ distributerRoom atype aamount = do
|
|||||||
i1 <- nextLayoutInt
|
i1 <- nextLayoutInt
|
||||||
w <- state $ randomR (100, 400)
|
w <- state $ randomR (100, 400)
|
||||||
h <- state $ randomR (200, 400)
|
h <- state $ randomR (200, 400)
|
||||||
r <- roomRectAutoLinks w h
|
r <- roomRectAutoLights w h
|
||||||
let mcstore = defaultMachine
|
let mcstore = defaultMachine
|
||||||
& mcMaterial .~ Metal
|
& mcMaterial .~ Metal
|
||||||
& mcType .~ McStorage atype aamount
|
& mcType .~ McStorage atype aamount
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ lockedStart i = do
|
|||||||
h <- state $ randomR (200, 400 :: Float)
|
h <- state $ randomR (200, 400 :: Float)
|
||||||
thels <- roomCritLS
|
thels <- roomCritLS
|
||||||
theweapon <- randBlockBreakWeapon
|
theweapon <- randBlockBreakWeapon
|
||||||
cenroom <- shuffleLinks =<< (roomRectAutoLinks 40 h <&> rmPmnts .~ [])
|
cenroom <- shuffleLinks =<< (roomRectAutoLights 40 h <&> rmPmnts .~ [])
|
||||||
theedge <- takeOne $ map OnEdge [West, East]
|
theedge <- takeOne $ map OnEdge [West, East]
|
||||||
let linkcor = smallRoom & rmPmnts .~ [spanLS thels (V2 0 65) (V2 40 65)]
|
let linkcor = smallRoom & rmPmnts .~ [spanLS thels (V2 0 65) (V2 40 65)]
|
||||||
n = length $ filter (elem theedge . _rlType) (_rmLinks cenroom)
|
n = length $ filter (elem theedge . _rlType) (_rmLinks cenroom)
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import Control.Monad
|
|||||||
-- for roomRectAutoLinks-- make the locked door a center door?
|
-- for roomRectAutoLinks-- make the locked door a center door?
|
||||||
sensorRoom :: RandomGen g => SensorType -> Int -> State g (Tree Room)
|
sensorRoom :: RandomGen g => SensorType -> Int -> State g (Tree Room)
|
||||||
sensorRoom senseType n = do
|
sensorRoom senseType n = do
|
||||||
rm <- join $ takeOne [roomNgon 8 200, roomRectAutoLinks 200 200]
|
rm <- join $ takeOne [roomNgon 8 200, roomRectAutoLights 200 200]
|
||||||
cenroom <- shuffleLinks $ sensInsideDoor senseType n rm
|
cenroom <- shuffleLinks $ sensInsideDoor senseType n rm
|
||||||
return $ treePost
|
return $ treePost
|
||||||
[ door
|
[ door
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ tanksPipesRoom = do
|
|||||||
h <- state $ randomR (200, 300)
|
h <- state $ randomR (200, 300)
|
||||||
i <- state $ randomR (2, 5)
|
i <- state $ randomR (2, 5)
|
||||||
tanks <- randEdgeTanks i
|
tanks <- randEdgeTanks i
|
||||||
roomRectAutoLinks w h <&> rmPmnts .++~ tanks
|
roomRectAutoLights w h <&> rmPmnts .++~ tanks
|
||||||
|
|
||||||
tanksRoom :: RandomGen g => [Creature] -> [Item] -> State g Room
|
tanksRoom :: RandomGen g => [Creature] -> [Item] -> State g Room
|
||||||
tanksRoom crs its = do
|
tanksRoom crs its = do
|
||||||
@@ -81,7 +81,7 @@ tanksRoom crs its = do
|
|||||||
ntanks <- state $ randomR (3, 6)
|
ntanks <- state $ randomR (3, 6)
|
||||||
thetank <- randomTank <&> plSpot .~ unusedOffPathAwayFromLink 50
|
thetank <- randomTank <&> plSpot .~ unusedOffPathAwayFromLink 50
|
||||||
thelight <- mntLightLnkCond $ resetPLUse $ rprBool $ \rp _ -> isOutLnk rp
|
thelight <- mntLightLnkCond $ resetPLUse $ rprBool $ \rp _ -> isOutLnk rp
|
||||||
room <- roomRectAutoLinks w h
|
room <- roomRectAutoLights w h
|
||||||
let plmnts =
|
let plmnts =
|
||||||
map (\it -> sps0 (PutFlIt it) & plSpot .~ anyUnusedSpot) its
|
map (\it -> sps0 (PutFlIt it) & plSpot .~ anyUnusedSpot) its
|
||||||
++ map (\cr -> sps0 (PutCrit cr) & plSpot .~ unusedSpotAwayFromLink 50) crs
|
++ map (\cr -> sps0 (PutCrit cr) & plSpot .~ unusedSpotAwayFromLink 50) crs
|
||||||
|
|||||||
+12
-12
@@ -101,7 +101,7 @@ tutDrop = do
|
|||||||
i <- nextLayoutInt
|
i <- nextLayoutInt
|
||||||
--let y = decontamRoom i
|
--let y = decontamRoom i
|
||||||
(j, y) <- setRoomInt (decontamRoom i)
|
(j, y) <- setRoomInt (decontamRoom i)
|
||||||
rm <- roomRectAutoLinks 40 100
|
rm <- roomRectAutoLights 40 100
|
||||||
return $
|
return $
|
||||||
tToBTree "TutDrop" $
|
tToBTree "TutDrop" $
|
||||||
treePost
|
treePost
|
||||||
@@ -134,7 +134,7 @@ cChasm :: State LayoutVars Room
|
|||||||
cChasm = do
|
cChasm = do
|
||||||
x <- state $ randomR (150, 300)
|
x <- state $ randomR (150, 300)
|
||||||
y <- state $ randomR (150, 300)
|
y <- state $ randomR (150, 300)
|
||||||
roomRectAutoLinks x y
|
roomRectAutoLights x y
|
||||||
<&> rmLinks %~ setOutLinks (isCornerLink NorthWest)
|
<&> rmLinks %~ setOutLinks (isCornerLink NorthWest)
|
||||||
<&> rmLinks %~ setInLinks (isCornerLink SouthWest)
|
<&> rmLinks %~ setInLinks (isCornerLink SouthWest)
|
||||||
<&> rmPmnts <>~ [sps0 $ putConvexChasm (rectNSWE (y -50) 50 0 (x -50))]
|
<&> rmPmnts <>~ [sps0 $ putConvexChasm (rectNSWE (y -50) 50 0 (x -50))]
|
||||||
@@ -143,7 +143,7 @@ lChasm :: State LayoutVars Room
|
|||||||
lChasm = do
|
lChasm = do
|
||||||
x <- state $ randomR (150, 300)
|
x <- state $ randomR (150, 300)
|
||||||
y <- state $ randomR (150, 300)
|
y <- state $ randomR (150, 300)
|
||||||
roomRectAutoLinks x y
|
roomRectAutoLights x y
|
||||||
<&> rmLinks %~ setOutLinks (isCornerLink NorthWest)
|
<&> rmLinks %~ setOutLinks (isCornerLink NorthWest)
|
||||||
<&> rmLinks %~ setInLinks (isCornerLink SouthEast)
|
<&> rmLinks %~ setInLinks (isCornerLink SouthEast)
|
||||||
<&> rmPmnts <>~ [sps0 $ putConvexChasm (rectNSWE (y -50) 0 0 (x -50))]
|
<&> rmPmnts <>~ [sps0 $ putConvexChasm (rectNSWE (y -50) 0 0 (x -50))]
|
||||||
@@ -153,7 +153,7 @@ zChasm :: Float -> State LayoutVars Room
|
|||||||
zChasm z = do
|
zChasm z = do
|
||||||
x <- state $ randomR (150, 300)
|
x <- state $ randomR (150, 300)
|
||||||
y <- state $ randomR (150, 300)
|
y <- state $ randomR (150, 300)
|
||||||
roomRectAutoLinks x y
|
roomRectAutoLights x y
|
||||||
<&> rmLinks %~ setOutLinks (isCornerLink NorthWest)
|
<&> rmLinks %~ setOutLinks (isCornerLink NorthWest)
|
||||||
<&> rmLinks %~ setInLinks (isCornerLink SouthEast)
|
<&> rmLinks %~ setInLinks (isCornerLink SouthEast)
|
||||||
<&> rmPath %~ addNodesCrossing (V2 0 (y/2),V2 x (y/2))
|
<&> rmPath %~ addNodesCrossing (V2 0 (y/2),V2 x (y/2))
|
||||||
@@ -166,7 +166,7 @@ midChasm :: State LayoutVars Room
|
|||||||
midChasm = do
|
midChasm = do
|
||||||
x <- state $ randomR (200, 300)
|
x <- state $ randomR (200, 300)
|
||||||
y <- state $ randomR (200, 300)
|
y <- state $ randomR (200, 300)
|
||||||
r <- roomRectAutoLinks x y
|
r <- roomRectAutoLights x y
|
||||||
cs <- join $ takeOne [cenoct x y, censquare x y]
|
cs <- join $ takeOne [cenoct x y, censquare x y]
|
||||||
shuffleLinks $
|
shuffleLinks $
|
||||||
r
|
r
|
||||||
@@ -185,7 +185,7 @@ midChasmPlatform :: State LayoutVars Room
|
|||||||
midChasmPlatform = do
|
midChasmPlatform = do
|
||||||
x <- state $ randomR (250, 300)
|
x <- state $ randomR (250, 300)
|
||||||
y <- state $ randomR (250, 300)
|
y <- state $ randomR (250, 300)
|
||||||
r <- roomRectAutoLinks x y
|
r <- roomRectAutoLights x y
|
||||||
cs <- join $ takeOne [censquare x y]
|
cs <- join $ takeOne [censquare x y]
|
||||||
shuffleLinks $
|
shuffleLinks $
|
||||||
r
|
r
|
||||||
@@ -239,17 +239,17 @@ midChasmSpit :: State LayoutVars Room
|
|||||||
midChasmSpit = do
|
midChasmSpit = do
|
||||||
let x = 300
|
let x = 300
|
||||||
y = 300
|
y = 300
|
||||||
r <- roomRectAutoLinks x y
|
r <- roomRectAutoLights x y
|
||||||
cs <- join $ takeOne [censquare x y]
|
cs <- join $ takeOne [censquare x y]
|
||||||
shuffleLinks $
|
shuffleLinks $
|
||||||
r
|
r
|
||||||
& rmLinks %~ setOutLinks
|
& rmLinks %~ setOutLinks
|
||||||
(\rl -> isMidEdgeLink r South rl
|
(\rl -> isMidEdgeLink r North rl
|
||||||
|| isMidEdgeLink r West rl
|
|
||||||
|| isMidEdgeLink r East rl
|
|| isMidEdgeLink r East rl
|
||||||
|
|| isMidEdgeLink r West rl
|
||||||
)
|
)
|
||||||
& rmLinks %~ setInLinks (isMidEdgeLink r South)
|
& rmLinks %~ setInLinks (isMidEdgeLink r South)
|
||||||
& rmPmnts <>~ cs
|
& rmPmnts .~ cs
|
||||||
where
|
where
|
||||||
censquare x y = do
|
censquare x y = do
|
||||||
z <- state $ randomR (40, 60)
|
z <- state $ randomR (40, 60)
|
||||||
@@ -396,8 +396,8 @@ tutHub = do
|
|||||||
, makeTermLine "---------------------------------------------"
|
, makeTermLine "---------------------------------------------"
|
||||||
, makeTermLine ""
|
, makeTermLine ""
|
||||||
]
|
]
|
||||||
r x = roomRectAutoLinks 100 100 <&> rmPmnts .:~ sps (PS 50 0) (PutFlIt x)
|
r x = roomRectAutoLights 100 100 <&> rmPmnts .:~ sps (PS 50 0) (PutFlIt x)
|
||||||
ammoroom x = roomRectAutoLinks 100 100 <&> rmPmnts .:~ sps (PS 50 0) (PutFlIt x)
|
ammoroom x = roomRectAutoLights 100 100 <&> rmPmnts .:~ sps (PS 50 0) (PutFlIt x)
|
||||||
itemshiftterminal =
|
itemshiftterminal =
|
||||||
putMessageTerminal
|
putMessageTerminal
|
||||||
(defaultTerminal & tmBootLines .~ ss' <> tlSetStatus (TerminalPressTo "QUIT") <> tlDoEffect TmWdWdPowerDownTerminal)
|
(defaultTerminal & tmBootLines .~ ss' <> tlSetStatus (TerminalPressTo "QUIT") <> tlDoEffect TmWdWdPowerDownTerminal)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import RandomHelp
|
|||||||
warningRooms :: String -> Int -> State StdGen (MetaTree Room String)
|
warningRooms :: String -> Int -> State StdGen (MetaTree Room String)
|
||||||
warningRooms str n = do
|
warningRooms str n = do
|
||||||
rm <- do
|
rm <- do
|
||||||
join $ takeOne [roomNgon 8 200, roomRectAutoLinks 200 200, tanksRoom [] []]
|
join $ takeOne [roomNgon 8 200, roomRectAutoLights 200 200, tanksRoom [] []]
|
||||||
cenroom <- shuffleLinks $ addWarningTerminal str n rm
|
cenroom <- shuffleLinks $ addWarningTerminal str n rm
|
||||||
rToOnward "warningRooms" $ treePost [door, cenroom, triggerDoorRoom n, cleatOnward door]
|
rToOnward "warningRooms" $ treePost [door, cenroom, triggerDoorRoom n, cleatOnward door]
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,9 @@ setInLinks = setLinkType InLink
|
|||||||
isMidEdgeLink :: Room -> CardinalPoint -> RoomLink -> Bool
|
isMidEdgeLink :: Room -> CardinalPoint -> RoomLink -> Bool
|
||||||
isMidEdgeLink r x rl
|
isMidEdgeLink r x rl
|
||||||
| x == North || x == South = g West (f $ r ^?! rmType . numLinkEW)
|
| x == North || x == South = g West (f $ r ^?! rmType . numLinkEW)
|
||||||
|
&& OnEdge x `S.member` (rl ^. rlType)
|
||||||
| otherwise = g South (f $ r ^?! rmType . numLinkNS)
|
| otherwise = g South (f $ r ^?! rmType . numLinkNS)
|
||||||
|
&& OnEdge x `S.member` (rl ^. rlType)
|
||||||
where
|
where
|
||||||
f y | even y = [y `div` 2]
|
f y | even y = [y `div` 2]
|
||||||
| otherwise = [y `div` 2, 1 + (y `div` 2)]
|
| otherwise = [y `div` 2, 1 + (y `div` 2)]
|
||||||
|
|||||||
Reference in New Issue
Block a user