- New Feature: Added INI option to enable/disable the use of random mercs stats ("RandomStats.xml")

o INI option: MERCS_RANDOM_STATS (3 values)

0 = Do not use random stats (JA2 vanilla setting)
1 = Use random stats for ALL merc from the file "TableData\RandomStats.xml"
2 = Use random stats for SELECTED merc, that have random stats defined in "TableData\RandomStats.xml"

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5963 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2013-03-27 23:17:15 +00:00
parent 49932ef904
commit 9cc873368d
3 changed files with 71 additions and 61 deletions
+4 -2
View File
@@ -844,11 +844,13 @@ void LoadGameExternalOptions()
gGameExternalOptions.giInsaneMercDeaths = iniReader.ReadInteger("Recruitment Settings","MAX_MERC_DEATHS_INSANE",4, 0, 10);
// CHRISL: New setting to allow Slay to remain as a hired PC
gGameExternalOptions.fEnableSlayForever = iniReader.ReadBoolean("Recruitment Settings", "SLAY_STAYS_FOREVER", FALSE);
gGameExternalOptions.fEnableSlayForever = iniReader.ReadBoolean("Recruitment Settings", "SLAY_STAYS_FOREVER", FALSE);
// Buggler: setting to show/hide skills/traits in AIM & MERC hiring page
gGameExternalOptions.fShowSkillsInHirePage = iniReader.ReadBoolean("Recruitment Settings", "SHOW_SKILLS_IN_HIRING_PAGE", FALSE);
gGameExternalOptions.ubMercRandomStats = iniReader.ReadInteger("Recruitment Settings", "MERCS_RANDOM_STATS", 0, 0, 2);
//################# Financial Settings #################
gGameExternalOptions.iStartingCashNovice = iniReader.ReadInteger("Financial Settings", "STARTING_CASH_NOVICE",45000, 2000, 0x0FFFFFFF);
@@ -1070,7 +1072,7 @@ void LoadGameExternalOptions()
// Flugente: does the queen send out assassins that mix among your militia?
gGameExternalOptions.fEnemyAssassins = iniReader.ReadBoolean("Tactical Difficulty Settings", "ENEMY_ASSASSINS", FALSE);
gGameExternalOptions.usAssassinMinimumProgress = iniReader.ReadInteger("Tactical Difficulty Settings", "ASSASSIN_MINIMUM_PROGRESS", 30, 0, 100);
gGameExternalOptions.usAssassinMinimumProgress = iniReader.ReadInteger("Tactical Difficulty Settings", "ASSASSIN_MINIMUM_PROGRESS", 20, 0, 100);
gGameExternalOptions.usAssassinMinimumMilitia = iniReader.ReadInteger("Tactical Difficulty Settings", "ASSASSIN_MINIMUM_MILITIA", 10, 0, 64);
gGameExternalOptions.usAssassinPropabilityModifier = iniReader.ReadInteger("Tactical Difficulty Settings", "ASSASSIN_PROPABILITY_MODIFIER", 100, 0, 1000);
+2
View File
@@ -1141,6 +1141,8 @@ typedef struct
BOOLEAN fShowSkillsInHirePage;
UINT8 ubMercRandomStats;
BOOLEAN fBobbyRayFastShipments;
BOOLEAN fGridExitInTurnBased;
+65 -59
View File
@@ -433,70 +433,76 @@ BOOLEAN LoadNewSystemMercsToSaveGameFile( HWFILE hFile )
//Random stats
void RandomStats ()
{
UINT32 cnt;
INT8 bBaseAttribute = 0;
MERCPROFILESTRUCT * pProfile;
UINT32 cnt;
INT8 bBaseAttribute = 0;
MERCPROFILESTRUCT * pProfile;
BOOLEAN randomStatsEnabled = FALSE;
for ( cnt = 0; cnt < NUM_PROFILES; cnt++ )
{
if ( gRandomStatsValue[cnt].Enabled == TRUE )
// WANNE: Random Stats are based on the INI entry (MERCS_RANDOM_STATS)
if ((gGameExternalOptions.ubMercRandomStats == 1) || (gGameExternalOptions.ubMercRandomStats == 2 && gRandomStatsValue[cnt].Enabled))
randomStatsEnabled = TRUE;
if ( randomStatsEnabled == TRUE )
{
bBaseAttribute = gRandomStatsValue[cnt].BaseAttribute + ( 4 * gRandomStatsValue[cnt].ExpLevel );
pProfile = &(gMercProfiles[cnt]);
pProfile->bExpLevel = gRandomStatsValue[cnt].ExpLevel;
if ( gRandomStatsValue[cnt].RandomLife == TRUE )
{
bBaseAttribute = gRandomStatsValue[cnt].BaseAttribute + ( 4 * gRandomStatsValue[cnt].ExpLevel );
pProfile = &(gMercProfiles[cnt]);
pProfile->bExpLevel = gRandomStatsValue[cnt].ExpLevel;
if ( gRandomStatsValue[cnt].RandomLife == TRUE )
{
pProfile->bLifeMax = (bBaseAttribute + Random( 9 ) + Random( 8 ));
pProfile->bLife = pProfile->bLifeMax;
}
if ( gRandomStatsValue[cnt].RandomAgility == TRUE )
{
pProfile->bAgility = (bBaseAttribute + Random( 9 ) + Random( 8 ));
}
if ( gRandomStatsValue[cnt].RandomLeadership == TRUE )
{
pProfile->bLeadership = (bBaseAttribute + Random( 9 ) + Random( 8 ));
}
if ( gRandomStatsValue[cnt].RandomDexterity == TRUE )
{
pProfile->bDexterity = (bBaseAttribute + Random( 9 ) + Random( 8 ));
}
if ( gRandomStatsValue[cnt].RandomWisdom == TRUE )
{
pProfile->bWisdom = (bBaseAttribute + Random( 9 ) + Random( 8 ));
}
if ( gRandomStatsValue[cnt].RandomMarksmanship == TRUE )
{
pProfile->bMarksmanship = (bBaseAttribute + Random( 9 ) + Random( 8 ));
}
if ( gRandomStatsValue[cnt].RandomMedical == TRUE )
{
pProfile->bMedical = (bBaseAttribute + Random( 9 ) + Random( 8 ));
}
if ( gRandomStatsValue[cnt].RandomMechanical == TRUE )
{
pProfile->bMechanical = (bBaseAttribute + Random( 9 ) + Random( 8 ));
}
if ( gRandomStatsValue[cnt].RandomExplosive == TRUE )
{
pProfile->bExplosive = (bBaseAttribute + Random( 9 ) + Random( 8 ));
}
if ( gRandomStatsValue[cnt].RandomStrength == TRUE )
{
pProfile->bStrength = (bBaseAttribute + Random( 9 ) + Random( 8 ));
}
pProfile->bLifeMax = (bBaseAttribute + Random( 9 ) + Random( 8 ));
pProfile->bLife = pProfile->bLifeMax;
}
if ( gRandomStatsValue[cnt].RandomAgility == TRUE )
{
pProfile->bAgility = (bBaseAttribute + Random( 9 ) + Random( 8 ));
}
if ( gRandomStatsValue[cnt].RandomLeadership == TRUE )
{
pProfile->bLeadership = (bBaseAttribute + Random( 9 ) + Random( 8 ));
}
if ( gRandomStatsValue[cnt].RandomDexterity == TRUE )
{
pProfile->bDexterity = (bBaseAttribute + Random( 9 ) + Random( 8 ));
}
if ( gRandomStatsValue[cnt].RandomWisdom == TRUE )
{
pProfile->bWisdom = (bBaseAttribute + Random( 9 ) + Random( 8 ));
}
if ( gRandomStatsValue[cnt].RandomMarksmanship == TRUE )
{
pProfile->bMarksmanship = (bBaseAttribute + Random( 9 ) + Random( 8 ));
}
if ( gRandomStatsValue[cnt].RandomMedical == TRUE )
{
pProfile->bMedical = (bBaseAttribute + Random( 9 ) + Random( 8 ));
}
if ( gRandomStatsValue[cnt].RandomMechanical == TRUE )
{
pProfile->bMechanical = (bBaseAttribute + Random( 9 ) + Random( 8 ));
}
if ( gRandomStatsValue[cnt].RandomExplosive == TRUE )
{
pProfile->bExplosive = (bBaseAttribute + Random( 9 ) + Random( 8 ));
}
if ( gRandomStatsValue[cnt].RandomStrength == TRUE )
{
pProfile->bStrength = (bBaseAttribute + Random( 9 ) + Random( 8 ));
}
}
}
}