Fix one bug in door wall movement, add airlock, cleanup

This commit is contained in:
2021-11-06 01:06:04 +00:00
parent 5a52b646e1
commit 4c6437da26
5 changed files with 64 additions and 14 deletions
+6 -4
View File
@@ -8,6 +8,7 @@ import Dodge.Data
--import Dodge.Base
--import Dodge.Zone
import Dodge.Default.Wall
import Dodge.Wall.Move
--import Dodge.LevelGen.Switch
--import Dodge.LevelGen.Pathing
import Dodge.LevelGen.MoveDoor
@@ -69,13 +70,14 @@ doorMechanismStepwise nsteps drid wlids pss dr w
where
playSound = soundContinue (WallSound drid) (fst $ head pss) slideDoorS (Just 1)
toOpen = _drTrigger dr w
cpss = uncurry (rectanglePairs 9) (head pss)
setWalls n = playSound (foldl' setWall w (zip3 wlids newps cpss))
--cpss = uncurry (rectanglePairs 9) (head pss)
setWalls n = playSound (foldl' setWall w (zip wlids newps))
& doors . ix drid . drStatus .~ DoorInt n
where
newps = uncurry (rectanglePairs 9) (pss !! n)
setWall w' (wlid,ps,cps) = w' & walls . ix wlid . wlLine .~ ps
& (\w'' -> foldr (changeZonedWall (wlLine .~ ps) wlid) w'' (zoneps cps))
setWall w' (wlid,ps) = w' & moveWallID wlid ps
-- setWall w' (wlid,ps,cps) = w' & walls . ix wlid . wlLine .~ ps
-- & (\w'' -> foldr (changeZonedWall (wlLine .~ ps) wlid) w'' (zoneps cps))
-- it is not at all clear that the zoning selects the correct walls
-- TODO think about wall zoning, simplify!