Start to migrate all old level generation to MetaTrees

This commit is contained in:
2022-06-12 19:31:57 +01:00
parent 617765d5d4
commit dbba78ef05
9 changed files with 57 additions and 93 deletions
+6 -9
View File
@@ -71,10 +71,8 @@ randomChallenges = shootingRange
runPastStart :: RandomGen g => Int -> State g (Tree Room)
runPastStart i = do
s <- rezBoxStart
rp <- runPastRoom i
--return $ s `passUntiluseAll` [rp]
rp <- lookedStart i
return . shiftChildren $ attachTree toOnward' rp $ fmap ([],) s
-- return . shiftChildren $ attachTree toOnward' (pure $ useAll corridor) $ fmap ([],) s
rezBoxStart :: RandomGen g => State g (Tree Room)
@@ -82,18 +80,17 @@ rezBoxStart = do
ls <- rezColor
return $ treePost [ rezBox ls, cleatOnward door ]
rezBoxesThenWeaponRoom :: RandomGen g => Int -> State g (Tree Room,String)
rezBoxesThenWeaponRoom :: RandomGen g => Int -> State g (MetaTree Room)
rezBoxesThenWeaponRoom i = do
rboxes <- rezBoxes
wroom <- snd <$> weaponRoom i
return (rboxes `passUntiluseAll` [wroom] , "rezBoxesThenWeaponRoom " ++ show i)
wroom <- weaponRoom i
return $ MTree "rezBoxesThenWeaponRoom" (tToBTree rboxes) [MBranch "" toOnward' wroom]
rezBoxThenWeaponRoom :: RandomGen g => Int -> State g (MetaTree Room)
rezBoxThenWeaponRoom i = do
rcol <- rezColor
(_,wroom) <- weaponRoom i
rToOnward ("rezBoxThenWeaponRoom "++ show i)
$ treeFromTrunk [ rezBox rcol, door] wroom
wroom <- weaponRoom i
return $ tToBTree (treePost [ rezBox rcol, cleatOnward door]) `attachOnward` wroom
rezBoxThenRoom :: RandomGen g => Room -> State g (Tree Room)
rezBoxThenRoom r = do