Work on placements/room generation

This commit is contained in:
2025-08-22 13:42:51 +01:00
parent e7b52f4487
commit f641805845
14 changed files with 294 additions and 596 deletions
+18 -15
View File
@@ -22,14 +22,15 @@ import LensHelp
import RandomHelp
cenLasTur :: Room
cenLasTur = roomNgon 8 200 & rmPmnts .~
[ putLasTurret 0.02
, heightWallPS
(resetPLUse $ rprBoolShift (const . isInLnk) (shiftInBy 100))
30
covershape
, mntLightLnkCond $ rprBool $ const . isInLnk
]
cenLasTur =
roomNgon 8 200 & rmPmnts
.~ [ putLasTurret 0.02
, heightWallPS
(resetPLUse $ rprBoolShift (const . isInLnk) (shiftInBy 100))
30
covershape
, mntLightLnkCond $ rprBool $ const . isInLnk
]
where
covershape = rectNSWE 10 (-10) (-20) 20
@@ -74,24 +75,26 @@ keyCardAnalyserByDoor keyid = analyserByDoor (RequireEquipment (HELD (KEYCARD ke
healthAnalyserByDoor :: Int -> Room -> Room
healthAnalyserByDoor = analyserByDoor (RequireHealth 1100)
analyserByDoor :: ProximityRequirement -> Int -> Room -> Room
analyserByDoor proxreq outplid rm =
analyserByNthLink :: Int -> ProximityRequirement -> Int -> Room -> Room
analyserByNthLink n proxreq outplid rm =
rm
& rmPmnts
.++~ [ psPt atFstLnkOut $ PutForeground $ verticalWire (V2 20 0) 0 80
.++~ [ psPt (atNthLinkOut n) $ PutForeground $ verticalWire (V2 20 0) 0 80
]
& rmOutPmnt
.~ [ OutPlacement
.:~ OutPlacement
( analyser
proxreq
(atFstLnkOutShiftBy (\(p, a) -> (p +.+ rotateV a (V2 18.5 (-2.5)), a)))
(atFstLnkOutShiftBy sensorshift)
(atNthLnkOutShiftBy n (\(p, a) -> (p +.+ rotateV a (V2 18.5 (-2.5)), a)))
(atNthLnkOutShiftBy n sensorshift)
)
outplid
]
where
sensorshift (p, a) = (p +.+ rotateV a (V2 30 (-10)), a)
analyserByDoor :: ProximityRequirement -> Int -> Room -> Room
analyserByDoor = analyserByNthLink 0
healthTest :: RandomGen g => Int -> State g (Tree Room)
healthTest n = do
cenroom <- shuffleLinks $ healthAnalyserByDoor n $ roomNgon 8 200