diff --git a/GameSettings.cpp b/GameSettings.cpp index dfba5a1d..2302deff 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -289,6 +289,12 @@ void InitGameOptions() } +// WDS: These HAVE to total 100% at all times!!! +#define PROGRESS_PORTION_KILLS 25 +#define PROGRESS_PORTION_CONTROL 25 +#define PROGRESS_PORTION_INCOME 50 + + // Snap: Read options from an INI file in the default of custom Data directory void LoadGameExternalOptions() { @@ -401,6 +407,19 @@ void LoadGameExternalOptions() gGameExternalOptions.iPriceModifier = iniReader.ReadInteger("JA2 Gameplay Settings","PRICE_MODIFIER",10); + // WDS: Game progress + gGameExternalOptions.ubGameProgressPortionKills = iniReader.ReadInteger("JA2 Gameplay Settings","GAME_PROGRESS_KILLS",25); + gGameExternalOptions.ubGameProgressPortionControl = iniReader.ReadInteger("JA2 Gameplay Settings","GAME_PROGRESS_CONTROL",25); + gGameExternalOptions.ubGameProgressPortionIncome = iniReader.ReadInteger("JA2 Gameplay Settings","GAME_PROGRESS_INCOME",50); + + // Any way to warn on this? + if (gGameExternalOptions.ubGameProgressPortionKills + gGameExternalOptions.ubGameProgressPortionControl + gGameExternalOptions.ubGameProgressPortionIncome != 100) + { + gGameExternalOptions.ubGameProgressPortionKills = 25; + gGameExternalOptions.ubGameProgressPortionControl = 25; + gGameExternalOptions.ubGameProgressPortionIncome = 50; + } + //Global game events gGameExternalOptions.ubGameProgressStartMadlabQuest = iniReader.ReadInteger("JA2 Gameplay Settings","GAME_PROGRESS_START_MADLAB_QUEST",35); gGameExternalOptions.ubGameProgressMikeAvailable = iniReader.ReadInteger("JA2 Gameplay Settings","GAME_PROGRESS_MIKE_AVAILABLE",50); diff --git a/GameSettings.h b/GameSettings.h index c8e2cde4..53c9dd22 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -259,6 +259,12 @@ typedef struct UINT32 guiProlongLightningIfSeenSomeone; UINT32 guiChanceToDoLightningBetweenTurns; + // WDS: Progress settings + + UINT32 ubGameProgressPortionKills; + UINT32 ubGameProgressPortionControl; + UINT32 ubGameProgressPortionIncome; + // Event settings UINT32 ubGameProgressStartMadlabQuest; diff --git a/GameVersion.cpp b/GameVersion.cpp index a0428843..01077163 100644 --- a/GameVersion.cpp +++ b/GameVersion.cpp @@ -23,7 +23,7 @@ INT16 zVersionLabel[256] = { L"Beta v. 0.98" }; #else //RELEASE BUILD VERSION - INT16 zVersionLabel[256] = { L"Release v1.13.751" }; + INT16 zVersionLabel[256] = { L"Release v1.13.765" }; #endif diff --git a/Tactical/Campaign.cpp b/Tactical/Campaign.cpp index dee7757b..e4c028d9 100644 --- a/Tactical/Campaign.cpp +++ b/Tactical/Campaign.cpp @@ -1239,9 +1239,10 @@ void HandleUnhiredMercDeaths( INT32 iProfileID ) // These HAVE to total 100% at all times!!! -#define PROGRESS_PORTION_KILLS 25 -#define PROGRESS_PORTION_CONTROL 25 -#define PROGRESS_PORTION_INCOME 50 +//#define PROGRESS_PORTION_KILLS 25 +//#define PROGRESS_PORTION_CONTROL 25 +//#define PROGRESS_PORTION_INCOME 50 +//Lalien: Removed due to externalization // returns a number between 0-100, this is an estimate of how far a player has progressed through the game @@ -1274,7 +1275,7 @@ UINT8 CurrentPlayerProgressPercentage(void) //Kris: Make sure you don't divide by zero!!! if( uiPossibleIncome > 0) { - ubCurrentProgress = (UINT8) ((uiCurrentIncome * PROGRESS_PORTION_INCOME) / uiPossibleIncome); + ubCurrentProgress = (UINT8) ((uiCurrentIncome * gGameExternalOptions.ubGameProgressPortionIncome) / uiPossibleIncome); } else { @@ -1303,9 +1304,9 @@ UINT8 CurrentPlayerProgressPercentage(void) } usKillsProgress = gStrategicStatus.usPlayerKills / ubKillsPerPoint; - if (usKillsProgress > PROGRESS_PORTION_KILLS) + if (usKillsProgress > gGameExternalOptions.ubGameProgressPortionKills) { - usKillsProgress = PROGRESS_PORTION_KILLS; + usKillsProgress = gGameExternalOptions.ubGameProgressPortionKills; } // add kills progress to income progress @@ -1314,9 +1315,9 @@ UINT8 CurrentPlayerProgressPercentage(void) // 19 sectors in mining towns + 3 wilderness SAMs each count double. Balime & Meduna are extra and not required usControlProgress = CalcImportantSectorControl(); - if (usControlProgress > PROGRESS_PORTION_CONTROL) + if (usControlProgress > gGameExternalOptions.ubGameProgressPortionControl) { - usControlProgress = PROGRESS_PORTION_CONTROL; + usControlProgress = gGameExternalOptions.ubGameProgressPortionControl; } // add control progress