Refactor sound
This commit is contained in:
@@ -19,7 +19,7 @@ import Dodge.Base
|
||||
import Dodge.Zone
|
||||
import Dodge.Base.Collide
|
||||
import Dodge.SoundLogic
|
||||
import Dodge.SoundLogic.Synonyms
|
||||
import Dodge.SoundLogic.LoadSound
|
||||
--import Dodge.WorldEvent
|
||||
import Dodge.Inventory
|
||||
--import Dodge.LightSources
|
||||
@@ -167,7 +167,7 @@ blinkAction
|
||||
-> World
|
||||
-> World
|
||||
blinkAction cr w
|
||||
= soundMultiFrom [TeleSound 0,TeleSound 1] p3 teleSound Nothing
|
||||
= soundMultiFrom [TeleSound 0,TeleSound 1] p3 teleS Nothing
|
||||
. over radDistortion (distortionBulge ++)
|
||||
. set (creatures . ix cid . crPos) p3
|
||||
. blinkShockwave cid p3
|
||||
@@ -198,7 +198,7 @@ youDropItem w = case yourItem w of
|
||||
NoItem -> w
|
||||
_ -> rmSelectedInvItem (_yourID w)
|
||||
. copyItemToFloor (you w) (_crInvSel cr)
|
||||
$ soundFrom (CrSound (_crID cr)) (_crPos cr) putDownSound Nothing
|
||||
$ soundFrom (CrSound (_crID cr)) (_crPos cr) whiteNoiseFadeOutS Nothing
|
||||
w
|
||||
where
|
||||
cr = you w
|
||||
@@ -233,7 +233,7 @@ pickUpItem
|
||||
pickUpItem cid flit w = case maybeInvSlot of
|
||||
Nothing -> w
|
||||
Just i -> w
|
||||
& soundFrom (CrSound cid) (_flItPos flit) pickUpSound Nothing
|
||||
& soundFrom (CrSound cid) (_flItPos flit) pickUpS Nothing
|
||||
& updateItLocation i
|
||||
& floorItems %~ IM.delete (_flItID flit)
|
||||
& creatures . ix cid . crInv . ix i %~ addItem it
|
||||
|
||||
@@ -11,7 +11,7 @@ import Dodge.Data.DamageType
|
||||
import Dodge.Creature.State.Data
|
||||
import Dodge.Creature.Stance.Data
|
||||
import Dodge.SoundLogic
|
||||
import Dodge.SoundLogic.Synonyms
|
||||
import Dodge.SoundLogic.LoadSound
|
||||
import Geometry
|
||||
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
@@ -84,5 +84,5 @@ followImpulse cr w imp = case imp of
|
||||
posFromID cid' = _crPos $ _creatures w IM.! cid'
|
||||
rr a = fst $ randomR (-a,a) $ _randGen w
|
||||
hitCr i = over (creatures . ix i . crState . crDamage) (addDam i)
|
||||
. soundFrom (CrSound cid) cpos hitSound Nothing
|
||||
. soundFrom (CrSound cid) cpos hitS Nothing
|
||||
addDam i dams = Blunt 100 cpos (posFromID i) (posFromID i) : dams
|
||||
|
||||
@@ -9,7 +9,7 @@ import Dodge.Creature.Stance.Data
|
||||
--import Dodge.Creature.Test
|
||||
--import Dodge.Base
|
||||
import Dodge.SoundLogic
|
||||
import Dodge.SoundLogic.Synonyms
|
||||
import Dodge.SoundLogic.LoadSound
|
||||
import Dodge.RandomHelp
|
||||
import Dodge.WorldEvent
|
||||
--import Dodge.WallCreatureCollisions
|
||||
@@ -141,7 +141,7 @@ weaponReloadSounds cr w = case _crInv cr IM.!? _crInvSel cr of
|
||||
| otherwise -> w
|
||||
Just Weapon{_wpReloadState = 0} -> w
|
||||
Just Weapon{_wpReloadState = 1} -> stopSoundFrom (CrReloadSound cid) w
|
||||
Just Weapon{} -> soundFrom (CrReloadSound cid) (_crPos cr) reloadSound (Just 1) w
|
||||
Just Weapon{} -> soundFrom (CrReloadSound cid) (_crPos cr) reloadS (Just 1) w
|
||||
_ -> w
|
||||
where
|
||||
cid = _crID cr
|
||||
@@ -223,7 +223,7 @@ updateExpBarrel cr w
|
||||
applyFuseDamage cr' = cr' & crHP %~
|
||||
subtract (length . _piercedPoints . _crSpState $ _crState cr')
|
||||
hiss | null poss = id
|
||||
| otherwise = soundMultiFrom [BarrelHiss 0,BarrelHiss 1] (_crPos cr) 41 (Just 1)
|
||||
| otherwise = soundMultiFrom [BarrelHiss 0,BarrelHiss 1] (_crPos cr) foamSprayLoopS (Just 1)
|
||||
stopSounds = stopSoundFrom (BarrelHiss 0) . stopSoundFrom (BarrelHiss 1)
|
||||
|
||||
damToExpBarrel :: [DamageType] -> Creature -> Creature
|
||||
|
||||
@@ -4,7 +4,9 @@ import Dodge.Data
|
||||
import Dodge.Data.SoundOrigin
|
||||
import Dodge.Creature.Stance.Data
|
||||
import Dodge.SoundLogic
|
||||
import Dodge.SoundLogic.LoadSound
|
||||
import Geometry.Data
|
||||
import Sound.Data
|
||||
|
||||
import Control.Lens
|
||||
|
||||
@@ -36,6 +38,6 @@ makeFootstepSound currentStride maxStride ff p
|
||||
where
|
||||
footor = [FootstepSound 0,FootstepSound 1]
|
||||
|
||||
chooseFootSound :: FootForward -> Int
|
||||
chooseFootSound LeftForward = 22
|
||||
chooseFootSound _ = 23
|
||||
chooseFootSound :: FootForward -> SoundID
|
||||
chooseFootSound LeftForward = foot1S
|
||||
chooseFootSound _ = foot2S
|
||||
|
||||
@@ -5,12 +5,12 @@ import Dodge.Data
|
||||
import Dodge.Base.Collide
|
||||
import Dodge.Creature.Test
|
||||
import Dodge.Creature.Stance.Data
|
||||
import Dodge.SoundLogic.Synonyms
|
||||
import Dodge.SoundLogic.LoadSound
|
||||
import Geometry
|
||||
|
||||
holsterWeapon, drawWeapon :: Action
|
||||
holsterWeapon = DoImpulses [ChangePosture AtEase, MakeSound putDownSound]
|
||||
drawWeapon = DoImpulses [ChangePosture Aiming, MakeSound pickUpSound]
|
||||
holsterWeapon = DoImpulses [ChangePosture AtEase, MakeSound whiteNoiseFadeOutS]
|
||||
drawWeapon = DoImpulses [ChangePosture Aiming, MakeSound whiteNoiseFadeInS]
|
||||
|
||||
fleeFrom :: Creature -> Maybe Creature -> Action
|
||||
fleeFrom cr mtcr = case mtcr of
|
||||
|
||||
Reference in New Issue
Block a user