Commit before tweaking placementn/room generation

This commit is contained in:
2025-09-23 09:52:52 +01:00
parent 4179115023
commit d1bb8a985b
18 changed files with 308 additions and 201 deletions
+12 -3
View File
@@ -1,4 +1,7 @@
module Dodge.Placement.Instance.Analyser (analyser) where
module Dodge.Placement.Instance.Analyser (
analyser,
analyserWithPrompt,
) where
import Color
import Dodge.Data.GenWorld
@@ -7,7 +10,11 @@ import Dodge.Placement.Instance
import LensHelp
analyser :: ProximitySensorType -> PlacementSpot -> PlacementSpot -> Placement
analyser pst pslight psmc = extTrigLitPos pslight $ \tp ->
analyser = analyserWithPrompt []
analyserWithPrompt ::
[TerminalLine] -> ProximitySensorType -> PlacementSpot -> PlacementSpot -> Placement
analyserWithPrompt l pst pslight psmc = extTrigLitPos pslight $ \tp ->
Just $
plSpot .~ psmc $
putTerminal
@@ -15,7 +22,9 @@ analyser pst pslight psmc = extTrigLitPos pslight $ \tp ->
(themachine & mcMounts . at OTTrigger .~ _plMID tp)
tparams
where
tparams = defaultTerminal & tmStatus .~ TerminalLineRead
tparams =
defaultTerminal & tmStatus .~ TerminalLineRead
& tmFutureLines .~ l
themachine =
defaultMachine & mcColor .~ aquamarine
& mcType .~ McTerminal
+2 -2
View File
@@ -78,8 +78,8 @@ divideDoorPane mid wl cond soff speed ppairs g = case ppairs of
putAutoDoor :: Point2 -> Point2 -> Placement
putAutoDoor a b = Placement (PS 0 0) (PutCoord a) Nothing $ \_ apl ->
Just $ Placement (PS 0 0) (PutCoord b) Nothing $ \w bpl ->
let x = w ^?! coordinates . ix (apl ^?! plMID . _Just)
y = w ^?! coordinates . ix (bpl ^?! plMID . _Just)
let x = w ^?! gwWorld . coordinates . ix (apl ^?! plMID . _Just)
y = w ^?! gwWorld . coordinates . ix (bpl ^?! plMID . _Just)
in Just $ putDoubleDoor
AutoDoorObstacle
defaultAutoWall
+1 -1
View File
@@ -41,7 +41,7 @@ placePlainPSSpot
placePlainPSSpot w rm plmnt shift =
let (i, w') = placeSpotID (shiftPSBy shift (_plSpot plmnt)) (_plType plmnt) w
newplmnt = plmnt & plMID ?~ i
in maybe ((w', rm), [newplmnt]) (recrPlace newplmnt w') (_plIDCont plmnt (_gwWorld w') newplmnt)
in maybe ((w', rm & rmPmnts .:~ newplmnt), [newplmnt]) (recrPlace newplmnt w') (_plIDCont plmnt (w') newplmnt)
where
recrPlace newplmnt w' pl =
let (wr, newplmnts) = placeSpot (w', rm) pl