mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
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:
@@ -92,6 +92,8 @@ typedef struct
|
|||||||
FLOAT NewDifficultySettingsAIM_DIFFICULTY;
|
FLOAT NewDifficultySettingsAIM_DIFFICULTY;
|
||||||
|
|
||||||
BOOLEAN bEnemyMoraleWorried;
|
BOOLEAN bEnemyMoraleWorried;
|
||||||
|
|
||||||
|
UINT8 usMaxMortarsPerTeam;
|
||||||
|
|
||||||
} DIFFICULTY_SETTINGS_VALUES;
|
} DIFFICULTY_SETTINGS_VALUES;
|
||||||
extern UINT8 MaxDifficultySettingsValues;
|
extern UINT8 MaxDifficultySettingsValues;
|
||||||
|
|||||||
@@ -47,9 +47,6 @@ UINT16 itemGrenadeLauncher;
|
|||||||
UINT16 itemLAW;
|
UINT16 itemLAW;
|
||||||
UINT16 itemRPG;
|
UINT16 itemRPG;
|
||||||
|
|
||||||
#define MAX_MORTARS_PER_TEAM 1 // one team can't randomly roll more than this many mortars per sector
|
|
||||||
|
|
||||||
|
|
||||||
UINT32 guiMortarsRolledByTeam = 0;
|
UINT32 guiMortarsRolledByTeam = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -544,7 +541,7 @@ void GenerateRandomEquipment( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass, INT8
|
|||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
// one per team maximum!
|
// one per team maximum!
|
||||||
if ( ( pp->bExpLevel >= 5 ) && ( guiMortarsRolledByTeam < MAX_MORTARS_PER_TEAM ) )
|
if ( (pp->bExpLevel >= 5) && (guiMortarsRolledByTeam < zDiffSetting[gGameOptions.ubDifficultyLevel].usMaxMortarsPerTeam) )
|
||||||
{
|
{
|
||||||
//mortar
|
//mortar
|
||||||
fMortar = TRUE;
|
fMortar = TRUE;
|
||||||
@@ -747,11 +744,11 @@ void GenerateRandomEquipment( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass, INT8
|
|||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
// one per team maximum!
|
// one per team maximum!
|
||||||
if ( guiMortarsRolledByTeam < MAX_MORTARS_PER_TEAM )
|
if ( guiMortarsRolledByTeam < zDiffSetting[gGameOptions.ubDifficultyLevel].usMaxMortarsPerTeam )
|
||||||
{
|
{
|
||||||
//mortar
|
//mortar
|
||||||
fMortar = TRUE;
|
fMortar = TRUE;
|
||||||
guiMortarsRolledByTeam++;
|
++guiMortarsRolledByTeam;
|
||||||
|
|
||||||
// the grenades will actually represent mortar shells in this case
|
// the grenades will actually represent mortar shells in this case
|
||||||
bGrenades = 3 + (INT8)(Random( 5 )); //3-7
|
bGrenades = 3 + (INT8)(Random( 5 )); //3-7
|
||||||
@@ -840,7 +837,7 @@ void GenerateRandomEquipment( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass, INT8
|
|||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
// one per team maximum!
|
// one per team maximum!
|
||||||
if ( guiMortarsRolledByTeam < MAX_MORTARS_PER_TEAM )
|
if ( guiMortarsRolledByTeam < zDiffSetting[gGameOptions.ubDifficultyLevel].usMaxMortarsPerTeam )
|
||||||
{
|
{
|
||||||
//mortar
|
//mortar
|
||||||
fMortar = TRUE;
|
fMortar = TRUE;
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ DifficultySettingsParseDataStartElementHandle(void *userData, const XML_Char *na
|
|||||||
strcmp(name, "RadioSightings") == 0 ||
|
strcmp(name, "RadioSightings") == 0 ||
|
||||||
strcmp(name, "RadioSightings2") == 0 ||
|
strcmp(name, "RadioSightings2") == 0 ||
|
||||||
strcmp(name, "EnemyMoraleWorried") == 0 ||
|
strcmp(name, "EnemyMoraleWorried") == 0 ||
|
||||||
|
strcmp(name, "MaxMortarsPerTeam" ) == 0 ||
|
||||||
strcmp(name, "CthConstantsAimDifficulty") == 0 ||
|
strcmp(name, "CthConstantsAimDifficulty") == 0 ||
|
||||||
strcmp(name, "CthConstantsBaseDifficulty") == 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].NewDifficultySettingsBASE_DIFFICULTY = pData->curDifficultySettings.NewDifficultySettingsBASE_DIFFICULTY;
|
||||||
|
|
||||||
zDiffSetting[pData->curDifficultySettings.uiIndex].bEnemyMoraleWorried = pData->curDifficultySettings.bEnemyMoraleWorried;
|
zDiffSetting[pData->curDifficultySettings.uiIndex].bEnemyMoraleWorried = pData->curDifficultySettings.bEnemyMoraleWorried;
|
||||||
|
|
||||||
|
zDiffSetting[pData->curDifficultySettings.uiIndex].usMaxMortarsPerTeam = pData->curDifficultySettings.usMaxMortarsPerTeam;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -549,7 +551,12 @@ difficultySettingsEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curDifficultySettings.bEnemyMoraleWorried = (BOOLEAN) atol(pData->szCharData);
|
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)
|
else if(strcmp(name, "CthConstantsAimDifficulty") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
|
|||||||
Reference in New Issue
Block a user