Slow down slime feeding
This commit is contained in:
+9
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user