This commit is contained in:
2026-05-08 10:10:06 +01:00
parent 7c1ada4546
commit 84e95da2b5
4 changed files with 38 additions and 53 deletions
+2 -15
View File
@@ -1091,23 +1091,17 @@ feedSlime s c w = fromMaybe w $ do
& cWorld . lWorld . creatures . ix (s ^. crID) %~ f
& slimeEatSound (s ^. crID) (s ^. crPos . _xy)
where
f cr = cr -- & crType . slimeRad .~ r
-- & crType . slimeSlime .~ round (r^(2::Int) * 100)
f cr = cr
& crType . slimeSlime +~ round (r2^(2::Int) * 100)
& crType . slimeSlimeChange +~ round (r2^(2::Int) * 100)
-- & crType . slimeRadWobble +~ r - r1 -- not sure if this is correct
-- & crType . slimeCompression %~ ((r/r1) *^)
--r1 = s ^?! crType . slimeRad
r1 = s ^?! crType . slimeSlime . to slimeToRad
r2 = c ^. crType . to crRad
r = sqrt (r1*r1 + r2*r2)
fuseSlimes :: Creature -> Creature -> World -> World
fuseSlimes c1 c2 = (cWorld . lWorld . creatures . ix mini .~ c)
. (cWorld . lWorld . creatures . at maxi .~ Nothing)
. slimeEatSound i1 (c ^. crPos . _xy)
. slimeEatSound mini (c ^. crPos . _xy)
where
--c' | c1 ^?! crType . slimeRad > c2 ^?! crType . slimeRad = c1
c' | c1 ^?! crType . slimeSlime > c2 ^?! crType . slimeSlime = c1
| otherwise = c2
mini = min i1 i2
@@ -1116,15 +1110,8 @@ fuseSlimes c1 c2 = (cWorld . lWorld . creatures . ix mini .~ c)
i2 = c2 ^. crID
c = c' & crType . slimeSlime +~ eslime
& crType . slimeSlimeChange +~ eslime
-- & crType . slimeRadWobble +~ r - max r1 r2
-- & crType . slimeCompression %~ ((r/max r1 r2) *^)
& crID .~ mini
eslime = min (c1 ^?! crType . slimeSlime) (c2 ^?! crType . slimeSlime)
-- r1 = c1 ^?! crType . slimeRad
-- r2 = c2 ^?! crType . slimeRad
r1 = c1 ^?! crType . slimeSlime . to slimeToRad
r2 = c2 ^?! crType . slimeSlime . to slimeToRad
r = sqrt (r1*r1 + r2*r2)
slimeEatSound :: Int -> Point2 -> World -> World
slimeEatSound i p w = w & soundStart (CrSound i) p s Nothing