Skip to content

Commit

Permalink
New turret sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
sabianroberts committed Nov 24, 2024
1 parent 20dcb1e commit 56bbe29
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion SourceCode/dlls/turret.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,14 @@ void CBaseTurret::Spawn()
void CBaseTurret::Precache( )
{
PRECACHE_SOUND ("turret/tu_fire1.wav");
PRECACHE_SOUND ("weapons/saw_fire1.wav");
PRECACHE_SOUND ("weapons/saw_fire2.wav");
PRECACHE_SOUND ("weapons/saw_fire3.wav");
PRECACHE_SOUND ("turret/tu_ping.wav");
PRECACHE_SOUND ("turret/tu_active2.wav");
PRECACHE_SOUND ("turret/tu_die.wav");
PRECACHE_SOUND ("turret/tu_die2.wav");
PRECACHE_SOUND ("turret/tu_die3.wav");
// PRECACHE_SOUND ("turret/tu_retract.wav"); // just use deploy sound to save memory
PRECACHE_SOUND ("turret/tu_deploy.wav");
PRECACHE_SOUND ("turret/tu_spinup.wav");
PRECACHE_SOUND ("turret/tu_spindown.wav");
Expand Down Expand Up @@ -629,6 +631,14 @@ void CBaseTurret::ActiveThink(void)
void CTurret::Shoot(Vector &vecSrc, Vector &vecDirToEnemy)
{
FireBullets( 1, vecSrc, vecDirToEnemy, TURRET_SPREAD, TURRET_RANGE, BULLET_MONSTER_12MM, 1 );

switch (RANDOM_LONG(0, 2))
{
case 0: EMIT_SOUND(ENT(pev), CHAN_WEAPON, "weapons/saw_fire1.wav", 1, ATTN_NORM); break;
case 1: EMIT_SOUND(ENT(pev), CHAN_WEAPON, "weapons/saw_fire2.wav", 1, ATTN_NORM); break;
case 2: EMIT_SOUND(ENT(pev), CHAN_WEAPON, "weapons/saw_fire3.wav", 1, ATTN_NORM); break;

}
EMIT_SOUND(ENT(pev), CHAN_WEAPON, "turret/tu_fire1.wav", 1, 0.6);
pev->effects = pev->effects | EF_MUZZLEFLASH;
}
Expand Down

0 comments on commit 56bbe29

Please sign in to comment.