mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Change strategic enemy amounts to UINT16
This commit is contained in:
+3
-3
@@ -81,9 +81,9 @@ void RandomStats ();
|
||||
void RandomAddEnemy( UINT8 SectorX, UINT8 SectorY, UINT8 Level )
|
||||
{
|
||||
UNDERGROUND_SECTORINFO *pSector;
|
||||
UINT8 ubNumAdmins = 0;
|
||||
UINT8 ubNumTroops = 0;
|
||||
UINT8 ubNumElites = 0;
|
||||
UINT16 ubNumAdmins = 0;
|
||||
UINT16 ubNumTroops = 0;
|
||||
UINT16 ubNumElites = 0;
|
||||
|
||||
if ( Level != 0 )
|
||||
{
|
||||
|
||||
@@ -157,7 +157,7 @@ void ViewCreaturesCallback( GUI_BUTTON *btn, INT32 reason );
|
||||
void ExtractAndUpdatePopulations();
|
||||
void PrintEnemyPopTable();
|
||||
void PrintEnemiesKilledTable();
|
||||
UINT8 ChooseEnemyIconColor( UINT8 ubAdmins, UINT8 ubTroops, UINT8 ubElites, UINT8 ubTanks, UINT8 ubJeeps );
|
||||
UINT8 ChooseEnemyIconColor( UINT16 ubAdmins, UINT16 ubTroops, UINT16 ubElites, UINT16 ubTanks, UINT16 ubJeeps );
|
||||
void BlitGroupIcon( UINT8 ubIconType, UINT8 ubIconColor, UINT32 uiX, UINT32 uiY, HVOBJECT hVObject );
|
||||
void PrintDetailedEnemiesInSectorInfo( INT32 iScreenX, INT32 iScreenY, UINT8 ubSectorX, UINT8 ubSectorY );
|
||||
|
||||
@@ -536,7 +536,7 @@ void RenderMovingGroupsAndMercs()
|
||||
GROUP *pGroup;
|
||||
HVOBJECT hVObject;
|
||||
INT32 x, y;
|
||||
UINT8 ubNumTroops, ubNumAdmins, ubNumElites, ubNumTanks, ubNumJeeps;
|
||||
UINT16 ubNumTroops, ubNumAdmins, ubNumElites, ubNumTanks, ubNumJeeps;
|
||||
float ratio;
|
||||
INT32 minX, maxX, minY, maxY;
|
||||
UINT8 ubIconType;
|
||||
@@ -722,7 +722,7 @@ void RenderInfoInSector()
|
||||
{
|
||||
SECTORINFO *pSector;
|
||||
GROUP *pGroup;
|
||||
UINT8 ubNumAdmins = 0, ubNumTroops = 0, ubNumElites = 0, ubNumTanks = 0, ubNumJeeps = 0, ubAdminsInBattle = 0, ubTroopsInBattle = 0, ubElitesInBattle = 0, ubTanksInBattle = 0, ubJeepsInBattle = 0,ubNumGroups = 0;
|
||||
UINT16 ubNumAdmins = 0, ubNumTroops = 0, ubNumElites = 0, ubNumTanks = 0, ubNumJeeps = 0, ubAdminsInBattle = 0, ubTroopsInBattle = 0, ubElitesInBattle = 0, ubTanksInBattle = 0, ubJeepsInBattle = 0,ubNumGroups = 0;
|
||||
|
||||
pSector = &SectorInfo[ SECTOR( ubSectorX, ubSectorY ) ];
|
||||
|
||||
@@ -1832,7 +1832,7 @@ void PrintEnemiesKilledTable()
|
||||
|
||||
|
||||
|
||||
UINT8 ChooseEnemyIconColor( UINT8 ubAdmins, UINT8 ubTroops, UINT8 ubElites, UINT8 ubTanks, UINT8 ubJeeps )
|
||||
UINT8 ChooseEnemyIconColor( UINT16 ubAdmins, UINT16 ubTroops, UINT16 ubElites, UINT16 ubTanks, UINT16 ubJeeps )
|
||||
{
|
||||
UINT8 ubIconColor;
|
||||
|
||||
|
||||
@@ -755,9 +755,9 @@ void AssociateEnemiesWithStrategicGroups()
|
||||
{
|
||||
SECTORINFO *pSector;
|
||||
GROUP *pGroup;
|
||||
UINT8 ubNumAdmins, ubNumTroops, ubNumElites, ubNumTanks, ubNumJeeps, ubNumRobots; //how many soldiers of the type do we still have to assign to a group?
|
||||
UINT8 ubISNumAdmins, ubISNumTroops, ubISNumElites, ubISNumTanks, ubISNumJeeps, ubISNumRobots;
|
||||
UINT8 ubNumElitesInGroup, ubNumTroopsInGroup, ubNumAdminsInGroup, ubNumTanksInGroup, ubNumJeepsInGroup, ubNumRobotsInGroup;
|
||||
UINT16 ubNumAdmins, ubNumTroops, ubNumElites, ubNumTanks, ubNumJeeps, ubNumRobots; //how many soldiers of the type do we still have to assign to a group?
|
||||
UINT16 ubISNumAdmins, ubISNumTroops, ubISNumElites, ubISNumTanks, ubISNumJeeps, ubISNumRobots;
|
||||
UINT16 ubNumElitesInGroup, ubNumTroopsInGroup, ubNumAdminsInGroup, ubNumTanksInGroup, ubNumJeepsInGroup, ubNumRobotsInGroup;
|
||||
INT32 i;
|
||||
UINT8 pSectors[4];
|
||||
UINT8 ubDirAmount;
|
||||
|
||||
@@ -8090,7 +8090,7 @@ void MilitiaGroupBoxButtonCallback( GUI_BUTTON *btn, INT32 reason )
|
||||
UINT8 militiatype = id / 2;
|
||||
|
||||
// for now, always alter by 1
|
||||
UINT8 howmany = 1;
|
||||
UINT16 howmany = 1;
|
||||
|
||||
// either add or remove a militia from currently selected group
|
||||
if ( id % 2 )
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
#define DIR_SOUTH 2
|
||||
#define DIR_WEST 3
|
||||
|
||||
UINT8 gpAttackDirs[5][4]; // 0. Green Militia 1. Regular Militia 2. Elite Militia 3. Insertion code
|
||||
UINT16 gpAttackDirs[5][4]; // 0. Green Militia 1. Regular Militia 2. Elite Militia 3. Insertion code
|
||||
UINT8 guiDirNumber = 0;
|
||||
BOOLEAN gfMSBattle = FALSE;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
//#define MAXIMUM_MILITIA_SQUAD_SIZE 30
|
||||
|
||||
extern UINT8 gpAttackDirs[5][4];
|
||||
extern UINT16 gpAttackDirs[5][4];
|
||||
extern UINT8 guiDirNumber;
|
||||
|
||||
// Flugente: militia in this sector is ordered to move according to flags that were applied to it prior
|
||||
|
||||
+45
-45
@@ -470,9 +470,9 @@ BOOLEAN SendReinforcementsForPatrol( INT32 iPatrolID, GROUP **pOptionalGroup );
|
||||
|
||||
void ClearPreviousAIGroupAssignment( GROUP *pGroup );
|
||||
|
||||
void CalcNumTroopsBasedOnComposition( UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 ubTotal, INT32 iCompositionID );
|
||||
void CalcNumTroopsBasedOnComposition( UINT16 *pubNumTroops, UINT16 *pubNumElites, UINT16 ubTotal, INT32 iCompositionID );
|
||||
void ConvertGroupTroopsToComposition( GROUP *pGroup, INT32 iCompositionID );
|
||||
void RemoveSoldiersFromGarrisonBasedOnComposition( INT32 iGarrisonID, UINT8 ubSize );
|
||||
void RemoveSoldiersFromGarrisonBasedOnComposition( INT32 iGarrisonID, UINT16 ubSize );
|
||||
|
||||
//If there are any enemy groups that will be moving through this sector due, they will have to repath which
|
||||
//will cause them to avoid the sector. Returns the number of redirected groups.
|
||||
@@ -1151,8 +1151,8 @@ void InitStrategicAI()
|
||||
INT32 iStartPop, iDesiredPop, iPriority;
|
||||
SECTORINFO *pSector = NULL;
|
||||
GROUP *pGroup;
|
||||
UINT8 ubNumTroops;
|
||||
UINT8 ubNumRobots, ubNumTanks, ubNumJeeps;
|
||||
UINT16 ubNumTroops;
|
||||
UINT16 ubNumRobots, ubNumTanks, ubNumJeeps;
|
||||
INT32 iPercentElitesBonus;
|
||||
INT32 iMaxEnemyGroupSize = gGameExternalOptions.iMaxEnemyGroupSize;
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Strategic3");
|
||||
@@ -1538,9 +1538,9 @@ void InitStrategicAI()
|
||||
//based on the difficulty settings in the above patrol table.
|
||||
//if( gPatrolGroup[ i ].ubUNUSEDStartIfDifficulty <= gGameOptions.ubDifficultyLevel )
|
||||
{
|
||||
UINT8 troopCount = (UINT8)(gPatrolGroup[ i ].bSize + Random( 3 ) - 1);
|
||||
troopCount = (UINT8)max( gubMinEnemyGroupSize, min( iMaxEnemyGroupSize, troopCount) );
|
||||
UINT8 ubNumElites;
|
||||
UINT16 troopCount = (UINT16)(gPatrolGroup[ i ].bSize + Random( 3 ) - 1);
|
||||
troopCount = (UINT16)max( gubMinEnemyGroupSize, min( iMaxEnemyGroupSize, troopCount) );
|
||||
UINT16 ubNumElites;
|
||||
InitializeGroup(GROUP_TYPE_PATROL, troopCount, ubNumTroops, ubNumElites, ubNumRobots, ubNumJeeps, ubNumTanks, Random(10) < gGameOptions.ubDifficultyLevel && i != 3 && i != 4);
|
||||
|
||||
//Note on adding patrol groups...
|
||||
@@ -2237,12 +2237,12 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Strategic5");
|
||||
if( gGarrisonGroup[ i ].ubSectorID != SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY ) )
|
||||
{
|
||||
EliminateSurplusTroopsForGarrison( pGroup, pSector );
|
||||
pSector->ubNumAdmins = (UINT8)(pSector->ubNumAdmins + pGroup->pEnemyGroup->ubNumAdmins);
|
||||
pSector->ubNumTroops = (UINT8)(pSector->ubNumTroops + pGroup->pEnemyGroup->ubNumTroops);
|
||||
pSector->ubNumElites = (UINT8)(pSector->ubNumElites + pGroup->pEnemyGroup->ubNumElites);
|
||||
pSector->ubNumRobots = (UINT8)(pSector->ubNumRobots + pGroup->pEnemyGroup->ubNumRobots);
|
||||
pSector->ubNumTanks = (UINT8)(pSector->ubNumTanks + pGroup->pEnemyGroup->ubNumTanks);
|
||||
pSector->ubNumJeeps = (UINT8)(pSector->ubNumJeeps + pGroup->pEnemyGroup->ubNumJeeps);
|
||||
pSector->ubNumAdmins = (pSector->ubNumAdmins + pGroup->pEnemyGroup->ubNumAdmins);
|
||||
pSector->ubNumTroops = (pSector->ubNumTroops + pGroup->pEnemyGroup->ubNumTroops);
|
||||
pSector->ubNumElites = (pSector->ubNumElites + pGroup->pEnemyGroup->ubNumElites);
|
||||
pSector->ubNumRobots = (pSector->ubNumRobots + pGroup->pEnemyGroup->ubNumRobots);
|
||||
pSector->ubNumTanks = (pSector->ubNumTanks + pGroup->pEnemyGroup->ubNumTanks);
|
||||
pSector->ubNumJeeps = (pSector->ubNumJeeps + pGroup->pEnemyGroup->ubNumJeeps);
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
LogStrategicEvent( "%d reinforcements have arrived to garrison sector %c%d",
|
||||
@@ -2325,7 +2325,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Strategic5");
|
||||
pPatrolGroup->pEnemyGroup->ubNumRobots += pGroup->pEnemyGroup->ubNumRobots;
|
||||
pPatrolGroup->pEnemyGroup->ubNumTanks += pGroup->pEnemyGroup->ubNumTanks;
|
||||
pPatrolGroup->pEnemyGroup->ubNumJeeps += pGroup->pEnemyGroup->ubNumJeeps;
|
||||
pPatrolGroup->ubGroupSize += (UINT8)(pGroup->pEnemyGroup->ubNumTroops + pGroup->pEnemyGroup->ubNumElites + pGroup->pEnemyGroup->ubNumAdmins
|
||||
pPatrolGroup->ubGroupSize += (pGroup->pEnemyGroup->ubNumTroops + pGroup->pEnemyGroup->ubNumElites + pGroup->pEnemyGroup->ubNumAdmins
|
||||
+ pGroup->pEnemyGroup->ubNumRobots + pGroup->pEnemyGroup->ubNumTanks + pGroup->pEnemyGroup->ubNumJeeps);
|
||||
#ifdef JA2BETAVERSION
|
||||
LogStrategicEvent( "%d reinforcements have joined patrol group at sector %c%d (new size: %d)",
|
||||
@@ -2678,7 +2678,7 @@ void CheckEnemyControlledSector( UINT8 ubSectorID )
|
||||
{
|
||||
if( pGroup->pEnemyGroup->ubPendingReinforcements > 4 )
|
||||
{
|
||||
UINT8 ubNum = (UINT8)(3 + Random( 3 ));
|
||||
UINT16 ubNum = (UINT16)(3 + Random( 3 ));
|
||||
pGroup->pEnemyGroup->ubNumTroops += ubNum;
|
||||
pGroup->ubGroupSize += ubNum;
|
||||
pGroup->pEnemyGroup->ubPendingReinforcements -= ubNum;
|
||||
@@ -3044,7 +3044,7 @@ BOOLEAN SendReinforcementsForGarrison( INT32 iDstGarrisonID, UINT16 usDefencePoi
|
||||
GROUP *pGroup;
|
||||
UINT8 ubSrcSectorX, ubSrcSectorY, ubDstSectorX, ubDstSectorY;
|
||||
UINT8 ubNumExtraReinforcements;
|
||||
UINT8 ubGroupSize;
|
||||
UINT16 ubGroupSize;
|
||||
BOOLEAN fLimitMaxTroopsAllowable = FALSE;
|
||||
|
||||
Ensure_RepairedGarrisonGroup( &gGarrisonGroup, &giGarrisonArraySize ); /* added NULL fix, 2007-03-03, Sgt. Kolja */
|
||||
@@ -3171,7 +3171,7 @@ BOOLEAN SendReinforcementsForGarrison( INT32 iDstGarrisonID, UINT16 usDefencePoi
|
||||
pGroup->ubMoveType = ONE_WAY;
|
||||
gGarrisonGroup[ iDstGarrisonID ].ubPendingGroupID = pGroup->ubGroupID;
|
||||
|
||||
ubGroupSize = (UINT8)(pGroup->pEnemyGroup->ubNumTroops + pGroup->pEnemyGroup->ubNumElites + pGroup->pEnemyGroup->ubNumAdmins + pGroup->pEnemyGroup->ubNumRobots + pGroup->pEnemyGroup->ubNumTanks + pGroup->pEnemyGroup->ubNumJeeps);
|
||||
ubGroupSize = (UINT16)(pGroup->pEnemyGroup->ubNumTroops + pGroup->pEnemyGroup->ubNumElites + pGroup->pEnemyGroup->ubNumAdmins + pGroup->pEnemyGroup->ubNumRobots + pGroup->pEnemyGroup->ubNumTanks + pGroup->pEnemyGroup->ubNumJeeps);
|
||||
|
||||
if( ubNumExtraReinforcements )
|
||||
{
|
||||
@@ -3261,7 +3261,7 @@ BOOLEAN SendReinforcementsForGarrison( INT32 iDstGarrisonID, UINT16 usDefencePoi
|
||||
pGroup->ubOriginalSector = (UINT8)SECTOR( ubDstSectorX, ubDstSectorY );
|
||||
pGroup->ubMoveType = ONE_WAY;
|
||||
gGarrisonGroup[ iDstGarrisonID ].ubPendingGroupID = pGroup->ubGroupID;
|
||||
ubGroupSize = (UINT8)(pGroup->pEnemyGroup->ubNumTroops + pGroup->pEnemyGroup->ubNumElites + pGroup->pEnemyGroup->ubNumAdmins + pGroup->pEnemyGroup->ubNumRobots + pGroup->pEnemyGroup->ubNumTanks + pGroup->pEnemyGroup->ubNumJeeps);
|
||||
ubGroupSize = (UINT16)(pGroup->pEnemyGroup->ubNumTroops + pGroup->pEnemyGroup->ubNumElites + pGroup->pEnemyGroup->ubNumAdmins + pGroup->pEnemyGroup->ubNumRobots + pGroup->pEnemyGroup->ubNumTanks + pGroup->pEnemyGroup->ubNumJeeps);
|
||||
|
||||
if( ubNumExtraReinforcements )
|
||||
{
|
||||
@@ -4510,15 +4510,15 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
||||
UINT8 stagesector0, stagesector1, stagesector2, stagesector3;
|
||||
UINT8 assaultsector0, assaultsector1, assaultsector2, assaultsector3;
|
||||
unsigned ubNumSoldiers;
|
||||
UINT8 ubNumRobots = 0;
|
||||
UINT8 ubNumTanks = 0;
|
||||
UINT8 ubNumJeeps = 0;
|
||||
UINT16 ubNumRobots = 0;
|
||||
UINT16 ubNumTanks = 0;
|
||||
UINT16 ubNumJeeps = 0;
|
||||
UINT32 totalusedsoldiers = 0;
|
||||
UINT8 grouptroops[4] = {0,0,0,0};
|
||||
UINT8 groupelites[4] = {0,0,0,0};
|
||||
UINT8 grouprobots[4] = {0,0,0,0};
|
||||
UINT8 grouptanks[4] = {0,0,0,0};
|
||||
UINT8 groupjeeps[4] = {0, 0, 0, 0};
|
||||
UINT16 grouptroops[4] = {0,0,0,0};
|
||||
UINT16 groupelites[4] = {0,0,0,0};
|
||||
UINT16 grouprobots[4] = {0,0,0,0};
|
||||
UINT16 grouptanks[4] = {0,0,0,0};
|
||||
UINT16 groupjeeps[4] = {0, 0, 0, 0};
|
||||
|
||||
UINT32 difficultyMod;
|
||||
switch (gGameOptions.ubDifficultyLevel)
|
||||
@@ -5211,12 +5211,12 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
||||
soldiersThisSquad = (unsigned)gGameExternalOptions.iMaxEnemyGroupSize;
|
||||
}
|
||||
ubNumSoldiers -= soldiersThisSquad;
|
||||
UINT8 adminsThisSquad = 0;
|
||||
UINT8 troopsThisSquad = 0;
|
||||
UINT8 elitesThisSquad = 0;
|
||||
UINT8 robotsThisSquad = 0;
|
||||
UINT8 tanksThisSquad = 0;
|
||||
UINT8 jeepsThisSquad = 0;
|
||||
UINT16 adminsThisSquad = 0;
|
||||
UINT16 troopsThisSquad = 0;
|
||||
UINT16 elitesThisSquad = 0;
|
||||
UINT16 robotsThisSquad = 0;
|
||||
UINT16 tanksThisSquad = 0;
|
||||
UINT16 jeepsThisSquad = 0;
|
||||
// this is an attack group, but set it to patrol since we'll set the admin/regular/elite composition by hand here
|
||||
InitializeGroup(GROUP_TYPE_PATROL, soldiersThisSquad, troopsThisSquad, elitesThisSquad, robotsThisSquad, jeepsThisSquad, tanksThisSquad, Random(10 * 100) < difficultyMod * direness);
|
||||
if (direness < 25) {
|
||||
@@ -5259,7 +5259,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
||||
// Note: 1st optional parm is a count of troops to send
|
||||
// 2nd optional parm is the composition of troops
|
||||
if (option1 > 0 && option1 < 256) {
|
||||
ubNumSoldiers = (UINT8)(option1);
|
||||
ubNumSoldiers = option1;
|
||||
} else {
|
||||
// Something is goofy, just send a default sized squad
|
||||
ubNumSoldiers = gubMinEnemyGroupSize;
|
||||
@@ -5351,7 +5351,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
||||
if ( !gfUnlimitedTroops )
|
||||
giReinforcementPool -= ubNumSoldiers;
|
||||
|
||||
UINT8 ubNumTroops, ubNumElites;
|
||||
UINT16 ubNumTroops, ubNumElites;
|
||||
// set the type to patrol as we're manually tuning the group composition here (100% elites + ASD upgrades)
|
||||
InitializeGroup(GROUP_TYPE_PATROL, ubNumSoldiers, ubNumTroops, ubNumElites, ubNumRobots, ubNumJeeps, ubNumTanks, Random(10*100) < difficultyMod * HighestPlayerProgressPercentage());
|
||||
|
||||
@@ -6751,7 +6751,7 @@ void ClearPreviousAIGroupAssignment( GROUP *pGroup )
|
||||
}
|
||||
}
|
||||
|
||||
void CalcNumTroopsBasedOnComposition( UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 ubTotal, INT32 iCompositionID )
|
||||
void CalcNumTroopsBasedOnComposition( UINT16 *pubNumTroops, UINT16 *pubNumElites, UINT16 ubTotal, INT32 iCompositionID )
|
||||
{
|
||||
*pubNumTroops = gArmyComp[ iCompositionID ].bTroopPercentage * ubTotal / 100;
|
||||
*pubNumElites = gArmyComp[ iCompositionID ].bElitePercentage * ubTotal / 100;
|
||||
@@ -6795,19 +6795,19 @@ void ConvertGroupTroopsToComposition( GROUP *pGroup, INT32 iCompositionID )
|
||||
ValidateLargeGroup( pGroup );
|
||||
}
|
||||
|
||||
void RemoveSoldiersFromGarrisonBasedOnComposition( INT32 iGarrisonID, UINT8 ubSize )
|
||||
void RemoveSoldiersFromGarrisonBasedOnComposition( INT32 iGarrisonID, UINT16 ubSize )
|
||||
{
|
||||
SECTORINFO *pSector;
|
||||
INT32 iCompositionID;
|
||||
UINT8 ubNumTroops, ubNumElites;
|
||||
UINT16 ubNumTroops, ubNumElites;
|
||||
|
||||
//debug stuff
|
||||
UINT8 ubOrigSectorAdmins;
|
||||
UINT8 ubOrigSectorTroops;
|
||||
UINT8 ubOrigSectorElites;
|
||||
UINT8 ubOrigNumElites;
|
||||
UINT8 ubOrigNumTroops;
|
||||
UINT8 ubOrigSize;
|
||||
UINT16 ubOrigSectorAdmins;
|
||||
UINT16 ubOrigSectorTroops;
|
||||
UINT16 ubOrigSectorElites;
|
||||
UINT16 ubOrigNumElites;
|
||||
UINT16 ubOrigNumTroops;
|
||||
UINT16 ubOrigSize;
|
||||
|
||||
Ensure_RepairedGarrisonGroup( &gGarrisonGroup, &giGarrisonArraySize ); /* added NULL fix, 2007-03-03, Sgt. Kolja */
|
||||
iCompositionID = gGarrisonGroup[ iGarrisonID ].ubComposition;
|
||||
@@ -7084,12 +7084,12 @@ void ASDInitializePatrolGroup(GROUP *pGroup)
|
||||
}
|
||||
}
|
||||
|
||||
void InitializeGroup( const GROUP_TYPE groupType, const UINT8 groupSize, ENEMYGROUP& enemyGroup, const BOOLEAN asdUpgrade )
|
||||
void InitializeGroup( const GROUP_TYPE groupType, const UINT16 groupSize, ENEMYGROUP& enemyGroup, const BOOLEAN asdUpgrade )
|
||||
{
|
||||
InitializeGroup( groupType, groupSize, enemyGroup.ubNumTroops, enemyGroup.ubNumElites, enemyGroup.ubNumRobots, enemyGroup.ubNumJeeps, enemyGroup.ubNumTanks, asdUpgrade );
|
||||
}
|
||||
|
||||
void InitializeGroup( const GROUP_TYPE groupType, const UINT8 groupSize, UINT8 &troopCount, UINT8 &eliteCount, UINT8 &robotCount, UINT8 &jeepCount, UINT8 &tankCount, const BOOLEAN asdUpgrade )
|
||||
void InitializeGroup( const GROUP_TYPE groupType, const UINT16 groupSize, UINT16 &troopCount, UINT16 &eliteCount, UINT16 &robotCount, UINT16 &jeepCount, UINT16 &tankCount, const BOOLEAN asdUpgrade )
|
||||
{
|
||||
troopCount = groupSize;
|
||||
eliteCount = 0;
|
||||
|
||||
@@ -84,8 +84,8 @@ enum GROUP_TYPE
|
||||
};
|
||||
|
||||
void ASDInitializePatrolGroup(GROUP *pGroup);
|
||||
void InitializeGroup(const GROUP_TYPE groupType, const UINT8 groupSize, ENEMYGROUP& enemyGroup, const BOOLEAN asdUpgrade);
|
||||
void InitializeGroup(const GROUP_TYPE groupType, const UINT8 groupSize, UINT8 &troopCount, UINT8 &eliteCount, UINT8 &robotCount, UINT8 &jeepCount, UINT8 &tankCount, const BOOLEAN asdUpgrade);
|
||||
void InitializeGroup(const GROUP_TYPE groupType, const UINT16 groupSize, ENEMYGROUP& enemyGroup, const BOOLEAN asdUpgrade);
|
||||
void InitializeGroup(const GROUP_TYPE groupType, const UINT16 groupSize, UINT16 &troopCount, UINT16 &eliteCount, UINT16 &robotCount, UINT16 &jeepCount, UINT16 &tankCount, const BOOLEAN asdUpgrade);
|
||||
|
||||
extern BOOLEAN gfDisplayStrategicAILogs;
|
||||
extern BOOLEAN gfFirstBattleMeanwhileScenePending;
|
||||
|
||||
@@ -62,28 +62,28 @@ typedef struct PLAYERGROUP
|
||||
|
||||
typedef struct ENEMYGROUP
|
||||
{
|
||||
UINT8 ubNumTroops; //number of regular troops in the group
|
||||
UINT8 ubNumElites; //number of elite troops in the group
|
||||
UINT8 ubNumAdmins; //number of administrators in the group
|
||||
UINT16 ubNumTroops; //number of regular troops in the group
|
||||
UINT16 ubNumElites; //number of elite troops in the group
|
||||
UINT16 ubNumAdmins; //number of administrators in the group
|
||||
UINT8 ubLeaderProfileID; //could be Mike, maybe the warden... someone new, but likely nobody.
|
||||
UINT8 ubPendingReinforcements;//This group is waiting for reinforcements before attacking or attempting to fortify newly aquired sector.
|
||||
UINT8 ubAdminsInBattle; //number of administrators in currently in battle.
|
||||
UINT16 ubPendingReinforcements;//This group is waiting for reinforcements before attacking or attempting to fortify newly aquired sector.
|
||||
UINT16 ubAdminsInBattle; //number of administrators in currently in battle.
|
||||
UINT8 ubIntention; //the type of group this is: patrol, assault, spies, etc.
|
||||
UINT8 ubTroopsInBattle; //number of soldiers currently in battle.
|
||||
UINT8 ubElitesInBattle; //number of elite soldiers currently in battle.
|
||||
UINT16 ubTroopsInBattle; //number of soldiers currently in battle.
|
||||
UINT16 ubElitesInBattle; //number of elite soldiers currently in battle.
|
||||
// WDS - New AI
|
||||
UINT8 ubNumTanks;
|
||||
UINT8 ubTanksInBattle;
|
||||
UINT8 ubNumJeeps;
|
||||
UINT8 ubJeepsInBattle;
|
||||
UINT16 ubNumTanks;
|
||||
UINT16 ubTanksInBattle;
|
||||
UINT16 ubNumJeeps;
|
||||
UINT16 ubJeepsInBattle;
|
||||
|
||||
// Flugente: number of turncoats
|
||||
UINT8 ubNumAdmins_Turncoat;
|
||||
UINT8 ubNumTroops_Turncoat;
|
||||
UINT8 ubNumElites_Turncoat;
|
||||
|
||||
UINT8 ubNumRobots; //number of enemy robots in the group
|
||||
UINT8 ubRobotsInBattle; //number of enemy robots currently in battle.
|
||||
UINT16 ubNumRobots; //number of enemy robots in the group
|
||||
UINT16 ubRobotsInBattle; //number of enemy robots currently in battle.
|
||||
|
||||
INT8 bPadding[11];
|
||||
}ENEMYGROUP;
|
||||
@@ -120,7 +120,7 @@ typedef struct GROUP
|
||||
BOOLEAN fVehicle; //vehicle controlled group?
|
||||
BOOLEAN fPersistant; //This flag when set prevents the group from being automatically deleted when it becomes empty.
|
||||
UINT8 ubGroupID; //the unique ID of the group (used for hooking into events and SOLDIERTYPE)
|
||||
UINT8 ubGroupSize; //total number of individuals in the group.
|
||||
UINT16 ubGroupSize; //total number of individuals in the group.
|
||||
UINT8 ubSectorX, ubSectorY; //last/curr sector occupied
|
||||
UINT8 ubSectorZ;
|
||||
UINT8 ubNextX, ubNextY; //next sector destination
|
||||
|
||||
@@ -52,10 +52,10 @@ extern ARMY_GUN_CHOICE_TYPE gExtendedArmyGunChoices[SOLDIER_GUN_CHOICE_SELECTION
|
||||
extern ARMY_GUN_CHOICE_TYPE gArmyItemChoices[SOLDIER_GUN_CHOICE_SELECTIONS][MAX_ITEM_TYPES];
|
||||
extern BOOLEAN gfTownUsesLoyalty[MAX_TOWNS];
|
||||
|
||||
std::map<UINT8, std::map<int, UINT8>> transportGroupIdToSoldierMap;
|
||||
std::map<UINT8, std::map<int, UINT16>> transportGroupIdToSoldierMap;
|
||||
std::map<UINT8, TransportGroupSectorInfo> transportGroupSectorInfo;
|
||||
|
||||
void PopulateTransportGroup(UINT8& admins, UINT8& troops, UINT8& elites, UINT8& jeeps, UINT8& tanks, UINT8& robots, UINT8 progress, int difficulty, BOOLEAN trySpecialCase);
|
||||
void PopulateTransportGroup(UINT16& admins, UINT16& troops, UINT16& elites, UINT16& jeeps, UINT16& tanks, UINT16& robots, UINT8 progress, int difficulty, BOOLEAN trySpecialCase);
|
||||
|
||||
BOOLEAN DeployTransportGroup()
|
||||
{
|
||||
@@ -128,7 +128,7 @@ BOOLEAN DeployTransportGroup()
|
||||
|
||||
TRANSPORT_GROUP_DEBUG(L"DeployTransportGroup sending group to sectorId: %d (%d/%d)", ubSectorID, SECTORX(ubSectorID), SECTORY(ubSectorID));
|
||||
|
||||
UINT8 admins, troops, elites, robots, jeeps, tanks;
|
||||
UINT16 admins, troops, elites, robots, jeeps, tanks;
|
||||
const UINT8 progress = min(125, HighestPlayerProgressPercentage() + recentLossCount * 5);
|
||||
PopulateTransportGroup(admins, troops, elites, jeeps, tanks, robots, progress, difficulty, mineSectorIds.size() == 1);
|
||||
|
||||
@@ -152,7 +152,7 @@ BOOLEAN DeployTransportGroup()
|
||||
|
||||
BOOLEAN ForceDeployTransportGroup(UINT8 sectorId)
|
||||
{
|
||||
UINT8 admins, troops, elites, robots, jeeps, tanks;
|
||||
UINT16 admins, troops, elites, robots, jeeps, tanks;
|
||||
const INT8 recentLossCount = min(5, GetAllStrategicEventsOfType(EVENT_TRANSPORT_GROUP_DEFEATED).size());
|
||||
const UINT8 progress = min(125, HighestPlayerProgressPercentage() + recentLossCount * 5);
|
||||
const UINT8 difficulty = gGameOptions.ubDifficultyLevel;
|
||||
@@ -603,7 +603,7 @@ void UpdateTransportGroupInventory()
|
||||
{
|
||||
SOLDIERTYPE* pSoldier = &Menptr[slot];
|
||||
|
||||
const std::map<UINT8, std::map<int, UINT8>>::iterator groupIter = transportGroupIdToSoldierMap.find(pSoldier->ubGroupID);
|
||||
const std::map<UINT8, std::map<int, UINT16>>::iterator groupIter = transportGroupIdToSoldierMap.find(pSoldier->ubGroupID);
|
||||
if (groupIter != transportGroupIdToSoldierMap.end())
|
||||
{
|
||||
// let's find out if this group is coming home or still outgoing to its target destination
|
||||
@@ -620,7 +620,7 @@ void UpdateTransportGroupInventory()
|
||||
}
|
||||
|
||||
// found a matching transport groupid
|
||||
std::map<int, UINT8>::iterator soldierClassIter = groupIter->second.find(SOLDIER_CLASS_JEEP);
|
||||
std::map<int, UINT16>::iterator soldierClassIter = groupIter->second.find(SOLDIER_CLASS_JEEP);
|
||||
if (cachedGroupJeepCount.find(groupIter->first) == cachedGroupJeepCount.end())
|
||||
{
|
||||
cachedGroupJeepCount[groupIter->first] = soldierClassIter == groupIter->second.end() ? 0 : groupIter->second[SOLDIER_CLASS_JEEP];
|
||||
@@ -874,7 +874,7 @@ void UpdateTransportGroupInventory()
|
||||
}
|
||||
}
|
||||
|
||||
void AddToTransportGroupMap(UINT8 groupId, int soldierClass, UINT8 amount)
|
||||
void AddToTransportGroupMap(UINT8 groupId, int soldierClass, UINT16 amount)
|
||||
{
|
||||
if (gGameExternalOptions.fStrategicTransportGroupsEnabled == FALSE)
|
||||
{
|
||||
@@ -913,7 +913,7 @@ void NotifyTransportGroupDefeated()
|
||||
AddStrategicEvent(EVENT_TRANSPORT_GROUP_DEFEATED, GetWorldTotalMin() + 60 * hoursToRememberDefeat, 0);
|
||||
}
|
||||
|
||||
void PopulateTransportGroup(UINT8& admins, UINT8& troops, UINT8& elites, UINT8& jeeps, UINT8& tanks, UINT8& robots, UINT8 progress, int difficulty, BOOLEAN trySpecialCase)
|
||||
void PopulateTransportGroup(UINT16& admins, UINT16& troops, UINT16& elites, UINT16& jeeps, UINT16& tanks, UINT16& robots, UINT8 progress, int difficulty, BOOLEAN trySpecialCase)
|
||||
{
|
||||
admins = troops = elites = robots = jeeps = tanks = 0;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ void UpdateTransportGroupInventory();
|
||||
|
||||
const std::map<UINT8, TransportGroupSectorInfo> GetTransportGroupSectorInfo();
|
||||
|
||||
void AddToTransportGroupMap(UINT8 groupId, int soldierClass, UINT8 amount);
|
||||
void AddToTransportGroupMap(UINT8 groupId, int soldierClass, UINT16 amount);
|
||||
void ClearTransportGroupMap();
|
||||
|
||||
void NotifyTransportGroupDefeated();
|
||||
|
||||
Reference in New Issue
Block a user