Fix for 1% chance to hit target when distance is > 52

Camo and other effects are taken into account when aiming at a body part
Max Distance Visible is more consistent in being calculated based on the soldier and direction rather than a fixed number

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1239 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
AalaarDB
2007-08-21 10:21:56 +00:00
parent c01ba3f6f1
commit 3f6ff281a3
31 changed files with 361 additions and 610 deletions
+3 -3
View File
@@ -1511,11 +1511,11 @@ INT8 CalcInterruptDuelPts( SOLDIERTYPE * pSoldier, UINT8 ubOpponentID, BOOLEAN f
// this soldier is moving, so give them a bonus for crawling or swatting at long distances
if ( !gbSeenOpponents[ ubOpponentID ][ pSoldier->ubID ] )
{
if (pSoldier->usAnimState == SWATTING && ubDistance > (MaxDistanceVisible() / 2) ) // more than 1/2 sight distance
if (pSoldier->usAnimState == SWATTING && ubDistance > (MaxNormalDistanceVisible() / 2) ) // more than 1/2 sight distance
{
iPoints++;
}
else if (pSoldier->usAnimState == CRAWLING && ubDistance > (MaxDistanceVisible() / 4) ) // more than 1/4 sight distance
else if (pSoldier->usAnimState == CRAWLING && ubDistance > (MaxNormalDistanceVisible() / 4) ) // more than 1/4 sight distance
{
iPoints += ubDistance / STRAIGHT;
}
@@ -1889,7 +1889,7 @@ void ResolveInterruptsVs( SOLDIERTYPE * pSoldier, UINT8 ubInterruptType)
if ( ubInterruptType == NOISEINTERRUPT )
{
// don't grant noise interrupts at greater than max. visible distance
if ( PythSpacesAway( pSoldier->sGridNo, pOpponent->sGridNo ) > MaxDistanceVisible() )
if ( PythSpacesAway( pSoldier->sGridNo, pOpponent->sGridNo ) > MaxNormalDistanceVisible() )
{
pOpponent->bInterruptDuelPts = NO_INTERRUPT;