Refactor damages

This commit is contained in:
2025-06-07 14:26:00 +01:00
parent 7a192e7631
commit 81a7dcd962
24 changed files with 271 additions and 277 deletions
+7 -5
View File
@@ -22,19 +22,21 @@ makeFlamelet ::
Point2 ->
-- | Velocity
Point2 ->
-- | Size
Float ->
-- | Timer
Int ->
World ->
World
makeFlamelet (V2 x y) vel time w =
makeFlamelet (V2 x y) vel s t w =
w
& randGen .~ g
& cWorld . lWorld . energyBalls
.:~ EnergyBall
{ _ebVel = vel
, _ebPos = V2 x y
, _ebTimer = time
, _ebEff = FlameletBall
, _ebTimer = t
, _ebEff = FlameletBall s
, _ebRot = rot
}
where
@@ -96,7 +98,7 @@ ebFlicker pt
ebColor :: EnergyBall -> Color
ebColor eb = case eb ^. ebEff of
FlamingBall -> red
FlameletBall -> red
FlameletBall {} -> red
ElectricalBall -> cyan
ExplosiveBall -> yellow
FlashBall -> white
@@ -118,7 +120,7 @@ damageCircle sp dt w =
ebtToDamage :: Point2 -> EnergyBallType -> Damage
ebtToDamage p = \case
FlamingBall -> Flaming 10
FlameletBall -> Flaming 1
FlameletBall _ -> Flaming 1
ElectricalBall -> Electrical 10
ExplosiveBall -> Explosive 10 p
FlashBall -> Flashing 10 p