Implement working no-item-airlock zone
This commit is contained in:
+25
-19
@@ -5,7 +5,7 @@ module Dodge.Room.Airlock where
|
||||
|
||||
import Control.Lens
|
||||
import Control.Monad
|
||||
import Dodge.Annotation.Data
|
||||
--import Dodge.Annotation.Data
|
||||
import Dodge.Data.GenWorld
|
||||
import Dodge.Default.Door
|
||||
import Dodge.Default.Room
|
||||
@@ -25,25 +25,31 @@ airlock =
|
||||
join $
|
||||
takeOne [return airlock0, return airlock90, return airlockCrystal, airlockZ]
|
||||
|
||||
--airlock = takeOne [airlockCrystal]
|
||||
decontamRoom :: State LayoutVars Room
|
||||
decontamRoom = do
|
||||
return $
|
||||
defaultRoom
|
||||
& rmPolys .~ cutps
|
||||
& rmLinks .~ muout lnks ++ muin [last lnks]
|
||||
& rmPath .~ foldMap doublePairSet [(V2 20 95, V2 20 45), (V2 20 45, V2 20 5)]
|
||||
& rmPmnts
|
||||
.~ [ pContID (PS (V2 (-35) 50) (negate $ pi / 2)) (PutButton $ makeSwitch col red NoWorldEffect NoWorldEffect) $
|
||||
\btid -> Just $
|
||||
putDoubleDoorThen DoorObstacle thewall (WdBlNegate $ WdBlBtOn btid) 1 (V2 0 20) (V2 40 20) 2 $
|
||||
\_ _ -> Just $ putDoubleDoor DoorObstacle thewall (WdBlBtOn btid) (V2 0 80) (V2 40 80) 2
|
||||
, invisibleWall $ rectNSWE 60 40 (-40) (-30)
|
||||
, spanLightI (V2 (-2) 30) (V2 (-2) 70)
|
||||
, analyser (NoItemZone ps) (PS 50 0) (PS mcpos 0)
|
||||
]
|
||||
& rmBound .~ [rectNSWE 75 15 0 40, switchcut]
|
||||
decontamRoom :: Int -> Room
|
||||
decontamRoom i =
|
||||
defaultRoom
|
||||
& rmPolys .~ cutps
|
||||
& rmLinks .~ muout lnks ++ muin [last lnks]
|
||||
& rmPath .~ foldMap doublePairSet [(V2 20 95, V2 20 45), (V2 20 45, V2 20 5)]
|
||||
& rmPmnts
|
||||
.~ [ pContID (PS (V2 (-35) 50) (negate $ pi / 2)) (PutButton $ makeSwitch col red NoWorldEffect NoWorldEffect) $
|
||||
\btid -> Just $
|
||||
putDoubleDoorThen DoorObstacle thewall (WdBlNegate $ WdBlBtOn btid) 1 (V2 0 20) (V2 40 20) 2 $
|
||||
\_ _ -> Just $ putDoubleDoor DoorObstacle thewall (WdBlBtOn btid) (V2 0 80) (V2 40 80) 2
|
||||
, invisibleWall $ rectNSWE 60 40 (-40) (-30)
|
||||
, spanLightI (V2 (-20) 30) (V2 (-20) 70)
|
||||
]
|
||||
& rmOutPmnt . at i ?~
|
||||
analyser (NoItemZone ps) (PS 50 0) (PS mcpos 0)
|
||||
& rmInPmnt .~ [InPlacement f i]
|
||||
& rmBound .~ [rectNSWE 75 15 0 40, switchcut]
|
||||
where
|
||||
f _ (pmnt : _) = putDoubleDoor DoorObstacle (switchWallCol red) (cond pmnt)
|
||||
(V2 (-10) 35)
|
||||
(V2 (-10) 65)
|
||||
2
|
||||
f _ _ = error "tried to put a door using an empty placement list"
|
||||
cond pmnt = WdTrig $ pmnt ^?! plMID . _Just
|
||||
mcpos = V2 70 50
|
||||
cutps = [rectNSWE 100 0 0 40, switchcut]
|
||||
ps = (\p -> p - mcpos) <$> orderPolygon (concat cutps)
|
||||
|
||||
@@ -56,7 +56,8 @@ tutAnoTree =
|
||||
tutDrop :: State LayoutVars (MetaTree Room String)
|
||||
tutDrop = do
|
||||
x <- shuffleLinks =<< roomNgon 6 100
|
||||
y <- decontamRoom
|
||||
i <- nextLayoutInt
|
||||
let y = decontamRoom i
|
||||
rm <- roomRectAutoLinks 40 100
|
||||
return $ tToBTree "TutDrop" $ treePost [x,y,cleatOnward rm]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user