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
+9 -8
View File
@@ -2,16 +2,17 @@ module Dodge.EnergyBall.Draw (
drawEnergyBall,
) where
import Dodge.Data.Damage.Type
import Dodge.Data.EnergyBall
import Geometry
import Picture
drawEnergyBall :: EnergyBall -> Picture
drawEnergyBall eb = case _ebEff eb of
(ELECTRICAL, _) -> drawStaticBall eb
(FLAMING, _) -> drawFlamelet eb
_ -> error "don't know how to draw an energy ball of this type"
FlamingBall -> drawFlamelet 5 eb
FlameletBall x -> drawFlamelet x eb
ElectricalBall -> drawStaticBall eb
ExplosiveBall -> mempty
FlashBall -> mempty
drawStaticBall ::
EnergyBall ->
@@ -21,10 +22,10 @@ drawStaticBall pt =
. setDepth 20
-- . setDepth (_ebZ pt + 20)
. uncurryV translate (_ebPos pt)
$ circleSolidCol (_ebColor pt) (withAlpha 0.5 white) (_ebWidth pt + 5)
$ circleSolidCol blue (withAlpha 0.5 white) 8
drawFlamelet :: EnergyBall -> Picture
drawFlamelet pt =
drawFlamelet :: Float -> EnergyBall -> Picture
drawFlamelet size pt =
fold
[ setLayer BloomLayer pic
, setLayer BloomNoZWrite piu
@@ -36,7 +37,7 @@ drawFlamelet pt =
sp = _ebPos pt
vel = _ebVel pt
ep = sp +.+ vel
size = _ebWidth pt
--size = _ebWidth pt
siz2 = size + 0.2
time = _ebTimer pt
piu =