This commit is contained in:
2022-06-10 20:53:01 +01:00
parent 1b7463f287
commit 6966e76206
14 changed files with 54 additions and 75 deletions
+8 -8
View File
@@ -60,7 +60,7 @@ branchWith r ts = Node r $ return (useAll door) : ts
manyDoors :: Int -> Tree Room
manyDoors i = treeFromPost (replicate i ( door)) $ useAll door
manyDoors i = treeFromPost (replicate i door) $ useAll door
glassSwitchBack :: RandomGen g => State g Room
glassSwitchBack = do
@@ -282,9 +282,9 @@ weaponLongCorridor = do
]
i1 <- state $ randomR (2,5)
i2 <- state $ randomR (2,5)
let branch1 = treeFromTrunk (replicate i1 $ corridorN) (pure . useAll $ putCrs connectingRoom)
let branch2 = treeFromTrunk (replicate i2 $ corridorN) (pure . useSide $ putWp corridor)
return $ Node ( rt) [branch1,branch2]
let branch1 = treeFromTrunk (replicate i1 corridorN) (pure . useAll $ putCrs connectingRoom)
let branch2 = treeFromTrunk (replicate i2 corridorN) (pure . useSide $ putWp corridor)
return $ Node rt [branch1,branch2]
where
putCrs = over rmPmnts (++ [sPS (V2 10 40) (-pi/2) randC1 ,sPS (V2 (-10) 40) (-pi/2) randC1 ])
putWp = set rmPmnts [sPS (V2 20 60) 0 $ RandPS randFirstWeapon ,spanLightI (V2 0 40) (V2 40 40)]
@@ -307,11 +307,11 @@ deadEndRoom = defaultRoom
{- A random Either tree with a weapon and melee monster challenge. -}
weaponRoom :: RandomGen g => Int -> State g (LabTree Room)
weaponRoom i = join $ takeOne
[ weaponEmptyRoom <&> (f "weaponEmptyRoom")
[ weaponEmptyRoom <&> f "weaponEmptyRoom"
, weaponUnderCrits i
, weaponBehindPillar<&> (f "weaponBehindPillar")
, weaponBetweenPillars<&> (f "weaponBetweenPillars")
, weaponLongCorridor<&> (f "weaponLongCorridor")
, weaponBehindPillar <&> f "weaponBehindPillar"
, weaponBetweenPillars <&> f "weaponBetweenPillars"
, weaponLongCorridor <&> f "weaponLongCorridor"
]
where
f str = ( toOnward str ,)