Bugfix: Feature Swap merc faces

When swapping merc faces in tactical the game will now rebuild the mercs squad.

Changed NCTH behaviour for lasers: 

When USE_NEW_CTH_CALCULATION = TRUE in Ja2_Options.ini the game now uses the item property <BestLaserRange> now for a laser specific bonus instead of <ProjectionFactor>. This bonus is a percentage reduction of the base aperture in NCTH. This functionality will only be used if one of the following new parameters in CTHConstants.ini is NOT 0.

LASER_PERFORMANCE_BONUS_HIP
LASER_PERFORMANCE_BONUS_IRON
LASER_PERFORMANCE_BONUS_SCOPE

This functionality also affects the laser property that is displayed in UDB.

Changed NCTH behaviour for Iron Sights and other 1x sights:

Iron sights and other 1x sights can now receive a bonus in NCTH to make them more useful compared to scopes. This bonus is a percentage reduction of the base aperture just like lasers can do.
There is a new parameter in CTHConstants.ini for this:

IRON_SIGHT_PERFORMANCE_BONUS


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6370 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2013-09-07 12:10:45 +00:00
parent 98f9831057
commit 4808850814
20 changed files with 295 additions and 67 deletions
+21 -9
View File
@@ -5188,11 +5188,11 @@ if (gGameExternalOptions.fUseNewCTHCalculation)
// apply bonus from traits
// Flugente: moved trait modifiers into a member function
UINT8 targetprofile = NOBODY;
if ( pTarget && pTarget->ubProfile != NOBODY )
targetprofile = pTarget->ubProfile;
UINT8 targetprofile = NOBODY;
if ( pTarget && pTarget->ubProfile != NOBODY )
targetprofile = pTarget->ubProfile;
fAimModifier += pSoldier->GetTraitCTHModifier( usInHand, ubAimTime, targetprofile );
fAimModifier += pSoldier->GetTraitCTHModifier( usInHand, ubAimTime, targetprofile );
// Flugente: backgrounds
if ( pTarget && pTarget->bTeam == CREATURE_TEAM )
@@ -6098,8 +6098,8 @@ else
iChance = __max(iChance + (INT32)iAimPoints, iChance);
iChance = __min(iChance, (INT32)uiCap);
}
// Impose global limits.
// Impose global limits.
// Flugente: backgrounds
iChance = min(iChance, min(100, gGameExternalOptions.ubMaximumCTH + (UINT8)(pSoldier->GetBackgroundValue(BG_PERC_CTH_MAX))) );
iChance = __max(iChance, gGameExternalOptions.ubMinimumCTH);
@@ -6941,7 +6941,7 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
targetprofile = pTarget->ubProfile;
iChance += pSoldier->GetTraitCTHModifier( usInHand, ubAimTime, targetprofile );
// Flugente: backgrounds
if ( pTarget && pTarget->bTeam == CREATURE_TEAM )
iChance += pSoldier->GetBackgroundValue(BG_PERC_CTH_CREATURE);
@@ -10297,7 +10297,7 @@ UINT32 CalcChanceHTH( SOLDIERTYPE * pAttacker,SOLDIERTYPE *pDefender, INT16 ubAi
else if ( bNumMercs > 0 )
iAttRating += 2;
}
}
}
// Flugente: backgrounds
if (ubMode == HTH_MODE_STAB)
@@ -11898,10 +11898,21 @@ void CalcMagFactorSimple( SOLDIERTYPE *pSoldier, FLOAT d2DDistance, INT16 bAimTi
gCTHDisplay.ScopeMagFactor = iScopeFactor;
iScopeFactor = __min(iScopeFactor, __max(1.0f, iTargetMagFactor/rangeModifier));
iProjectionFactor = CalcProjectionFactor(pSoldier, pWeapon, d2DDistance, (UINT8)bAimTime);
// With the reworked NCTH code we don't want to use iProjectionFactor anymore.
// Instead we use the performance bonus if at least one bonus is != 0. Otherwise -> continue using Projection Factor.
if (gGameExternalOptions.fUseNewCTHCalculation
&& ( gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0 ))
iProjectionFactor = 1.0;
else
iProjectionFactor = CalcProjectionFactor(pSoldier, pWeapon, d2DDistance, (UINT8)bAimTime);
// Set a display variable
gCTHDisplay.ProjectionFactor = iProjectionFactor;
// Set a display variable
gCTHDisplay.iBestLaserRange = GetBestLaserRange( pWeapon );
// The final factor is the largest of the two.
iHighestMagFactor = __max( iScopeFactor, iProjectionFactor );
}
@@ -11909,6 +11920,7 @@ void CalcMagFactorSimple( SOLDIERTYPE *pSoldier, FLOAT d2DDistance, INT16 bAimTi
{
gCTHDisplay.ScopeMagFactor = 1.0;
gCTHDisplay.ProjectionFactor = 1.0;
gCTHDisplay.iBestLaserRange = GetBestLaserRange( pWeapon );
iHighestMagFactor = 1.0;
}