From 075d4b11647c5e152f685124b9bc58cdb6350bab Mon Sep 17 00:00:00 2001 From: justin Date: Sun, 19 Jun 2022 10:26:18 +0100 Subject: [PATCH] Cleanup --- src/Dodge/Room/Tanks.hs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Dodge/Room/Tanks.hs b/src/Dodge/Room/Tanks.hs index b5f8ce9e5..f5855ab75 100644 --- a/src/Dodge/Room/Tanks.hs +++ b/src/Dodge/Room/Tanks.hs @@ -44,12 +44,24 @@ randEdgeTank = do & plSpot .~ rprBool (\rp _ -> _rpPlacementUse rp == 0 && rpOffPathEdge (PathFromEdge edge 0) rp) +randEdgeTanks :: RandomGen g => Int -> State g [Placement] +randEdgeTanks i = do + edge <- takeOne cardList + basetank <- randomTank + return $ replicate i $ basetank + & plType . putBlock . blDraw + %~ fmap (<> noPic ( colorSH orange (verticalPipe 80 + <> horPipe 80 0 (70 *.* cardVec edge)))) + -- 70 is a guess, the true value depends on the distance to the wall + & plSpot .~ rprBool (\rp _ -> _rpPlacementUse rp == 0 + && rpOffPathEdge (PathFromEdge edge 0) rp) + tanksPipesRoom :: RandomGen g => State g Room tanksPipesRoom = do - w <- state $ randomR (200,400) - h <- state $ randomR (200,400) - i <- state $ randomR (1,5) - tanks <- replicateM i randEdgeTank + w <- state $ randomR (200,300) + h <- state $ randomR (200,300) + i <- state $ randomR (2,5) + tanks <- randEdgeTanks i return $ roomRectAutoLinks w h & rmPmnts .++~ tanks tanksRoom :: RandomGen g => [Creature] -> [Item] -> State g Room