This commit is contained in:
2025-12-26 15:43:21 +00:00
parent 3c07069adc
commit 3f7eeb871c
5 changed files with 44 additions and 61 deletions
+3 -19
View File
@@ -1,3 +1,4 @@
{-# LANGUAGE LambdaCase #-}
module Dodge.Placement.Instance.Sensor (
lightSensor,
damageSensor,
@@ -17,29 +18,12 @@ damageSensor dt wdth mtrid ps = pContID ps (PutLS $ lsPosCol (V3 0 0 30) 0.1) $
PutMachine
(reverse $ square wdth)
( defaultMachine
-- & mcColor .~ yellow
& mcMounts . at OTTrigger .~ mtrid
& mcMounts . at OTLightSource ?~ lsid
& mcType
.~ McDamSensor
( DamSensor
0
dt
(damageTypeThreshold dt)
)
.~ McDamSensor ( DamSensor 0 dt)
)
Nothing
damageTypeThreshold :: SensorType -> Int
damageTypeThreshold dt = case dt of
LaserSensor -> 1000
ElectricSensor -> 500
ThermalSensor -> 1000
PhysicalSensor -> 1000
lightSensor ::
Float ->
Maybe Int ->
PlacementSpot ->
Placement
lightSensor :: Float -> Maybe Int -> PlacementSpot -> Placement
lightSensor = damageSensor LaserSensor
+5 -10
View File
@@ -51,16 +51,11 @@ putTerminalFull f mc tm =
putTerminal :: Machine -> Terminal -> Placement
putTerminal = putTerminalFull (\_ _ _ -> Nothing)
tmMachine :: Machine
tmMachine = defaultMachine & mcType .~ McTerminal & mcHP .~ 100
putMessageTerminal :: Terminal -> Placement
putMessageTerminal =
putTerminal $
defaultMachine
& mcType .~ McTerminal
& mcHP .~ 100
putMessageTerminal = putTerminal tmMachine
putImmediateMessageTerminal :: Terminal -> Placement
putImmediateMessageTerminal =
putTerminalImediateAccess $
defaultMachine
& mcType .~ McTerminal
& mcHP .~ 100
putImmediateMessageTerminal = putTerminalImediateAccess tmMachine