Simplify cloud/dust update

This commit is contained in:
2025-12-02 22:20:41 +00:00
parent b2cb8cfe11
commit 22646d1702
3 changed files with 70 additions and 82 deletions
+3 -2
View File
@@ -18,13 +18,14 @@ import RandomHelp
updateFlame :: World -> Flame -> (World, Maybe Flame)
updateFlame w pt
| _flTimer pt <= 0 = (makeCloudAt Smoke 200 (addZ 20 ep) w, Nothing)
| _flTimer pt <= 0 = (mcloud w, Nothing)
| Just (_, Right wl) <- thit = (doupdate, Just $ reflame wl)
-- might want to move differently if we hit a creature?
| _flTimer pt <= 1 = (makeCloudAt Smoke 200 (addZ 20 ep) $ flFlicker pt doupdate
| _flTimer pt <= 1 = (mcloud $ flFlicker pt doupdate
, Just mvflame)
| otherwise = (flFlicker pt doupdate, Just mvflame)
where
mcloud = makeCloudAt Smoke 200 (addZ 20 ep)
reflame wl = pt & flTimer -~ 1 & flVel %~ reflVelWallDamp 0.9 wl
doupdate =
soundContinue FlameSound sp fireLoudS (Just 2) $