Assign used links during room generation

This commit is contained in:
2021-11-02 22:27:19 +00:00
parent 0b058674ea
commit 903a79cf85
7 changed files with 28 additions and 23 deletions
+5 -1
View File
@@ -106,8 +106,12 @@ addButtonSlowDoor x h rm = do
,( V2 (x/2+50) 5,0)
]
thePlacement <- takeOne [butDoor butPos butRot ]
filterLinks aboveH =<< changeLinkTo belowH (rm & rmPS %~ (thePlacement :))
filterLinks aboveH =<< changeLinkTo belowH (rm
& rmPS %~ (thePlacement :)
& rmBound %~ (openDoorBound :)
)
where
openDoorBound = rectNSEW (h + 5) (h - 5) (-x/2) (3*x/2)
belowH y = (sndV2 . fst) y < h - 40
aboveH y = (sndV2 . fst) y > h + 40
butDoor bpos brot = putLitButtonID col bpos brot