Skip to content

Commit

Permalink
+ explosive fizzle sound
Browse files Browse the repository at this point in the history
  • Loading branch information
brae committed Oct 27, 2020
1 parent 4c7bb93 commit 53c904e
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 0 deletions.
20 changes: 20 additions & 0 deletions mp/game/momentum/scripts/game_sounds_momentum_weapons.txt
Expand Up @@ -76,6 +76,16 @@
"wave" "weapons/mom_rocketlauncher/mom_rocketlauncher-RocketTrail.wav"
}

"Rocket.Fizzle"
{
"channel" "CHAN_STATIC"
"volume" "0.42"
"soundlevel" "SNDLVL_NORM"
"pitch" "70,80"

"wave" "weapons/physcannon/physcannon_dryfire.wav"
}

"Weapon_RL.Explosion"
{
"channel" "CHAN_STATIC"
Expand Down Expand Up @@ -169,6 +179,16 @@

}

"Stickybomb.Fizzle"
{
"channel" "CHAN_STATIC"
"volume" "0.42"
"soundlevel" "SNDLVL_NORM"
"pitch" "70,80"

"wave" "^weapons/physcannon/physcannon_dryfire.wav"
}

"Weapon_Pistol.Single"
{
"channel" "CHAN_WEAPON"
Expand Down
Expand Up @@ -31,6 +31,7 @@ WeaponData
"single_shot" "Weapon_RL.Single"
"explosion" "Weapon_RL.Explosion"
"RocketTrail" "Rocket.Trail"
"RocketFizzle" "Rocket.Fizzle"
}

// Weapon particles
Expand Down
Expand Up @@ -33,6 +33,7 @@ WeaponData
"deny" "StickybombLauncher.Deny"
"charge" "StickybombLauncher.Charge"
"chargestop" "StickybombLauncher.ChargeStop"
"StickyFizzle" "Stickybomb.Fizzle"
}

// Weapon particles
Expand Down
1 change: 1 addition & 0 deletions mp/src/game/shared/momentum/mom_explosive.cpp
Expand Up @@ -137,6 +137,7 @@ void CMomExplosive::Fizzle()
Destroy();

ShowFizzleSprite();
PlayFizzleSound();
}

void CMomExplosive::ShowFizzleSprite()
Expand Down
1 change: 1 addition & 0 deletions mp/src/game/shared/momentum/mom_explosive.h
Expand Up @@ -32,6 +32,7 @@ class CMomExplosive : public CBaseProjectile
virtual void Destroy();
virtual void Fizzle();
virtual void ShowFizzleSprite();
virtual void PlayFizzleSound() {}
virtual void InitExplosive(CBaseEntity *pOwner, const Vector &velocity, const QAngle &angles);

float GetDamage() const { return m_fDamage; }
Expand Down
9 changes: 9 additions & 0 deletions mp/src/game/shared/momentum/mom_rocket.cpp
Expand Up @@ -25,6 +25,7 @@ PRECACHE_WEAPON_REGISTER(momentum_rocket);

#ifdef GAME_DLL
static MAKE_TOGGLE_CONVAR(mom_rj_sound_trail_enable, "1", FCVAR_ARCHIVE, "Toggles the rocket trail sound. 0 = OFF, 1 = ON\n");
static MAKE_TOGGLE_CONVAR(mom_rj_sound_fizzle_enable, "1", FCVAR_ARCHIVE | FCVAR_REPLICATED, "Toggles the rocket fizzle sound. 0 = OFF, 1 = ON\n");
static MAKE_TOGGLE_CONVAR(mom_rj_decals_enable, "1", FCVAR_ARCHIVE, "Toggles creating decals on rocket explosion. 0 = OFF, 1 = ON\n");
#else
static MAKE_TOGGLE_CONVAR(mom_rj_particle_trail_enable, "1", FCVAR_ARCHIVE, "Toggles the rocket trail particle. 0 = OFF, 1 = ON\n");
Expand Down Expand Up @@ -101,6 +102,14 @@ void CMomRocket::Destroy()
BaseClass::Destroy();
}

void CMomRocket::PlayFizzleSound()
{
if (mom_rj_sound_fizzle_enable.GetBool())
{
EmitSound(g_pWeaponDef->GetWeaponSound(WEAPON_ROCKETLAUNCHER, "RocketFizzle"));
}
}

void CMomRocket::Explode(trace_t *pTrace, CBaseEntity *pOther)
{
if (CNoGrenadesZone::IsInsideNoGrenadesZone(this))
Expand Down
1 change: 1 addition & 0 deletions mp/src/game/shared/momentum/mom_rocket.h
Expand Up @@ -21,6 +21,7 @@ class CMomRocket : public CMomExplosive
#else
float GetDamageAmount() override;
void Destroy() override;
void PlayFizzleSound() override;

void RocketTouch(CBaseEntity *pOther);
void Explode(trace_t *pTrace, CBaseEntity *pOther);
Expand Down
10 changes: 10 additions & 0 deletions mp/src/game/shared/momentum/mom_stickybomb.cpp
Expand Up @@ -49,6 +49,7 @@ static MAKE_TOGGLE_CONVAR(mom_sj_particle_trail_enable, "1", FCVAR_ARCHIVE,
"Toggles the sticky trail particle. 0 = OFF, 1 = ON\n");
#else
static MAKE_TOGGLE_CONVAR(mom_sj_decals_enable, "1", FCVAR_ARCHIVE, "Toggles creating decals on sticky explosion. 0 = OFF, 1 = ON\n");
static MAKE_TOGGLE_CONVAR(mom_sj_sound_fizzle_enable, "1", FCVAR_ARCHIVE | FCVAR_REPLICATED, "Toggles the stickybomb fizzle sound. 0 = OFF, 1 = ON\n");
#endif

CMomStickybomb::CMomStickybomb()
Expand Down Expand Up @@ -230,6 +231,15 @@ void CMomStickybomb::InitExplosive(CBaseEntity *pOwner, const Vector &velocity,
void CMomStickybomb::Fizzle()
{
Dissolve(nullptr, gpGlobals->curtime, false, ENTITY_DISSOLVE_CORE);
PlayFizzleSound();
}

void CMomStickybomb::PlayFizzleSound()
{
if (mom_sj_sound_fizzle_enable.GetBool())
{
EmitSound(g_pWeaponDef->GetWeaponSound(WEAPON_STICKYLAUNCHER, "StickyFizzle"));
}
}

void CMomStickybomb::Detonate()
Expand Down
1 change: 1 addition & 0 deletions mp/src/game/shared/momentum/mom_stickybomb.h
Expand Up @@ -39,6 +39,7 @@ class CMomStickybomb : public CMomExplosive

void Explode(trace_t *pTrace, CBaseEntity *pOther);
void Fizzle() override;
void PlayFizzleSound() override;

void Detonate();
void VPhysicsCollision(int index, gamevcollisionevent_t *pEvent) override;
Expand Down

0 comments on commit 53c904e

Please sign in to comment.