mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
Improved Random Stats Feature (by Buggler)
- Added random starting salaries in Ja2_options.ini - Added more options for random stats & tweaked existing formula git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6070 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+5
-1
@@ -848,7 +848,11 @@ void LoadGameExternalOptions()
|
|||||||
// Buggler: setting to show/hide skills/traits in AIM & MERC hiring page
|
// 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.fShowSkillsInHirePage = iniReader.ReadBoolean("Recruitment Settings", "SHOW_SKILLS_IN_HIRING_PAGE", FALSE);
|
||||||
|
|
||||||
gGameExternalOptions.fMercRandomStats = iniReader.ReadBoolean("Recruitment Settings", "MERCS_RANDOM_STATS", FALSE);
|
gGameExternalOptions.ubMercRandomStats = iniReader.ReadInteger("Recruitment Settings", "MERCS_RANDOM_STATS", 1, 0, 3);
|
||||||
|
gGameExternalOptions.ubMercRandomStatsRange = iniReader.ReadInteger("Recruitment Settings", "MERCS_RANDOM_STAT_RANGE", 10, 0, 50);
|
||||||
|
gGameExternalOptions.ubMercRandomExpRange = iniReader.ReadInteger("Recruitment Settings", "MERCS_RANDOM_EXP_RANGE", 1, 0, 4);
|
||||||
|
gGameExternalOptions.fMercRandomStartSalary = iniReader.ReadBoolean("Recruitment Settings", "MERCS_RANDOM_START_SALARY", TRUE);
|
||||||
|
gGameExternalOptions.ubMercRandomStartSalaryPercentMod = iniReader.ReadInteger("Recruitment Settings", "MERCS_RANDOM_START_SALARY_PERCENTAGE_MAX_MODIFIER", 30, 0, 100);
|
||||||
|
|
||||||
//################# Financial Settings #################
|
//################# Financial Settings #################
|
||||||
|
|
||||||
|
|||||||
+9
-1
@@ -1151,7 +1151,15 @@ typedef struct
|
|||||||
|
|
||||||
BOOLEAN fShowSkillsInHirePage;
|
BOOLEAN fShowSkillsInHirePage;
|
||||||
|
|
||||||
BOOLEAN fMercRandomStats;
|
UINT8 ubMercRandomStats;
|
||||||
|
|
||||||
|
UINT8 ubMercRandomStatsRange;
|
||||||
|
|
||||||
|
UINT8 ubMercRandomExpRange;
|
||||||
|
|
||||||
|
BOOLEAN fMercRandomStartSalary;
|
||||||
|
|
||||||
|
UINT8 ubMercRandomStartSalaryPercentMod;
|
||||||
|
|
||||||
BOOLEAN fBobbyRayFastShipments;
|
BOOLEAN fBobbyRayFastShipments;
|
||||||
|
|
||||||
|
|||||||
+157
-44
@@ -50,6 +50,7 @@
|
|||||||
#include "strategic.h"
|
#include "strategic.h"
|
||||||
#include "strategicmap.h" // added by SANDRO
|
#include "strategicmap.h" // added by SANDRO
|
||||||
#include "drugs and alcohol.h" // added by Flugente
|
#include "drugs and alcohol.h" // added by Flugente
|
||||||
|
#include "Campaign.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "aim.h"
|
#include "aim.h"
|
||||||
@@ -96,7 +97,9 @@ extern UINT8 gubItemDroppableFlag[NUM_INV_SLOTS];
|
|||||||
|
|
||||||
//Random Stats
|
//Random Stats
|
||||||
RANDOM_STATS_VALUES gRandomStatsValue[NUM_PROFILES];
|
RANDOM_STATS_VALUES gRandomStatsValue[NUM_PROFILES];
|
||||||
void RandomStats ();
|
void RandomStats();
|
||||||
|
|
||||||
|
void RandomStartSalary();
|
||||||
|
|
||||||
INT8 gbSkillTraitBonus[NUM_SKILLTRAITS_OT] =
|
INT8 gbSkillTraitBonus[NUM_SKILLTRAITS_OT] =
|
||||||
{
|
{
|
||||||
@@ -425,75 +428,182 @@ BOOLEAN LoadNewSystemMercsToSaveGameFile( HWFILE hFile )
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Random stats
|
//Random stats
|
||||||
void RandomStats ()
|
void RandomStats()
|
||||||
{
|
{
|
||||||
UINT32 cnt;
|
UINT32 cnt;
|
||||||
INT8 bBaseAttribute = 0;
|
INT8 bBaseAttribute = 0;
|
||||||
MERCPROFILESTRUCT * pProfile;
|
MERCPROFILESTRUCT * pProfile;
|
||||||
|
UINT8 Exp = gGameExternalOptions.ubMercRandomExpRange;
|
||||||
|
UINT8 Stats = gGameExternalOptions.ubMercRandomStatsRange;
|
||||||
|
|
||||||
for ( cnt = 0; cnt < NUM_PROFILES; cnt++ )
|
// not randomizing
|
||||||
|
if ( gGameExternalOptions.ubMercRandomStats == 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// full stats random for all soldierIDs
|
||||||
|
else if ( gGameExternalOptions.ubMercRandomStats == 1 )
|
||||||
{
|
{
|
||||||
if (gGameExternalOptions.fMercRandomStats == TRUE && gRandomStatsValue[cnt].Enabled)
|
for ( cnt = 0; cnt < NUM_PROFILES; cnt++ )
|
||||||
{
|
{
|
||||||
bBaseAttribute = gRandomStatsValue[cnt].BaseAttribute + ( 4 * gRandomStatsValue[cnt].ExpLevel );
|
|
||||||
pProfile = &(gMercProfiles[cnt]);
|
pProfile = &(gMercProfiles[cnt]);
|
||||||
|
// Buggler: +/- random range will be limited due to proximity to min/max allowed value, slightly different for EXP as can ignore 0
|
||||||
|
pProfile->bExpLevel += Random( 2 * min( Exp, min( 9 - pProfile->bExpLevel, pProfile->bExpLevel - 1 ) ) + 1 ) - min( Exp, min( 9 - pProfile->bExpLevel, pProfile->bExpLevel - 1 ) );
|
||||||
|
pProfile->bLifeMax += Random( 2 * min( Stats, min( 100 - pProfile->bLifeMax, max( 0, pProfile->bLifeMax - 1 ) ) ) + 1 ) - min( Stats, min( 100 - pProfile->bLifeMax, max( 0, pProfile->bLifeMax - 1 ) ) );
|
||||||
|
pProfile->bLife = pProfile->bLifeMax;
|
||||||
|
pProfile->bAgility += Random( 2 * min( Stats, min( 100 - pProfile->bAgility, max( 0, pProfile->bAgility - 1 ) ) ) + 1 ) - min( Stats, min( 100 - pProfile->bAgility, max( 0, pProfile->bAgility - 1 ) ) );
|
||||||
|
pProfile->bDexterity += Random( 2 * min( Stats, min( 100 - pProfile->bDexterity, max( 0, pProfile->bDexterity - 1 ) ) ) + 1 ) - min( Stats, min( 100 - pProfile->bDexterity, max( 0, pProfile->bDexterity - 1 ) ) );
|
||||||
|
pProfile->bStrength += Random( 2 * min( Stats, min( 100 - pProfile->bStrength, max( 0, pProfile->bStrength - 1 ) ) ) + 1 ) - min( Stats, min( 100 - pProfile->bStrength, max( 0, pProfile->bStrength - 1 ) ) );
|
||||||
|
pProfile->bLeadership += Random( 2 * min( Stats, min( 100 - pProfile->bLeadership, max( 0, pProfile->bLeadership - 1 ) ) ) + 1 ) - min( Stats, min( 100 - pProfile->bLeadership, max( 0, pProfile->bLeadership - 1 ) ) );
|
||||||
|
pProfile->bWisdom += Random( min( Stats, 2 * min( 100 - pProfile->bWisdom, max( 0, pProfile->bWisdom - 1 ) ) ) + 1 ) - min( Stats, min( 100 - pProfile->bWisdom, max( 0, pProfile->bWisdom - 1 ) ) );
|
||||||
|
pProfile->bMarksmanship += Random( 2 * min( Stats, min( 100 - pProfile->bMarksmanship, max( 0, pProfile->bMarksmanship - 1 ) ) ) + 1 ) - min( Stats, min( 100 - pProfile->bMarksmanship, max( 0, pProfile->bMarksmanship - 1 ) ) );
|
||||||
|
pProfile->bMechanical += Random( 2 * min( Stats, min( 100 - pProfile->bMechanical, max( 0, pProfile->bMechanical - 1 ) ) ) + 1 ) - min( Stats, min( 100 - pProfile->bMechanical, max( 0, pProfile->bMechanical - 1 ) ) );
|
||||||
|
pProfile->bExplosive += Random( 2 * min( Stats, min( 100 - pProfile->bExplosive, max( 0, pProfile->bExplosive - 1 ) ) ) + 1 ) - min( Stats, min( 100 - pProfile->bExplosive, max( 0, pProfile->bExplosive - 1 ) ) );
|
||||||
|
pProfile->bMedical += Random( 2 * min( Stats, min( 100 - pProfile->bMedical, max( 0, pProfile->bMedical - 1 ) ) ) + 1 ) - min( Stats, min( 100 - pProfile->bMedical, max( 0, pProfile->bMedical - 1 ) ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pProfile->bExpLevel = gRandomStatsValue[cnt].ExpLevel;
|
// partial stats random based on XML stat tag
|
||||||
|
else if ( gGameExternalOptions.ubMercRandomStats == 2 )
|
||||||
if ( gRandomStatsValue[cnt].RandomLife == TRUE )
|
{
|
||||||
|
for ( cnt = 0; cnt < NUM_PROFILES; cnt++ )
|
||||||
|
{
|
||||||
|
if ( gRandomStatsValue[cnt].Enabled )
|
||||||
{
|
{
|
||||||
pProfile->bLifeMax = (bBaseAttribute + Random( 9 ) + Random( 8 ));
|
pProfile = &(gMercProfiles[cnt]);
|
||||||
pProfile->bLife = pProfile->bLifeMax;
|
|
||||||
|
if ( gRandomStatsValue[cnt].RandomExpLevel == TRUE )
|
||||||
|
pProfile->bExpLevel += Random( 2 * min( Exp, min( 9 - pProfile->bExpLevel, pProfile->bExpLevel - 1 ) ) + 1 ) - min( Exp, min( 9 - pProfile->bExpLevel, pProfile->bExpLevel - 1 ) );
|
||||||
|
|
||||||
|
if ( gRandomStatsValue[cnt].RandomLife == TRUE )
|
||||||
|
pProfile->bLifeMax += Random( 2 * min( Stats, min( 100 - pProfile->bLifeMax, max( 0, pProfile->bLifeMax - 1 ) ) ) + 1 ) - min( Stats, min( 100 - pProfile->bLifeMax, max( 0, pProfile->bLifeMax - 1 ) ) );
|
||||||
|
pProfile->bLife = pProfile->bLifeMax;
|
||||||
|
|
||||||
|
if ( gRandomStatsValue[cnt].RandomAgility == TRUE )
|
||||||
|
pProfile->bAgility += Random( 2 * min( Stats, min( 100 - pProfile->bAgility, max( 0, pProfile->bAgility - 1 ) ) ) + 1 ) - min( Stats, min( 100 - pProfile->bAgility, max( 0, pProfile->bAgility - 1 ) ) );
|
||||||
|
|
||||||
|
if ( gRandomStatsValue[cnt].RandomDexterity == TRUE )
|
||||||
|
pProfile->bDexterity += Random( 2 * min( Stats, min( 100 - pProfile->bDexterity, max( 0, pProfile->bDexterity - 1 ) ) ) + 1 ) - min( Stats, min( 100 - pProfile->bDexterity, max( 0, pProfile->bDexterity - 1 ) ) );
|
||||||
|
|
||||||
|
if ( gRandomStatsValue[cnt].RandomStrength == TRUE )
|
||||||
|
pProfile->bStrength += Random( 2 * min( Stats, min( 100 - pProfile->bStrength, max( 0, pProfile->bStrength - 1 ) ) ) + 1 ) - min( Stats, min( 100 - pProfile->bStrength, max( 0, pProfile->bStrength - 1 ) ) );
|
||||||
|
|
||||||
|
if ( gRandomStatsValue[cnt].RandomLeadership == TRUE )
|
||||||
|
pProfile->bLeadership += Random( 2 * min( Stats, min( 100 - pProfile->bLeadership, max( 0, pProfile->bLeadership - 1 ) ) ) + 1 ) - min( Stats, min( 100 - pProfile->bLeadership, max( 0, pProfile->bLeadership - 1 ) ) );
|
||||||
|
|
||||||
|
if ( gRandomStatsValue[cnt].RandomWisdom == TRUE )
|
||||||
|
pProfile->bWisdom += Random( min( Stats, 2 * min( 100 - pProfile->bWisdom, max( 0, pProfile->bWisdom - 1 ) ) ) + 1 ) - min( Stats, min( 100 - pProfile->bWisdom, max( 0, pProfile->bWisdom - 1 ) ) );
|
||||||
|
|
||||||
|
if ( gRandomStatsValue[cnt].RandomMarksmanship == TRUE )
|
||||||
|
pProfile->bMarksmanship += Random( 2 * min( Stats, min( 100 - pProfile->bMarksmanship, max( 0, pProfile->bMarksmanship - 1 ) ) ) + 1 ) - min( Stats, min( 100 - pProfile->bMarksmanship, max( 0, pProfile->bMarksmanship - 1 ) ) );
|
||||||
|
|
||||||
|
if ( gRandomStatsValue[cnt].RandomMechanical == TRUE )
|
||||||
|
pProfile->bMechanical += Random( 2 * min( Stats, min( 100 - pProfile->bMechanical, max( 0, pProfile->bMechanical - 1 ) ) ) + 1 ) - min( Stats, min( 100 - pProfile->bMechanical, max( 0, pProfile->bMechanical - 1 ) ) );
|
||||||
|
|
||||||
|
if ( gRandomStatsValue[cnt].RandomExplosive == TRUE )
|
||||||
|
pProfile->bExplosive += Random( 2 * min( Stats, min( 100 - pProfile->bExplosive, max( 0, pProfile->bExplosive - 1 ) ) ) + 1 ) - min( Stats, min( 100 - pProfile->bExplosive, max( 0, pProfile->bExplosive - 1 ) ) );
|
||||||
|
|
||||||
|
if ( gRandomStatsValue[cnt].RandomMedical == TRUE )
|
||||||
|
pProfile->bMedical += Random( 2 * min( Stats, min( 100 - pProfile->bMedical, max( 0, pProfile->bMedical - 1 ) ) ) + 1 ) - min( Stats, min( 100 - pProfile->bMedical, max( 0, pProfile->bMedical - 1 ) ) );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( gRandomStatsValue[cnt].RandomAgility == TRUE )
|
// Buggler: tweaked Jazz's random code
|
||||||
|
else if ( gGameExternalOptions.ubMercRandomStats == 3 )
|
||||||
|
{
|
||||||
|
for ( cnt = 0; cnt < NUM_PROFILES; cnt++ )
|
||||||
|
{
|
||||||
|
if ( gRandomStatsValue[cnt].Enabled )
|
||||||
{
|
{
|
||||||
pProfile->bAgility = (bBaseAttribute + Random( 9 ) + Random( 8 ));
|
pProfile = &(gMercProfiles[cnt]);
|
||||||
}
|
|
||||||
|
|
||||||
if ( gRandomStatsValue[cnt].RandomLeadership == TRUE )
|
if ( gRandomStatsValue[cnt].RandomExpLevel == TRUE )
|
||||||
{
|
pProfile->bExpLevel += Random( 2 * min( Exp, min( 9 - pProfile->bExpLevel, pProfile->bExpLevel - 1 ) ) + 1 ) - min( Exp, min( 9 - pProfile->bExpLevel, pProfile->bExpLevel - 1 ) );
|
||||||
pProfile->bLeadership = (bBaseAttribute + Random( 9 ) + Random( 8 ));
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( gRandomStatsValue[cnt].RandomDexterity == TRUE )
|
bBaseAttribute = gRandomStatsValue[cnt].BaseAttribute + ( 4 * pProfile->bExpLevel );
|
||||||
{
|
|
||||||
pProfile->bDexterity = (bBaseAttribute + Random( 9 ) + Random( 8 ));
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( gRandomStatsValue[cnt].RandomWisdom == TRUE )
|
if ( gRandomStatsValue[cnt].RandomLife == TRUE )
|
||||||
{
|
{
|
||||||
pProfile->bWisdom = (bBaseAttribute + Random( 9 ) + Random( 8 ));
|
pProfile->bLifeMax = (bBaseAttribute + Random( 9 ) + Random( 8 ));
|
||||||
}
|
pProfile->bLife = pProfile->bLifeMax;
|
||||||
|
}
|
||||||
|
|
||||||
if ( gRandomStatsValue[cnt].RandomMarksmanship == TRUE )
|
if ( gRandomStatsValue[cnt].RandomAgility == TRUE )
|
||||||
{
|
{
|
||||||
pProfile->bMarksmanship = (bBaseAttribute + Random( 9 ) + Random( 8 ));
|
pProfile->bAgility = (bBaseAttribute + Random( 9 ) + Random( 8 ));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( gRandomStatsValue[cnt].RandomMedical == TRUE )
|
if ( gRandomStatsValue[cnt].RandomDexterity == TRUE )
|
||||||
{
|
{
|
||||||
pProfile->bMedical = (bBaseAttribute + Random( 9 ) + Random( 8 ));
|
pProfile->bDexterity = (bBaseAttribute + Random( 9 ) + Random( 8 ));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( gRandomStatsValue[cnt].RandomMechanical == TRUE )
|
if ( gRandomStatsValue[cnt].RandomStrength == TRUE )
|
||||||
{
|
{
|
||||||
pProfile->bMechanical = (bBaseAttribute + Random( 9 ) + Random( 8 ));
|
pProfile->bStrength = (bBaseAttribute + Random( 9 ) + Random( 8 ));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( gRandomStatsValue[cnt].RandomExplosive == TRUE )
|
if ( gRandomStatsValue[cnt].RandomLeadership == TRUE )
|
||||||
{
|
{
|
||||||
pProfile->bExplosive = (bBaseAttribute + Random( 9 ) + Random( 8 ));
|
pProfile->bLeadership = (bBaseAttribute + Random( 9 ) + Random( 8 ));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( gRandomStatsValue[cnt].RandomStrength == TRUE )
|
if ( gRandomStatsValue[cnt].RandomWisdom == TRUE )
|
||||||
{
|
{
|
||||||
pProfile->bStrength = (bBaseAttribute + Random( 9 ) + Random( 8 ));
|
pProfile->bWisdom = (bBaseAttribute + Random( 9 ) + Random( 8 ));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( gRandomStatsValue[cnt].RandomMarksmanship == TRUE )
|
||||||
|
{
|
||||||
|
pProfile->bMarksmanship = (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].RandomMedical == TRUE )
|
||||||
|
{
|
||||||
|
pProfile->bMedical = (bBaseAttribute + Random( 9 ) + Random( 8 ));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RandomStartSalary()
|
||||||
|
{
|
||||||
|
UINT32 cnt;
|
||||||
|
MERCPROFILESTRUCT * pProfile;
|
||||||
|
|
||||||
|
// Buggler: random starting salary
|
||||||
|
if ( gGameExternalOptions.fMercRandomStartSalary == TRUE )
|
||||||
|
{
|
||||||
|
UINT8 SalaryPercentMod = gGameExternalOptions.ubMercRandomStartSalaryPercentMod;
|
||||||
|
FLOAT SalaryMod;
|
||||||
|
|
||||||
|
for ( cnt = 0; cnt < NUM_PROFILES; cnt++ )
|
||||||
|
{
|
||||||
|
pProfile = &(gMercProfiles[cnt]);
|
||||||
|
SalaryMod = 1 + ( (FLOAT) Random ( 2 * SalaryPercentMod + 1 ) - (FLOAT) SalaryPercentMod ) / 100;
|
||||||
|
// random non-zero salary
|
||||||
|
if ( pProfile->sSalary |= 0 )
|
||||||
|
pProfile->sSalary = RoundOffSalary( (UINT32)( pProfile->sSalary * SalaryMod ) );
|
||||||
|
if ( pProfile->uiWeeklySalary |= 0 )
|
||||||
|
pProfile->uiWeeklySalary = RoundOffSalary( (UINT32)( pProfile->uiWeeklySalary * SalaryMod ) );
|
||||||
|
if ( pProfile->uiBiWeeklySalary |= 0 )
|
||||||
|
pProfile->uiBiWeeklySalary = RoundOffSalary( (UINT32)( pProfile->uiBiWeeklySalary * SalaryMod ) );
|
||||||
|
if ( pProfile->sTrueSalary |= 0 )
|
||||||
|
pProfile->sTrueSalary = RoundOffSalary( (UINT32)( pProfile->sTrueSalary * SalaryMod ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// WANNE - BMP: DONE!
|
// WANNE - BMP: DONE!
|
||||||
BOOLEAN LoadMercProfiles(void)
|
BOOLEAN LoadMercProfiles(void)
|
||||||
{
|
{
|
||||||
@@ -932,6 +1042,9 @@ for( int i = 0; i < NUM_PROFILES; i++ )
|
|||||||
|
|
||||||
RandomStats (); //random stats by Jazz
|
RandomStats (); //random stats by Jazz
|
||||||
|
|
||||||
|
// Buggler: random starting salary
|
||||||
|
RandomStartSalary ();
|
||||||
|
|
||||||
// decide which terrorists are active
|
// decide which terrorists are active
|
||||||
DecideActiveTerrorists();
|
DecideActiveTerrorists();
|
||||||
|
|
||||||
|
|||||||
@@ -10,19 +10,18 @@ typedef struct
|
|||||||
UINT16 uiIndex;
|
UINT16 uiIndex;
|
||||||
BOOLEAN Enabled;
|
BOOLEAN Enabled;
|
||||||
INT8 BaseAttribute;
|
INT8 BaseAttribute;
|
||||||
INT8 ExpLevel;
|
BOOLEAN RandomExpLevel;
|
||||||
BOOLEAN RandomLife;
|
BOOLEAN RandomLife;
|
||||||
BOOLEAN RandomAgility;
|
BOOLEAN RandomAgility;
|
||||||
BOOLEAN RandomLeadership;
|
|
||||||
BOOLEAN RandomDexterity;
|
BOOLEAN RandomDexterity;
|
||||||
|
BOOLEAN RandomStrength;
|
||||||
|
BOOLEAN RandomLeadership;
|
||||||
BOOLEAN RandomWisdom;
|
BOOLEAN RandomWisdom;
|
||||||
BOOLEAN RandomMarksmanship;
|
BOOLEAN RandomMarksmanship;
|
||||||
BOOLEAN RandomMedical;
|
|
||||||
BOOLEAN RandomMechanical;
|
BOOLEAN RandomMechanical;
|
||||||
BOOLEAN RandomExplosive;
|
BOOLEAN RandomExplosive;
|
||||||
|
BOOLEAN RandomMedical;
|
||||||
BOOLEAN RandomScientific;
|
BOOLEAN RandomScientific;
|
||||||
BOOLEAN RandomStrength;
|
|
||||||
|
|
||||||
} RANDOM_STATS_VALUES;
|
} RANDOM_STATS_VALUES;
|
||||||
|
|
||||||
extern RANDOM_STATS_VALUES gRandomStatsValue[NUM_PROFILES];
|
extern RANDOM_STATS_VALUES gRandomStatsValue[NUM_PROFILES];
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ RandomStatsStartElementHandle(void *userData, const XML_Char *name, const XML_Ch
|
|||||||
|
|
||||||
pData->maxReadDepth++; //we are not skipping this element
|
pData->maxReadDepth++; //we are not skipping this element
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "PROFIL") == 0 && pData->curElement == ELEMENT_LIST)
|
else if(strcmp(name, "PROFILE") == 0 && pData->curElement == ELEMENT_LIST)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
|
|
||||||
@@ -52,18 +52,19 @@ RandomStatsStartElementHandle(void *userData, const XML_Char *name, const XML_Ch
|
|||||||
( strcmp(name, "uiIndex") == 0 ||
|
( strcmp(name, "uiIndex") == 0 ||
|
||||||
strcmp(name, "Enabled") == 0 ||
|
strcmp(name, "Enabled") == 0 ||
|
||||||
strcmp(name, "BaseAttribute") == 0 ||
|
strcmp(name, "BaseAttribute") == 0 ||
|
||||||
strcmp(name, "ExpLevel") == 0 ||
|
strcmp(name, "RandomExpLevel") == 0 ||
|
||||||
strcmp(name, "RandomLife") == 0 ||
|
strcmp(name, "RandomLife") == 0 ||
|
||||||
strcmp(name, "RandomAgility") == 0 ||
|
strcmp(name, "RandomAgility") == 0 ||
|
||||||
|
strcmp(name, "RandomDexterity") == 0 ||
|
||||||
|
strcmp(name, "RandomStrength") == 0 ||
|
||||||
strcmp(name, "RandomLeadership") == 0 ||
|
strcmp(name, "RandomLeadership") == 0 ||
|
||||||
strcmp(name, "RandomDexterity") == 0 ||
|
|
||||||
strcmp(name, "RandomWisdom") == 0 ||
|
strcmp(name, "RandomWisdom") == 0 ||
|
||||||
strcmp(name, "RandomMarksmanship") == 0 ||
|
strcmp(name, "RandomMarksmanship") == 0 ||
|
||||||
strcmp(name, "RandomMedical") == 0 ||
|
|
||||||
strcmp(name, "RandomMechanical") == 0 ||
|
strcmp(name, "RandomMechanical") == 0 ||
|
||||||
strcmp(name, "RandomExplosive") == 0 ||
|
strcmp(name, "RandomExplosive") == 0 ||
|
||||||
strcmp(name, "RandomScientific") == 0 ||
|
strcmp(name, "RandomMedical") == 0 ||
|
||||||
strcmp(name, "RandomStrength") == 0 ) )
|
strcmp(name, "RandomScientific") == 0 ) )
|
||||||
|
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT_PROPERTY;
|
pData->curElement = ELEMENT_PROPERTY;
|
||||||
|
|
||||||
@@ -101,23 +102,23 @@ RandomStatsEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
{
|
{
|
||||||
pData->curElement = ELEMENT_NONE;
|
pData->curElement = ELEMENT_NONE;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "PROFIL") == 0)
|
else if(strcmp(name, "PROFILE") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT_LIST;
|
pData->curElement = ELEMENT_LIST;
|
||||||
|
|
||||||
gRandomStatsValue[pData->curRandomStats.uiIndex].Enabled = pData->curRandomStats.Enabled;
|
gRandomStatsValue[pData->curRandomStats.uiIndex].Enabled = pData->curRandomStats.Enabled;
|
||||||
gRandomStatsValue[pData->curRandomStats.uiIndex].BaseAttribute = pData->curRandomStats.BaseAttribute;
|
gRandomStatsValue[pData->curRandomStats.uiIndex].BaseAttribute = pData->curRandomStats.BaseAttribute;
|
||||||
gRandomStatsValue[pData->curRandomStats.uiIndex].ExpLevel = pData->curRandomStats.ExpLevel;
|
gRandomStatsValue[pData->curRandomStats.uiIndex].RandomExpLevel = pData->curRandomStats.RandomExpLevel;
|
||||||
gRandomStatsValue[pData->curRandomStats.uiIndex].RandomLife = pData->curRandomStats.RandomLife;
|
gRandomStatsValue[pData->curRandomStats.uiIndex].RandomLife = pData->curRandomStats.RandomLife;
|
||||||
gRandomStatsValue[pData->curRandomStats.uiIndex].RandomStrength = pData->curRandomStats.RandomStrength;
|
|
||||||
gRandomStatsValue[pData->curRandomStats.uiIndex].RandomAgility = pData->curRandomStats.RandomAgility;
|
gRandomStatsValue[pData->curRandomStats.uiIndex].RandomAgility = pData->curRandomStats.RandomAgility;
|
||||||
gRandomStatsValue[pData->curRandomStats.uiIndex].RandomLeadership = pData->curRandomStats.RandomLeadership;
|
|
||||||
gRandomStatsValue[pData->curRandomStats.uiIndex].RandomDexterity = pData->curRandomStats.RandomDexterity;
|
gRandomStatsValue[pData->curRandomStats.uiIndex].RandomDexterity = pData->curRandomStats.RandomDexterity;
|
||||||
|
gRandomStatsValue[pData->curRandomStats.uiIndex].RandomStrength = pData->curRandomStats.RandomStrength;
|
||||||
|
gRandomStatsValue[pData->curRandomStats.uiIndex].RandomLeadership = pData->curRandomStats.RandomLeadership;
|
||||||
gRandomStatsValue[pData->curRandomStats.uiIndex].RandomWisdom = pData->curRandomStats.RandomWisdom;
|
gRandomStatsValue[pData->curRandomStats.uiIndex].RandomWisdom = pData->curRandomStats.RandomWisdom;
|
||||||
gRandomStatsValue[pData->curRandomStats.uiIndex].RandomMarksmanship = pData->curRandomStats.RandomMarksmanship;
|
gRandomStatsValue[pData->curRandomStats.uiIndex].RandomMarksmanship = pData->curRandomStats.RandomMarksmanship;
|
||||||
gRandomStatsValue[pData->curRandomStats.uiIndex].RandomMedical = pData->curRandomStats.RandomMedical;
|
|
||||||
gRandomStatsValue[pData->curRandomStats.uiIndex].RandomMechanical = pData->curRandomStats.RandomMechanical;
|
gRandomStatsValue[pData->curRandomStats.uiIndex].RandomMechanical = pData->curRandomStats.RandomMechanical;
|
||||||
gRandomStatsValue[pData->curRandomStats.uiIndex].RandomExplosive = pData->curRandomStats.RandomExplosive;
|
gRandomStatsValue[pData->curRandomStats.uiIndex].RandomExplosive = pData->curRandomStats.RandomExplosive;
|
||||||
|
gRandomStatsValue[pData->curRandomStats.uiIndex].RandomMedical = pData->curRandomStats.RandomMedical;
|
||||||
gRandomStatsValue[pData->curRandomStats.uiIndex].RandomScientific = pData->curRandomStats.RandomScientific;
|
gRandomStatsValue[pData->curRandomStats.uiIndex].RandomScientific = pData->curRandomStats.RandomScientific;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "uiIndex") == 0)
|
else if(strcmp(name, "uiIndex") == 0)
|
||||||
@@ -135,10 +136,10 @@ RandomStatsEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curRandomStats.BaseAttribute = (INT8) atol(pData->szCharData);
|
pData->curRandomStats.BaseAttribute = (INT8) atol(pData->szCharData);
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "ExpLevel") == 0)
|
else if(strcmp(name, "RandomExpLevel") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curRandomStats.ExpLevel = (INT8) atol(pData->szCharData);
|
pData->curRandomStats.RandomExpLevel = (INT8) atol(pData->szCharData);
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "RandomLife") == 0)
|
else if(strcmp(name, "RandomLife") == 0)
|
||||||
{
|
{
|
||||||
@@ -150,16 +151,21 @@ RandomStatsEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curRandomStats.RandomAgility = (BOOLEAN) atol(pData->szCharData);
|
pData->curRandomStats.RandomAgility = (BOOLEAN) atol(pData->szCharData);
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "RandomLeadership") == 0)
|
|
||||||
{
|
|
||||||
pData->curElement = ELEMENT;
|
|
||||||
pData->curRandomStats.RandomLeadership = (BOOLEAN) atol(pData->szCharData);
|
|
||||||
}
|
|
||||||
else if(strcmp(name, "RandomDexterity") == 0)
|
else if(strcmp(name, "RandomDexterity") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curRandomStats.RandomDexterity = (BOOLEAN) atol(pData->szCharData);
|
pData->curRandomStats.RandomDexterity = (BOOLEAN) atol(pData->szCharData);
|
||||||
}
|
}
|
||||||
|
else if(strcmp(name, "RandomStrength") == 0)
|
||||||
|
{
|
||||||
|
pData->curElement = ELEMENT;
|
||||||
|
pData->curRandomStats.RandomStrength = (BOOLEAN) atol(pData->szCharData);
|
||||||
|
}
|
||||||
|
else if(strcmp(name, "RandomLeadership") == 0)
|
||||||
|
{
|
||||||
|
pData->curElement = ELEMENT;
|
||||||
|
pData->curRandomStats.RandomLeadership = (BOOLEAN) atol(pData->szCharData);
|
||||||
|
}
|
||||||
else if(strcmp(name, "RandomWisdom") == 0)
|
else if(strcmp(name, "RandomWisdom") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
@@ -170,11 +176,6 @@ RandomStatsEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curRandomStats.RandomMarksmanship = (BOOLEAN) atol(pData->szCharData);
|
pData->curRandomStats.RandomMarksmanship = (BOOLEAN) atol(pData->szCharData);
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "RandomMedical") == 0)
|
|
||||||
{
|
|
||||||
pData->curElement = ELEMENT;
|
|
||||||
pData->curRandomStats.RandomMedical = (BOOLEAN) atol(pData->szCharData);
|
|
||||||
}
|
|
||||||
else if(strcmp(name, "RandomMechanical") == 0)
|
else if(strcmp(name, "RandomMechanical") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
@@ -185,16 +186,16 @@ RandomStatsEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curRandomStats.RandomExplosive = (BOOLEAN) atol(pData->szCharData);
|
pData->curRandomStats.RandomExplosive = (BOOLEAN) atol(pData->szCharData);
|
||||||
}
|
}
|
||||||
|
else if(strcmp(name, "RandomMedical") == 0)
|
||||||
|
{
|
||||||
|
pData->curElement = ELEMENT;
|
||||||
|
pData->curRandomStats.RandomMedical = (BOOLEAN) atol(pData->szCharData);
|
||||||
|
}
|
||||||
else if(strcmp(name, "RandomScientific") == 0)
|
else if(strcmp(name, "RandomScientific") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curRandomStats.RandomScientific = (BOOLEAN) atol(pData->szCharData);
|
pData->curRandomStats.RandomScientific = (BOOLEAN) atol(pData->szCharData);
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "RandomStrength") == 0)
|
|
||||||
{
|
|
||||||
pData->curElement = ELEMENT;
|
|
||||||
pData->curRandomStats.RandomStrength = (BOOLEAN) atol(pData->szCharData);
|
|
||||||
}
|
|
||||||
|
|
||||||
pData->maxReadDepth--;
|
pData->maxReadDepth--;
|
||||||
}
|
}
|
||||||
@@ -278,23 +279,23 @@ BOOLEAN WriteRandomStats( STR fileName)
|
|||||||
FilePrintf(hFile,"<RANDOM_STATS>\r\n");
|
FilePrintf(hFile,"<RANDOM_STATS>\r\n");
|
||||||
for ( cnt = 0; cnt < NUM_PROFILES; cnt++ )
|
for ( cnt = 0; cnt < NUM_PROFILES; cnt++ )
|
||||||
{
|
{
|
||||||
FilePrintf(hFile,"\t<PROFIL>\r\n");
|
FilePrintf(hFile,"\t<PROFILE>\r\n");
|
||||||
FilePrintf(hFile,"\t\t<uiIndex>%d</uiIndex>\r\n", cnt);
|
FilePrintf(hFile,"\t\t<uiIndex>%d</uiIndex>\r\n", cnt);
|
||||||
FilePrintf(hFile,"\t\t<Enabled>%d</Enabled>\r\n",gRandomStatsValue[cnt].Enabled);
|
FilePrintf(hFile,"\t\t<Enabled>%d</Enabled>\r\n",gRandomStatsValue[cnt].Enabled);
|
||||||
FilePrintf(hFile,"\t\t<BaseAttribute>%d</BaseAttribute>\r\n",gRandomStatsValue[cnt].BaseAttribute);
|
FilePrintf(hFile,"\t\t<BaseAttribute>%d</BaseAttribute>\r\n",gRandomStatsValue[cnt].BaseAttribute);
|
||||||
FilePrintf(hFile,"\t\t<ExpLevel>%d</ExpLevel>\r\n",gRandomStatsValue[cnt].ExpLevel);
|
FilePrintf(hFile,"\t\t<RandomExpLevel>%d</RandomExpLevel>\r\n",gRandomStatsValue[cnt].RandomExpLevel);
|
||||||
FilePrintf(hFile,"\t\t<RandomLife>%d</RandomLife>\r\n",gRandomStatsValue[cnt].RandomLife);
|
FilePrintf(hFile,"\t\t<RandomLife>%d</RandomLife>\r\n",gRandomStatsValue[cnt].RandomLife);
|
||||||
FilePrintf(hFile,"\t\t<RandomAgility>%d</RandomAgility>\r\n",gRandomStatsValue[cnt].RandomAgility);
|
FilePrintf(hFile,"\t\t<RandomAgility>%d</RandomAgility>\r\n",gRandomStatsValue[cnt].RandomAgility);
|
||||||
FilePrintf(hFile,"\t\t<RandomLeadership>%d</RandomLeadership>\r\n",gRandomStatsValue[cnt].RandomLeadership);
|
|
||||||
FilePrintf(hFile,"\t\t<RandomDexterity>%d</RandomDexterity>\r\n",gRandomStatsValue[cnt].RandomDexterity);
|
FilePrintf(hFile,"\t\t<RandomDexterity>%d</RandomDexterity>\r\n",gRandomStatsValue[cnt].RandomDexterity);
|
||||||
|
FilePrintf(hFile,"\t\t<RandomStrength>%d</RandomStrength>\r\n",gRandomStatsValue[cnt].RandomStrength);
|
||||||
|
FilePrintf(hFile,"\t\t<RandomLeadership>%d</RandomLeadership>\r\n",gRandomStatsValue[cnt].RandomLeadership);
|
||||||
FilePrintf(hFile,"\t\t<RandomWisdom>%d</RandomWisdom>\r\n",gRandomStatsValue[cnt].RandomWisdom);
|
FilePrintf(hFile,"\t\t<RandomWisdom>%d</RandomWisdom>\r\n",gRandomStatsValue[cnt].RandomWisdom);
|
||||||
FilePrintf(hFile,"\t\t<RandomMarksmanship>%d</RandomMarksmanship>\r\n",gRandomStatsValue[cnt].RandomMarksmanship);
|
FilePrintf(hFile,"\t\t<RandomMarksmanship>%d</RandomMarksmanship>\r\n",gRandomStatsValue[cnt].RandomMarksmanship);
|
||||||
FilePrintf(hFile,"\t\t<RandomMedical>%d</RandomMedical>\r\n",gRandomStatsValue[cnt].RandomMedical);
|
|
||||||
FilePrintf(hFile,"\t\t<RandomMechanical>%d</RandomMechanical>\r\n",gRandomStatsValue[cnt].RandomMechanical);
|
FilePrintf(hFile,"\t\t<RandomMechanical>%d</RandomMechanical>\r\n",gRandomStatsValue[cnt].RandomMechanical);
|
||||||
FilePrintf(hFile,"\t\t<RandomExplosive>%d</RandomExplosive>\r\n",gRandomStatsValue[cnt].RandomExplosive);
|
FilePrintf(hFile,"\t\t<RandomExplosive>%d</RandomExplosive>\r\n",gRandomStatsValue[cnt].RandomExplosive);
|
||||||
|
FilePrintf(hFile,"\t\t<RandomMedical>%d</RandomMedical>\r\n",gRandomStatsValue[cnt].RandomMedical);
|
||||||
FilePrintf(hFile,"\t\t<RandomScientific>%d</RandomScientific>\r\n",gRandomStatsValue[cnt].RandomScientific);
|
FilePrintf(hFile,"\t\t<RandomScientific>%d</RandomScientific>\r\n",gRandomStatsValue[cnt].RandomScientific);
|
||||||
FilePrintf(hFile,"\t\t<RandomStrength>%d</RandomStrength>\r\n",gRandomStatsValue[cnt].RandomStrength);
|
FilePrintf(hFile,"\t</PROFILE>\r\n");
|
||||||
FilePrintf(hFile,"\t</PROFIL>\r\n");
|
|
||||||
}
|
}
|
||||||
FilePrintf(hFile,"</RANDOM_STATS>\r\n");
|
FilePrintf(hFile,"</RANDOM_STATS>\r\n");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user