Creature springs checks for heights

This commit is contained in:
2026-04-04 08:33:09 +01:00
parent 615295ca3e
commit def204d211
8 changed files with 96 additions and 66 deletions
+2 -2
View File
@@ -31,7 +31,7 @@ updateExpBarrel ps cr w = case cr ^. crHP of
HP _ ->
w
& makeExplosionAt ((cr ^. crPos) & _z +~ 20) 0
& cWorld . lWorld . creatures . ix (_crID cr) . crHP .~ CrIsGibs
& cWorld . lWorld . creatures . ix (_crID cr) . crHP .~ CrDestroyed Gibbed
_ -> w
where
f w' p = makeSpark NormalSpark (p + normalizeV p + cr ^. crPos . _xy) (argV p) w'
@@ -44,7 +44,7 @@ updateExpBarrel ps cr w = case cr ^. crHP of
updateBarrel :: Creature -> World -> World
updateBarrel cr = case cr ^. crHP of
HP x | x > 0 -> doDamage (cr ^. crID)
HP _ -> cWorld . lWorld . creatures . ix (_crID cr) . crHP .~ CrIsGibs
HP _ -> cWorld . lWorld . creatures . ix (_crID cr) . crHP .~ CrDestroyed Gibbed
_ -> id
damsToExpBarrel :: [Damage] -> Creature -> Creature