Cleanup
This commit is contained in:
+15
-18
@@ -214,22 +214,21 @@ weaponLongCorridor = do
|
|||||||
let branch1 = treeFromTrunk (replicate i1 corridorN) (pure . cleatOnward $ putCrs connectingRoom)
|
let branch1 = treeFromTrunk (replicate i1 corridorN) (pure . cleatOnward $ putCrs connectingRoom)
|
||||||
let branch2 = treeFromTrunk (replicate i2 corridorN) (pure . cleatSide $ putWp corridor)
|
let branch2 = treeFromTrunk (replicate i2 corridorN) (pure . cleatSide $ putWp corridor)
|
||||||
return $ Node rt [branch1,branch2]
|
return $ Node rt [branch1,branch2]
|
||||||
where
|
where
|
||||||
putCrs = over rmPmnts (++ [sPS (V2 10 40) (-pi/2) randC1 ,sPS (V2 (-10) 40) (-pi/2) randC1 ])
|
putCrs = over rmPmnts (++ [sPS (V2 10 40) (-pi/2) randC1 ,sPS (V2 (-10) 40) (-pi/2) randC1 ])
|
||||||
putWp = set rmPmnts [sPS (V2 20 60) 0 $ RandPS randFirstWeapon ,spanLightI (V2 0 40) (V2 40 40)]
|
putWp = set rmPmnts [sPS (V2 20 60) 0 $ RandPS randFirstWeapon ,spanLightI (V2 0 40) (V2 40 40)]
|
||||||
|
|
||||||
critInDeadEnd :: Room
|
critInDeadEnd :: Room
|
||||||
critInDeadEnd = set rmPmnts [sPS (V2 0 0) 0 randC1] deadEndRoom
|
critInDeadEnd = deadEndRoom & rmPmnts .~ [sPS (V2 0 0) 0 randC1]
|
||||||
|
|
||||||
deadEndRoom :: Room
|
deadEndRoom :: Room
|
||||||
deadEndRoom = defaultRoom
|
deadEndRoom = defaultRoom
|
||||||
{ _rmPolys = [rectNSWE 40 (-20) (-20) 20
|
{ _rmPolys = [rectNSWE 40 (-20) (-20) 20 ]
|
||||||
]
|
|
||||||
, _rmLinks = muout (init lnks) ++ muin [last lnks]
|
, _rmLinks = muout (init lnks) ++ muin [last lnks]
|
||||||
, _rmPath = []
|
, _rmPath = []
|
||||||
, _rmPmnts = [sPS (V2 0 (-10)) 0 putLamp]
|
, _rmPmnts = [sPS (V2 0 (-10)) 0 putLamp]
|
||||||
, _rmBound = [rectNSWE 20 (-20) (-30) 30]
|
, _rmBound = [rectNSWE 20 (-20) (-30) 30]
|
||||||
, _rmName = "deadEndRoom"
|
, _rmName = "deadEndRoom"
|
||||||
}
|
}
|
||||||
where
|
where
|
||||||
lnks = [(V2 0 30 ,0) ]
|
lnks = [(V2 0 30 ,0) ]
|
||||||
@@ -261,7 +260,7 @@ doubleCorridorBarrels = do
|
|||||||
|
|
||||||
shootersRoom' :: RandomGen g => State g Room
|
shootersRoom' :: RandomGen g => State g Room
|
||||||
shootersRoom' = do
|
shootersRoom' = do
|
||||||
w <- state $ randomR (200,300)
|
w <- state $ randomR (200,300)
|
||||||
x1 <- state $ randomR (20,w/3-20)
|
x1 <- state $ randomR (20,w/3-20)
|
||||||
x2 <- state $ randomR (w/3+20,2*w/3-20)
|
x2 <- state $ randomR (w/3+20,2*w/3-20)
|
||||||
x3 <- state $ randomR (2*w/3+20,w-20)
|
x3 <- state $ randomR (2*w/3+20,w-20)
|
||||||
@@ -282,11 +281,9 @@ shootersRoom' = do
|
|||||||
& rmRandPSs .~ [toPS x1 y1,toPS x2 y2,toPS x3 y3]
|
& rmRandPSs .~ [toPS x1 y1,toPS x2 y2,toPS x3 y3]
|
||||||
|
|
||||||
shootersRoom1 :: RandomGen g => State g Room
|
shootersRoom1 :: RandomGen g => State g Room
|
||||||
shootersRoom1 = shootersRoom' <&> rmPmnts %~
|
shootersRoom1 = shootersRoom' <&> rmPmnts .:~ RandomPlacement
|
||||||
( (
|
(takeOne $ map (\i -> spNoID (PSRoomRand i (uncurry PS)) (PutCrit autoCrit))
|
||||||
RandomPlacement $ takeOne $ map (\i -> spNoID (PSRoomRand i (uncurry PS)) (PutCrit autoCrit))
|
[0,1,2])
|
||||||
[0,1,2]
|
|
||||||
) :)
|
|
||||||
|
|
||||||
shootersRoom :: RandomGen g => State g Room
|
shootersRoom :: RandomGen g => State g Room
|
||||||
shootersRoom = shootersRoom' <&> rmPmnts .++~
|
shootersRoom = shootersRoom' <&> rmPmnts .++~
|
||||||
@@ -310,13 +307,13 @@ shootingRange = do
|
|||||||
rm3 <- shootersRoom >>= shuffleLinks
|
rm3 <- shootersRoom >>= shuffleLinks
|
||||||
. restrictInLinks (\(V2 x y,_) -> y < 10 && x > 20 && x < 180)
|
. restrictInLinks (\(V2 x y,_) -> y < 10 && x > 20 && x < 180)
|
||||||
. restrictOutLinks (\(_,r) -> r == 0)
|
. restrictOutLinks (\(_,r) -> r == 0)
|
||||||
|
let padcutroom = roomPadCut (rectNSWE 40 (-40) (-80) 80) (V2 0 20)
|
||||||
|
& rmPmnts .:~ spanLightI (V2 (-80) 10) (V2 80 10)
|
||||||
rToOnward "shootingRange" $ treePost
|
rToOnward "shootingRange" $ treePost
|
||||||
[ rm1
|
[ rm1
|
||||||
, roomPadCut (rectNSWE 40 (-40) (-80) 80) (V2 0 20)
|
, padcutroom
|
||||||
& rmPmnts %~ (spanLightI (V2 (-80) 10) (V2 80 10) :)
|
|
||||||
, rm2
|
, rm2
|
||||||
, roomPadCut (rectNSWE 40 (-40) (-80) 80) (V2 0 20)
|
, padcutroom
|
||||||
& rmPmnts %~ (spanLightI (V2 (-80) 10) (V2 80 10) :)
|
|
||||||
, cleatOnward rm3
|
, cleatOnward rm3
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user