From 5acabf4a8280f2fe2915126e6d3e7df31cf64c3f Mon Sep 17 00:00:00 2001 From: silversurfer Date: Thu, 5 Sep 2013 09:35:36 +0000 Subject: [PATCH] - added missing merc backgrounds calculation for BG_PERC_CTH_MAX to the reworked NCTH calculation - changed skill handling for disarming bomb traps to rely more on explosives than mechanical in new skill system(old ratio 5:2, new 6:1). Mercs were blowing themselves up to often even when disarming own bombs (big bonus). In the old skill system this ratio is 7:0. - changed skill handling luck factor to make high skilled mercs rely less on luck and more on skill git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6361 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/SkillCheck.cpp | 18 ++++++++++++++---- Tactical/Weapons.cpp | 3 ++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Tactical/SkillCheck.cpp b/Tactical/SkillCheck.cpp index 6d1888d1..91d66dd0 100644 --- a/Tactical/SkillCheck.cpp +++ b/Tactical/SkillCheck.cpp @@ -48,7 +48,7 @@ INT16 EffectiveStrength( SOLDIERTYPE *pSoldier, BOOLEAN fTrainer ) { iEffStrength = 0; } - + iEffStrength = (iEffStrength * (100 + pSoldier->GetBackgroundValue(BG_STRENGTH))) / 100; // ATE: Make sure at least 2... @@ -436,8 +436,13 @@ INT32 SkillCheck( SOLDIERTYPE * pSoldier, INT8 bReason, INT8 bChanceMod ) } else { - iSkill = EffectiveExplosive( pSoldier ) * 5; - iSkill += EffectiveMechanical( pSoldier ) * 2; + // The part that Mechanical plays is a bit too high. A merc with 90+ explosives will still fail + // a lot when his Mechanical is not in the 90+ as well. Even when disarming own mines which provides a bonus + // he will fail a lot which doesn't make sense. Let's change this from 5/2 to 6/1. + //iSkill = EffectiveExplosive( pSoldier ) * 5; + //iSkill += EffectiveMechanical( pSoldier ) * 2; + iSkill = EffectiveExplosive( pSoldier ) * 6; + iSkill += EffectiveMechanical( pSoldier ); } } else @@ -755,7 +760,12 @@ INT32 SkillCheck( SOLDIERTYPE * pSoldier, INT8 bReason, INT8 bChanceMod ) iChance = 0; } - iRoll = PreRandom( 100 ); + // silversurfer: changed this a little. I think this is supposed to represent "luck". + // A soldier that has low skills, attributes and experience should have to rely more on luck + // than someone that knows exactly what he is doing. This will produce more stable results + // for those that are good at their job. + // iRoll = PreRandom( 100 ); + iRoll = PreRandom( UINT32( 115 - iChance / 3 ) ); iMadeItBy = iChance - iRoll; if (iMadeItBy < 0) { diff --git a/Tactical/Weapons.cpp b/Tactical/Weapons.cpp index 414f1fed..342cda3c 100644 --- a/Tactical/Weapons.cpp +++ b/Tactical/Weapons.cpp @@ -5261,7 +5261,8 @@ if (gGameExternalOptions.fUseNewCTHCalculation) } // Impose global limits. - fFinalChance = __min(fFinalChance, gGameExternalOptions.ubMaximumCTH); + // Flugente: backgrounds + fFinalChance = __min(fFinalChance, min(100, gGameExternalOptions.ubMaximumCTH + (UINT8)(pSoldier->GetBackgroundValue(BG_PERC_CTH_MAX))) ); fFinalChance = __max(fFinalChance, gGameExternalOptions.ubMinimumCTH);