This commit is contained in:
2025-07-29 10:10:25 +01:00
parent 81f88c32e9
commit 15077be769
5 changed files with 219 additions and 233 deletions
+8 -4
View File
@@ -465,15 +465,19 @@ updatePulseLasers w = f w & cWorld . lWorld . pulseLasers .~ pzs
updatePulseBall :: PulseBall -> World -> World
updatePulseBall pb w
| Just (_, ecrwl) <- thit =
w & cWorld . lWorld . pulseBalls . at (pb ^. pbID) .~ Nothing
w & cWorld . lWorld . pulseBalls . at (pb ^. pbID) .~ Nothing
& cWorld . lWorld %~ dodam ecrwl
| pb ^. pbTimer <= 0 =
w & cWorld . lWorld . pulseBalls . at (pb ^. pbID) .~ Nothing
w & cWorld . lWorld . pulseBalls . at (pb ^. pbID) .~ Nothing
| otherwise =
w
& cWorld . lWorld . pulseBalls . ix (pb ^. pbID) . pbTimer -~ 1
w & cWorld . lWorld . pulseBalls . ix (pb ^. pbID) . pbTimer -~ 1
& cWorld . lWorld . pulseBalls . ix (pb ^. pbID) . pbPos .~ ep
& pbFlicker pb
where
dodam = \case
Left cr -> creatures . ix (_crID cr) . crDamage .:~ thedam
Right wl -> wallDamages . at (_wlID wl) . non mempty .:~ thedam
thedam = Lasering 100 ep (pb ^. pbVel)
sp = pb ^. pbPos
ep = sp + pb ^. pbVel
thit = thingHit sp ep w