From c8207018e328668365527a5690c986ebdee11a59 Mon Sep 17 00:00:00 2001 From: Flugente Date: Wed, 27 Nov 2019 21:46:49 +0000 Subject: [PATCH] Added Battlesounds for melee attacks. For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&goto=358569&#msg_358569 git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8708 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Soldier Ani.cpp | 10 ++++++++++ Tactical/Soldier Control.cpp | 2 ++ Tactical/Soldier Control.h | 2 ++ 3 files changed, 14 insertions(+) diff --git a/Tactical/Soldier Ani.cpp b/Tactical/Soldier Ani.cpp index a03ac359..e6d823d9 100644 --- a/Tactical/Soldier Ani.cpp +++ b/Tactical/Soldier Ani.cpp @@ -2931,6 +2931,16 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier ) { PlaySoldierJA2Sample( pSoldier->ubID, (UINT8)( SWOOSH_1 + Random( 6 ) ), RATE_11025, SoundVolume( HIGHVOLUME, pSoldier->sGridNo ), 1, SoundDir( pSoldier->sGridNo ), TRUE ); } + + // Flugente: play a little sound for melee attacks + if ( !usedWeapon || Item[usedWeapon].usItemClass & IC_PUNCH ) + { + pSoldier->DoMercBattleSound( BATTLE_SOUND_PUNCH ); + } + else if ( Item[usedWeapon].usItemClass & (IC_BLADE | IC_THROWING_KNIFE) ) + { + pSoldier->DoMercBattleSound( BATTLE_SOUND_KNIFE ); + } } break; diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index d7be396f..0208e1be 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -261,6 +261,8 @@ BATTLESNDS_STRUCT gBattleSndsData[] = "lmattn", 1, 0, 1, 0, "locked", 0, 0, 1, 0, "enem", 1, 1, 1, 0, + "punch", 1, 0, 0, 0, + "knife", 1, 0, 0, 0, }; extern void ReduceAttachmentsOnGunForNonPlayerChars( SOLDIERTYPE *pSoldier, OBJECTTYPE * pObj ); diff --git a/Tactical/Soldier Control.h b/Tactical/Soldier Control.h index 04783184..9ec27661 100644 --- a/Tactical/Soldier Control.h +++ b/Tactical/Soldier Control.h @@ -260,6 +260,8 @@ enum BATTLE_SOUND_LOWMARALE_ATTN1, BATTLE_SOUND_LOCKED, BATTLE_SOUND_ENEMY, + BATTLE_SOUND_PUNCH, // Flugente: attacking with punch attack + BATTLE_SOUND_KNIFE, // Flugente: attacking with knife attack NUM_MERC_BATTLE_SOUNDS };