Add z levels to shockwaves

This commit is contained in:
2025-08-05 08:30:57 +01:00
parent 09428f2707
commit 22dafda9bd
12 changed files with 27 additions and 39 deletions
+2 -2
View File
@@ -76,8 +76,8 @@ makeExplosionAt p' vel' w =
& soundStart (Explosion (w ^. cWorld . lWorld . lClock)) (p) bangS Nothing
& addFlames
& cWorld . lWorld . worldEvents
.:~ MakeTempLight (LSParam (addZ 20 p) 150 (V3 1 0.5 0)) 20
& makeShockwaveAt [] p 50 50 1 white
.:~ MakeTempLight (LSParam (p') 150 (V3 1 0.5 0)) 20
& makeShockwaveAt [] p' 50 50 1 white
where
p = p' ^. _xy
fVs = fmap (`v2z` 0) $ replicateM 100 (randInCirc 1) & evalState $ _randGen w
+2 -2
View File
@@ -13,7 +13,7 @@ makeShockwaveAt ::
-- | IDs of invulnerable creatures.
[Int] ->
-- | Center of shockwave.
Point2 ->
Point3 ->
-- | Maximal radius.
Float ->
-- | Damage caused per frame.
@@ -41,7 +41,7 @@ makeShockwaveAt is p rad dam push col =
{- Create a shockwave going from an outside circle into a center point. -}
inverseShockwaveAt ::
Point2 -> -- Center position
Point3 -> -- Center position
Float -> -- Radius
Int -> -- Damage
Float -> -- Push amount