From 160829eb536d84c0fbfad87eb2ed45836c2dac3b Mon Sep 17 00:00:00 2001 From: Sevenfm Date: Sat, 18 Jan 2020 06:49:52 +0000 Subject: [PATCH] Added weapon raising sound. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8733 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Soldier Control.cpp | 53 ++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index e8921556..20a02a74 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -5602,6 +5602,59 @@ BOOLEAN SOLDIERTYPE::InternalSoldierReadyWeapon( UINT8 sFacingDir, BOOLEAN fEndR //}// } + // weapon raising sound + if (fReturnVal && + !fEndReady && + this->bVisible >= 0 && + !WeaponReady(this) && + this->inv[HANDPOS].exists() && + this->inv[HANDPOS].usItem && + Item[this->inv[HANDPOS].usItem].usItemClass & IC_GUN) + { + CHAR8 zFilename[512]; + sprintf(zFilename, ""); + + switch (Weapon[Item[this->inv[HANDPOS].usItem].ubClassIndex].ubWeaponType) + { + case GUN_PISTOL: + sprintf(zFilename, "sounds\\equip\\Draw_Pistol.ogg"); + break; + case GUN_M_PISTOL: + sprintf(zFilename, "sounds\\equip\\Draw_MP.ogg"); + break; + case GUN_SMG: + sprintf(zFilename, "sounds\\equip\\Draw_SMG.ogg"); + break; + case GUN_RIFLE: + sprintf(zFilename, "sounds\\equip\\Draw_Rifle.ogg"); + break; + case GUN_SN_RIFLE: + sprintf(zFilename, "sounds\\equip\\Draw_Sniper.ogg"); + break; + case GUN_AS_RIFLE: + sprintf(zFilename, "sounds\\equip\\Draw_AR.ogg"); + break; + case GUN_LMG: + sprintf(zFilename, "sounds\\equip\\Draw_LMG.ogg"); + break; + case GUN_SHOTGUN: + sprintf(zFilename, "sounds\\equip\\Draw_Shotgun.ogg"); + break; + default: + sprintf(zFilename, "sounds\\equip\\Draw.ogg"); + } + + if (!FileExists(zFilename)) + { + sprintf(zFilename, "sounds\\equip\\Draw.ogg"); + } + + if (FileExists(zFilename)) + { + PlayJA2SampleFromFile(zFilename, RATE_11025, SoundVolume(HIGHVOLUME, this->sGridNo), 1, SoundDir(this->sGridNo)); + } + } + return(fReturnVal); }