mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
Merged from revision: 7155
Custom sounds for non-guns (by anv) - knives, throwing knives, blunt weapons can use attack sounds specified with <sSound> tag - previously their sound was chosen depending on animation used and hardcoded - it should open space for exotic weapons like chainsaws, lawn mowers, jackhammers, etc. If <sSound> is left unspecified, default hardcoded sound will be used normally. - knives, throwing knives, blunt weapons, launchers on attack can cause noise specified with <ubAttackVolume>, previously it was ignored for anything but guns, - small fix for knife/wire cutters combo where using it on empty grid would cause deadlock during battle. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7156 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -2714,7 +2714,18 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier )
|
||||
case 709:
|
||||
|
||||
// Knife throw sound...
|
||||
PlayJA2Sample( Weapon[ THROWING_KNIFE ].sSound, RATE_11025, SoundVolume( HIGHVOLUME, pSoldier->sGridNo ), 1, SoundDir( pSoldier->sGridNo ) );
|
||||
// anv: possiblity to use custom sounds for throwing knives
|
||||
{
|
||||
UINT16 usedWeapon = pSoldier->GetUsedWeaponNumber( &pSoldier->inv[ pSoldier->ubAttackingHand ] );
|
||||
if ( Weapon[ usedWeapon ].sSound != 0 )
|
||||
{
|
||||
PlayJA2Sample( Weapon[ usedWeapon ].sSound, 44100-Random(5000)-Random(5000)-Random(5000), SoundVolume( HIGHVOLUME, pSoldier->sGridNo ), 1, SoundDir( pSoldier->sGridNo ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayJA2Sample( Weapon[ THROWING_KNIFE ].sSound, RATE_11025, SoundVolume( HIGHVOLUME, pSoldier->sGridNo ), 1, SoundDir( pSoldier->sGridNo ) );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 710:
|
||||
@@ -2909,7 +2920,18 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier )
|
||||
case 727:
|
||||
|
||||
// Swoosh
|
||||
PlaySoldierJA2Sample( pSoldier->ubID, (UINT8)( SWOOSH_1 + Random( 6 ) ), RATE_11025, SoundVolume( HIGHVOLUME, pSoldier->sGridNo ), 1, SoundDir( pSoldier->sGridNo ), TRUE );
|
||||
// anv: possiblity to use custom sounds for melee weapons
|
||||
{
|
||||
UINT16 usedWeapon = pSoldier->GetUsedWeaponNumber( &pSoldier->inv[ pSoldier->ubAttackingHand ] );
|
||||
if ( Weapon[ usedWeapon ].sSound != 0 )
|
||||
{
|
||||
PlayJA2Sample( Weapon[ usedWeapon ].sSound, 44100-Random(5000)-Random(5000)-Random(5000), SoundVolume( HIGHVOLUME, pSoldier->sGridNo ), 1, SoundDir( pSoldier->sGridNo ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
PlaySoldierJA2Sample( pSoldier->ubID, (UINT8)( SWOOSH_1 + Random( 6 ) ), RATE_11025, SoundVolume( HIGHVOLUME, pSoldier->sGridNo ), 1, SoundDir( pSoldier->sGridNo ), TRUE );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 728:
|
||||
|
||||
Reference in New Issue
Block a user