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