Continue tweaking sound
This commit is contained in:
@@ -29,7 +29,7 @@ bezierGun = defaultGun
|
||||
, _itUse = \_ -> useTargetPos $ \p -> shootBezier $ fromJust p -- <- the start point
|
||||
, _itUseModifiers =
|
||||
[ useTimeCheckI
|
||||
, withSoundI tap2S
|
||||
, withSoundStart tap2S
|
||||
, useAmmo 1
|
||||
, withMuzFlareI
|
||||
. withRecoilI 40
|
||||
|
||||
@@ -32,7 +32,7 @@ moveGrenade 0 _ pID w = over projectiles (IM.delete pID)
|
||||
pj = _projectiles w IM.! pID
|
||||
explosion = _pjPayload pj
|
||||
moveGrenade time dir pID w = case hitWl of
|
||||
Just (p,_) -> soundFrom (Tap 0) p tapQuietS Nothing updatedWorld
|
||||
Just (p,_) -> soundStart (Tap 0) p tapQuietS Nothing updatedWorld
|
||||
_ -> updatedWorld
|
||||
where
|
||||
updatedWorld = updateV $ set (projectiles . ix pID . pjPos) finalPos
|
||||
|
||||
@@ -43,7 +43,7 @@ launcher = defaultGun
|
||||
, _itUseModifiers =
|
||||
[ ammoCheckI
|
||||
, useTimeCheckI
|
||||
, withSoundI tap4S
|
||||
, withSoundStart tap4S
|
||||
, useAmmo 1
|
||||
]
|
||||
, _wpSpread = 0.02
|
||||
@@ -107,7 +107,7 @@ doThrust :: Projectile -> World -> World
|
||||
doThrust pj w = w
|
||||
& randGen .~ g
|
||||
& projectiles . ix i . pjVel %~ (\v -> accel +.+ frict *.* v)
|
||||
& soundFrom (ShellSound i) newPos missileLaunchS (Just 1)
|
||||
& soundContinue (ShellSound i) newPos missileLaunchS (Just 1)
|
||||
& makeFlameletTimed (oldPos -.- vel) 0 (vel +.+ rotateV (pi+sparkD) accel) Nothing 3 10
|
||||
& smokeGen
|
||||
where
|
||||
|
||||
@@ -12,7 +12,8 @@ module Dodge.Item.Weapon.TriggerType
|
||||
, torqueBefore
|
||||
, torqueBeforeAtLeast
|
||||
, torqueAfterI
|
||||
, withSoundI
|
||||
, withSoundStart
|
||||
, withSoundContinue
|
||||
, withSoundForI
|
||||
, withThickSmokeI
|
||||
, withThinSmokeI
|
||||
@@ -128,7 +129,7 @@ withWarmUpI soundID f item cr w
|
||||
| _wpReloadState item /= 0 = w
|
||||
| curWarmUp < maxWarmUp = w
|
||||
& pointerToItem . wpCurWarmUp +~ 2
|
||||
& soundFrom (CrWeaponSound cid) (_crPos cr) soundID (Just 2)
|
||||
& soundContinue (CrWeaponSound cid 0) (_crPos cr) soundID (Just 2)
|
||||
| otherwise = w
|
||||
& pointerToItem . wpCurWarmUp .~ maxWarmUp
|
||||
& f item cr
|
||||
@@ -140,11 +141,22 @@ withWarmUpI soundID f item cr w
|
||||
maxWarmUp = _wpMaxWarmUp item
|
||||
{- | Adds a sound to a creature based world effect.
|
||||
The sound is emitted from the creature's position. -}
|
||||
withSoundI
|
||||
withSoundStart
|
||||
:: SoundID -- ^ Sound id
|
||||
-> ChainEffect
|
||||
withSoundI soundid f item cr
|
||||
= soundFrom (CrWeaponSound cid) (_crPos cr) soundid Nothing
|
||||
withSoundStart soundid f item cr
|
||||
= soundMultiFrom [CrWeaponSound cid 0,CrWeaponSound cid 1,CrWeaponSound cid 2] (_crPos cr) soundid Nothing
|
||||
-- = soundStart (CrWeaponSound cid 0) (_crPos cr) soundid Nothing
|
||||
. f item cr
|
||||
where
|
||||
cid = _crID cr
|
||||
{- | Adds a sound to a creature based world effect.
|
||||
The sound is emitted from the creature's position. -}
|
||||
withSoundContinue
|
||||
:: SoundID -- ^ Sound id
|
||||
-> ChainEffect
|
||||
withSoundContinue soundid f item cr
|
||||
= soundContinue (CrWeaponSound cid 0) (_crPos cr) soundid Nothing
|
||||
. f item cr
|
||||
where
|
||||
cid = _crID cr
|
||||
@@ -156,7 +168,7 @@ withSoundForI
|
||||
-> Int -- ^ Frames to play
|
||||
-> ChainEffect
|
||||
withSoundForI soundid playTime f item cr
|
||||
= soundFrom (CrWeaponSound (_crID cr)) (_crPos cr) soundid (Just playTime)
|
||||
= soundContinue (CrWeaponSound (_crID cr) 0) (_crPos cr) soundid (Just playTime)
|
||||
. f item cr
|
||||
|
||||
afterRecoil
|
||||
|
||||
Reference in New Issue
Block a user