Fix no damage to walls bug
This commit is contained in:
@@ -29,7 +29,7 @@ analyser proxreq pslight psmc = extTrigLitPos pslight $ \tp ->
|
||||
-- & mcUpdate .~ mcProximitySensorUpdate
|
||||
& mcType .~ McTerminal
|
||||
& mcHP .~ 100
|
||||
& mcType . _McSensor .~ defaultProximitySensor{_proxRequirement = proxreq}
|
||||
& mcType .~ McSensor (defaultProximitySensor{_proxRequirement = proxreq})
|
||||
|
||||
--this can probably be deleted
|
||||
--mcProximitySensorUpdate :: Machine -> World -> World
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import Dodge.Placement.Instance.Block
|
||||
import Geometry
|
||||
|
||||
heightWallPS :: PlacementSpot -> Float -> [Point2] -> Placement
|
||||
heightWallPS spot h ps = spNoID spot $ lowBlock Stone (_wlColor defaultWall) h ps
|
||||
heightWallPS spot h ps = psPtPl spot $ lowBlock Stone (_wlColor defaultWall) h ps
|
||||
|
||||
invisibleWall :: [Point2] -> Placement
|
||||
invisibleWall ps =
|
||||
|
||||
Reference in New Issue
Block a user