Fix no damage to walls bug
This commit is contained in:
@@ -19,20 +19,27 @@ damageSensor ::
|
||||
PlacementSpot ->
|
||||
Placement
|
||||
damageSensor dt wdth mtrid ps = pContID ps (PutLS $ lsPosCol (V3 0 0 30) 0.1) $
|
||||
\lsid -> Just $
|
||||
spNoID 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)
|
||||
)
|
||||
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
|
||||
_ -> undefined
|
||||
|
||||
lightSensor ::
|
||||
Float ->
|
||||
@@ -40,4 +47,3 @@ lightSensor ::
|
||||
PlacementSpot ->
|
||||
Placement
|
||||
lightSensor = damageSensor LASERING
|
||||
|
||||
|
||||
Reference in New Issue
Block a user