Tweak starting rooms

This commit is contained in:
2021-04-21 22:34:51 +02:00
parent a1c344a342
commit 50e957818f
+33 -27
View File
@@ -121,9 +121,13 @@ door = Room
] ]
roomPillars :: Room roomPillars :: Room
roomPillars = over rmLinks init $ set rmPS plmnts $ roomRect' 240 240 2 2 roomPillars = over rmLinks init $ set rmPS plmnts $ roomRect' 240 240 2 2
where plmnts = g 180 150 90 60 where
f a x b y = putBlockRect a x b y plmnts = PS (120,120) 0 putLamp
g a b c d = f a b a b ++ f a b c d ++ f c d a b ++ f c d c d : PS (10,10) 0 putLamp
: PS (230,230) 0 putLamp
: g 180 150 90 60
f a x b y = putBlockRect a x b y
g a b c d = f a b a b ++ f a b c d ++ f c d a b ++ f c d c d
putBlockRect a x b y = [ blockLine (a,b) (a,y) putBlockRect a x b y = [ blockLine (a,b) (a,y)
@@ -269,8 +273,8 @@ roomMiniIntro = fmap (g . expandTreeBy f) $ sequence $ treePost
roomCenterPillar :: RandomGen g => State g Room roomCenterPillar :: RandomGen g => State g Room
roomCenterPillar = changeLinkTo ((\p -> dist p (120,0) < 10) . fst) roomCenterPillar = changeLinkTo ((\p -> dist p (120,0) < 10) . fst)
$ set rmPS plmnts $ roomRect' 240 240 2 2 $ set rmPS plmnts $ roomRect' 240 240 2 2
where plmnts = [ blockLine (110,110) (110,130) where plmnts = [ blockLine (115,115) (115,125)
, blockLine (130,110) (130,130) , blockLine (125,115) (125,125)
, PS (40,120) 0 putLamp , PS (40,120) 0 putLamp
, PS (200,120) 0 putLamp , PS (200,120) 0 putLamp
] ]
@@ -336,21 +340,23 @@ weaponEmptyRoom = do
$ set rmPS plmnts $ roomRect' w h 2 2) $ set rmPS plmnts $ roomRect' w h 2 2)
--weaponUnderCrits :: RandomGen g => State g (Tree (Either Room Room)) weaponUnderCrits :: RandomGen g => State g (Tree (Either Room Room))
--weaponUnderCrits = do weaponUnderCrits = do
-- let plmnts = [PS (0,0) 0 $ RandPS randFirstWeapon let plmnts = [PS (20,0) 0 $ RandPS randFirstWeapon
-- ,PS (-5,0) (0-pi/2) $ randC1 ,PS (20,0) (0-pi/2) $ randC1
-- ,PS (5,20) (0-pi/2) $ randC1 ,PS (20,20) (0-pi/2) $ randC1
-- ] ]
-- let continuationRoom = treeTrunk [Left corridorN,Left corridorN] let continuationRoom = treeTrunk [Left corridorN,Left corridorN]
-- (connectRoom (set rmPS plmnts $ corridorN)) (connectRoom (set rmPS plmnts $ corridorN))
-- deadEndRoom <- takeOne [roomSquare,roomPillars,roomVs,roomCenterPillar] rcp' <- roomCenterPillar
-- junctionRoom <- takeOne [Left corridorE,Left corridorW] let rcp = over rmPS ( PS (120,80) 0 putLamp : ) rcp'
-- return $ treeTrunk [Left corridorN,Left corridorN] deadEndRoom <- takeOne [roomPillars,rcp]
-- $ Node junctionRoom junctionRoom <- takeOne [Left tEast,Left tWest]
-- [continuationRoom return $ treeTrunk [Left corridorN,Left corridorN]
-- ,deadRoom deadEndRoom $ Node junctionRoom
-- ] [continuationRoom
,deadRoom deadEndRoom
]
weaponBehindPillar :: RandomGen g => State g (Tree (Either Room Room)) weaponBehindPillar :: RandomGen g => State g (Tree (Either Room Room))
@@ -394,8 +400,8 @@ weaponLongCorridor :: RandomGen g => State g (Tree (Either Room Room))
weaponLongCorridor = do weaponLongCorridor = do
root <- takeOne $ [tEast, tWest] root <- takeOne $ [tEast, tWest]
connectingRoom <- takeOne connectingRoom <- takeOne
[--tEast & rmPS .~ [PS (-40,60) 0 $ putLamp] [tEast & rmPS .~ [PS (-40,60) 0 $ putLamp]
tWest & rmPS .~ [PS (40,60) 0 $ putLamp] ,tWest & rmPS .~ [PS ( 40,60) 0 $ putLamp]
] ]
i1 <- state $ randomR (2,5) i1 <- state $ randomR (2,5)
i2 <- state $ randomR (2,5) i2 <- state $ randomR (2,5)
@@ -427,11 +433,11 @@ deadEndRoom = Room
weaponRoom :: RandomGen g => State g (Tree (Either Room Room)) weaponRoom :: RandomGen g => State g (Tree (Either Room Room))
weaponRoom = do weaponRoom = do
x <- takeOne --[weaponEmptyRoom x <- takeOne [ weaponEmptyRoom
--, weaponUnderCrits , weaponUnderCrits
--, weaponBehindPillar , weaponBehindPillar
--, weaponBetweenPillars , weaponBetweenPillars
[ weaponLongCorridor , weaponLongCorridor
] ]
x x