externalised maximum number of mortars per AI team to DifficultySettings.xml

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8120 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2016-03-24 23:16:52 +00:00
parent 321203c3f1
commit 7e3d9e368c
3 changed files with 15 additions and 9 deletions
+2
View File
@@ -92,6 +92,8 @@ typedef struct
FLOAT NewDifficultySettingsAIM_DIFFICULTY;
BOOLEAN bEnemyMoraleWorried;
UINT8 usMaxMortarsPerTeam;
} DIFFICULTY_SETTINGS_VALUES;
extern UINT8 MaxDifficultySettingsValues;
+4 -7
View File
@@ -47,9 +47,6 @@ UINT16 itemGrenadeLauncher;
UINT16 itemLAW;
UINT16 itemRPG;
#define MAX_MORTARS_PER_TEAM 1 // one team can't randomly roll more than this many mortars per sector
UINT32 guiMortarsRolledByTeam = 0;
//
@@ -544,7 +541,7 @@ void GenerateRandomEquipment( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass, INT8
case 6:
// one per team maximum!
if ( ( pp->bExpLevel >= 5 ) && ( guiMortarsRolledByTeam < MAX_MORTARS_PER_TEAM ) )
if ( (pp->bExpLevel >= 5) && (guiMortarsRolledByTeam < zDiffSetting[gGameOptions.ubDifficultyLevel].usMaxMortarsPerTeam) )
{
//mortar
fMortar = TRUE;
@@ -747,11 +744,11 @@ void GenerateRandomEquipment( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass, INT8
break;
case 6:
// one per team maximum!
if ( guiMortarsRolledByTeam < MAX_MORTARS_PER_TEAM )
if ( guiMortarsRolledByTeam < zDiffSetting[gGameOptions.ubDifficultyLevel].usMaxMortarsPerTeam )
{
//mortar
fMortar = TRUE;
guiMortarsRolledByTeam++;
++guiMortarsRolledByTeam;
// the grenades will actually represent mortar shells in this case
bGrenades = 3 + (INT8)(Random( 5 )); //3-7
@@ -840,7 +837,7 @@ void GenerateRandomEquipment( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass, INT8
break;
case 4:
// one per team maximum!
if ( guiMortarsRolledByTeam < MAX_MORTARS_PER_TEAM )
if ( guiMortarsRolledByTeam < zDiffSetting[gGameOptions.ubDifficultyLevel].usMaxMortarsPerTeam )
{
//mortar
fMortar = TRUE;
+9 -2
View File
@@ -107,6 +107,7 @@ DifficultySettingsParseDataStartElementHandle(void *userData, const XML_Char *na
strcmp(name, "RadioSightings") == 0 ||
strcmp(name, "RadioSightings2") == 0 ||
strcmp(name, "EnemyMoraleWorried") == 0 ||
strcmp(name, "MaxMortarsPerTeam" ) == 0 ||
strcmp(name, "CthConstantsAimDifficulty") == 0 ||
strcmp(name, "CthConstantsBaseDifficulty") == 0
))
@@ -230,7 +231,8 @@ difficultySettingsEndElementHandle(void *userData, const XML_Char *name)
zDiffSetting[pData->curDifficultySettings.uiIndex].NewDifficultySettingsBASE_DIFFICULTY = pData->curDifficultySettings.NewDifficultySettingsBASE_DIFFICULTY;
zDiffSetting[pData->curDifficultySettings.uiIndex].bEnemyMoraleWorried = pData->curDifficultySettings.bEnemyMoraleWorried;
zDiffSetting[pData->curDifficultySettings.uiIndex].usMaxMortarsPerTeam = pData->curDifficultySettings.usMaxMortarsPerTeam;
}
else
{
@@ -549,7 +551,12 @@ difficultySettingsEndElementHandle(void *userData, const XML_Char *name)
{
pData->curElement = ELEMENT;
pData->curDifficultySettings.bEnemyMoraleWorried = (BOOLEAN) atol(pData->szCharData);
}
}
else if ( strcmp( name, "MaxMortarsPerTeam" ) == 0 )
{
pData->curElement = ELEMENT;
pData->curDifficultySettings.usMaxMortarsPerTeam = (UINT8)atol( pData->szCharData );
}
else if(strcmp(name, "CthConstantsAimDifficulty") == 0)
{
pData->curElement = ELEMENT;