mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
Auto Resolve code: added type change missing from previous commit, fixed some compiler warnings.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9210 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -4379,7 +4379,7 @@ BOOLEAN TargetHasLoadedGun( SOLDIERTYPE *pSoldier )
|
|||||||
void AttackTarget( SOLDIERCELL *pAttacker, SOLDIERCELL *pTarget )
|
void AttackTarget( SOLDIERCELL *pAttacker, SOLDIERCELL *pTarget )
|
||||||
{
|
{
|
||||||
INT16 sAttack;
|
INT16 sAttack;
|
||||||
UINT16 sDefence;
|
INT16 sDefence;
|
||||||
UINT8 ubImpact;
|
UINT8 ubImpact;
|
||||||
UINT8 ubLocation;
|
UINT8 ubLocation;
|
||||||
INT16 sAccuracy;
|
INT16 sAccuracy;
|
||||||
@@ -4489,7 +4489,7 @@ void AttackTarget( SOLDIERCELL *pAttacker, SOLDIERCELL *pTarget )
|
|||||||
fCannon = TRUE;
|
fCannon = TRUE;
|
||||||
|
|
||||||
// cannons have a huge splash zone, so they are much more likely to hit
|
// cannons have a huge splash zone, so they are much more likely to hit
|
||||||
sAttack *= 1.5;
|
sAttack = (INT16)(sAttack * 1.5);
|
||||||
}
|
}
|
||||||
// if our target is a tank, we use heavy weapons if we have any
|
// if our target is a tank, we use heavy weapons if we have any
|
||||||
else if ( (ARMED_VEHICLE( pTarget->pSoldier ) || ENEMYROBOT( pTarget->pSoldier )) && FireAntiTankWeapon( pAttacker ) )
|
else if ( (ARMED_VEHICLE( pTarget->pSoldier ) || ENEMYROBOT( pTarget->pSoldier )) && FireAntiTankWeapon( pAttacker ) )
|
||||||
@@ -4497,7 +4497,7 @@ void AttackTarget( SOLDIERCELL *pAttacker, SOLDIERCELL *pTarget )
|
|||||||
fAntiTank = TRUE;
|
fAntiTank = TRUE;
|
||||||
|
|
||||||
// hitting a tank with an rpg isn't easy
|
// hitting a tank with an rpg isn't easy
|
||||||
sAttack *= 0.8;
|
sAttack = (INT16)(sAttack * 0.8);
|
||||||
}
|
}
|
||||||
else if( !FireAShot( pAttacker ) )
|
else if( !FireAShot( pAttacker ) )
|
||||||
{
|
{
|
||||||
@@ -4664,7 +4664,7 @@ void AttackTarget( SOLDIERCELL *pAttacker, SOLDIERCELL *pTarget )
|
|||||||
|
|
||||||
UINT8 ubAmmoType = Magazine[Item[(&pAttacker->pSoldier->inv[pAttacker->bWeaponSlot])->usItem].ubClassIndex].ubAmmoType;
|
UINT8 ubAmmoType = Magazine[Item[(&pAttacker->pSoldier->inv[pAttacker->bWeaponSlot])->usItem].ubClassIndex].ubAmmoType;
|
||||||
|
|
||||||
ubImpact *= AmmoTypes[ubAmmoType].dDamageModifierTank;
|
ubImpact = (UINT8)(ubImpact * AmmoTypes[ubAmmoType].dDamageModifierTank);
|
||||||
|
|
||||||
iRandom = Random( 100 );
|
iRandom = Random( 100 );
|
||||||
if ( iRandom < 15 )
|
if ( iRandom < 15 )
|
||||||
@@ -4715,7 +4715,7 @@ void AttackTarget( SOLDIERCELL *pAttacker, SOLDIERCELL *pTarget )
|
|||||||
if (sDefence >= pTarget->usDefence)
|
if (sDefence >= pTarget->usDefence)
|
||||||
iRandom = PreRandom(sDefence - pTarget->usDefence);
|
iRandom = PreRandom(sDefence - pTarget->usDefence);
|
||||||
else
|
else
|
||||||
iRandom = -PreRandom(pTarget->usDefence - sDefence);
|
iRandom = -(INT16)PreRandom(pTarget->usDefence - sDefence);
|
||||||
|
|
||||||
sAccuracy = (sAttack - sDefence + iRandom) / 10;
|
sAccuracy = (sAttack - sDefence + iRandom) / 10;
|
||||||
|
|
||||||
@@ -4757,7 +4757,7 @@ void AttackTarget( SOLDIERCELL *pAttacker, SOLDIERCELL *pTarget )
|
|||||||
if (sDefence >= pTarget->usDefence)
|
if (sDefence >= pTarget->usDefence)
|
||||||
iRandom = PreRandom(sDefence - pTarget->usDefence);
|
iRandom = PreRandom(sDefence - pTarget->usDefence);
|
||||||
else
|
else
|
||||||
iRandom = -PreRandom(pTarget->usDefence - sDefence);
|
iRandom = -(INT16)PreRandom(pTarget->usDefence - sDefence);
|
||||||
|
|
||||||
sAccuracy = (sAttack - sDefence + iRandom) / 10;
|
sAccuracy = (sAttack - sDefence + iRandom) / 10;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user