mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
- Added external parameter CounterAttackGroupSize to DifficultySettings.xml for counter attack strength. This replaces the old hard coded value. Requires GameDir >= 2363!
- Changed counter attack elite soldier distribution to replace regulars just like the rest of the code handles elites. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8396 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -16,7 +16,7 @@ enum
|
|||||||
DIF_LEVEL_MEDIUM,
|
DIF_LEVEL_MEDIUM,
|
||||||
DIF_LEVEL_HARD,
|
DIF_LEVEL_HARD,
|
||||||
DIF_LEVEL_INSANE,
|
DIF_LEVEL_INSANE,
|
||||||
MAX_DIF_LEVEL = 15,
|
MAX_DIF_LEVEL,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
@@ -31,6 +31,7 @@ typedef struct
|
|||||||
UINT16 iNumKillsPerProgressPoint;
|
UINT16 iNumKillsPerProgressPoint;
|
||||||
INT32 iInitialGarrisonPercentages;
|
INT32 iInitialGarrisonPercentages;
|
||||||
UINT8 iMinEnemyGroupSize;
|
UINT8 iMinEnemyGroupSize;
|
||||||
|
UINT8 iCounterAttackGroupSize;
|
||||||
BOOLEAN bUnlimitedPoolOfTroops;
|
BOOLEAN bUnlimitedPoolOfTroops;
|
||||||
INT32 iQueensInitialPoolOfTroops;
|
INT32 iQueensInitialPoolOfTroops;
|
||||||
UINT32 iQueenPoolIncrementPerDifficultyLevel;
|
UINT32 iQueenPoolIncrementPerDifficultyLevel;
|
||||||
|
|||||||
+9
-9
@@ -15,9 +15,9 @@
|
|||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.8384 (Development Build)" };
|
CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.8396 (Development Build)" };
|
||||||
#else
|
#else
|
||||||
CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.8384 (Development Build)" };
|
CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.8396 (Development Build)" };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
@@ -27,11 +27,11 @@
|
|||||||
|
|
||||||
//DEBUG BUILD VERSION
|
//DEBUG BUILD VERSION
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.8384 (Development Build)" };
|
CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.8396 (Development Build)" };
|
||||||
#elif defined (JA113DEMO)
|
#elif defined (JA113DEMO)
|
||||||
CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.8384 (Development Build)" };
|
CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.8396 (Development Build)" };
|
||||||
#else
|
#else
|
||||||
CHAR16 zVersionLabel[256] = { L"Debug: v1.13.8384 (Development Build)" };
|
CHAR16 zVersionLabel[256] = { L"Debug: v1.13.8396 (Development Build)" };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#elif defined CRIPPLED_VERSION
|
#elif defined CRIPPLED_VERSION
|
||||||
@@ -46,16 +46,16 @@
|
|||||||
|
|
||||||
//RELEASE BUILD VERSION
|
//RELEASE BUILD VERSION
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.8384 (Development Build)" };
|
CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.8396 (Development Build)" };
|
||||||
#elif defined (JA113DEMO)
|
#elif defined (JA113DEMO)
|
||||||
CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.8384 (Development Build)" };
|
CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.8396 (Development Build)" };
|
||||||
#else
|
#else
|
||||||
CHAR16 zVersionLabel[256] = { L"Release v1.13.8384 (Development Build)" };
|
CHAR16 zVersionLabel[256] = { L"Release v1.13.8396 (Development Build)" };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CHAR8 czVersionNumber[16] = { "Build 17.01.29" }; //YY.MM.DD
|
CHAR8 czVersionNumber[16] = { "Build 17.03.14" }; //YY.MM.DD
|
||||||
CHAR16 zTrackingNumber[16] = { L"Z" };
|
CHAR16 zTrackingNumber[16] = { L"Z" };
|
||||||
|
|
||||||
// SAVE_GAME_VERSION is defined in header, change it there
|
// SAVE_GAME_VERSION is defined in header, change it there
|
||||||
|
|||||||
+18
-40
@@ -4556,23 +4556,8 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
|||||||
if ( !NumNonPlayerTeamMembersInSector( SECTORX( ubSourceSectorID ), SECTORY( ubSourceSectorID ), ENEMY_TEAM ) )
|
if ( !NumNonPlayerTeamMembersInSector( SECTORX( ubSourceSectorID ), SECTORY( ubSourceSectorID ), ENEMY_TEAM ) )
|
||||||
ubSourceSectorID = SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY );
|
ubSourceSectorID = SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY );
|
||||||
|
|
||||||
UINT8 val;
|
// make sure that we use at least the min group size
|
||||||
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
|
ubNumSoldiers = (UINT8)( __max(zDiffSetting[gGameOptions.ubDifficultyLevel].iCounterAttackGroupSize, zDiffSetting[gGameOptions.ubDifficultyLevel].iMinEnemyGroupSize) );
|
||||||
val = 1;
|
|
||||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_MEDIUM )
|
|
||||||
val = 2;
|
|
||||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_HARD )
|
|
||||||
val = 3;
|
|
||||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
|
|
||||||
val = 4;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
val = Random (4);
|
|
||||||
if (val == 0)
|
|
||||||
val = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + val * 3);
|
|
||||||
|
|
||||||
// anv: replace one of soldiers with tank
|
// anv: replace one of soldiers with tank
|
||||||
if ( ubNumSoldiers )
|
if ( ubNumSoldiers )
|
||||||
@@ -4584,7 +4569,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
|||||||
grouptanks[ubCounter] = 0;
|
grouptanks[ubCounter] = 0;
|
||||||
groupjeeps[ubCounter] = 0;
|
groupjeeps[ubCounter] = 0;
|
||||||
|
|
||||||
if ( Random( 10 ) < val )
|
if ( Random( 10 ) < gGameOptions.ubDifficultyLevel )
|
||||||
{
|
{
|
||||||
if ( gGameExternalOptions.fArmyUsesJeepsInAttacks && ASDSoldierUpgradeToJeep( ) )
|
if ( gGameExternalOptions.fArmyUsesJeepsInAttacks && ASDSoldierUpgradeToJeep( ) )
|
||||||
{
|
{
|
||||||
@@ -4598,8 +4583,12 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( val > 0 )
|
// replace some soldiers with elites
|
||||||
groupelites[ubCounter] = grouptroops[ubCounter] - grouptroops[ubCounter] / val;
|
if ( gGameOptions.ubDifficultyLevel > 0 )
|
||||||
|
{
|
||||||
|
groupelites[ubCounter] = grouptroops[ubCounter] - grouptroops[ubCounter] / gGameOptions.ubDifficultyLevel;
|
||||||
|
grouptroops[ubCounter] -= groupelites[ubCounter];
|
||||||
|
}
|
||||||
|
|
||||||
totalusedsoldiers += grouptroops[ubCounter] + groupelites[ubCounter] + grouptanks[ubCounter] + groupjeeps[ubCounter];
|
totalusedsoldiers += grouptroops[ubCounter] + groupelites[ubCounter] + grouptanks[ubCounter] + groupjeeps[ubCounter];
|
||||||
}
|
}
|
||||||
@@ -4655,23 +4644,9 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT8 value;
|
// make sure that we use at least the min group size
|
||||||
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
|
ubNumSoldiers = (UINT8)( __max(zDiffSetting[gGameOptions.ubDifficultyLevel].iCounterAttackGroupSize, zDiffSetting[gGameOptions.ubDifficultyLevel].iMinEnemyGroupSize) );
|
||||||
value = 1;
|
|
||||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_MEDIUM )
|
|
||||||
value = 2;
|
|
||||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_HARD )
|
|
||||||
value = 3;
|
|
||||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
|
|
||||||
value = 4;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
value = Random (4);
|
|
||||||
if (value == 0) value = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + value * 3);
|
|
||||||
|
|
||||||
// anv: replace one of soldiers with tank
|
// anv: replace one of soldiers with tank
|
||||||
for( UINT8 ubCounter = 0; ubCounter < 4; ++ubCounter )
|
for( UINT8 ubCounter = 0; ubCounter < 4; ++ubCounter )
|
||||||
{
|
{
|
||||||
@@ -4682,7 +4657,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
|||||||
|
|
||||||
if( ubNumSoldiers )
|
if( ubNumSoldiers )
|
||||||
{
|
{
|
||||||
if ( Random( 10 ) < value )
|
if ( Random( 10 ) < gGameOptions.ubDifficultyLevel )
|
||||||
{
|
{
|
||||||
if ( gGameExternalOptions.fArmyUsesJeepsInAttacks && ASDSoldierUpgradeToJeep( ) )
|
if ( gGameExternalOptions.fArmyUsesJeepsInAttacks && ASDSoldierUpgradeToJeep( ) )
|
||||||
{
|
{
|
||||||
@@ -4697,8 +4672,11 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( value > 0 )
|
if ( gGameOptions.ubDifficultyLevel > 0 )
|
||||||
groupelites[ubCounter] = grouptroops[ubCounter] - grouptroops[ubCounter] / value;
|
{
|
||||||
|
groupelites[ubCounter] = grouptroops[ubCounter] - grouptroops[ubCounter] / gGameOptions.ubDifficultyLevel;
|
||||||
|
grouptroops[ubCounter] -= groupelites[ubCounter];
|
||||||
|
}
|
||||||
|
|
||||||
totalusedsoldiers += grouptroops[ubCounter] + groupelites[ubCounter] + grouptanks[ubCounter] + groupjeeps[ubCounter];
|
totalusedsoldiers += grouptroops[ubCounter] + groupelites[ubCounter] + grouptanks[ubCounter] + groupjeeps[ubCounter];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ DifficultySettingsParseDataStartElementHandle(void *userData, const XML_Char *na
|
|||||||
strcmp(name, "NumKillsPerProgressPoint") == 0 ||
|
strcmp(name, "NumKillsPerProgressPoint") == 0 ||
|
||||||
strcmp(name, "InitialGarrisonPercentages") == 0 ||
|
strcmp(name, "InitialGarrisonPercentages") == 0 ||
|
||||||
strcmp(name, "MinEnemyGroupSize") == 0 ||
|
strcmp(name, "MinEnemyGroupSize") == 0 ||
|
||||||
|
strcmp(name, "CounterAttackGroupSize") == 0 ||
|
||||||
strcmp(name, "UnlimitedPoolOfTroops") == 0 ||
|
strcmp(name, "UnlimitedPoolOfTroops") == 0 ||
|
||||||
strcmp(name, "QueensInitialPoolOfTroops") == 0 ||
|
strcmp(name, "QueensInitialPoolOfTroops") == 0 ||
|
||||||
strcmp(name, "QueenPoolIncrementPerDifficultyLevel") == 0 ||
|
strcmp(name, "QueenPoolIncrementPerDifficultyLevel") == 0 ||
|
||||||
@@ -161,6 +162,7 @@ difficultySettingsEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
zDiffSetting[pData->curDifficultySettings.uiIndex].iNumKillsPerProgressPoint = pData->curDifficultySettings.iNumKillsPerProgressPoint;
|
zDiffSetting[pData->curDifficultySettings.uiIndex].iNumKillsPerProgressPoint = pData->curDifficultySettings.iNumKillsPerProgressPoint;
|
||||||
zDiffSetting[pData->curDifficultySettings.uiIndex].iInitialGarrisonPercentages = pData->curDifficultySettings.iInitialGarrisonPercentages;
|
zDiffSetting[pData->curDifficultySettings.uiIndex].iInitialGarrisonPercentages = pData->curDifficultySettings.iInitialGarrisonPercentages;
|
||||||
zDiffSetting[pData->curDifficultySettings.uiIndex].iMinEnemyGroupSize = pData->curDifficultySettings.iMinEnemyGroupSize;
|
zDiffSetting[pData->curDifficultySettings.uiIndex].iMinEnemyGroupSize = pData->curDifficultySettings.iMinEnemyGroupSize;
|
||||||
|
zDiffSetting[pData->curDifficultySettings.uiIndex].iCounterAttackGroupSize = pData->curDifficultySettings.iCounterAttackGroupSize;
|
||||||
zDiffSetting[pData->curDifficultySettings.uiIndex].bUnlimitedPoolOfTroops = pData->curDifficultySettings.bUnlimitedPoolOfTroops;
|
zDiffSetting[pData->curDifficultySettings.uiIndex].bUnlimitedPoolOfTroops = pData->curDifficultySettings.bUnlimitedPoolOfTroops;
|
||||||
zDiffSetting[pData->curDifficultySettings.uiIndex].iQueensInitialPoolOfTroops = pData->curDifficultySettings.iQueensInitialPoolOfTroops;
|
zDiffSetting[pData->curDifficultySettings.uiIndex].iQueensInitialPoolOfTroops = pData->curDifficultySettings.iQueensInitialPoolOfTroops;
|
||||||
zDiffSetting[pData->curDifficultySettings.uiIndex].iQueenPoolIncrementPerDifficultyLevel = pData->curDifficultySettings.iQueenPoolIncrementPerDifficultyLevel;
|
zDiffSetting[pData->curDifficultySettings.uiIndex].iQueenPoolIncrementPerDifficultyLevel = pData->curDifficultySettings.iQueenPoolIncrementPerDifficultyLevel;
|
||||||
@@ -286,6 +288,11 @@ difficultySettingsEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curDifficultySettings.iMinEnemyGroupSize = (UINT8) atol(pData->szCharData);
|
pData->curDifficultySettings.iMinEnemyGroupSize = (UINT8) atol(pData->szCharData);
|
||||||
}
|
}
|
||||||
|
else if(strcmp(name, "CounterAttackGroupSize") == 0)
|
||||||
|
{
|
||||||
|
pData->curElement = ELEMENT;
|
||||||
|
pData->curDifficultySettings.iCounterAttackGroupSize = (UINT8) atol(pData->szCharData);
|
||||||
|
}
|
||||||
else if(strcmp(name, "PercentElitesBonus") == 0)
|
else if(strcmp(name, "PercentElitesBonus") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
|
|||||||
Reference in New Issue
Block a user