Make reloading based upon creature stance

This commit is contained in:
2022-06-20 00:53:47 +01:00
parent 8d457033a2
commit 2f4b381484
11 changed files with 91 additions and 77 deletions
+5 -5
View File
@@ -232,14 +232,14 @@ 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) == _laReloadState am
PassiveReload stype | Just (_laReloadTime am) == am ^? laTransfer . transferTime
-> soundContinue (CrReloadSound 0) (_crPos cr) stype Nothing w
PassiveReload _ -> w
ActiveClear | _laReloadState am == Just' 0 -> stopSoundFrom (CrReloadSound cid) w
ActiveClear | _laReloadState am == Nothing' -> 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{} | _laReloadState am == Just' 0 -> stopSoundFrom (CrReloadSound cid) w
ActivePartial{} | _laReloadState am == Nothing' -> 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