Fix bugs in zoning
This commit is contained in:
@@ -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 ::
|
||||
|
||||
Reference in New Issue
Block a user