Fix bugs in zoning

This commit is contained in:
2022-07-30 14:21:13 +01:00
parent c8ad3e1294
commit 82db86f55f
16 changed files with 204 additions and 157 deletions
+24 -16
View File
@@ -19,26 +19,34 @@ damageSensor ::
PlacementSpot ->
Placement
damageSensor dt wdth mtrid ps = pContID ps (PutLS $ lsPosCol (V3 0 0 30) 0.1) $
\lsid -> psPtJpl ps $
PutUsingGenParams $
\gw ->
( gw
, PutMachine
(reverse $ square wdth)
( defaultMachine
& mcColor .~ yellow
& mcMounts . at ObTrigger .~ mtrid
& mcMounts . at ObLightSource ?~ lsid
& mcType .~ McSensor (DamageSensor False 0 dt (_sensorCoding (_genParams (_cWorld gw)) M.! dt) (damageTypeThreshold dt))
)
defaultSensorWall
\lsid -> psPtJpl ps
. PutUsingGenParams
$ \gw ->
( gw
, PutMachine
(reverse $ square wdth)
( defaultMachine
& mcColor .~ yellow
& mcMounts . at ObTrigger .~ mtrid
& mcMounts . at ObLightSource ?~ lsid
& mcType
.~ McSensor
( DamageSensor
False
0
dt
(_sensorCoding (_genParams (_cWorld gw)) M.! dt)
(damageTypeThreshold dt)
)
)
defaultSensorWall
)
damageTypeThreshold :: DamageType -> Int
damageTypeThreshold dt = case dt of
FLAMING -> 1000
LASERING -> 1000
ELECTRICAL -> 5
FLAMING -> 1000
LASERING -> 1000
ELECTRICAL -> 500
_ -> undefined
lightSensor ::