Commit before changing logging of placement spots

This commit is contained in:
2025-09-29 21:58:02 +01:00
parent 9ed6d75853
commit bf9a2250da
14 changed files with 294 additions and 288 deletions
+29 -8
View File
@@ -9,6 +9,7 @@ module Dodge.Room.Room (
spawnerRoom,
corDoor,
weaponBehindPillar,
critsRoom,
) where
import qualified Data.Set as S
@@ -73,6 +74,7 @@ glassSwitchBack = do
wth <- state $ randomR (200, 400)
hgt <- state $ randomR (400, 600)
wllen <- state $ randomR (60, wth / 2 -40)
l1 <- mntLightLnkCond (resetPLUse $ rprBool $ \rp _ -> isInLnk rp)
let hf = hgt / 5
awindow h xl xr = windowLine (V2 xl h) (V2 xr h)
plmnts =
@@ -84,7 +86,8 @@ glassSwitchBack = do
, blockLine (V2 (wth - wllen) (2 * hf)) (V2 wth (2 * hf))
, blockLine (V2 0 (3 * hf)) (V2 wllen (3 * hf))
, blockLine (V2 (wth - wllen) (4 * hf)) (V2 wth (4 * hf))
, sPS (V2 (wth / 2) (hgt / 2)) 0 putLamp
, l1
-- , sPS (V2 (wth / 2) (10 + hgt / 2)) 0 putLamp
]
let northPSs = do
cry <- randomRanges [3 * hf + 10, 4 * hf -10, 4 * hf + 10, 5 * hf -10]
@@ -120,7 +123,8 @@ roomMiniIntro = do
roomCenterPillar :: RandomGen g => State g Room
roomCenterPillar = do
l1 <- mntLightLnkCond (resetPLUse $ rprBool $ \rp _ -> isInLnk rp)
l2 <- mntLightLnkCond (resetPLUse $ rprBool $ \rp _ -> isOutLnk rp)
l2 <- mntLightLnkCond ((resetPLUse $ rprBool $ \rp _ -> isOutLnk rp)
& psFallback ?~ mntLightLnkCond' (resetPLUse useUnusedLnk))
let plmnts =
[ blockLine (V2 115 115) (V2 115 125)
, blockLine (V2 125 115) (V2 125 125)
@@ -299,15 +303,16 @@ shootersRoom' = do
]
toPS x y = return (V2 x y, -0.5 * pi)
roomRectAutoLinks w 600
<&> rmPmnts .~ plmnts
<&> rmRandPSs .~ [toPS x1 y1, toPS x2 y2, toPS x3 y3]
<&> rmPmnts .~ plmnts
<&> rmRandPSs .~ [toPS x1 y1, toPS x2 y2, toPS x3 y3]
shootersRoom1 :: RandomGen g => State g Room
shootersRoom1 = do
pl <- takeOne $
map
(\i -> psPtPl (PSRoomRand i (uncurry PS)) (PutCrit autoCrit))
[0, 1, 2]
pl <-
takeOne $
map
(\i -> psPtPl (PSRoomRand i (uncurry PS)) (PutCrit autoCrit))
[0, 1, 2]
shootersRoom' <&> rmPmnts
.:~ pl
@@ -377,5 +382,21 @@ corDoor = do
cor <- shuffleLinks (cleatOnward corridor) <&> rmPmnts .~ []
return $ tToBTree "corDoor" $ treePost [door, cor]
critsPillarRoom :: Int -> State LayoutVars Room
critsPillarRoom i = do
xs <- takeN i $ [V2 x y | x <- [20, 220], y <- [20, 40]] ++ [V2 120 160, V2 120 200]
rcp <- roomCenterPillar
return $ rcp & rmPmnts <>~ fmap f xs
where
f x = sPS x (argV $ V2 120 80 -.- x) randC1
critsRoom :: Int -> State LayoutVars (Tree Room)
critsRoom i =
join $
takeOne
--[return <$> critsPillarRoom i]
--[return <$> roomC 200 200]
[return <$> glassSwitchBack]
-- cor <- shuffleLinks corridor
-- return $ tToBTree "corDoor" $ treePost [door,cor,cleatOnward door]