Implement pulse rifle with explodable pulse balls

This commit is contained in:
2025-07-27 11:10:30 +01:00
parent 68a4bc7aab
commit f1fb0ee768
19 changed files with 190 additions and 108 deletions
+3 -3
View File
@@ -34,7 +34,7 @@ mcTypeUpdate mc = case mc ^. mcType of
terminalScreenGlow :: Machine -> World -> World
terminalScreenGlow mc w = fromMaybe w $ do
tid <- mc ^? mcMounts . ix ObTerminal
tid <- mc ^? mcMounts . ix OTTerminal
term <- w ^? cWorld . lWorld . terminals . ix tid
V4 x y z _ <- termScreenColor term
return $
@@ -92,7 +92,7 @@ mcUseItem mc = fromMaybe id $ do
mcSensorTriggerUpdate :: Sensor -> Machine -> World -> World
mcSensorTriggerUpdate se mc = fromMaybe id $ do
trid <- mc ^? mcMounts . ix ObTrigger
trid <- mc ^? mcMounts . ix OTTrigger
bval <- mcTriggerVal se
return $ cWorld . lWorld . triggers . ix trid ||~ bval
@@ -172,7 +172,7 @@ senseDamage threshold dt mc =
x = sum . map _dmAmount $ filter f (_mcDamage mc)
ni = fromIntegral (mc ^?! mcType . _McSensor . sensAmount) / fromIntegral threshold
updatels = fromMaybe id $ do
lsid <- mc ^? mcMounts . ix ObLightSource
lsid <- mc ^? mcMounts . ix OTLightSource
return $ cWorld . lWorld . lightSources . ix lsid . lsParam . lsCol .~ V3 ni ni ni
sensorTypeDamages :: SensorType -> Damage -> Bool