Background additions:

- <no_male> and <no_female> prohibit specific backgrounds to show up on IMP generation
- <cth_vs_creatures> modifies gun CTH when aiming at creatures
- added wisdom stat modifier
- Fix: maximum cth can never exceed 100

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6359 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2013-09-04 21:13:40 +00:00
parent 5ca8da319c
commit 251d96ccb6
15 changed files with 101 additions and 14 deletions
+18 -9
View File
@@ -5181,14 +5181,15 @@ if (gGameExternalOptions.fUseNewCTHCalculation)
// apply bonus from traits
// Flugente: moved trait modifiers into a member function
if(gGameOptions.fNewTraitSystem)
{
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 )
fAimModifier += pSoldier->GetBackgroundValue(BG_PERC_CTH_CREATURE);
// get aimbonus from target
fAimModifier += CalcNewChanceToHitAimTargetBonus(pSoldier, pTarget, sGridNo, iRange, ubAimPos, fCantSeeTarget);
@@ -5357,6 +5358,10 @@ else
iTraitModifier = pSoldier->GetTraitCTHModifier( usInHand, ubAimTime, targetprofile );
// Flugente: backgrounds
if ( pTarget && pTarget->bTeam == CREATURE_TEAM )
iTraitModifier += pSoldier->GetBackgroundValue(BG_PERC_CTH_CREATURE);
// SHOOTING AT SAME TARGET AGAIN
if (sGridNo == pSoldier->sLastTarget )
iBaseModifier += (FLOAT)gGameCTHConstants.BASE_SAME_TARGET;
@@ -6088,7 +6093,7 @@ else
// Impose global limits.
// Flugente: backgrounds
iChance = min(iChance, gGameExternalOptions.ubMaximumCTH + (UINT8)(pSoldier->GetBackgroundValue(BG_PERC_CTH_MAX)) );
iChance = min(iChance, min(100, gGameExternalOptions.ubMaximumCTH + (UINT8)(pSoldier->GetBackgroundValue(BG_PERC_CTH_MAX))) );
iChance = __max(iChance, gGameExternalOptions.ubMinimumCTH);
return (iChance);
@@ -6920,6 +6925,10 @@ 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);
/////////////////////////////////////////////////////////////////////////////////////
@@ -7452,7 +7461,7 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
// iChance = MAXCHANCETOHIT;
// Flugente: backgrounds
iChance = min(iChance, gGameExternalOptions.ubMaximumCTH + (UINT8)(pSoldier->GetBackgroundValue(BG_PERC_CTH_MAX)) );
iChance = min(iChance, min(100, gGameExternalOptions.ubMaximumCTH + (UINT8)(pSoldier->GetBackgroundValue(BG_PERC_CTH_MAX))) );
}
/////////////////////////////////////////////////////////////////////////////////////