Slow down slime feeding

This commit is contained in:
2026-04-16 08:43:53 +01:00
parent a0ff15fe61
commit 9e215b474f
5 changed files with 22 additions and 7 deletions
+9 -4
View File
@@ -1049,10 +1049,15 @@ slimeFood cr = case cr ^. crType of
_ -> False
feedSlime :: Creature -> Creature -> World -> World
feedSlime s c w = w
& cWorld . lWorld . creatures . ix (c ^. crID) . crHP .~ CrDestroyed Swallowed
& cWorld . lWorld . creatures . ix (s ^. crID) %~ f
& slimeEatSound (s ^. crID) (s ^. crPos . _xy)
feedSlime s c w = fromMaybe w $ do
ch <- crHeight c
return $ if min 10 r1 + s ^?! crType . slimeFeedProgress < ch + 2
then w & cWorld . lWorld . creatures . ix (s ^. crID) . crType . slimeFeedProgress %~ (min r1 . (+0.7))
else
w
& cWorld . lWorld . creatures . ix (c ^. crID) . crHP .~ CrDestroyed Swallowed
& cWorld . lWorld . creatures . ix (s ^. crID) %~ f
& slimeEatSound (s ^. crID) (s ^. crPos . _xy)
where
f cr = cr & crType . slimeRad .~ r
& crType . slimeRadWobble +~ r - r1