Refactor sound

This commit is contained in:
2021-09-12 17:52:34 +01:00
parent ea333a363b
commit 51a85bd1ec
97 changed files with 409 additions and 177 deletions
+17 -17
View File
@@ -8,7 +8,7 @@ import Dodge.Base
import Dodge.Zone
import Dodge.Picture.Layer
import Dodge.SoundLogic
import Dodge.SoundLogic.Synonyms
import Dodge.SoundLogic.LoadSound
import Dodge.Creature.Action
import Dodge.RandomHelp
import Dodge.WorldEvent
@@ -66,7 +66,7 @@ pistol = defaultGun
[ ammoCheckI
, hammerCheckI
, useTimeCheckI
, withSoundI 0
, withSoundI tap3S
, useAmmo 1
, randSpreadDir
, withMuzFlareI
@@ -145,7 +145,7 @@ teslaGun = defaultGun
[ ammoCheckI
, useTimeCheckI
, withTempLight 1 100 (V3 0 0 1)
, withSoundForI 25 1
, withSoundForI elecCrackleS 1
, useAmmo 1
]
, _wpSpread = 0.001
@@ -180,7 +180,7 @@ lasGun = defaultAutoGun
[ ammoCheckI
, useTimeCheckI
, withTempLight 1 100 (V3 1 1 0)
, withSoundForI 24 1
, withSoundForI tone440sawtoothS 1
, useAmmo 1
]
, _wpSpread = 0.001
@@ -296,7 +296,7 @@ hvAutoGun = defaultAutoGun
, _itUseModifiers =
[ ammoCheckI
, rateIncABI 24 7 (torqueBeforeAtLeast 0.1 0.1) (torqueAfterI 0.2)
, withSoundI longGunSound
, withSoundI bangEchoS
, withThinSmokeI
, withMuzFlareI
]
@@ -323,7 +323,7 @@ ltAutoGun = defaultAutoGun
, _itUseModifiers =
[ ammoCheckI
, useTimeCheckI
, withSoundI 0
, withSoundI tap1S
, useAmmo 1
, withRandomDirI 0.1
, torqueAfterI 0.2
@@ -359,10 +359,10 @@ miniGun = defaultAutoGun
, _itUse = useAmmoParamsVelMod vm4
, _itUseModifiers =
[ ammoCheckI
, withWarmUpI 26
, withWarmUpI crankSlowS
, useTimeCheckI
--, afterRecoil recoilAmount
, withSoundForI 28 2
, withSoundForI mini1S 2
--, withThinSmokeI
, torqueAfterI 0.05
, withSidePushI 53
@@ -429,7 +429,7 @@ spreadGun = defaultGun
[ ammoCheckI
, hammerCheckI
, useTimeCheckI
, withSoundI shotgunSound
, withSoundI shotgunS
, useAmmo 1
, withRecoilI 100
, withMuzFlareI
@@ -461,7 +461,7 @@ multGun = defaultGun
[ ammoCheckI
, hammerCheckI
, useTimeCheckI
, withSoundI shotgunSound
, withSoundI shotgunS
, useAmmo 1
, withRecoilI 200
, withMuzFlareI
@@ -499,7 +499,7 @@ longGun = defaultGun
, _wpLoadedAmmo = 1
, _wpReloadTime = 100
, _wpReloadState = 0
, _wpReloadType = PassiveReload skwareFadeTwoSecSound
, _wpReloadType = PassiveReload skwareFadeTwoSecS
, _itUseRate = 100
, _itUseTime = 0
, _itUse = useAmmoParams
@@ -507,7 +507,7 @@ longGun = defaultGun
[ ammoCheckI
, hammerCheckI
, useTimeCheckI
, withSoundI longGunSound
, withSoundI bangEchoS
, useAmmo 1
, withThickSmokeI
, torqueAfterI 0.05
@@ -553,7 +553,7 @@ poisonSprayer = defaultAutoGun
, _itUseModifiers =
[ ammoCheckI
, useTimeCheckI
, withSoundForI foamSpray 5
, withSoundForI foamSprayLoopS 5
, useAmmo 1
, spreadNumI
]
@@ -752,10 +752,10 @@ moveRemoteBomb itid time pID w
$ set (projectiles .ix pID.pjUpdate) (\_ -> moveRemoteBomb itid (f time) pID)
w
| time < 2 = case hitWl of
Just (p,_) -> soundFrom (Tap 0) p tapQuiet Nothing $ halfV updatedWorld
Just (p,_) -> soundFrom (Tap 0) p tapQuietS Nothing $ halfV updatedWorld
_ -> halfV updatedWorld
| otherwise = case hitWl of
Just (p,_) -> soundFrom (Tap 0) p tapQuiet Nothing updatedWorld
Just (p,_) -> soundFrom (Tap 0) p tapQuietS Nothing updatedWorld
_ -> updatedWorld
where
updatedWorld
@@ -875,7 +875,7 @@ fireRemoteLauncher :: Creature -> World -> World
fireRemoteLauncher cr w = setLocation
$ resetFire
$ resetName
$ soundFrom (CrWeaponSound cid) pos launcherSound Nothing
$ soundFrom (CrWeaponSound cid) pos tap4S Nothing
$ over projectiles addRemRocket w
where
i = IM.newKey $ _projectiles w
@@ -923,7 +923,7 @@ moveRemoteShell cid itid pj w
( ( pjVel %~ ( (accel +.+) . (frict *.*) ) )
. ( pjDir .~ newdir )
)
& soundFrom (ShellSound i) newPos smokeTrailSound (Just 1)
& soundFrom (ShellSound i) newPos missileLaunchS (Just 1)
& smokeGen
& makeFlameletTimed oldPos 20 (0.5 *.* rotateV (pi+sparkD) accel) Nothing 3 10
| time > -200 = case thingHit of