Make machines have footprint like doors

This commit is contained in:
2026-03-31 20:29:30 +01:00
parent dea4c0dffe
commit 5701261ace
12 changed files with 137 additions and 138 deletions
+2 -1
View File
@@ -9,14 +9,15 @@ import Dodge.Default
import Dodge.LevelGen.PlacementHelper
import Dodge.LightSource
import Geometry
import qualified Data.IntMap.Strict as IM
damageSensor :: SensorType -> Float -> Maybe Int -> PlacementSpot -> Placement
damageSensor dt wdth mtrid ps = pContID ps (PutLS $ lsPosCol (V3 0 0 30) 0.1) $
\lsid ->
psPtJpl ps $
PutMachine
(reverse $ square wdth)
( defaultMachine
& mcFootPrint .~ IM.fromDistinctAscList (zip [0..] . loopPairs . reverse $ square wdth)
& mcSkin .~ mattype
& mcMounts . at OTTrigger .~ mtrid
& mcMounts . at OTLightSource ?~ lsid
+2 -1
View File
@@ -4,6 +4,7 @@ module Dodge.Placement.Instance.Terminal (
putTerminal,
) where
import qualified Data.IntMap.Strict as IM
import Data.Maybe
import Dodge.Data.GenWorld
import Dodge.Default
@@ -29,9 +30,9 @@ putTerminalFull f mc tm =
\btpl -> Just $
pt0
( PutMachine
(reverse $ square 10)
( mc & mcMounts . at OTButton ?~ fromJust (_plMID btpl)
& mcMounts . at OTTerminal .~ _plMID tmpl
& mcFootPrint .~ IM.fromDistinctAscList (zip [0..] . loopPairs . reverse $ square 10)
)
Nothing
)
+3 -3
View File
@@ -1,5 +1,4 @@
module Dodge.Placement.Instance.Turret
(putLasTurret) where
module Dodge.Placement.Instance.Turret (putLasTurret) where
import Dodge.Item.Held.BatteryGuns
import Dodge.Data.GenWorld
@@ -7,6 +6,7 @@ import Dodge.Default
import Dodge.LevelGen.PlacementHelper
import Geometry
import LensHelp
import qualified Data.IntMap.Strict as IM
--putTurret :: Item -> Float -> Placement
--putTurret itm rotSpeed =
@@ -24,8 +24,8 @@ putLasTurret :: Float -> Placement
putLasTurret rotSpeed =
sps0 $
PutMachine
(reverse $ square 10)
( defaultMachine
& mcFootPrint .~ IM.fromDistinctAscList (zip [0..] . loopPairs . reverse $ square 10)
-- & mcColor .~ blue
& mcType .~ (lasTurret & mctTurret . tuTurnSpeed .~ rotSpeed)
& mcHP .~ 1500