Remove heldParams record

This commit is contained in:
2025-06-04 13:33:44 +01:00
parent 0cb7b54180
commit 9797f610aa
7 changed files with 38 additions and 28 deletions
+16 -4
View File
@@ -231,15 +231,27 @@ itemSidePush = \case
BLINKERUNSAFE -> 0
applyInvLock :: Item -> Creature -> World -> World
applyInvLock itm cr = case itm ^? itUse . heldParams . weaponInvLock of
Just i
| i > 0 ->
applyInvLock itm cr
| i <- itemInvLock itm
, i > 0 =
(cWorld . lWorld . delayedEvents .:~ (i, UnlockInv cid))
. lockInv cid
_ -> id
| otherwise = id
where
cid = _crID cr
itemInvLock :: Item -> Int
itemInvLock itm = case itm ^. itType of
HELD hit -> heldItemInvLock hit
_ -> 0
heldItemInvLock :: HeldItemType -> Int
heldItemInvLock = \case
FLAMESPITTER -> 10
VOLLEYGUN i -> i + 1
BURSTRIFLE -> 7
_ -> 0
applySoundCME :: Item -> Creature -> World -> World
applySoundCME itm cr = fromMaybe id $ do
(soundid, x) <- bgunSound itm