mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
- externalized game progress weights
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@765 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -259,6 +259,12 @@ typedef struct
|
||||
UINT32 guiProlongLightningIfSeenSomeone;
|
||||
UINT32 guiChanceToDoLightningBetweenTurns;
|
||||
|
||||
// WDS: Progress settings
|
||||
|
||||
UINT32 ubGameProgressPortionKills;
|
||||
UINT32 ubGameProgressPortionControl;
|
||||
UINT32 ubGameProgressPortionIncome;
|
||||
|
||||
// Event settings
|
||||
|
||||
UINT32 ubGameProgressStartMadlabQuest;
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user