Add machine direction to turret direction

This commit is contained in:
2026-03-12 17:58:54 +00:00
parent 24af6a731b
commit be72daf6d5
6 changed files with 35 additions and 18 deletions
+23 -12
View File
@@ -172,25 +172,36 @@ lasCenRunClose' = do
lasCenRunClose :: (RandomGen g) => State g (MetaTree Room String)
lasCenRunClose = do
r <-
roomRectAutoLights 250 250
a <- takeOne [3*pi/2]--,pi/4]
laspos <- takeOne [V2 60 190, V2 65 185]
r <- shuffleLinks =<<
(roomRectAutoLights 250 250
<&> rmPmnts
<>~ [ putLasTurret 0.02 & plSpot .~ PS (V2 220 20) 0
, inlinkwall 70 (rectNSWE 10 (-10) (-10) 30)
, inlinkwall 125 (rectNSWE 55 (-55) (-10) 10)
, inlinkwall 180 (rectNSWE 10 (-10) (-30) 10)
, outlinkwall 70 (rectNSWE 10 (-10) (-30) 10)
, outlinkwall 125 (rectNSWE 55 (-55) (-10) 10)
, outlinkwall 180 (rectNSWE 10 (-10) (-10) 30)
<>~ [ putLasTurret 0.02 & plSpot .~ PS laspos a
-- <>~ [ putLasTurret 0.02 & plSpot .~ PS (V2 65 185) 0
-- <>~ [ putLasTurret 0.02 & plSpot .~ PS (V2 70 180) 0
, awall (V2 35 100) (rectWH 10 60) -- (rectNSWE 80 (-40) (-30) (-10))
, awall (V2 150 215) (rectWH 60 10) -- (rectNSWE 80 (-40) (-30) (-10))
]
<&> rmLinks %~ setInLinks (memtest (FromEdge West 0) (OnEdge South))
<&> rmLinks %~ setOutLinks (memtest (FromEdge East 0) (OnEdge North))
<&> rmLinks %~ setInLinks
(etest
(memtest (FromEdge West 0) (OnEdge South))
(memtest (FromEdge South 0) (OnEdge West))
)
<&> rmLinks %~ setOutLinks
(etest
(memtest (FromEdge East 0) (OnEdge North))
(memtest (FromEdge North 0) (OnEdge East))
)
)
rToOnward "lasCenRunClose" $ return $ cleatOnward r
where
awall x v = heightWallPS (PS x 0) 30 v
etest f g x = f x || g x
memtest a b x = let y = _rlType x
in a `S.member` y && b `S.member` y
linkwall f x = heightWallPS
(resetPLUse $ rprBoolShift (const . f) (shiftInBy x <&> (,S.singleton UsedPosLow)))
(resetPLUse $ rprBoolShift (const . f) (shiftByV2 x <&> (,S.singleton UsedPosLow)))
30
inlinkwall = linkwall isInLnk
outlinkwall = linkwall isOutLnk