mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
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:
+18
-9
@@ -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))) );
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
Reference in New Issue
Block a user