Start to make wall flags/pathing interaction more sensible

This commit is contained in:
2025-10-23 11:35:24 +01:00
parent 9e6534b8f4
commit fc7c4d6468
18 changed files with 167 additions and 145 deletions
+3 -1
View File
@@ -4,6 +4,7 @@ module Dodge.Placement.PlaceSpot.Block (
plLineBlock,
) where
import qualified Data.Set as S
import Control.Lens
import qualified Data.IntSet as IS
import Data.List
@@ -119,5 +120,6 @@ insertWalls blid wls w = w' & cWorld . lWorld . blocks . ix blid . blObstructs .
insertWall :: Wall -> World -> (World, [(Int,Int)])
insertWall wl =
uncurry (obstructPathsCrossing BlockObstacle) (_wlLine wl)
uncurry (obstructPathsCrossing (S.fromList [WallObstacle WallNotAutoOpen, WallObstacle WallBlockVisibility]))
(_wlLine wl)
. (cWorld . lWorld . walls . at (_wlID wl) ?~ wl)
+5 -3
View File
@@ -4,6 +4,7 @@ module Dodge.Placement.PlaceSpot.TriggerDoor (
updateDoorEdges,
) where
import qualified Data.Set as S
import Dodge.ShiftPoint
import Linear
import Dodge.Data.GenWorld
@@ -18,7 +19,7 @@ import Picture
plDoor ::
Color ->
EdgeObstacle ->
S.Set EdgeObstacle ->
-- | Opening condition
WdBl ->
-- | Door positions, closed to open.
@@ -51,7 +52,8 @@ plDoor col eo cond l p1 p2 gw = (drid, over gwWorld addWalls $ gw & gwWorld . cW
addWalls w' = foldl' (addDoorWall eo drid $ switchWallCol col) w' $ zip wlids
$ wlps' & each . each %~ shiftPointBy p1
addDoorWall :: EdgeObstacle -> Int -> Wall -> World -> (Int, (Point2, Point2)) -> World
addDoorWall :: S.Set EdgeObstacle
-> Int -> Wall -> World -> (Int, (Point2, Point2)) -> World
addDoorWall eo drid wl w (wlid, wlps) =
w'
& cWorld . lWorld . walls
@@ -80,7 +82,7 @@ updateDoorEdge _ w _ = w
plSlideDoor ::
Door ->
Wall ->
EdgeObstacle ->
S.Set EdgeObstacle ->
Float ->
Point2 ->
Point2 ->