Allow multiple pulseBalls to be destroyed by one pulse laser shot
This commit is contained in:
+6
-5
@@ -635,19 +635,20 @@ updatePulseLaser pz = case pz ^. pzTimer of
|
||||
5 -> (Endo f, [pz & pzTimer -~ 1])
|
||||
_ -> (Endo g, [pz & pzTimer -~ 1])
|
||||
where
|
||||
f w = dodam thHit ps
|
||||
f w = dodam thHit
|
||||
w
|
||||
& cWorld . lWorld . flares <>~ drawLaser cyan (sp : ps)
|
||||
where
|
||||
(thHit, ps) = reflectPulseLaserAlong phasev sp xp w
|
||||
dodam thit ps = case thit of
|
||||
Just (p, OCreature cr) ->
|
||||
dodam thit = case thit of
|
||||
((p, OCreature cr):_) ->
|
||||
cWorld . lWorld . creatures . ix (_crID cr) . crDamage
|
||||
.:~ Lasering (pz ^. pzDamage) p (xp - sp)
|
||||
Just (p, OWall wl) ->
|
||||
((p, OWall wl):_) ->
|
||||
cWorld . lWorld . wallDamages . at (_wlID wl) . non mempty
|
||||
.:~ Lasering (pz ^. pzDamage) p (xp - sp)
|
||||
Just (p, OPulseBall pb) ->
|
||||
((_, OPulseBall pb):xs) -> dodam xs
|
||||
.
|
||||
(cWorld . lWorld . pulseBalls . ix (_pbID pb) . pbTimer .~ 0)
|
||||
. makeExplosionAt (_pbPos pb) 0
|
||||
_ -> id
|
||||
|
||||
Reference in New Issue
Block a user