Continue reload refactor

This commit is contained in:
2022-06-21 14:07:17 +01:00
parent 14a7189b44
commit 53c8be0679
33 changed files with 106 additions and 115 deletions
+3 -3
View File
@@ -217,8 +217,8 @@ invSideEff cr w = weaponReloadSounds cr $ IM.foldrWithKey f w (_crInv cr)
itemUpdate :: Creature -> Int -> Item -> Item
itemUpdate cr i
| i == _crInvSel cr = baseupdate True
| otherwise = baseupdate False
| i == crSel cr = baseupdate True
| otherwise = baseupdate False
where
baseupdate bool = (itUse %~ useUpdate) . (itInvPos ?~ i) . (itIsHeld .~ bool)
@@ -230,7 +230,7 @@ doItemTargeting invid cr w = case cr ^? crInv . ix invid . itTargeting of
in w' & creatures . ix (_crID cr) . crInv . ix invid . itTargeting .~ t'
weaponReloadSounds :: Creature -> World -> World
weaponReloadSounds cr w = case cr ^? crInvSelAction of
weaponReloadSounds cr w = case cr ^? crInvSel . iselAction of
Just ReloadAction{} -> soundContinue (CrReloadSound cid) (_crPos cr) reloadS (Just 1) w
_ -> w
-- PassiveReload stype | Just (_laReloadTime am) == am ^? laTransfer . transferTime