// Sound Manager.
// Worthless Bums 2013.


// Plays a bullet impact sound effect.
function playBulletImpactSfx ()
{//echo("playBulletImpactSfx()");
	%randomSfx = getRandom(1, 3);
	switch (%randomSfx)
	{
		case 1:	playAudio("Audio:bullet_impact_metal_01", EffectsAudioVolume.value);
		case 2:	playAudio("Audio:bullet_impact_metal_02", EffectsAudioVolume.value);
		case 3:	playAudio("Audio:bullet_impact_metal_03", EffectsAudioVolume.value);
	}
}
// Plays light metal sound effect.
function playMetalLightSfx ()
{//echo("playMetalLightSfx()");
	// Play metal light sound effect.
	%randomSfx = getRandom(1, 4);
	switch (%randomSfx)
	{
		case 1:	playAudio("Audio:fs_metal_light_01", EffectsAudioVolume.value);
		case 2:	playAudio("Audio:fs_metal_light_02", EffectsAudioVolume.value);
		case 3:	playAudio("Audio:fs_metal_light_03", EffectsAudioVolume.value);
		case 4:	playAudio("Audio:fs_metal_light_04", EffectsAudioVolume.value);
	}
}
// Plays a random footstep sound effect.
function playRandomFootstepSfx ()
{//echo("playRandomFootstepSfx()");
	%randomFootStep = getRandom(1, 4);
	%soundFile = "Audio:fs_metal_light_0";
	playAudio(%soundFile @ %randomFootStep, EffectsAudioVolume.value);
}
// Plays a random footstep sound effect.
function playRandomHeavyMetalSfx ()
{//echo("playRandomHeavyMetalSfx()");
	%randomSfx = getRandom(1, 4);
	switch (%randomSfx)
	{
		case 1:	playAudio("Audio:fs_metal_heavy_01", EffectsAudioVolume.value);
		case 2:	playAudio("Audio:fs_metal_heavy_02", EffectsAudioVolume.value);
		case 3:	playAudio("Audio:fs_metal_heavy_03", EffectsAudioVolume.value);
		case 4:	playAudio("Audio:fs_metal_heavy_04", EffectsAudioVolume.value);
	}
}
function playRandomMetalWallCollapseSfx ()
{
	%randomSfx = getRandom(1, 3);
	switch (%randomSfx)
	{
		case 1:	playAudio("Audio:metal_wall_collapse_01", EffectsAudioVolume.value);
		case 2:	playAudio("Audio:metal_wall_collapse_02", EffectsAudioVolume.value);
		case 3:	playAudio("Audio:metal_wall_collapse_03", EffectsAudioVolume.value);
	}
}
// Plays a robot shriek sound effect.
function playRobotShriekSfx ()
{//echo("playRobotShriekSfx()");
	%randomShriek = getRandom(1, 2);
	switch (%randomShriek)
	{
		case 1:	playAudio("Audio:mechanical_monster_shriek_01", EffectsAudioVolume.value);
		case 2:	playAudio("Audio:mechanical_monster_shriek_02", EffectsAudioVolume.value);
	}
}
// Plays a shotgun sound effect.
function playShotGunSfx (%projectileType)
{//echo("playShotGunSfx()");
	switch (%projectileType)
	{
		case $weaponProjectileBallisticType:
			%randomSfx = getRandom(1, 3);
			switch (%randomSfx)
			{
				case 1:	playAudio("Audio:shotgun_shot_01", EffectsAudioVolume.value);
				case 2:	playAudio("Audio:shotgun_shot_02", EffectsAudioVolume.value);
				case 3:	playAudio("Audio:shotgun_shot_03", EffectsAudioVolume.value);
			}
		case $weaponProjectileLaserType:
			playAudio("Audio:LaserBeam", EffectsAudioVolume.value);
		case $weaponProjectilePlasmaType:
			playAudio("Audio:PlasmaBlast", EffectsAudioVolume.value);
		case $weaponProjectileBeamType:
			// Nothing here yet!
	}
}
// Plays a sniper rifle sound effect.
function playSniperRifleSfx (%projectileType)
{//echo("playSniperRifleSfx()");
	switch (%projectileType)
	{
		case $weaponProjectileBallisticType:
			%randomSfx = getRandom(1, 3);
			switch (%randomSfx)
			{
				case 1:	playAudio("Audio:sniper_rifle_shot_01", EffectsAudioVolume.value);
				case 2:	playAudio("Audio:sniper_rifle_shot_02", EffectsAudioVolume.value);
				case 3:	playAudio("Audio:sniper_rifle_shot_03", EffectsAudioVolume.value);
			}
		case $weaponProjectileLaserType:
			playAudio("Audio:LaserBeam", EffectsAudioVolume.value);
		case $weaponProjectilePlasmaType:
			playAudio("Audio:PlasmaBlast", EffectsAudioVolume.value);
		case $weaponProjectileBeamType:
			// Nothing here yet!
	}
}
// Plays a grenade launcher sound effect.
function playGrenadeLauncherSfx (%projectileType)
{//echo("playGrenadeLauncherSfx()");
	switch (%projectileType)
	{
		case $weaponProjectileBallisticType:
			%randomSfx = getRandom(1, 3);
			switch (%randomSfx)
			{
				case 1:	playAudio("Audio:grenade_launcher_01", EffectsAudioVolume.value);
				case 2:	playAudio("Audio:grenade_launcher_02", EffectsAudioVolume.value);
				case 3:	playAudio("Audio:grenade_launcher_03", EffectsAudioVolume.value);
			}
		case $weaponProjectileLaserType:
			playAudio("Audio:LaserBeam", EffectsAudioVolume.value);
		case $weaponProjectilePlasmaType:
			playAudio("Audio:PlasmaBlast", EffectsAudioVolume.value);
		case $weaponProjectileBeamType:
			// Nothing here yet!
	}
}
// Plays a machine gun sound effect.
function playMachineGunSfx (%projectileType)
{//echo("playMachineGunSfx()");
	switch (%projectileType)
	{
		case $weaponProjectileBallisticType:
			%randomSfx = getRandom(1, 3);
			switch (%randomSfx)
			{
				case 1:	playAudio("Audio:machine_gun_01", EffectsAudioVolume.value);
				case 2:	playAudio("Audio:machine_gun_02", EffectsAudioVolume.value);
				case 3:	playAudio("Audio:machine_gun_03", EffectsAudioVolume.value);
			}
		case $weaponProjectileLaserType:
			playAudio("Audio:LaserBeam", EffectsAudioVolume.value);
		case $weaponProjectilePlasmaType:
			playAudio("Audio:PlasmaBlast", EffectsAudioVolume.value);
		case $weaponProjectileBeamType:
			// Nothing here yet!
	}
}
// Plays a submachine gun sound effect.
function playSubMachineGunSfx (%projectileType)
{//echo("playSubMachineGunSfx()");
	switch (%projectileType)
	{
		case $weaponProjectileBallisticType:
			%randomSfx = getRandom(1, 3);
			switch (%randomSfx)
			{
				case 1:	playAudio("Audio:machine_gun_01", EffectsAudioVolume.value);
				case 2:	playAudio("Audio:machine_gun_02", EffectsAudioVolume.value);
				case 3:	playAudio("Audio:machine_gun_03", EffectsAudioVolume.value);
			}
		case $weaponProjectileLaserType:
			playAudio("Audio:engineerLaserFire", EffectsAudioVolume.value);
		case $weaponProjectilePlasmaType:
			playAudio("Audio:PlasmaBlast", EffectsAudioVolume.value);
		case $weaponProjectileBeamType:
			// Nothing here yet!
	}
}
// Plays a random bullet casing drop sound effect.
function playBulletCasingDropSfx ()
{//echo("playBulletCasingDropSfx()");
	%randomSfx = getRandom(1, 2);
	switch (%randomSfx)
	{
		case 1:	playAudio("Audio:bulletCasingDrop1", EffectsAudioVolume.value);
		case 2:	playAudio("Audio:bulletCasingDrop2", EffectsAudioVolume.value);
	}
}
// Plays a random explosion sound effect.
function playExplosionSfx ()
{//echo("playBulletCasingDropSfx()");
	%randomSfx = getRandom(1, 3);
	switch (%randomSfx)
	{
		case 1:	playAudio("Audio:explosion_01", EffectsAudioVolume.value);
		case 2:	playAudio("Audio:explosion_02", EffectsAudioVolume.value);
		case 3:	playAudio("Audio:explosion_03", EffectsAudioVolume.value);
	}
}