Refactor sounds
This commit is contained in:
@@ -135,11 +135,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 -> soundOncePos stype (_crPos cr) w
|
||||
| rt == rs -> soundFrom (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) reloadSound 1 0 w
|
||||
Just Weapon{} -> soundFrom (CrReloadSound cid) (_crPos cr) reloadSound (Just 1) w
|
||||
_ -> w
|
||||
where
|
||||
cid = _crID cr
|
||||
@@ -221,7 +221,7 @@ updateExpBarrel cr w
|
||||
applyFuseDamage cr' = cr' & crHP %~
|
||||
subtract (length . _piercedPoints . _crSpState $ _crState cr')
|
||||
hiss | null poss = id
|
||||
| otherwise = soundMultiFrom [BarrelHiss 0,BarrelHiss 1] 41 50 1
|
||||
| otherwise = soundMultiFrom [BarrelHiss 0,BarrelHiss 1] (_crPos cr) 41 (Just 1)
|
||||
stopSounds = stopSoundFrom (BarrelHiss 0) . stopSoundFrom (BarrelHiss 1)
|
||||
|
||||
damToExpBarrel :: [DamageType] -> Creature -> Creature
|
||||
|
||||
Reference in New Issue
Block a user