Fix slime suck bug

This commit is contained in:
2026-05-18 19:25:07 +01:00
parent 3119f10c2c
commit eb817d34ef
5 changed files with 16 additions and 25 deletions
+1 -1
View File
@@ -230,7 +230,7 @@ updateCalmBee cr cid w
& tocr . crActionPlan . apStrategy .~ SearchTimed 200
(p,g) = runState (randOnCirc 200) (w ^. randGen)
cxy = cr ^. crPos . _xy
mountshakeoff mid = fromMaybe True $ do
mountshakeoff mid = fromMaybe False $ do
mcr <- w ^? cWorld . lWorld . creatures . ix mid
x <- mcr ^? crType . slimeDistortion . sdTime
return $ x > 8
-7
View File
@@ -83,10 +83,6 @@ data Action
{ _waitThenTimer :: Int
, _waitThenAction :: Action
}
-- | DoActionWhile
-- { _doActionWhileCondition :: WdCrBl
-- , _doActionWhileAction :: Action
-- }
| DoActionWhilePartial
{ _doActionWhilePartial :: Action
, _doActionWhileCondition :: WdCrBl
@@ -122,9 +118,6 @@ data Action
}
| LeadTarget { _leadTargetBy :: Point2 }
| NoAction
-- | StartSentinelPost
-- | UseSelf { _useSelf :: CrAc }
-- | ArbitraryAction {_arbitraryAction :: CrWdAc}
-- | Repeatedly perform impulses alongside a main action until the main action terminates
| DoImpulsesAlongside
{ _sideImpulses :: [Impulse]
+2 -3
View File
@@ -454,8 +454,7 @@ itemSidePush = \case
applyInvLock :: Item -> Creature -> World -> World
applyInvLock itm cr = case itemInvLock itm of
i
| i > 0 && cid == 0 ->
i | i > 0 && cid == 0 ->
(cWorld . lWorld . delayedEvents .:~ (i, UnlockInv)) . lockInv
_ -> id
where
@@ -470,7 +469,7 @@ heldItemInvLock :: HeldItemType -> Int
heldItemInvLock = \case
FLAMESPITTER -> 10
VOLLEYGUN i -> i + 1
BURSTRIFLE -> 70
BURSTRIFLE -> 8
_ -> 0
applySoundCME :: Item -> Creature -> World -> World
+12 -14
View File
@@ -2,13 +2,11 @@ module Dodge.Item.Location (
pointerToItemID,
--pointerToItemLocation,
pointerToItem,
pointerYourSelectedItem,
pointerYourRootItem,
) where
import NewInt
import Control.Lens
import Data.Maybe
--import Data.Maybe
import Dodge.Data.World
--pointerToItemLocation ::
@@ -23,17 +21,17 @@ import Dodge.Data.World
---- cWorld . lWorld . floorItems . ix (_unNInt flid) . flIt
--pointerToItemLocation _ = const pure
pointerYourSelectedItem :: Applicative a => (Item -> a Item) -> World -> a World
pointerYourSelectedItem f w = fromMaybe (pure w) $ do
Sel 0 itinvid <- w ^? hud.diSelection._Just
itid <- w ^? cWorld . lWorld . creatures . ix 0 . crInv . ix (NInt itinvid)
Just $ (cWorld . lWorld . items . ix itid) f w
pointerYourRootItem :: Applicative a => (Item -> a Item) -> World -> a World
pointerYourRootItem f w = fromMaybe (pure w) $ do
itinvid <- w ^? hud. manObject . hiRootSelectedItem
itid <- w ^? cWorld . lWorld . creatures . ix 0 . crInv . ix itinvid
Just $ (cWorld . lWorld . items . ix itid) f w
--pointerYourSelectedItem :: Applicative a => (Item -> a Item) -> World -> a World
--pointerYourSelectedItem f w = fromMaybe (pure w) $ do
-- Sel 0 itinvid <- w ^? hud.diSelection._Just
-- itid <- w ^? cWorld . lWorld . creatures . ix 0 . crInv . ix (NInt itinvid)
-- Just $ (cWorld . lWorld . items . ix itid) f w
--
--pointerYourRootItem :: Applicative a => (Item -> a Item) -> World -> a World
--pointerYourRootItem f w = fromMaybe (pure w) $ do
-- itinvid <- w ^? hud. manObject . hiRootSelectedItem
-- itid <- w ^? cWorld . lWorld . creatures . ix 0 . crInv . ix itinvid
-- Just $ (cWorld . lWorld . items . ix itid) f w
pointerToItem :: Applicative f => Item -> (Item -> f Item) -> World -> f World
pointerToItem x = cWorld . lWorld . items . ix (x ^. itID . unNInt)
+1
View File
@@ -1027,6 +1027,7 @@ crCrSpring c1 c2
, distance xy1 xy2 < r1 - (r2 + 5)
= feedSlime c1 c2
| maybe True not (c1 ^? crType . slimeDistortion . sdIsSplit)
, SlimeCrit{} <- c1 ^. crType
, slimeFood c2 = slimeSuck c1 c2
| SlimeCrit{} <- c1 ^. crType = id
| SlimeCrit{} <- c2 ^. crType = id