From f156660bb3d347f77449989115d92af0432d092c Mon Sep 17 00:00:00 2001 From: rftrdev <102184004+rftrdev@users.noreply.github.com> Date: Fri, 21 Jul 2023 16:42:27 -0700 Subject: [PATCH 1/2] Add optional stat growth reduction at 80+ and 90+ This makes mercs with high base stats more valuable as it is harder to grow to their levels --- GameSettings.cpp | 5 +++++ GameSettings.h | 4 ++++ Tactical/Campaign.cpp | 11 +++++++++++ 3 files changed, 20 insertions(+) diff --git a/GameSettings.cpp b/GameSettings.cpp index 4ba69e16f..3791ae0c7 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -1428,6 +1428,11 @@ void LoadGameExternalOptions() gGameExternalOptions.usLeadershipSubpointsToImprove = iniReader.ReadInteger("Tactical Difficulty Settings","LEADERSHIP_SUBPOINTS_TO_IMPROVE", 25, 1, 1000 ); gGameExternalOptions.usLevelSubpointsToImprove = iniReader.ReadInteger("Tactical Difficulty Settings","LEVEL_SUBPOINTS_TO_IMPROVE", 350, 1, 6500); + // rftr: optionally slow stat growth at 80+ and 90+. this gives more value to mercs with high base stats + gGameExternalOptions.ubMaxGrowthChanceAt80 = iniReader.ReadInteger("Tactical Difficulty Settings", "MAX_GROWTH_CHANCE_AT_80", 100, 1, 100); + gGameExternalOptions.ubMaxGrowthChanceAt90 = iniReader.ReadInteger("Tactical Difficulty Settings", "MAX_GROWTH_CHANCE_AT_90", 100, 1, 100); + + // Alternate algorithm for choosing equipment level. Mostly disregards soldier's class and puts less emphasis on distance from Sector P3. // SANDRO - moved into the game //gGameExternalOptions.fSlowProgressForEnemyItemsChoice = iniReader.ReadBoolean("Tactical Difficulty Settings", "SLOW_PROGRESS_FOR_ENEMY_ITEMS_CHOICE", TRUE); diff --git a/GameSettings.h b/GameSettings.h index 8ca4097e3..5bdeb6dcf 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -1149,6 +1149,10 @@ typedef struct UINT16 usLeadershipSubpointsToImprove; UINT16 usLevelSubpointsToImprove; + // rftr: optionally slow stat growth at 80+ and 90+. this gives more value to mercs with high base stats + UINT8 ubMaxGrowthChanceAt80; + UINT8 ubMaxGrowthChanceAt90; + // HEADROCK HAM B2.7: When turned on, this will give a CTH approximation instead of an exact value, on CTH Bars and "F" key feedback. BOOLEAN fApproximateCTH; diff --git a/Tactical/Campaign.cpp b/Tactical/Campaign.cpp index 3da28dd61..8a7637681 100644 --- a/Tactical/Campaign.cpp +++ b/Tactical/Campaign.cpp @@ -1,3 +1,4 @@ +#pragma optimize("",off) #include "builddefines.h" #include #include @@ -305,6 +306,16 @@ void ProcessStatChange(MERCPROFILESTRUCT *pProfile, UINT8 ubStat, UINT16 usNumCh usChance += (usChance * (pProfile->bWisdom + (pProfile->sWisdomGain / SubpointsPerPoint(WISDOMAMT, pProfile->bExpLevel)) - 50)) / 100; } + // rftr: reduced growth rates at 80+ and 90+ (to make mercs with higher base stats more valuable) + if (bCurrentRating >= 90) + { + usChance = min(min(gGameExternalOptions.ubMaxGrowthChanceAt80, gGameExternalOptions.ubMaxGrowthChanceAt90), usChance); + } + else if (bCurrentRating >= 80) + { + usChance = min(gGameExternalOptions.ubMaxGrowthChanceAt80, usChance); + } + /* // if the stat is Marksmanship, and the guy is a hopeless shot if ((ubStat == MARKAMT) && (pProfile->bSpecialTrait == HOPELESS_SHOT)) From 353373b321a8657ed72d76bd8825c315fa9949ef Mon Sep 17 00:00:00 2001 From: rftrdev <102184004+rftrdev@users.noreply.github.com> Date: Fri, 21 Jul 2023 16:43:01 -0700 Subject: [PATCH 2/2] Remove pragma --- Tactical/Campaign.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Tactical/Campaign.cpp b/Tactical/Campaign.cpp index 8a7637681..d128fb751 100644 --- a/Tactical/Campaign.cpp +++ b/Tactical/Campaign.cpp @@ -1,4 +1,3 @@ -#pragma optimize("",off) #include "builddefines.h" #include #include