Add analysing machine

This commit is contained in:
2022-03-21 09:14:32 +00:00
parent 13e8ea85d2
commit 51cc04799d
7 changed files with 102 additions and 15 deletions
+27
View File
@@ -12,6 +12,7 @@ import Dodge.Room.Ngon
import Dodge.Room.Foreground
--import Dodge.Room.RoadBlock
import Dodge.Placement.Instance
import Dodge.Placement.Instance.Analyser
import Dodge.Default.Room
--import Dodge.Item.Weapon.BulletGuns
--import Dodge.Item.Weapon.Utility
@@ -69,6 +70,32 @@ lightSensByDoor outplid rm = rm
covershape = rectNSEW 10 (-10) 20 (-20)
sensorshift (p,a) = (p +.+ rotateV a (V2 60 (-20)), a)
healthAnalyserByDoor :: Int -> Room -> Room
healthAnalyserByDoor outplid rm = rm
& rmPmnts .++~
[ psPt atFstLnkOut $ PutShape $ colorSH yellow
$ barPP 1.5 (V3 20 (-1) 0) (V3 20 (-1) 80)
, heightWallPS (atNthLnkOutShiftInward 1 100) 30 covershape
, heightWallPS (atFstLnkOutShiftInward 100) 30 covershape
]
& rmOutPmnt .~
[OutPlacement
(analyser
(atFstLnkOutShiftBy (\(p,a) -> (p +.+ rotateV a (V2 18.5 (-2.5)), a)))
(atFstLnkOutShiftBy sensorshift)
(testYourHealth 1100)
)
outplid]
where
covershape = rectNSEW 10 (-10) 20 (-20)
sensorshift (p,a) = (p +.+ rotateV a (V2 60 (-20)), a)
healthTest :: RandomGen g => Int -> State g (SubCompTree Room)
healthTest n = do
cenroom <- shuffleLinks $ healthAnalyserByDoor n $ roomNgon 8 200
let doorroom = triggerDoorRoom n
return $ treeFromPost [PassDown door,PassDown cenroom,PassDown doorroom] (UseAll door)
lasSensorTurretTest :: RandomGen g => Int -> State g (SubCompTree Room)
lasSensorTurretTest n = do
cenroom <- shuffleLinks $ lightSensInsideDoor n cenLasTur
+1 -3
View File
@@ -81,9 +81,7 @@ randomLightPositions rm = do
xs <- shuffle [0.._numLinkEW rmtype]
ys <- shuffle [0.._numLinkNS rmtype]
let n = max (length xs) (length ys)
return $ zip
(take n $ xs ++ xs)
(take n $ ys ++ ys)
return $ take n $ zip (xs ++ xs) (ys ++ ys)
intsToPos :: Room -> (Int,Int) -> Point2
intsToPos rm (x,y) = V2