Polymorphise meta tree labels

This commit is contained in:
2022-06-13 15:22:15 +01:00
parent 31e7f4290e
commit 7a07fc97c2
19 changed files with 67 additions and 97 deletions
+4 -4
View File
@@ -123,7 +123,7 @@ rot90Around cen p = cen +.+ vNormal (p -.- cen)
-- So, the idea is to attach outer children to the bottommost right nodes
-- inside an inner tree
-- no idea what was going on here...
roomMiniIntro :: RandomGen g => State g (MetaTree Room)
roomMiniIntro :: RandomGen g => State g (MetaTree Room String)
roomMiniIntro = do
midroom <- join $ takeOne [miniTree2] --,glassLesson]
rToOnward "roomMiniIntro" midroom
@@ -191,7 +191,7 @@ weaponEmptyRoom = do
$ restrictRMInLinksPD f (roomRect w h 2 2 & rmPmnts .~ plmnts)
return $ treeFromTrunk [ corridor] (pure $ cleatOnward rm )
weaponUnderCrits :: RandomGen g => Int -> State g (MetaTree Room)
weaponUnderCrits :: RandomGen g => Int -> State g (MetaTree Room String)
weaponUnderCrits i = do
let plmnts =
[--sPS (V2 20 0) 0 $ RandPS randFirstWeapon
@@ -278,7 +278,7 @@ deadEndRoom = defaultRoom
where
lnks = [(V2 0 30 ,0) ]
{- A random Either tree with a weapon and melee monster challenge. -}
weaponRoom :: RandomGen g => Int -> State g (MetaTree Room)
weaponRoom :: RandomGen g => Int -> State g (MetaTree Room String)
weaponRoom i = join $ takeOne
[ weaponEmptyRoom >>= rToOnward "weaponEmptyRoom"
, weaponUnderCrits i
@@ -381,7 +381,7 @@ pistolerRoom = pillarGrid
]
++)
shootingRange :: RandomGen g => State g (MetaTree Room)
shootingRange :: RandomGen g => State g (MetaTree Room String)
shootingRange = do
rm1 <- shootersRoom1 >>= shuffleLinks . restrictInLinks (\(V2 _ y,_) -> y < 40)
. restrictOutLinks (\(V2 _ y,r) -> y > 200 && r /= 0)