diff --git a/GameSettings.cpp b/GameSettings.cpp index 3a6bbb01..27237afa 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -848,7 +848,11 @@ void LoadGameExternalOptions() // 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.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 ################# diff --git a/GameSettings.h b/GameSettings.h index 5b688d28..7364b824 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -1151,7 +1151,15 @@ typedef struct BOOLEAN fShowSkillsInHirePage; - BOOLEAN fMercRandomStats; + UINT8 ubMercRandomStats; + + UINT8 ubMercRandomStatsRange; + + UINT8 ubMercRandomExpRange; + + BOOLEAN fMercRandomStartSalary; + + UINT8 ubMercRandomStartSalaryPercentMod; BOOLEAN fBobbyRayFastShipments; diff --git a/Tactical/Soldier Profile.cpp b/Tactical/Soldier Profile.cpp index 9d42d29c..54b03f52 100644 --- a/Tactical/Soldier Profile.cpp +++ b/Tactical/Soldier Profile.cpp @@ -50,6 +50,7 @@ #include "strategic.h" #include "strategicmap.h" // added by SANDRO #include "drugs and alcohol.h" // added by Flugente + #include "Campaign.h" #endif #include "aim.h" @@ -96,7 +97,9 @@ extern UINT8 gubItemDroppableFlag[NUM_INV_SLOTS]; //Random Stats RANDOM_STATS_VALUES gRandomStatsValue[NUM_PROFILES]; -void RandomStats (); +void RandomStats(); + +void RandomStartSalary(); INT8 gbSkillTraitBonus[NUM_SKILLTRAITS_OT] = { @@ -425,75 +428,182 @@ BOOLEAN LoadNewSystemMercsToSaveGameFile( HWFILE hFile ) } //Random stats -void RandomStats () +void RandomStats() { UINT32 cnt; INT8 bBaseAttribute = 0; MERCPROFILESTRUCT * pProfile; + UINT8 Exp = gGameExternalOptions.ubMercRandomExpRange; + UINT8 Stats = gGameExternalOptions.ubMercRandomStatsRange; - for ( cnt = 0; cnt < NUM_PROFILES; cnt++ ) - { - if (gGameExternalOptions.fMercRandomStats == TRUE && gRandomStatsValue[cnt].Enabled) + // not randomizing + if ( gGameExternalOptions.ubMercRandomStats == 0 ) + return; + + // full stats random for all soldierIDs + else if ( gGameExternalOptions.ubMercRandomStats == 1 ) + { + for ( cnt = 0; cnt < NUM_PROFILES; cnt++ ) { - bBaseAttribute = gRandomStatsValue[cnt].BaseAttribute + ( 4 * gRandomStatsValue[cnt].ExpLevel ); pProfile = &(gMercProfiles[cnt]); - - pProfile->bExpLevel = gRandomStatsValue[cnt].ExpLevel; + // 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 ) ) ); + } + } - if ( gRandomStatsValue[cnt].RandomLife == TRUE ) + // partial stats random based on XML stat tag + else if ( gGameExternalOptions.ubMercRandomStats == 2 ) + { + for ( cnt = 0; cnt < NUM_PROFILES; cnt++ ) + { + if ( gRandomStatsValue[cnt].Enabled ) { - pProfile->bLifeMax = (bBaseAttribute + Random( 9 ) + Random( 8 )); - pProfile->bLife = pProfile->bLifeMax; - } + pProfile = &(gMercProfiles[cnt]); - if ( gRandomStatsValue[cnt].RandomAgility == TRUE ) - { - pProfile->bAgility = (bBaseAttribute + Random( 9 ) + Random( 8 )); - } + 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].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].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].RandomMechanical == TRUE ) - { - pProfile->bMechanical = (bBaseAttribute + Random( 9 ) + Random( 8 )); - } + } + } - if ( gRandomStatsValue[cnt].RandomExplosive == TRUE ) + // Buggler: tweaked Jazz's random code + else if ( gGameExternalOptions.ubMercRandomStats == 3 ) + { + for ( cnt = 0; cnt < NUM_PROFILES; cnt++ ) + { + if ( gRandomStatsValue[cnt].Enabled ) { - pProfile->bExplosive = (bBaseAttribute + Random( 9 ) + Random( 8 )); - } + pProfile = &(gMercProfiles[cnt]); - if ( gRandomStatsValue[cnt].RandomStrength == TRUE ) - { - pProfile->bStrength = (bBaseAttribute + Random( 9 ) + Random( 8 )); - } + 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 ) ); + + bBaseAttribute = gRandomStatsValue[cnt].BaseAttribute + ( 4 * pProfile->bExpLevel ); + + 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].RandomDexterity == TRUE ) + { + pProfile->bDexterity = (bBaseAttribute + Random( 9 ) + Random( 8 )); + } + + if ( gRandomStatsValue[cnt].RandomStrength == TRUE ) + { + pProfile->bStrength = (bBaseAttribute + Random( 9 ) + Random( 8 )); + } + + if ( gRandomStatsValue[cnt].RandomLeadership == TRUE ) + { + pProfile->bLeadership = (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].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! BOOLEAN LoadMercProfiles(void) { @@ -931,6 +1041,9 @@ for( int i = 0; i < NUM_PROFILES; i++ ) // --------------- RandomStats (); //random stats by Jazz + + // Buggler: random starting salary + RandomStartSalary (); // decide which terrorists are active DecideActiveTerrorists(); @@ -2712,4 +2825,4 @@ INT8 ProfileHasSkillTrait( INT32 ubProfileID, INT8 bSkillTrait ) else return ( bNumTraits ); } -} +} diff --git a/Tactical/Soldier Profile.h b/Tactical/Soldier Profile.h index 7acb7731..3043d576 100644 --- a/Tactical/Soldier Profile.h +++ b/Tactical/Soldier Profile.h @@ -10,19 +10,18 @@ typedef struct UINT16 uiIndex; BOOLEAN Enabled; INT8 BaseAttribute; - INT8 ExpLevel; + BOOLEAN RandomExpLevel; BOOLEAN RandomLife; BOOLEAN RandomAgility; - BOOLEAN RandomLeadership; BOOLEAN RandomDexterity; + BOOLEAN RandomStrength; + BOOLEAN RandomLeadership; BOOLEAN RandomWisdom; BOOLEAN RandomMarksmanship; - BOOLEAN RandomMedical; BOOLEAN RandomMechanical; BOOLEAN RandomExplosive; + BOOLEAN RandomMedical; BOOLEAN RandomScientific; - BOOLEAN RandomStrength; - } RANDOM_STATS_VALUES; extern RANDOM_STATS_VALUES gRandomStatsValue[NUM_PROFILES]; diff --git a/Tactical/XML_RandomStats.cpp b/Tactical/XML_RandomStats.cpp index 75a9332a..ba11da10 100644 --- a/Tactical/XML_RandomStats.cpp +++ b/Tactical/XML_RandomStats.cpp @@ -42,7 +42,7 @@ RandomStatsStartElementHandle(void *userData, const XML_Char *name, const XML_Ch 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; @@ -52,18 +52,19 @@ RandomStatsStartElementHandle(void *userData, const XML_Char *name, const XML_Ch ( strcmp(name, "uiIndex") == 0 || strcmp(name, "Enabled") == 0 || strcmp(name, "BaseAttribute") == 0 || - strcmp(name, "ExpLevel") == 0 || + strcmp(name, "RandomExpLevel") == 0 || strcmp(name, "RandomLife") == 0 || strcmp(name, "RandomAgility") == 0 || + strcmp(name, "RandomDexterity") == 0 || + strcmp(name, "RandomStrength") == 0 || strcmp(name, "RandomLeadership") == 0 || - strcmp(name, "RandomDexterity") == 0 || strcmp(name, "RandomWisdom") == 0 || strcmp(name, "RandomMarksmanship") == 0 || - strcmp(name, "RandomMedical") == 0 || strcmp(name, "RandomMechanical") == 0 || strcmp(name, "RandomExplosive") == 0 || - strcmp(name, "RandomScientific") == 0 || - strcmp(name, "RandomStrength") == 0 ) ) + strcmp(name, "RandomMedical") == 0 || + strcmp(name, "RandomScientific") == 0 ) ) + { pData->curElement = ELEMENT_PROPERTY; @@ -101,23 +102,23 @@ RandomStatsEndElementHandle(void *userData, const XML_Char *name) { pData->curElement = ELEMENT_NONE; } - else if(strcmp(name, "PROFIL") == 0) + else if(strcmp(name, "PROFILE") == 0) { pData->curElement = ELEMENT_LIST; gRandomStatsValue[pData->curRandomStats.uiIndex].Enabled = pData->curRandomStats.Enabled; 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].RandomStrength = pData->curRandomStats.RandomStrength; 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].RandomStrength = pData->curRandomStats.RandomStrength; + gRandomStatsValue[pData->curRandomStats.uiIndex].RandomLeadership = pData->curRandomStats.RandomLeadership; gRandomStatsValue[pData->curRandomStats.uiIndex].RandomWisdom = pData->curRandomStats.RandomWisdom; 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].RandomExplosive = pData->curRandomStats.RandomExplosive; + gRandomStatsValue[pData->curRandomStats.uiIndex].RandomMedical = pData->curRandomStats.RandomMedical; gRandomStatsValue[pData->curRandomStats.uiIndex].RandomScientific = pData->curRandomStats.RandomScientific; } else if(strcmp(name, "uiIndex") == 0) @@ -135,10 +136,10 @@ RandomStatsEndElementHandle(void *userData, const XML_Char *name) pData->curElement = ELEMENT; pData->curRandomStats.BaseAttribute = (INT8) atol(pData->szCharData); } - else if(strcmp(name, "ExpLevel") == 0) + else if(strcmp(name, "RandomExpLevel") == 0) { pData->curElement = ELEMENT; - pData->curRandomStats.ExpLevel = (INT8) atol(pData->szCharData); + pData->curRandomStats.RandomExpLevel = (INT8) atol(pData->szCharData); } else if(strcmp(name, "RandomLife") == 0) { @@ -150,15 +151,20 @@ RandomStatsEndElementHandle(void *userData, const XML_Char *name) pData->curElement = ELEMENT; 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) { pData->curElement = ELEMENT; 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) { @@ -170,11 +176,6 @@ RandomStatsEndElementHandle(void *userData, const XML_Char *name) pData->curElement = ELEMENT; 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) { pData->curElement = ELEMENT; @@ -185,15 +186,15 @@ RandomStatsEndElementHandle(void *userData, const XML_Char *name) pData->curElement = ELEMENT; 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) { pData->curElement = ELEMENT; 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--; @@ -278,23 +279,23 @@ BOOLEAN WriteRandomStats( STR fileName) FilePrintf(hFile,"\r\n"); for ( cnt = 0; cnt < NUM_PROFILES; cnt++ ) { - FilePrintf(hFile,"\t\r\n"); + FilePrintf(hFile,"\t\r\n"); FilePrintf(hFile,"\t\t%d\r\n", cnt); FilePrintf(hFile,"\t\t%d\r\n",gRandomStatsValue[cnt].Enabled); FilePrintf(hFile,"\t\t%d\r\n",gRandomStatsValue[cnt].BaseAttribute); - FilePrintf(hFile,"\t\t%d\r\n",gRandomStatsValue[cnt].ExpLevel); + FilePrintf(hFile,"\t\t%d\r\n",gRandomStatsValue[cnt].RandomExpLevel); FilePrintf(hFile,"\t\t%d\r\n",gRandomStatsValue[cnt].RandomLife); FilePrintf(hFile,"\t\t%d\r\n",gRandomStatsValue[cnt].RandomAgility); - FilePrintf(hFile,"\t\t%d\r\n",gRandomStatsValue[cnt].RandomLeadership); FilePrintf(hFile,"\t\t%d\r\n",gRandomStatsValue[cnt].RandomDexterity); + FilePrintf(hFile,"\t\t%d\r\n",gRandomStatsValue[cnt].RandomStrength); + FilePrintf(hFile,"\t\t%d\r\n",gRandomStatsValue[cnt].RandomLeadership); FilePrintf(hFile,"\t\t%d\r\n",gRandomStatsValue[cnt].RandomWisdom); FilePrintf(hFile,"\t\t%d\r\n",gRandomStatsValue[cnt].RandomMarksmanship); - FilePrintf(hFile,"\t\t%d\r\n",gRandomStatsValue[cnt].RandomMedical); FilePrintf(hFile,"\t\t%d\r\n",gRandomStatsValue[cnt].RandomMechanical); FilePrintf(hFile,"\t\t%d\r\n",gRandomStatsValue[cnt].RandomExplosive); - FilePrintf(hFile,"\t\t%d\r\n",gRandomStatsValue[cnt].RandomScientific); - FilePrintf(hFile,"\t\t%d\r\n",gRandomStatsValue[cnt].RandomStrength); - FilePrintf(hFile,"\t\r\n"); + FilePrintf(hFile,"\t\t%d\r\n",gRandomStatsValue[cnt].RandomMedical); + FilePrintf(hFile,"\t\t%d\r\n",gRandomStatsValue[cnt].RandomScientific); + FilePrintf(hFile,"\t\r\n"); } FilePrintf(hFile,"\r\n"); }