mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
-continued from last commit
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@158 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -7100,3 +7100,40 @@ INT8 FindNightGoggles( SOLDIERTYPE * pSoldier, INT16 bonusToBeat )
|
||||
}
|
||||
return( ITEM_NOT_FOUND );
|
||||
}
|
||||
|
||||
INT16 GetMinRangeForAimBonus( OBJECTTYPE * pObj )
|
||||
{
|
||||
INT16 bns;
|
||||
|
||||
bns = Item[pObj->usItem].minrangeforaimbonus;
|
||||
bns += Item[pObj->usGunAmmoItem].minrangeforaimbonus;
|
||||
|
||||
for (int i = 0; i < MAX_ATTACHMENTS; i++)
|
||||
{
|
||||
bns += Item[pObj->usAttachItem[i]].minrangeforaimbonus;
|
||||
}
|
||||
|
||||
return( bns );
|
||||
}
|
||||
|
||||
UINT8 AllowedAimingLevels(SOLDIERTYPE * pSoldier)
|
||||
{
|
||||
UINT8 aimLevels = 4;
|
||||
OBJECTTYPE obj = pSoldier->inv[pSoldier->ubAttackingHand];
|
||||
|
||||
if ( IsScoped( &obj ) )
|
||||
{
|
||||
if ( GetMinRangeForAimBonus(&obj) >= 60 ) // HACK: Madd: hard coded for now for testing
|
||||
{
|
||||
aimLevels += 2;
|
||||
}
|
||||
|
||||
if ( GetMinRangeForAimBonus(&obj) >= 90 ) // HACK: Madd: hard coded for now for testing
|
||||
{
|
||||
aimLevels += 2;
|
||||
}
|
||||
}
|
||||
|
||||
return aimLevels;
|
||||
}
|
||||
|
||||
|
||||
@@ -288,5 +288,8 @@ UINT16 GetFirstExplosiveOfType(UINT16 expType);
|
||||
INT8 FindSunGoggles( SOLDIERTYPE * pSoldier, INT16 bonusToBeat );
|
||||
INT8 FindNightGoggles( SOLDIERTYPE * pSoldier, INT16 bonusToBeat );
|
||||
|
||||
INT16 GetMinRangeForAimBonus( OBJECTTYPE * pObj );
|
||||
UINT8 AllowedAimingLevels(SOLDIERTYPE * pSoldier);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1687,7 +1687,7 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo )
|
||||
DeductAmmo( pSoldier, pSoldier->ubAttackingHand );
|
||||
|
||||
// ATE: Check if we should say quote...
|
||||
if ( pSoldier->inv[ pSoldier->ubAttackingHand ].ubGunShotsLeft == 0 && !Item[pSoldier->usAttackingWeapon].singleshotrocketlauncher )
|
||||
if ( pSoldier->inv[ pSoldier->ubAttackingHand ].ubGunShotsLeft == 0 && !Item[pSoldier->usAttackingWeapon].rocketlauncher )
|
||||
{
|
||||
if ( pSoldier->bTeam == gbPlayerNum )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user