Continue tweaking sound

This commit is contained in:
2021-09-12 20:33:33 +01:00
parent 51a85bd1ec
commit 72657294d1
89 changed files with 373 additions and 517 deletions
+3 -3
View File
@@ -52,7 +52,7 @@ stateUpdate u cr w = case u (updateMovement cr) w of
| otherwise = Nothing
deathEff
| cr ^.crHP > 0 = id
| otherwise = stopSoundFrom (CrWeaponSound (_crID cr))
| otherwise = stopSoundFrom (CrWeaponSound (_crID cr) 0)
. over decorations addCorpse
. dropByState cr
addCorpse = IM.insertNewKey
@@ -137,11 +137,11 @@ invSideEff cr w = weaponReloadSounds cr $ IM.foldrWithKey f w (_crInv cr)
weaponReloadSounds :: Creature -> World -> World
weaponReloadSounds cr w = case _crInv cr IM.!? _crInvSel cr of
Just Weapon{_wpReloadType = PassiveReload stype,_wpReloadTime=rt,_wpReloadState=rs}
| rt == rs -> soundFrom (CrReloadSound 0) (_crPos cr) stype Nothing w
| rt == rs -> soundContinue (CrReloadSound 0) (_crPos cr) stype Nothing w
| otherwise -> w
Just Weapon{_wpReloadState = 0} -> w
Just Weapon{_wpReloadState = 1} -> stopSoundFrom (CrReloadSound cid) w
Just Weapon{} -> soundFrom (CrReloadSound cid) (_crPos cr) reloadS (Just 1) w
Just Weapon{} -> soundContinue (CrReloadSound cid) (_crPos cr) reloadS (Just 1) w
_ -> w
where
cid = _crID cr