Work on creature destruction/damage update

This commit is contained in:
2026-04-16 17:31:53 +01:00
parent 033991ad3f
commit 722a25240e
7 changed files with 102 additions and 88 deletions
+2
View File
@@ -1,5 +1,6 @@
module Dodge.Update.Cloud (cloudPoisonDamage) where
import Data.Maybe
import Data.Foldable
import Dodge.Creature.Radius
import Dodge.Data.World
@@ -15,4 +16,5 @@ cloudPoisonDamage c w = foldl' (flip doDam) w (filter f $ crsNearPoint clpos w)
doDam cr =
cWorld . lWorld . creatures . ix (_crID cr) . crDamage .:~ Poison 1
f cr = dist3 (_crPos cr & _z +~ 20) (_gsPos c) < crRad (cr ^. crType) + 20
&& isJust (cr ^? crHP . _HP)
clpos = stripZ $ _gsPos c