Continue refactor of reloading
This commit is contained in:
+13
-10
@@ -231,16 +231,19 @@ 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 _laReloadType am of
|
||||
PassiveReload stype | Just (_laReloadTime am) == am ^? laTransfer . transferTime
|
||||
-> soundContinue (CrReloadSound 0) (_crPos cr) stype Nothing w
|
||||
PassiveReload _ -> w
|
||||
ActiveClear | am ^? laTransfer . transferTime == Just 0 -> stopSoundFrom (CrReloadSound cid) w
|
||||
ActiveClear | _laTransfer am == NoTransfer -> w
|
||||
ActiveClear -> soundContinue (CrReloadSound cid) (_crPos cr) reloadS (Just 1) w
|
||||
ActivePartial{} | am ^? laTransfer . transferTime == Just 0 -> stopSoundFrom (CrReloadSound cid) w
|
||||
ActivePartial{} | _laTransfer am == NoTransfer -> w
|
||||
ActivePartial{} -> soundContinue (CrReloadSound cid) (_crPos cr) reloadS (Just 1) w
|
||||
Just am@LoadableAmmo{} -> case am ^? laLoadType . loadProgress of
|
||||
Just NoTransfer -> 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
|
||||
-- -> soundContinue (CrReloadSound 0) (_crPos cr) stype Nothing w
|
||||
-- PassiveReload _ -> w
|
||||
-- ActiveClear | am ^? laTransfer . transferTime == Just 0 -> stopSoundFrom (CrReloadSound cid) w
|
||||
-- ActiveClear | _laTransfer am == NoTransfer -> w
|
||||
-- ActiveClear -> soundContinue (CrReloadSound cid) (_crPos cr) reloadS (Just 1) w
|
||||
-- ActivePartial{} | am ^? laTransfer . transferTime == Just 0 -> stopSoundFrom (CrReloadSound cid) w
|
||||
-- ActivePartial{} | _laTransfer am == NoTransfer -> w
|
||||
-- ActivePartial{} -> soundContinue (CrReloadSound cid) (_crPos cr) reloadS (Just 1) w
|
||||
Just ChargeableAmmo {} -> w
|
||||
Just NoConsumption {} -> w
|
||||
Just ItemItselfConsumable {} -> w
|
||||
|
||||
Reference in New Issue
Block a user