Add bounds to door rooms, tweak mounted lights

This commit is contained in:
2022-03-20 08:23:18 +00:00
parent 02adb0a915
commit e811e67ff9
8 changed files with 44 additions and 65 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ door = defaultRoom
-- door extends into side walls (for shadows as rendered 12/03)
, _rmPmnts = [putAutoDoor (V2 0 20) (V2 40 20)]
, _rmName = "autoDoor"
-- note no bounds
, _rmBound = [rectNSWE 21 19 0 40]
}
where
lnks = [uncurry outLink (V2 20 35,0)
+13 -11
View File
@@ -136,16 +136,15 @@ roomMiniIntro = do
return $ chainUses [return $ UseAll corridor,return $ UseAll corridor,return $ UseAll corridor,return $ UseAll door, midroom,return $ UseAll corridor]
roomCenterPillar :: RandomGen g => State g Room
roomCenterPillar = randomiseAllLinks . restrictInLinks ((\p -> dist p (V2 120 0) < 10) . fst)
roomCenterPillar = shuffleLinks . restrictInLinks ((\p -> dist p (V2 120 0) < 10) . fst)
$ set rmPmnts plmnts $ roomRect 240 240 2 2
where
plmnts =
[ blockLine (V2 115 115) (V2 115 125)
, blockLine (V2 125 115) (V2 125 125)
--, sPS (V2 40 120) 0 putLamp
--, sPS (V2 200 120) 0 putLamp
, mntLightLnkCond useUnusedLnk
, mntLightLnkCond useUnusedLnk
, mntLightLnkCond (resetPLUse $ rprBool $ \rp _ -> isInLnk rp)
]
roomOctogon :: Room
@@ -179,7 +178,7 @@ randFirstWeapon = do
takeOne $ map PutFlIt $
replicate 10 pistol
++ replicate 5 ltAutoGun
++ replicate 5 spreadGun
++ replicate 5 (bangStick 3)
++ replicate 5 multGun
++ replicate 2 autoGun
++ [launcher]
@@ -200,24 +199,27 @@ weaponEmptyRoom = do
$ restrictRMInLinksPD f (roomRect w h 2 2 & rmPmnts .~ plmnts)
return $ treeFromTrunk [PassDown corridor] (singleUseAll rm )
weaponUnderCrits :: RandomGen g => State g (SubCompTree Room)
weaponUnderCrits = do
weaponUnderCrits :: RandomGen g => Int -> State g (SubCompTree Room)
weaponUnderCrits i = do
let plmnts =
[--sPS (V2 20 0) 0 $ RandPS randFirstWeapon
sPS (V2 20 0) (negate $ pi/2) randC1
,sPS (V2 20 20) (negate $ pi/2) randC1
]
addwpat p = rmPmnts %~ ((PickOnePlacement 0 $ sPS p 0 $ RandPS randFirstWeapon) :)
addwpat p = rmPmnts .:~ PickOnePlacement i (sPS p 0 $ RandPS randFirstWeapon)
let continuationRoom = treeFromTrunk
[PassDown $ addwpat (V2 20 0) corridorN,PassDown $ addwpat (V2 20 0) corridorN]
(singleUseAll (set rmPmnts plmnts corridorN))
rcp <- roomCenterPillar
rcp <- roomCenterPillar
rmpils <- roomPillars 30 240 240 2 2
deadEndRoom' <- takeOne
[ addwpat (V2 120 20) rmpils
, addwpat (V2 120 20) rcp]
junctionRoom <- takeOne [PassDown tEast,PassDown tWest]
return $ treeFromTrunk [PassDown corridorN,PassDown corridorN]
return $ treeFromTrunk
--[PassDown $ corridorN & rmPmnts .:~ mntLightLnkCond (resetPLUse $ rprBool $ \rp _ -> isInLnk rp)
[PassDown corridorN
,PassDown corridorN]
$ Node junctionRoom
[continuationRoom
,singleUseNone deadEndRoom'
@@ -294,9 +296,9 @@ deadEndRoom = defaultRoom
weaponRoom :: RandomGen g => State g (SubCompTree Room)
weaponRoom = join $ takeOne
-- [ weaponEmptyRoom
-- , weaponUnderCrits
[ weaponUnderCrits 0
-- , weaponBehindPillar
[ weaponBetweenPillars
-- , weaponBetweenPillars
-- , weaponLongCorridor
]