Refactor reloading to use list of required steps

This commit is contained in:
2022-06-20 19:06:02 +01:00
parent a85cf4d1fb
commit 37eb69c661
16 changed files with 79 additions and 118 deletions
+2 -2
View File
@@ -231,8 +231,8 @@ doItemTargeting invid cr w = case cr ^? crInv . ix invid . itTargeting of
weaponReloadSounds :: Creature -> World -> World
weaponReloadSounds cr w = case cr ^? crInv . ix (_crInvSel cr) . itConsumption of
Just am@LoadableAmmo{} -> case am ^? laLoadType . loadProgress of
Just NoTransfer -> w -- stopSoundFrom (CrReloadSound cid) w
Just am@LoadableAmmo{} -> case am ^? laProgress of
Just FinishedLoading -> w -- stopSoundFrom (CrReloadSound cid) w
Just _ -> soundContinue (CrReloadSound cid) (_crPos cr) reloadS (Just 1) w
Nothing -> w
-- PassiveReload stype | Just (_laReloadTime am) == am ^? laTransfer . transferTime