Add damage origins

This commit is contained in:
2026-04-24 20:34:20 +01:00
parent 011286ccb5
commit e0e346aade
43 changed files with 535 additions and 449 deletions
+4 -4
View File
@@ -29,7 +29,7 @@ updateFlame w pt
reflame wl = pt & flTimer -~ 1 & flVel %~ reflVelWallDamp 0.9 wl
doupdate =
soundContinue FlameSound sp fireLoudS (Just 2) $
damageInCircle (const $ Flaming 1) ep r w
damageInCircle (const $ Flaming 1 (pt ^. flOrigin)) ep r w
thit = List.safeHead $ thingsHit sp ep w
sp = _flPos pt
ep = sp + _flVel pt
@@ -43,10 +43,10 @@ flFlicker pt
.:~ LSParam (addZ 10 $ _flPos pt) 70 (0.5 *.*.* xyzV4 red)
| otherwise = id
makeFlame :: Point2 -> Point2 -> World -> World
makeFlame pos vel w =
makeFlame :: Point2 -> Point2 -> DamageOrigin -> World -> World
makeFlame pos vel d w =
w
& cWorld . lWorld . flames .:~ Flame t pos vel
& cWorld . lWorld . flames .:~ Flame t pos vel d
& randGen .~ g
where
(t, g) = randomR (99, 102) (_randGen w)