- 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
+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 ));
}
}
}
}