Move typical light placement over doors
This commit is contained in:
@@ -96,6 +96,12 @@ isUnusedLnk rp = case _rpLinkStatus rp of
|
||||
UnusedLink {} -> _rpPlacementUse rp == 0
|
||||
_ -> False
|
||||
|
||||
isUsedLnkUnplaced :: RoomPos -> Bool
|
||||
isUsedLnkUnplaced rp = case _rpLinkStatus rp of
|
||||
UsedOutLink {} -> _rpPlacementUse rp == 0
|
||||
UsedInLink {} -> _rpPlacementUse rp == 0
|
||||
_ -> False
|
||||
|
||||
useRoomPosCond :: (RoomPos -> Bool)
|
||||
-> RoomPos -> Room -> Maybe (PlacementSpot,RoomPos)
|
||||
useRoomPosCond t rp _
|
||||
|
||||
@@ -73,9 +73,7 @@ twinSlowDoorRoom w h x = defaultRoom
|
||||
cond' btid w' = _btState (_buttons w' IM.! btid) /= BtOff
|
||||
col = dim $ dim $ bright red
|
||||
|
||||
twinSlowDoorChasers
|
||||
:: RandomGen g
|
||||
=> State g Room
|
||||
twinSlowDoorChasers :: RandomGen g => State g Room
|
||||
twinSlowDoorChasers = do
|
||||
let lps = V2 (-65) <$> [20,40 .. 180]
|
||||
rps = V2 65 <$> [20,40 .. 180]
|
||||
@@ -84,24 +82,13 @@ twinSlowDoorChasers = do
|
||||
return $ twinSlowDoorRoom 80 200 40 & rmPmnts %~ (plmnts ++)
|
||||
|
||||
southPillarsRoom :: RandomGen g => Float -> Float -> Float -> State g Room
|
||||
southPillarsRoom x y h = do
|
||||
let pillarsa = []
|
||||
pillarsb = putBlockRect (x/5-20) (x/5+20) (h/2-20) (h/2+20)
|
||||
++ putBlockRect (2*x/5-20) (2*x/5+20) (h/2-20) (h/2+20)
|
||||
++ putBlockRect (3*x/5-20) (3*x/5+20) (h/2-20) (h/2+20)
|
||||
++ putBlockRect (4*x/5-20) (4*x/5+20) (h/2-20) (h/2+20)
|
||||
pillarsc = putBlockRect (x/3-20) (x/3+20) (h/2-20) (h/2+20)
|
||||
++ putBlockRect (2*x/3-20) (2*x/3+20) (h/2-20) (h/2+20)
|
||||
pillars <- takeOne [pillarsa, pillarsb, pillarsc]
|
||||
return $ roomRectAutoLinks x y & rmPmnts .~ (pillars ++ [mntLightLnkCond usedInLnkToPS])
|
||||
southPillarsRoom x y h = addSouthPillars x h (roomRectAutoLinks x y)
|
||||
|
||||
addSouthPillars :: RandomGen g => Float -> Float -> Room -> State g Room
|
||||
addSouthPillars x h r = do
|
||||
let pillarsa = []
|
||||
pillarsb = concat [putBlockRect (i*x/5-20) (i*x/5+20) (h/2-20) (h/2+20)
|
||||
| i <- map fromIntegral [1..4::Int]]
|
||||
pillarsc = putBlockRect (x/3-20) (x/3+20) (h/2-20) (h/2+20)
|
||||
++ putBlockRect (2*x/3-20) (2*x/3+20) (h/2-20) (h/2+20)
|
||||
pillarsb = concat [putBlockRect (i*x/5-20) (i*x/5+20) (h/2-20) (h/2+20) | i <- [1..4] ]
|
||||
pillarsc = concat [putBlockRect (i*x/3-20) (i*x/3+20) (h/2-20) (h/2+20) | i <- [1,2] ]
|
||||
pillars <- takeOne [pillarsa, pillarsb, pillarsc]
|
||||
return $ r & rmPmnts .++~ pillars
|
||||
|
||||
|
||||
@@ -91,8 +91,7 @@ roomRectAutoLinks x y = (roomRect x y xn yn)
|
||||
where
|
||||
xn = max 1 $ (ceiling x - 40) `div` 60
|
||||
yn = max 1 $ (ceiling y - 40) `div` 60
|
||||
plmnts = [mntLightLnkCond unusedLnkToPS
|
||||
, mntLightLnkCond unusedLnkToPS ]
|
||||
plmnts = replicate 3 (mntLightLnkCond $ useRoomPosCond isUsedLnkUnplaced)
|
||||
{- Combines two rooms into one room.
|
||||
- will have to work out exactly what to do with combining links
|
||||
Mostly involves concatenation. -}
|
||||
|
||||
Reference in New Issue
Block a user