Work on rectangular sensor room
This commit is contained in:
@@ -27,8 +27,8 @@ import RandomHelp
|
|||||||
-- for roomRectAutoLinks-- make the locked door a center door?
|
-- for roomRectAutoLinks-- make the locked door a center door?
|
||||||
sensorRoom :: SensorType -> Int -> State LayoutVars (Tree Room)
|
sensorRoom :: SensorType -> Int -> State LayoutVars (Tree Room)
|
||||||
sensorRoom senseType n = do
|
sensorRoom senseType n = do
|
||||||
rm <- join $ takeOne [addLightsNGon =<< roomNgon 8 200, roomRectAutoLights 200 200]
|
--rm <- join $ takeOne [addLightsNGon =<< roomNgon 8 200, roomRectAutoLights 200 200]
|
||||||
--rm <- join $ takeOne [addLightsNGon =<< roomNgon 8 200]
|
rm <- join $ takeOne [ roomRectAutoLights 200 200]
|
||||||
cenroom <- shuffleLinks $ sensInsideDoor senseType n rm
|
cenroom <- shuffleLinks $ sensInsideDoor senseType n rm
|
||||||
return $
|
return $
|
||||||
treePost
|
treePost
|
||||||
@@ -70,8 +70,7 @@ sensAboveDoor sensetype wth ps =
|
|||||||
sensInsideDoor :: SensorType -> Int -> Room -> Room
|
sensInsideDoor :: SensorType -> Int -> Room -> Room
|
||||||
sensInsideDoor senseType i rm =
|
sensInsideDoor senseType i rm =
|
||||||
rm
|
rm
|
||||||
& rmName
|
& rmName .++~ take 4 (show senseType)
|
||||||
.++~ take 4 (show senseType)
|
|
||||||
& rmPmnts
|
& rmPmnts
|
||||||
.++~ [ psPt atFstLnkOut . PutForeground $ floorWire (V2 20 0) (V2 20 (-100))
|
.++~ [ psPt atFstLnkOut . PutForeground $ floorWire (V2 20 0) (V2 20 (-100))
|
||||||
, psPt atFstLnkOut . PutForeground $ floorWire (V2 0 (-100)) (V2 20 (-100))
|
, psPt atFstLnkOut . PutForeground $ floorWire (V2 0 (-100)) (V2 20 (-100))
|
||||||
@@ -79,8 +78,16 @@ sensInsideDoor senseType i rm =
|
|||||||
, putMessageTerminal
|
, putMessageTerminal
|
||||||
(textTerminal & tmCommands .:~ TCDamageCommand)
|
(textTerminal & tmCommands .:~ TCDamageCommand)
|
||||||
& plSpot
|
& plSpot
|
||||||
.~ rprBoolShift isUnusedLnk (shiftInBy 10 <&> (,S.singleton UsedPosHigh))
|
.~ rprBoolShift termpos (shiftInBy 10 <&> (,S.singleton UsedPosHigh))
|
||||||
, sensAboveDoor senseType 10 (atFstLnkOutShiftInward 100) & plExternalID ?~ i
|
, sensAboveDoor senseType 10 (atFstLnkOutShiftInward 100) & plExternalID ?~ i
|
||||||
]
|
]
|
||||||
|
where
|
||||||
|
termpos rp rm' = isUnusedLnk rp rm'
|
||||||
|
&& all ((>30) . dist (_rpPos rp) . _rpPos) (filter usedlnks $ rm' ^. rmPos)
|
||||||
|
usedlnks rp = case _rpType rp of
|
||||||
|
UsedOutLink {} -> True
|
||||||
|
UsedInLink {} -> True
|
||||||
|
UnusedLink {} -> False
|
||||||
|
NotLink {} -> False
|
||||||
|
|
||||||
|
|
||||||
-- & rmOutPmnt . at i ?~ sensAboveDoor senseType 10 (atFstLnkOutShiftInward 100)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user