Skip to content

Commit 6d2baa4

Browse files
committed
Add sounds for Devastator's lock-mode On and Off events
This commit adds a sound for lock-mode disabling. And also provides separate WAV files for lock-mode On and Off. Note: lockmodeon.wav is a copy of reload2.wav lockmodeoff.wav is a copy of autogun_b.wav These files are provided to allow mods to replace them.
1 parent 3043514 commit 6d2baa4

6 files changed

Lines changed: 45 additions & 11 deletions

File tree

reactivedrop/scripts/asw_weapon_devastator.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ WeaponData
2424
{
2525
"empty" "ASW_Weapon.Empty"
2626
"special3" "ASW_Weapon.Reload3" // weapon switch
27-
"burst" "ASW_Weapon.Reload2"
28-
27+
28+
"special1" "ASW_Weapon_Devastator.LockModeOn" // Lock Mode enabled
29+
"burst" "ASW_Weapon_Devastator.LockModeOff" // Lock Mode disabled
30+
2931
"single_shot" "ASW_Weapon_Devastator.SingleFP" // sound for locally controlled marine
3032
"single_shot_npc" "ASW_Weapon_Devastator.Single" // sound for other marines
3133
}

reactivedrop/scripts/game_sounds_asw_weapons.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,24 @@
241241
"wave" "@weapons\2D\devastator\devastatorfp.wav"
242242
}
243243

244+
"ASW_Weapon_Devastator.LockModeOn"
245+
{
246+
"channel" "CHAN_ITEM"
247+
"volume" "1.0"
248+
"soundlevel" "SNDLVL_NORM"
249+
250+
"wave" "weapons\3D\devastator\lockmodeon.wav"
251+
}
252+
253+
"ASW_Weapon_Devastator.LockModeOff"
254+
{
255+
"channel" "CHAN_ITEM"
256+
"volume" "1.0"
257+
"soundlevel" "SNDLVL_NORM"
258+
259+
"wave" "weapons\3D\devastator\lockmodeoff.wav"
260+
}
261+
244262
"ASW_Weapon_Prifle.Single"
245263
{
246264
"channel" "CHAN_WEAPON"
36.3 KB
Binary file not shown.
153 KB
Binary file not shown.

src/game/shared/swarm/asw_weapon_devastator_shared.cpp

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,13 @@ void CASW_Weapon_Devastator::Precache()
7272
PrecacheModel( "swarm/sprites/whiteglow1.vmt" );
7373
PrecacheModel( "swarm/sprites/greylaser1.vmt");
7474
PrecacheScriptSound( "ASW_Weapon.Empty" );
75-
PrecacheScriptSound( "ASW_Weapon.Reload3" );
7675
PrecacheScriptSound( "ASW_Weapon_Devastator.SingleFP" );
7776
PrecacheScriptSound( "ASW_Weapon_Devastator.Single" );
7877
PrecacheScriptSound( "ASW_Weapon_Devastator.ReloadA" );
7978
PrecacheScriptSound( "ASW_Weapon_Devastator.ReloadB" );
8079
PrecacheScriptSound( "ASW_Weapon_Devastator.ReloadC" );
80+
PrecacheScriptSound( "ASW_Weapon_Devastator.LockModeOn" );
81+
PrecacheScriptSound( "ASW_Weapon_Devastator.LockModeOff" );
8182

8283
BaseClass::Precache();
8384
}
@@ -171,21 +172,21 @@ const Vector& CASW_Weapon_Devastator::GetAngularBulletSpread()
171172

172173
bool CASW_Weapon_Devastator::Reload( void )
173174
{
174-
m_bLockedFire = false;
175+
DisableLockFire();
175176

176177
return BaseClass::Reload();
177178
}
178179

179180
bool CASW_Weapon_Devastator::Holster( CBaseCombatWeapon *pSwitchingTo )
180181
{
181-
m_bLockedFire = false;
182+
DisableLockFire();
182183

183184
return BaseClass::Holster( pSwitchingTo );
184185
}
185186

186187
void CASW_Weapon_Devastator::Drop( const Vector &vecVelocity )
187188
{
188-
m_bLockedFire = false;
189+
DisableLockFire();
189190

190191
BaseClass::Drop( vecVelocity );
191192
}
@@ -197,11 +198,11 @@ void CASW_Weapon_Devastator::ItemPostFrame( void )
197198
CASW_Marine* pMarine = GetMarine();
198199
if ( !pMarine || !pMarine->IsAlive() )
199200
{
200-
m_bLockedFire = false;
201+
DisableLockFire();
201202
return;
202203
}
203204
if ( pMarine->GetCurrentMeleeAttack() )
204-
m_bLockedFire = false;
205+
DisableLockFire();
205206
}
206207

207208
void CASW_Weapon_Devastator::ItemBusyFrame( void )
@@ -211,11 +212,11 @@ void CASW_Weapon_Devastator::ItemBusyFrame( void )
211212
CASW_Marine* pMarine = GetMarine();
212213
if ( !pMarine || !pMarine->IsAlive() )
213214
{
214-
m_bLockedFire = false;
215+
DisableLockFire();
215216
return;
216217
}
217218
if ( pMarine->GetCurrentMeleeAttack() )
218-
m_bLockedFire = false;
219+
DisableLockFire();
219220
}
220221

221222
void CASW_Weapon_Devastator::SecondaryAttack()
@@ -227,8 +228,10 @@ void CASW_Weapon_Devastator::SecondaryAttack()
227228
if ( m_bLockedFire )
228229
{
229230
m_flNextPrimaryAttack = gpGlobals->curtime + 0.5f;
230-
WeaponSound( BURST );
231+
WeaponSound( SPECIAL1 );
231232
}
233+
else
234+
WeaponSound( BURST );
232235
}
233236
else
234237
{
@@ -258,3 +261,12 @@ float CASW_Weapon_Devastator::GetFireRate()
258261
return GetEquipItem()->m_flFireRate;
259262
}
260263
}
264+
265+
void CASW_Weapon_Devastator::DisableLockFire()
266+
{
267+
if (m_bLockedFire)
268+
{
269+
m_bLockedFire = false;
270+
WeaponSound( BURST );
271+
}
272+
}

src/game/shared/swarm/asw_weapon_devastator_shared.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ class CASW_Weapon_Devastator : public CASW_Weapon_Assault_Shotgun
4747
virtual Class_T Classify(void) { return (Class_T)CLASS_ASW_DEVASTATOR; }
4848
protected:
4949
CNetworkVar( bool, m_bLockedFire );
50+
51+
void DisableLockFire();
5052
};
5153

5254
#endif // asw_weapon_devastator_shared_h__

0 commit comments

Comments
 (0)