mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Change UINT8 to UINT16 for soldierInitLists & hostiles in sector
This commit is contained in:
+14
-14
@@ -163,13 +163,13 @@ typedef struct AUTORESOLVE_STRUCT
|
||||
|
||||
UINT8 ubEnemyLeadership;
|
||||
UINT8 ubPlayerLeadership;
|
||||
UINT8 ubMercs, ubCivs, ubEnemies;
|
||||
UINT8 ubAdmins, ubTroops, ubElites, ubTanks, ubJeeps, ubRobots;
|
||||
UINT8 ubYMCreatures, ubYFCreatures, ubAMCreatures, ubAFCreatures;
|
||||
UINT8 ubBloodcats;
|
||||
UINT8 ubZombies;
|
||||
UINT8 ubBandits;
|
||||
UINT8 ubAliveMercs, ubAliveCivs, ubAliveEnemies;
|
||||
UINT16 ubMercs, ubCivs, ubEnemies;
|
||||
UINT16 ubAdmins, ubTroops, ubElites, ubTanks, ubJeeps, ubRobots;
|
||||
UINT16 ubYMCreatures, ubYFCreatures, ubAMCreatures, ubAFCreatures;
|
||||
UINT16 ubBloodcats;
|
||||
UINT16 ubZombies;
|
||||
UINT16 ubBandits;
|
||||
UINT16 ubAliveMercs, ubAliveCivs, ubAliveEnemies;
|
||||
UINT8 ubMercCols, ubMercRows;
|
||||
UINT8 ubEnemyCols, ubEnemyRows;
|
||||
UINT8 ubCivCols, ubCivRows;
|
||||
@@ -410,10 +410,10 @@ void EliminateAllEnemies( UINT8 ubSectorX, UINT8 ubSectorY )
|
||||
GROUP *pGroup, *pDeleteGroup;
|
||||
SECTORINFO *pSector;
|
||||
INT32 i;
|
||||
UINT8 ubNumEnemies[ NUM_ENEMY_RANKS ];
|
||||
UINT8 ubNumTanks = 0;
|
||||
UINT8 ubNumJeeps = 0;
|
||||
UINT8 ubNumRobots = 0;
|
||||
UINT16 ubNumEnemies[NUM_ENEMY_RANKS]{};
|
||||
UINT16 ubNumTanks = 0;
|
||||
UINT16 ubNumJeeps = 0;
|
||||
UINT16 ubNumRobots = 0;
|
||||
UINT8 ubRankIndex;
|
||||
|
||||
//Clear any possible battle locator
|
||||
@@ -3067,7 +3067,7 @@ void CalculateAutoResolveInfo()
|
||||
&gpAR->ubAMCreatures, &gpAR->ubAFCreatures );
|
||||
}
|
||||
|
||||
gpAR->ubEnemies = (UINT8)min( gpAR->ubYMCreatures + gpAR->ubYFCreatures + gpAR->ubAMCreatures + gpAR->ubAFCreatures, MAX_AR_TEAM_SIZE );
|
||||
gpAR->ubEnemies = min( gpAR->ubYMCreatures + gpAR->ubYFCreatures + gpAR->ubAMCreatures + gpAR->ubAFCreatures, MAX_AR_TEAM_SIZE );
|
||||
}
|
||||
else if ( GetEnemyEncounterCode() == BLOODCAT_ATTACK_CODE ||
|
||||
GetEnemyEncounterCode() == ZOMBIE_ATTACK_CODE ||
|
||||
@@ -3087,7 +3087,7 @@ void CalculateAutoResolveInfo()
|
||||
gpAR->ubBandits = gubNumCreaturesAttackingTown;
|
||||
}
|
||||
|
||||
gpAR->ubEnemies = (UINT8)min( gubNumCreaturesAttackingTown, MAX_AR_TEAM_SIZE );
|
||||
gpAR->ubEnemies = min( gubNumCreaturesAttackingTown, MAX_AR_TEAM_SIZE );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3096,7 +3096,7 @@ void CalculateAutoResolveInfo()
|
||||
GetNumberOfEnemiesInFiveSectors( gpAR->ubSectorX, gpAR->ubSectorY,
|
||||
&gpAR->ubAdmins, &gpAR->ubTroops, &gpAR->ubElites, &gpAR->ubRobots, &gpAR->ubTanks, &gpAR->ubJeeps );
|
||||
|
||||
gpAR->ubEnemies = (UINT8)min( gpAR->ubAdmins + gpAR->ubTroops + gpAR->ubElites + gpAR->ubTanks + gpAR->ubJeeps + gpAR->ubRobots, MAX_AR_TEAM_SIZE );
|
||||
gpAR->ubEnemies = min( gpAR->ubAdmins + gpAR->ubTroops + gpAR->ubElites + gpAR->ubTanks + gpAR->ubJeeps + gpAR->ubRobots, MAX_AR_TEAM_SIZE );
|
||||
}
|
||||
|
||||
gfTransferTacticalOppositionToAutoResolve = FALSE;
|
||||
|
||||
+26
-26
@@ -487,18 +487,18 @@ typedef struct SECTORINFO
|
||||
//This value determines how quickly it is investigated by the enemy.
|
||||
UINT8 ubGarrisonID; //IF the sector has an ID for this (non 255), then the queen values this sector and it
|
||||
//indexes the garrison group.
|
||||
INT8 ubPendingReinforcements; //when the enemy owns this sector, this value will keep track of HIGH priority reinforcements -- not regular.
|
||||
INT8 ubPendingReinforcements; //when the enemy owns this sector, this value will keep track of HIGH priority reinforcements -- not regular.
|
||||
BOOLEAN fMilitiaTrainingPaid;
|
||||
UINT8 ubMilitiaTrainingPercentDone;
|
||||
UINT8 ubMilitiaTrainingHundredths;
|
||||
//enemy military presence
|
||||
BOOLEAN fPlayer[ 4 ]; //whether the player THINKS the sector is unde his control or not. array is for sublevels
|
||||
//enemy only info
|
||||
UINT8 ubNumTroops; //the actual number of troops here.
|
||||
UINT8 ubNumElites; //the actual number of elites here.
|
||||
UINT8 ubNumAdmins; //the actual number of admins here.
|
||||
UINT8 ubNumCreatures; //only set when immediately before ground attack made!
|
||||
UINT8 ubTroopsInBattle, ubElitesInBattle, ubAdminsInBattle, ubCreaturesInBattle;
|
||||
UINT16 ubNumTroops; //the actual number of troops here.
|
||||
UINT16 ubNumElites; //the actual number of elites here.
|
||||
UINT16 ubNumAdmins; //the actual number of admins here.
|
||||
UINT16 ubNumCreatures; //only set when immediately before ground attack made!
|
||||
UINT16 ubTroopsInBattle, ubElitesInBattle, ubAdminsInBattle, ubCreaturesInBattle;
|
||||
|
||||
INT8 bLastKnownEnemies; // -1 means never been there, no idea, otherwise it's what we'd observed most recently
|
||||
// while this is being maintained (partially, surely buggy), nothing uses it anymore. ARM
|
||||
@@ -511,8 +511,8 @@ typedef struct SECTORINFO
|
||||
//throught the sector without entering it.
|
||||
INT8 bNameId;
|
||||
INT8 bUSUSED;
|
||||
INT8 bBloodCats;
|
||||
INT8 bBloodCatPlacements;
|
||||
INT16 bBloodCats;
|
||||
INT16 bBloodCatPlacements;
|
||||
INT8 UNUSEDbSAMCondition;
|
||||
|
||||
UINT8 ubTravelRating; //Represents how travelled a sector is. Typically, the higher the travel rating,
|
||||
@@ -551,8 +551,8 @@ typedef struct SECTORINFO
|
||||
|
||||
UINT32 uiTimeAIArtillerywasOrdered; // Flugente: updated every time an artillery strike is ordered from the militia
|
||||
|
||||
UINT8 ubNumTanks;
|
||||
UINT8 ubTanksInBattle;
|
||||
UINT16 ubNumTanks;
|
||||
UINT16 ubTanksInBattle;
|
||||
|
||||
// Flugente: disease
|
||||
UINT16 usNumCorpses; // number of corpses in this sector
|
||||
@@ -565,8 +565,8 @@ typedef struct SECTORINFO
|
||||
FLOAT dFortification_UnappliedProgress; // progress done via assignment work. As we cannot update unloaded sectors, update happens once sector is loaded
|
||||
|
||||
// Flugente: enemy jeeps
|
||||
UINT8 ubNumJeeps;
|
||||
UINT8 ubJeepsInBattle;
|
||||
UINT16 ubNumJeeps;
|
||||
UINT16 ubJeepsInBattle;
|
||||
|
||||
UINT8 usWorkers;
|
||||
UINT8 ubWorkerTrainingHundredths;
|
||||
@@ -583,8 +583,8 @@ typedef struct SECTORINFO
|
||||
UINT8 ubNumElites_Turncoat;
|
||||
UINT8 usExplorationProgress;
|
||||
|
||||
UINT8 ubNumRobots;
|
||||
UINT8 ubRobotsInBattle;
|
||||
UINT16 ubNumRobots;
|
||||
UINT16 ubRobotsInBattle;
|
||||
INT8 bPadding[ 6 ];
|
||||
|
||||
}SECTORINFO;
|
||||
@@ -600,18 +600,18 @@ typedef struct UNDERGROUND_SECTORINFO
|
||||
{
|
||||
UINT32 uiFlags;
|
||||
UINT8 ubSectorX, ubSectorY, ubSectorZ;
|
||||
UINT8 ubNumElites, ubNumTroops, ubNumAdmins, ubNumCreatures;
|
||||
UINT16 ubNumElites, ubNumTroops, ubNumAdmins, ubNumCreatures;
|
||||
UINT8 fVisited;
|
||||
INT8 ubTravelRating; //Represents how travelled a sector is. Typically, the higher the travel rating,
|
||||
INT8 ubTravelRating; //Represents how travelled a sector is. Typically, the higher the travel rating,
|
||||
//the more people go near it. A travel rating of 0 means there are never people
|
||||
//around. This value is used for determining how often items would "vanish" from
|
||||
//a sector.
|
||||
UINT32 uiTimeCurrentSectorWasLastLoaded; //Specifies the last time the player was in the sector
|
||||
struct UNDERGROUND_SECTORINFO *next;
|
||||
|
||||
UINT8 ubNumBloodcats; // Bloodcat population
|
||||
UINT16 ubNumBloodcats; // Bloodcat population
|
||||
UINT8 ubCreatureHabitat; //determines how creatures live in this sector (see creature spreading.c)
|
||||
UINT8 ubElitesInBattle, ubTroopsInBattle, ubAdminsInBattle, ubCreaturesInBattle;
|
||||
UINT16 ubElitesInBattle, ubTroopsInBattle, ubAdminsInBattle, ubCreaturesInBattle;
|
||||
|
||||
// adding these (should not change struct layout due to padding)
|
||||
UINT8 ubMusicMode, ubUnsed;
|
||||
@@ -622,20 +622,20 @@ typedef struct UNDERGROUND_SECTORINFO
|
||||
BOOLEAN fCampaignSector;
|
||||
#endif
|
||||
|
||||
UINT8 uiNumberOfPrisonersOfWar[PRISONER_MAX];
|
||||
UINT16 uiNumberOfPrisonersOfWar[PRISONER_MAX];
|
||||
|
||||
UINT8 ubNumTanks;
|
||||
UINT8 ubTanksInBattle;
|
||||
UINT16 ubNumTanks;
|
||||
UINT16 ubTanksInBattle;
|
||||
|
||||
// Flugente: fortification
|
||||
FLOAT dFortification_MaxPossible; // the amount of fortification that can still be done in this sector, given the current layout plans. Is updated every time we unload a sector
|
||||
FLOAT dFortification_UnappliedProgress; // progress done via assignment work. As we cannot update unloaded sectors, update happens once sector is loaded
|
||||
|
||||
UINT8 ubNumJeeps;
|
||||
UINT8 ubJeepsInBattle;
|
||||
UINT16 ubNumJeeps;
|
||||
UINT16 ubJeepsInBattle;
|
||||
UINT8 usExplorationProgress;
|
||||
UINT8 ubNumRobots;
|
||||
UINT8 ubRobotsInBattle;
|
||||
UINT16 ubNumRobots;
|
||||
UINT16 ubRobotsInBattle;
|
||||
|
||||
INT8 bPadding[10];
|
||||
//no padding left!
|
||||
@@ -656,4 +656,4 @@ enum CreateMusic
|
||||
CM_ALWAYS,
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -139,11 +139,11 @@ INT32 giDestroyedLairID = 0;
|
||||
//prebattle interface, autoresolve, etc.
|
||||
INT16 gsCreatureInsertionCode = 0;
|
||||
INT32 gsCreatureInsertionGridNo = 0;
|
||||
UINT8 gubNumCreaturesAttackingTown = 0;
|
||||
UINT8 gubYoungMalesAttackingTown = 0;
|
||||
UINT8 gubYoungFemalesAttackingTown = 0;
|
||||
UINT8 gubAdultMalesAttackingTown = 0;
|
||||
UINT8 gubAdultFemalesAttackingTown = 0;
|
||||
UINT16 gubNumCreaturesAttackingTown = 0;
|
||||
UINT16 gubYoungMalesAttackingTown = 0;
|
||||
UINT16 gubYoungFemalesAttackingTown = 0;
|
||||
UINT16 gubAdultMalesAttackingTown = 0;
|
||||
UINT16 gubAdultFemalesAttackingTown = 0;
|
||||
UINT8 gubCreatureBattleCode = CREATURE_BATTLE_CODE_NONE;
|
||||
UINT8 gubSectorIDOfCreatureAttack = 0;
|
||||
|
||||
@@ -1634,8 +1634,8 @@ BOOLEAN MineClearOfMonsters( UINT8 ubMineIndex )
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void DetermineCreatureTownComposition( UINT8 ubNumCreatures, UINT8 *pubNumYoungMales, UINT8 *pubNumYoungFemales,
|
||||
UINT8 *pubNumAdultMales, UINT8 *pubNumAdultFemales )
|
||||
void DetermineCreatureTownComposition( UINT16 ubNumCreatures, UINT16 *pubNumYoungMales, UINT16 *pubNumYoungFemales,
|
||||
UINT16 *pubNumAdultMales, UINT16 *pubNumAdultFemales )
|
||||
{
|
||||
INT32 i, iRandom;
|
||||
UINT8 ubYoungMalePercentage = 10;
|
||||
@@ -1667,8 +1667,8 @@ void DetermineCreatureTownComposition( UINT8 ubNumCreatures, UINT8 *pubNumYoungM
|
||||
}
|
||||
}
|
||||
|
||||
void DetermineCreatureTownCompositionBasedOnTacticalInformation( UINT8 *pubNumCreatures, UINT8 *pubNumYoungMales, UINT8 *pubNumYoungFemales,
|
||||
UINT8 *pubNumAdultMales, UINT8 *pubNumAdultFemales )
|
||||
void DetermineCreatureTownCompositionBasedOnTacticalInformation( UINT16 *pubNumCreatures, UINT16 *pubNumYoungMales, UINT16 *pubNumYoungFemales,
|
||||
UINT16 *pubNumAdultMales, UINT16 *pubNumAdultFemales )
|
||||
{
|
||||
SOLDIERTYPE *pSoldier;
|
||||
|
||||
@@ -1704,7 +1704,7 @@ void DetermineCreatureTownCompositionBasedOnTacticalInformation( UINT8 *pubNumCr
|
||||
}
|
||||
}
|
||||
|
||||
void DetermineOtherCreatureTownCompositionBasedOnTacticalInformation( UINT8* pubNumCreatures, UINT8* pubNumBloodcats, UINT8* pubNumZombies, UINT8* pubNumBandits )
|
||||
void DetermineOtherCreatureTownCompositionBasedOnTacticalInformation( UINT16* pubNumCreatures, UINT16* pubNumBloodcats, UINT16* pubNumZombies, UINT16* pubNumBandits )
|
||||
{
|
||||
SOLDIERTYPE *pSoldier;
|
||||
|
||||
@@ -1750,13 +1750,13 @@ BOOLEAN PrepareCreaturesForBattle()
|
||||
UINT8 ubAdultMalePercentage;
|
||||
UINT8 ubAdultFemalePercentage;
|
||||
UINT8 ubCreatureHabitat;
|
||||
UINT8 ubNumLarvae = 0;
|
||||
UINT8 ubNumInfants = 0;
|
||||
UINT8 ubNumYoungMales = 0;
|
||||
UINT8 ubNumYoungFemales = 0;
|
||||
UINT8 ubNumAdultMales = 0;
|
||||
UINT8 ubNumAdultFemales = 0;
|
||||
UINT8 ubNumCreatures;
|
||||
UINT16 ubNumLarvae = 0;
|
||||
UINT16 ubNumInfants = 0;
|
||||
UINT16 ubNumYoungMales = 0;
|
||||
UINT16 ubNumYoungFemales = 0;
|
||||
UINT16 ubNumAdultMales = 0;
|
||||
UINT16 ubNumAdultFemales = 0;
|
||||
UINT16 ubNumCreatures;
|
||||
|
||||
if( !gubCreatureBattleCode )
|
||||
{
|
||||
@@ -2422,4 +2422,4 @@ void ResetCreatureAttackVariables()
|
||||
gubAdultFemalesAttackingTown = 0;
|
||||
gubCreatureBattleCode = CREATURE_BATTLE_CODE_NONE;
|
||||
gubSectorIDOfCreatureAttack = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,11 +30,11 @@ BOOLEAN GetWarpOutOfMineCodes( INT16 *psSectorX, INT16 *psSectorY, INT8 *pbSecto
|
||||
|
||||
extern INT16 gsCreatureInsertionCode;
|
||||
extern INT32 gsCreatureInsertionGridNo;
|
||||
extern UINT8 gubNumCreaturesAttackingTown;
|
||||
extern UINT8 gubYoungMalesAttackingTown;
|
||||
extern UINT8 gubYoungFemalesAttackingTown;
|
||||
extern UINT8 gubAdultMalesAttackingTown;
|
||||
extern UINT8 gubAdultFemalesAttackingTown;
|
||||
extern UINT16 gubNumCreaturesAttackingTown;
|
||||
extern UINT16 gubYoungMalesAttackingTown;
|
||||
extern UINT16 gubYoungFemalesAttackingTown;
|
||||
extern UINT16 gubAdultMalesAttackingTown;
|
||||
extern UINT16 gubAdultFemalesAttackingTown;
|
||||
extern UINT8 gubSectorIDOfCreatureAttack;
|
||||
enum{
|
||||
CREATURE_BATTLE_CODE_NONE,
|
||||
@@ -53,15 +53,15 @@ enum {
|
||||
};
|
||||
extern UINT8 guCreatureAttackType;
|
||||
|
||||
void DetermineCreatureTownComposition( UINT8 ubNumCreatures,
|
||||
UINT8 *pubNumYoungMales, UINT8 *pubNumYoungFemales,
|
||||
UINT8 *pubNumAdultMales, UINT8 *pubNumAdultFemales );
|
||||
void DetermineCreatureTownComposition( UINT16 ubNumCreatures,
|
||||
UINT16 *pubNumYoungMales, UINT16 *pubNumYoungFemales,
|
||||
UINT16 *pubNumAdultMales, UINT16 *pubNumAdultFemales );
|
||||
|
||||
void DetermineCreatureTownCompositionBasedOnTacticalInformation( UINT8 *pubNumCreatures,
|
||||
UINT8 *pubNumYoungMales, UINT8 *pubNumYoungFemales,
|
||||
UINT8 *pubNumAdultMales, UINT8 *pubNumAdultFemales );
|
||||
void DetermineCreatureTownCompositionBasedOnTacticalInformation( UINT16 *pubNumCreatures,
|
||||
UINT16 *pubNumYoungMales, UINT16 *pubNumYoungFemales,
|
||||
UINT16 *pubNumAdultMales, UINT16 *pubNumAdultFemales );
|
||||
|
||||
void DetermineOtherCreatureTownCompositionBasedOnTacticalInformation( UINT8* pubNumCreatures, UINT8* pubNumBloodcats, UINT8* pubNumZombies, UINT8* pubNumBandits );
|
||||
void DetermineOtherCreatureTownCompositionBasedOnTacticalInformation( UINT16* pubNumCreatures, UINT16* pubNumBloodcats, UINT16* pubNumZombies, UINT16* pubNumBandits );
|
||||
|
||||
|
||||
BOOLEAN PlayerGroupIsInACreatureInfestedMine();
|
||||
@@ -114,4 +114,4 @@ extern CREATURECOMPOSITION gCreatureComposition[ MAX_NUMBER_OF_CREATURE_COMPOSIT
|
||||
// Flugente: reset code for creature attacks
|
||||
void ResetCreatureAttackVariables();
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -220,7 +220,7 @@ static int l_iStringToUse(lua_State *L);
|
||||
static int l_StopVideo(lua_State *L);
|
||||
static int l_StartVideo(lua_State *L);
|
||||
|
||||
UNDERGROUND_SECTORINFO* NewUndergroundNode( UINT8 ubSectorX, UINT8 ubSectorY, UINT8 ubSectorZ );
|
||||
extern UNDERGROUND_SECTORINFO* NewUndergroundNode( UINT8 ubSectorX, UINT8 ubSectorY, UINT8 ubSectorZ );
|
||||
|
||||
BOOLEAN LoadLuaGlobalFromLoadGameFile( HWFILE hFile );
|
||||
BOOLEAN SaveLuaGlobalToSaveGameFile( HWFILE hFile );
|
||||
@@ -13574,7 +13574,7 @@ static int l_SetPhotoFactLaptopData( lua_State *L )
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern UINT8 NumHostilesInSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ );
|
||||
extern UINT16 NumHostilesInSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ );
|
||||
|
||||
static int l_GetNumHostilesInSector( lua_State *L )
|
||||
{
|
||||
|
||||
@@ -543,7 +543,7 @@ BOOLEAN SetThisSectorAsEnemyControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, BO
|
||||
{
|
||||
// Enemies can steal items left lying about, each one can carry out up to X kg (defined in RemoveRandomItemsInSector).
|
||||
// Don't care underground sectors here -- we are in overground code branch.
|
||||
UINT8 ubNumAdmins, ubNumTroops, ubNumElites, ubNumRobots, ubNumTanks, ubNumJeeps;
|
||||
UINT16 ubNumAdmins, ubNumTroops, ubNumElites, ubNumRobots, ubNumTanks, ubNumJeeps;
|
||||
GetNumberOfStationaryEnemiesInSector( sMapX, sMapY, &ubNumAdmins, &ubNumTroops, &ubNumElites, &ubNumRobots, &ubNumTanks, &ubNumJeeps );
|
||||
RemoveRandomItemsInSector( sMapX, sMapY, bMapZ, (UINT32)ubNumAdmins + ubNumTroops + ubNumElites );
|
||||
}
|
||||
|
||||
+40
-41
@@ -141,9 +141,9 @@ void ValidateEnemiesHaveWeapons()
|
||||
}
|
||||
|
||||
//Counts enemies and crepitus, but not bloodcats.
|
||||
UINT8 NumHostilesInSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
||||
UINT16 NumHostilesInSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
||||
{
|
||||
UINT8 ubNumHostiles = 0;
|
||||
UINT16 ubNumHostiles = 0;
|
||||
|
||||
AssertGE( sSectorX, MINIMUM_VALID_X_COORDINATE);
|
||||
AssertLE( sSectorX, MAXIMUM_VALID_X_COORDINATE );
|
||||
@@ -158,7 +158,7 @@ UINT8 NumHostilesInSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
||||
pSector = FindUnderGroundSector( sSectorX, sSectorY, (UINT8)sSectorZ );
|
||||
if( pSector )
|
||||
{
|
||||
ubNumHostiles = (UINT8)(pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumCreatures + pSector->ubNumRobots + pSector->ubNumJeeps + pSector->ubNumTanks);
|
||||
ubNumHostiles = (pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumCreatures + pSector->ubNumRobots + pSector->ubNumJeeps + pSector->ubNumTanks);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -168,7 +168,7 @@ UINT8 NumHostilesInSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
||||
|
||||
//Count stationary hostiles
|
||||
pSector = &SectorInfo[ SECTOR( sSectorX, sSectorY ) ];
|
||||
ubNumHostiles = (UINT8)(pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumCreatures + pSector->ubNumRobots + pSector->ubNumJeeps + pSector->ubNumTanks);
|
||||
ubNumHostiles = (pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumCreatures + pSector->ubNumRobots + pSector->ubNumJeeps + pSector->ubNumTanks);
|
||||
|
||||
//Count mobile enemies
|
||||
pGroup = gpGroupList;
|
||||
@@ -185,9 +185,9 @@ UINT8 NumHostilesInSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
||||
return ubNumHostiles;
|
||||
}
|
||||
|
||||
UINT8 NumEnemiesInAnySector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
||||
UINT16 NumEnemiesInAnySector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
||||
{
|
||||
UINT8 ubNumEnemies = 0;
|
||||
UINT16 ubNumEnemies = 0;
|
||||
|
||||
AssertGE( sSectorX, MINIMUM_VALID_X_COORDINATE);
|
||||
AssertLE( sSectorX, MAXIMUM_VALID_X_COORDINATE );
|
||||
@@ -202,7 +202,7 @@ UINT8 NumEnemiesInAnySector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
||||
pSector = FindUnderGroundSector( sSectorX, sSectorY, (UINT8)sSectorZ );
|
||||
if( pSector )
|
||||
{
|
||||
ubNumEnemies = (UINT8)(pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumRobots + pSector->ubNumJeeps + pSector->ubNumTanks);
|
||||
ubNumEnemies = (pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumRobots + pSector->ubNumJeeps + pSector->ubNumTanks);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -212,7 +212,7 @@ UINT8 NumEnemiesInAnySector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
||||
|
||||
//Count stationary enemies
|
||||
pSector = &SectorInfo[ SECTOR( sSectorX, sSectorY ) ];
|
||||
ubNumEnemies = (UINT8)(pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumRobots + pSector->ubNumJeeps + pSector->ubNumTanks);
|
||||
ubNumEnemies = (pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumRobots + pSector->ubNumJeeps + pSector->ubNumTanks);
|
||||
|
||||
//Count mobile enemies
|
||||
pGroup = gpGroupList;
|
||||
@@ -230,11 +230,11 @@ UINT8 NumEnemiesInAnySector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
||||
}
|
||||
|
||||
// returns how many members of a team are in a sector - not intended for OUR_TEAM!
|
||||
UINT8 NumNonPlayerTeamMembersInSector( INT16 sSectorX, INT16 sSectorY, UINT8 ubTeam )
|
||||
UINT16 NumNonPlayerTeamMembersInSector( INT16 sSectorX, INT16 sSectorY, UINT8 ubTeam )
|
||||
{
|
||||
SECTORINFO *pSector;
|
||||
GROUP *pGroup;
|
||||
UINT8 ubNumTroops;
|
||||
UINT16 ubNumTroops = 0;
|
||||
|
||||
// HEADROCK: This is a TEMPORARY fix to avoid the assertion error. Not sure this is the best solution,
|
||||
// probably isn't. But I need this bit to work.
|
||||
@@ -255,14 +255,14 @@ UINT8 NumNonPlayerTeamMembersInSector( INT16 sSectorX, INT16 sSectorY, UINT8 ubT
|
||||
|
||||
if ( ubTeam == ENEMY_TEAM )
|
||||
{
|
||||
ubNumTroops = (UINT8)(pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumRobots + pSector->ubNumJeeps + pSector->ubNumTanks);
|
||||
ubNumTroops = (pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumRobots + pSector->ubNumJeeps + pSector->ubNumTanks);
|
||||
|
||||
if ( is_networked )
|
||||
ubNumTroops += numenemyLAN((UINT8)sSectorX,(UINT8)sSectorY ); //hayden
|
||||
}
|
||||
else if ( ubTeam == MILITIA_TEAM )
|
||||
{
|
||||
ubNumTroops = (UINT8)(pSector->ubNumberOfCivsAtLevel[0] + pSector->ubNumberOfCivsAtLevel[1] + pSector->ubNumberOfCivsAtLevel[2]);
|
||||
ubNumTroops = (pSector->ubNumberOfCivsAtLevel[0] + pSector->ubNumberOfCivsAtLevel[1] + pSector->ubNumberOfCivsAtLevel[2]);
|
||||
}
|
||||
else if ( ubTeam == CREATURE_TEAM )
|
||||
{
|
||||
@@ -309,7 +309,7 @@ UINT16 NumEnemyArmedVehiclesInSector( INT16 sSectorX, INT16 sSectorY, UINT8 usTe
|
||||
{
|
||||
SECTORINFO *pSector;
|
||||
GROUP *pGroup;
|
||||
UINT16 ubNum;
|
||||
UINT16 ubNum = 0;
|
||||
|
||||
// HEADROCK: This is a TEMPORARY fix to avoid the assertion error. Not sure this is the best solution,
|
||||
// probably isn't. But I need this bit to work.
|
||||
@@ -344,7 +344,7 @@ UINT16 NumEnemyArmedVehiclesInSector( INT16 sSectorX, INT16 sSectorY, UINT8 usTe
|
||||
return ubNum;
|
||||
}
|
||||
|
||||
UINT8 NumStationaryEnemiesInSector( INT16 sSectorX, INT16 sSectorY )
|
||||
UINT16 NumStationaryEnemiesInSector( INT16 sSectorX, INT16 sSectorY )
|
||||
{
|
||||
SECTORINFO *pSector;
|
||||
|
||||
@@ -368,14 +368,14 @@ UINT8 NumStationaryEnemiesInSector( INT16 sSectorX, INT16 sSectorY )
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
return (UINT8)(pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumTanks + pSector->ubNumJeeps + pSector->ubNumRobots);
|
||||
return (pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumTanks + pSector->ubNumJeeps + pSector->ubNumRobots);
|
||||
}
|
||||
|
||||
UINT8 NumMobileEnemiesInSector( INT16 sSectorX, INT16 sSectorY )
|
||||
UINT16 NumMobileEnemiesInSector( INT16 sSectorX, INT16 sSectorY )
|
||||
{
|
||||
GROUP *pGroup;
|
||||
SECTORINFO *pSector;
|
||||
UINT8 ubNumTroops;
|
||||
UINT16 ubNumTroops;
|
||||
AssertGE( sSectorX, MINIMUM_VALID_X_COORDINATE);
|
||||
AssertLE( sSectorX, MAXIMUM_VALID_X_COORDINATE );
|
||||
AssertGE( sSectorY, MINIMUM_VALID_Y_COORDINATE);
|
||||
@@ -396,13 +396,13 @@ UINT8 NumMobileEnemiesInSector( INT16 sSectorX, INT16 sSectorY )
|
||||
if( pSector->ubGarrisonID == ROADBLOCK )
|
||||
{
|
||||
//consider these troops as mobile troops even though they are in a garrison
|
||||
ubNumTroops += (UINT8)(pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumRobots + pSector->ubNumJeeps + pSector->ubNumTanks);
|
||||
ubNumTroops += (pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites + pSector->ubNumRobots + pSector->ubNumJeeps + pSector->ubNumTanks);
|
||||
}
|
||||
|
||||
return ubNumTroops;
|
||||
}
|
||||
|
||||
void GetNumberOfMobileEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT8 *pubNumAdmins, UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 *pubNumRobots, UINT8 *pubNumTanks, UINT8 *pubNumJeeps )
|
||||
void GetNumberOfMobileEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT16 *pubNumAdmins, UINT16 *pubNumTroops, UINT16 *pubNumElites, UINT16 *pubNumRobots, UINT16 *pubNumTanks, UINT16 *pubNumJeeps )
|
||||
{
|
||||
GROUP *pGroup;
|
||||
SECTORINFO *pSector;
|
||||
@@ -441,7 +441,7 @@ void GetNumberOfMobileEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT8 *pu
|
||||
}
|
||||
}
|
||||
|
||||
void GetNumberOfMobileEnemiesInSectorWithoutRoadBlock( INT16 sSectorX, INT16 sSectorY, UINT8 usTeam, UINT8 *pubNumAdmins, UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 *pubNumRobots, UINT8 *pubNumTanks, UINT8 *pubNumJeeps )
|
||||
void GetNumberOfMobileEnemiesInSectorWithoutRoadBlock( INT16 sSectorX, INT16 sSectorY, UINT16 usTeam, UINT16 *pubNumAdmins, UINT16 *pubNumTroops, UINT16 *pubNumElites, UINT16 *pubNumRobots, UINT16 *pubNumTanks, UINT16 *pubNumJeeps )
|
||||
{
|
||||
GROUP *pGroup;
|
||||
AssertGE( sSectorX, MINIMUM_VALID_X_COORDINATE);
|
||||
@@ -468,7 +468,7 @@ void GetNumberOfMobileEnemiesInSectorWithoutRoadBlock( INT16 sSectorX, INT16 sSe
|
||||
}
|
||||
|
||||
|
||||
void GetNumberOfStationaryEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT8 *pubNumAdmins, UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 *pubNumRobots, UINT8 *pubNumTanks, UINT8 *pubNumJeeps )
|
||||
void GetNumberOfStationaryEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT16 *pubNumAdmins, UINT16 *pubNumTroops, UINT16 *pubNumElites, UINT16 *pubNumRobots, UINT16 *pubNumTanks, UINT16 *pubNumJeeps )
|
||||
{
|
||||
SECTORINFO *pSector;
|
||||
AssertGE( sSectorX, MINIMUM_VALID_X_COORDINATE);
|
||||
@@ -486,9 +486,9 @@ void GetNumberOfStationaryEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT8
|
||||
*pubNumJeeps = pSector->ubNumJeeps;
|
||||
}
|
||||
|
||||
void GetNumberOfEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT8 *pubNumAdmins, UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 *pubNumRobots, UINT8 *pubNumTanks, UINT8 *pubNumJeeps )
|
||||
void GetNumberOfEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT16 *pubNumAdmins, UINT16 *pubNumTroops, UINT16 *pubNumElites, UINT16 *pubNumRobots, UINT16 *pubNumTanks, UINT16 *pubNumJeeps )
|
||||
{
|
||||
UINT8 ubNumAdmins, ubNumTroops, ubNumElites, ubNumRobots, ubNumTanks, ubNumJeeps;
|
||||
UINT16 ubNumAdmins, ubNumTroops, ubNumElites, ubNumRobots, ubNumTanks, ubNumJeeps;
|
||||
|
||||
GetNumberOfStationaryEnemiesInSector( sSectorX, sSectorY, pubNumAdmins, pubNumTroops, pubNumElites, pubNumRobots, pubNumTanks, pubNumJeeps );
|
||||
|
||||
@@ -576,9 +576,9 @@ void EndTacticalBattleForEnemy()
|
||||
}
|
||||
}
|
||||
|
||||
UINT8 NumFreeSlots( UINT8 ubTeam )
|
||||
UINT16 NumFreeSlots( UINT8 ubTeam )
|
||||
{
|
||||
UINT8 ubNumFreeSlots = 0;
|
||||
UINT16 ubNumFreeSlots = 0;
|
||||
|
||||
//Count the number of free enemy slots. It is possible to have multiple groups exceed the maximum.
|
||||
for ( INT32 i = gTacticalStatus.Team[ubTeam].bFirstID; i <= gTacticalStatus.Team[ubTeam].bLastID; ++i )
|
||||
@@ -590,13 +590,12 @@ UINT8 NumFreeSlots( UINT8 ubTeam )
|
||||
// the militia team size can be restricted by the ini
|
||||
if ( ubTeam == MILITIA_TEAM )
|
||||
{
|
||||
ubNumFreeSlots = (UINT8)max( 0, (INT8)ubNumFreeSlots - (INT8)(gGameExternalOptions.ubGameMaximumNumberOfRebels - gGameExternalOptions.iMaxMilitiaPerSector) );
|
||||
ubNumFreeSlots = (UINT16)max( 0, (INT16)ubNumFreeSlots - (INT16)(gGameExternalOptions.ubGameMaximumNumberOfRebels - gGameExternalOptions.iMaxMilitiaPerSector) );
|
||||
}
|
||||
|
||||
return ubNumFreeSlots;
|
||||
}
|
||||
|
||||
#pragma optimize("",off)
|
||||
//Called when entering a sector so the campaign AI can automatically insert the
|
||||
//correct number of troops of each type based on the current number in the sector
|
||||
//in global focus (gWorldSectorX/Y)
|
||||
@@ -1187,7 +1186,7 @@ BOOLEAN PrepareEnemyForUndergroundBattle()
|
||||
Assert( FALSE );
|
||||
return FALSE;
|
||||
}
|
||||
#pragma optimize("",on)
|
||||
|
||||
//The queen AI layer must process the event by subtracting forces, etc.
|
||||
void ProcessQueenCmdImplicationsOfDeath( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
@@ -2176,12 +2175,12 @@ void NotifyPlayersOfNewEnemies()
|
||||
}
|
||||
}
|
||||
|
||||
void AddEnemiesToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ubNumAdmins, UINT8 ubNumTroops, UINT8 ubNumElites, UINT8 ubNumRobots, UINT8 ubNumTanks, UINT8 ubNumJeeps, BOOLEAN fMagicallyAppeared )
|
||||
void AddEnemiesToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT16 ubNumAdmins, UINT16 ubNumTroops, UINT16 ubNumElites, UINT16 ubNumRobots, UINT16 ubNumTanks, UINT16 ubNumJeeps, BOOLEAN fMagicallyAppeared )
|
||||
{
|
||||
SOLDIERTYPE *pSoldier;
|
||||
MAPEDGEPOINTINFO MapEdgepointInfo;
|
||||
UINT8 ubCurrSlot;
|
||||
UINT8 ubTotalSoldiers;
|
||||
UINT16 ubCurrSlot;
|
||||
UINT16 ubTotalSoldiers;
|
||||
UINT8 bDesiredDirection=0;
|
||||
|
||||
// while transport groups can't normally reinforce, this covers the case where a transport group enters a sector (via normal movement)
|
||||
@@ -2323,7 +2322,7 @@ void AddEnemiesToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ub
|
||||
}
|
||||
UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, 0 );
|
||||
}
|
||||
else if( ubNumTroops && (UINT8)Random( ubTotalSoldiers ) < (UINT8)(ubNumElites + ubNumTroops) )
|
||||
else if( ubNumTroops && Random( ubTotalSoldiers ) < (ubNumElites + ubNumTroops) )
|
||||
{
|
||||
ubNumTroops--;
|
||||
ubTotalSoldiers--;
|
||||
@@ -2346,7 +2345,7 @@ void AddEnemiesToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ub
|
||||
}
|
||||
UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, 0 );
|
||||
}
|
||||
else if( ubNumAdmins && (UINT8)Random( ubTotalSoldiers ) < (UINT8)(ubNumElites + ubNumTroops + ubNumAdmins) )
|
||||
else if( ubNumAdmins && Random( ubTotalSoldiers ) < (ubNumElites + ubNumTroops + ubNumAdmins) )
|
||||
{
|
||||
ubNumAdmins--;
|
||||
ubTotalSoldiers--;
|
||||
@@ -2369,7 +2368,7 @@ void AddEnemiesToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ub
|
||||
}
|
||||
UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, 0 );
|
||||
}
|
||||
else if( ubNumRobots && (UINT8)Random( ubTotalSoldiers ) < (UINT8)(ubNumElites + ubNumTroops + ubNumAdmins + ubNumRobots) )
|
||||
else if( ubNumRobots && Random( ubTotalSoldiers ) < (ubNumElites + ubNumTroops + ubNumAdmins + ubNumRobots) )
|
||||
{
|
||||
ubNumRobots--;
|
||||
ubTotalSoldiers--;
|
||||
@@ -2392,7 +2391,7 @@ void AddEnemiesToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ub
|
||||
}
|
||||
UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, 0 );
|
||||
}
|
||||
else if( ubNumTanks && (UINT8)Random( ubTotalSoldiers ) < (UINT8)(ubNumElites + ubNumTroops + ubNumAdmins + ubNumRobots + ubNumTanks) && ubNumberOfVehicles < 9 )
|
||||
else if( ubNumTanks && Random( ubTotalSoldiers ) < (ubNumElites + ubNumTroops + ubNumAdmins + ubNumRobots + ubNumTanks) && ubNumberOfVehicles < 9 )
|
||||
{
|
||||
ubNumTanks--;
|
||||
ubTotalSoldiers--;
|
||||
@@ -2415,7 +2414,7 @@ void AddEnemiesToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ub
|
||||
}
|
||||
UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, 0 );
|
||||
}
|
||||
else if ( ubNumJeeps && (UINT8)Random( ubTotalSoldiers ) < (UINT8)(ubNumElites + ubNumTroops + ubNumAdmins + ubNumRobots + ubNumTanks + ubNumJeeps) && ubNumberOfVehicles < 9 )
|
||||
else if ( ubNumJeeps && Random( ubTotalSoldiers ) < (ubNumElites + ubNumTroops + ubNumAdmins + ubNumRobots + ubNumTanks + ubNumJeeps) && ubNumberOfVehicles < 9 )
|
||||
{
|
||||
ubNumJeeps--;
|
||||
ubTotalSoldiers--;
|
||||
@@ -2463,12 +2462,12 @@ void AddEnemiesToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ub
|
||||
#endif
|
||||
}
|
||||
|
||||
void AddMilitiaToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ubNumGreens, UINT8 ubNumRegulars, UINT8 ubNumElites, BOOLEAN fMagicallyAppeared )
|
||||
void AddMilitiaToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT16 ubNumGreens, UINT16 ubNumRegulars, UINT16 ubNumElites, BOOLEAN fMagicallyAppeared )
|
||||
{
|
||||
SOLDIERTYPE *pSoldier;
|
||||
MAPEDGEPOINTINFO MapEdgepointInfo;
|
||||
UINT8 ubCurrSlot;
|
||||
UINT8 ubTotalSoldiers;
|
||||
UINT16 ubCurrSlot;
|
||||
UINT16 ubTotalSoldiers;
|
||||
UINT8 bDesiredDirection = 0;
|
||||
|
||||
switch ( ubStrategicInsertionCode )
|
||||
@@ -2558,7 +2557,7 @@ void AddMilitiaToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ub
|
||||
}
|
||||
UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, 0 );
|
||||
}
|
||||
else if ( ubNumRegulars && (UINT8)Random( ubTotalSoldiers ) < (UINT8)(ubNumElites + ubNumRegulars) )
|
||||
else if ( ubNumRegulars && Random( ubTotalSoldiers ) < (ubNumElites + ubNumRegulars) )
|
||||
{
|
||||
ubNumRegulars--;
|
||||
ubTotalSoldiers--;
|
||||
@@ -2581,7 +2580,7 @@ void AddMilitiaToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ub
|
||||
}
|
||||
UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, 0 );
|
||||
}
|
||||
else if ( ubNumGreens && (UINT8)Random( ubTotalSoldiers ) < (UINT8)(ubNumElites + ubNumRegulars + ubNumGreens) )
|
||||
else if ( ubNumGreens && Random( ubTotalSoldiers ) < (ubNumElites + ubNumRegulars + ubNumGreens) )
|
||||
{
|
||||
ubNumGreens--;
|
||||
ubTotalSoldiers--;
|
||||
|
||||
+12
-12
@@ -12,26 +12,26 @@
|
||||
extern BOOLEAN gfPendingNonPlayerTeam[PLAYER_PLAN];
|
||||
|
||||
|
||||
UINT8 NumFreeSlots( UINT8 ubTeam );
|
||||
UINT16 NumFreeSlots( UINT8 ubTeam );
|
||||
|
||||
//Counts enemies and crepitus, but not bloodcats.
|
||||
UINT8 NumHostilesInSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ );
|
||||
UINT16 NumHostilesInSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ );
|
||||
|
||||
UINT8 NumEnemiesInAnySector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ );
|
||||
UINT16 NumEnemiesInAnySector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ );
|
||||
|
||||
// returns how many members of a team are in a sector - not intended for OUR_TEAM!
|
||||
UINT8 NumNonPlayerTeamMembersInSector( INT16 sSectorX, INT16 sSectorY, UINT8 ubTeam );
|
||||
UINT16 NumNonPlayerTeamMembersInSector( INT16 sSectorX, INT16 sSectorY, UINT8 ubTeam );
|
||||
|
||||
// returns how many members of a team are in a sector - only intended for OUR_TEAM! POWs not included
|
||||
UINT16 NumPlayerTeamMembersInSector( INT16 sSectorX, INT16 sSectorY, INT8 sSectorZ );
|
||||
|
||||
UINT16 NumEnemyArmedVehiclesInSector( INT16 sSectorX, INT16 sSectorY, UINT8 usTeam );
|
||||
UINT8 NumStationaryEnemiesInSector( INT16 sSectorX, INT16 sSectorY );
|
||||
UINT8 NumMobileEnemiesInSector( INT16 sSectorX, INT16 sSectorY );
|
||||
void GetNumberOfMobileEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT8 *pubNumAdmins, UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 *pubNumRobots, UINT8 *pubNumTanks, UINT8 *pubNumJeeps );
|
||||
void GetNumberOfMobileEnemiesInSectorWithoutRoadBlock( INT16 sSectorX, INT16 sSectorY, UINT8 usTeam, UINT8 *pubNumAdmins, UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 *pubNumRobots, UINT8 *pubNumTanks, UINT8 *pubNumJeeps );
|
||||
void GetNumberOfStationaryEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT8 *pubNumAdmins, UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 *pubNumRobots, UINT8 *pubNumTanks, UINT8 *pubNumJeeps );
|
||||
void GetNumberOfEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT8 *pubNumAdmins, UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 *pubNumRobots, UINT8 *pubNumTanks, UINT8 *pubNumJeeps );
|
||||
UINT16 NumStationaryEnemiesInSector( INT16 sSectorX, INT16 sSectorY );
|
||||
UINT16 NumMobileEnemiesInSector( INT16 sSectorX, INT16 sSectorY );
|
||||
void GetNumberOfMobileEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT16 *pubNumAdmins, UINT16 *pubNumTroops, UINT16 *pubNumElites, UINT16 *pubNumRobots, UINT16 *pubNumTanks, UINT16 *pubNumJeeps );
|
||||
void GetNumberOfMobileEnemiesInSectorWithoutRoadBlock( INT16 sSectorX, INT16 sSectorY, UINT16 usTeam, UINT16 *pubNumAdmins, UINT16 *pubNumTroops, UINT16 *pubNumElites, UINT16 *pubNumRobots, UINT16 *pubNumTanks, UINT16 *pubNumJeeps );
|
||||
void GetNumberOfStationaryEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT16 *pubNumAdmins, UINT16 *pubNumTroops, UINT16 *pubNumElites, UINT16 *pubNumRobots, UINT16 *pubNumTanks, UINT16 *pubNumJeeps );
|
||||
void GetNumberOfEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT16 *pubNumAdmins, UINT16 *pubNumTroops, UINT16 *pubNumElites, UINT16 *pubNumRobots, UINT16 *pubNumTanks, UINT16 *pubNumJeeps );
|
||||
|
||||
//Called when entering a sector so the campaign AI can automatically insert the
|
||||
//correct number of troops of each type based on the current number in the sector
|
||||
@@ -39,8 +39,8 @@ void GetNumberOfEnemiesInSector( INT16 sSectorX, INT16 sSectorY, UINT8 *pubNumAd
|
||||
BOOLEAN PrepareEnemyForSectorBattle();
|
||||
BOOLEAN PrepareEnemyForUndergroundBattle();
|
||||
|
||||
void AddEnemiesToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ubNumAdmins, UINT8 ubNumTroops, UINT8 ubNumElites, UINT8 ubNumRobots, UINT8 ubNumTanks, UINT8 abNumJeeps, BOOLEAN fMagicallyAppeared );
|
||||
void AddMilitiaToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ubNumGreens, UINT8 ubNumRegulars, UINT8 ubNumElites, BOOLEAN fMagicallyAppeared );
|
||||
void AddEnemiesToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT16 ubNumAdmins, UINT16 ubNumTroops, UINT16 ubNumElites, UINT16 ubNumRobots, UINT16 ubNumTanks, UINT16 abNumJeeps, BOOLEAN fMagicallyAppeared );
|
||||
void AddMilitiaToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT16 ubNumGreens, UINT16 ubNumRegulars, UINT16 ubNumElites, BOOLEAN fMagicallyAppeared );
|
||||
void AddPossiblePendingEnemiesToBattle();
|
||||
void EndTacticalBattleForEnemy();
|
||||
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
UINT8 gubReinforcementMinEnemyStaticGroupSize = 12;
|
||||
UINT32 guiMilitiaReinforceTurn = 0, guiMilitiaArrived = 0;//dnl ch68 090913
|
||||
|
||||
void GetNumberOfEnemiesInFiveSectors( INT16 sSectorX, INT16 sSectorY, UINT8 *pubNumAdmins, UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 *pubNumRobots, UINT8 *pubNumTanks, UINT8 *pubNumJeeps )
|
||||
void GetNumberOfEnemiesInFiveSectors( INT16 sSectorX, INT16 sSectorY, UINT16 *pubNumAdmins, UINT16 *pubNumTroops, UINT16 *pubNumElites, UINT16 *pubNumRobots, UINT16 *pubNumTanks, UINT16 *pubNumJeeps )
|
||||
{
|
||||
UINT8 ubNumAdmins, ubNumTroops, ubNumElites, ubNumRobots, ubNumTanks, ubNumJeeps;
|
||||
UINT16 ubNumAdmins, ubNumTroops, ubNumElites, ubNumRobots, ubNumTanks, ubNumJeeps;
|
||||
UINT16 pusMoveDir[4][3]; //first column in this matrix is number of sector, except for 4th row
|
||||
UINT8 ubDirNumber, ubIndex;
|
||||
|
||||
@@ -156,9 +156,9 @@ void ActivateTurncoatsForAutoResolve( INT16 sSectorX, INT16 sSectorY )
|
||||
}
|
||||
}
|
||||
|
||||
UINT8 NumEnemiesInFiveSectors( INT16 sMapX, INT16 sMapY )
|
||||
UINT16 NumEnemiesInFiveSectors( INT16 sMapX, INT16 sMapY )
|
||||
{
|
||||
UINT8 ubNumAdmins, ubNumTroops, ubNumElites, ubNumRobots, ubNumTanks, ubNumJeeps;
|
||||
UINT16 ubNumAdmins, ubNumTroops, ubNumElites, ubNumRobots, ubNumTanks, ubNumJeeps;
|
||||
|
||||
GetNumberOfEnemiesInFiveSectors( sMapX, sMapY, &ubNumAdmins, &ubNumTroops, &ubNumElites, &ubNumRobots, &ubNumTanks, &ubNumJeeps );
|
||||
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
#define __REINFORCEMENT_H__
|
||||
|
||||
//For Autoresolve (mostly)
|
||||
void GetNumberOfEnemiesInFiveSectors( INT16 sSectorX, INT16 sSectorY, UINT8 *pubNumAdmins, UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 *pubNumRobots, UINT8 *pubNumTanks, UINT8 *pubNumJeeps );
|
||||
void GetNumberOfEnemiesInFiveSectors( INT16 sSectorX, INT16 sSectorY, UINT16 *pubNumAdmins, UINT16 *pubNumTroops, UINT16 *pubNumElites, UINT16 *pubNumRobots, UINT16 *pubNumTanks, UINT16 *pubNumJeeps );
|
||||
void ActivateTurncoatsForAutoResolve( INT16 sSectorX, INT16 sSectorY );
|
||||
BOOLEAN IsGroupInARightSectorToReinforce( GROUP *pGroup, INT16 sSectorX, INT16 sSectorY );
|
||||
UINT8 GetAdjacentSectors( UINT8 pSectors[4], INT16 sSectorX, INT16 sSectorY );
|
||||
UINT16 CountAllMilitiaInFiveSectors(INT16 sMapX, INT16 sMapY);
|
||||
UINT8 NumEnemiesInFiveSectors( INT16 sMapX, INT16 sMapY );
|
||||
UINT16 NumEnemiesInFiveSectors( INT16 sMapX, INT16 sMapY );
|
||||
|
||||
//For Tactical
|
||||
UINT8 DoReinforcementAsPendingNonPlayer( INT16 sMapX, INT16 sMapY, UINT8 usTeam );
|
||||
void AddPossiblePendingMilitiaToBattle();
|
||||
GROUP* GetNonPlayerGroupInSectorForReinforcement( INT16 sMapX, INT16 sMapY, UINT8 usTeam );
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -19,7 +19,7 @@ extern "C" {
|
||||
#include "connect.h"
|
||||
|
||||
// externals
|
||||
UNDERGROUND_SECTORINFO* NewUndergroundNode( UINT8 ubSectorX, UINT8 ubSectorY, UINT8 ubSectorZ );
|
||||
extern UNDERGROUND_SECTORINFO* NewUndergroundNode( UINT8 ubSectorX, UINT8 ubSectorY, UINT8 ubSectorZ );
|
||||
extern BOOLEAN gfGettingNameFromSaveLoadScreen;
|
||||
|
||||
// helper functions
|
||||
@@ -49,6 +49,21 @@ bool LuaTable::getValue<UINT8>(const char * index, UINT8& value)
|
||||
return false;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool LuaTable::getValue<UINT16>(const char* index, UINT16& value)
|
||||
{
|
||||
int dummy;
|
||||
|
||||
bool b = getValue(index, dummy);
|
||||
if (b)
|
||||
{
|
||||
value = static_cast<UINT16>(dummy);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Calls into Lua script to let build underground sector list.
|
||||
BOOLEAN LuaUnderground::InitializeSectorList()
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ int gCivPreservedTempFileVersion[256];
|
||||
|
||||
BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *pNode, GROUP *pGroup = NULL );
|
||||
|
||||
BOOLEAN CountNumberOfElitesRegularsAdminsAndCreaturesFromEnemySoldiersTempFile( UINT8 *pubNumRobots, UINT8 *pubNumElites, UINT8 *pubNumRegulars, UINT8 *pubNumAdmins, UINT8 *pubNumCreatures, UINT8 *pubNumTanks, UINT8 *pubNumJeeps );
|
||||
BOOLEAN CountNumberOfElitesRegularsAdminsAndCreaturesFromEnemySoldiersTempFile( UINT16 *pubNumRobots, UINT16 *pubNumElites, UINT16 *pubNumRegulars, UINT16 *pubNumAdmins, UINT16 *pubNumCreatures, UINT16 *pubNumTanks, UINT16 *pubNumJeeps );
|
||||
|
||||
BOOLEAN gfRestoringEnemySoldiersFromTempFile = FALSE;
|
||||
BOOLEAN gfRestoringCiviliansFromTempFile = FALSE;
|
||||
@@ -100,8 +100,8 @@ BOOLEAN LoadEnemySoldiersFromTempFile()
|
||||
#endif
|
||||
INT8 bSectorZ;
|
||||
UINT8 ubSectorID;
|
||||
UINT8 ubNumRobots = 0, ubNumElites = 0, ubNumTroops = 0, ubNumAdmins = 0, ubNumCreatures = 0, ubNumTanks = 0, ubNumJeeps = 0;
|
||||
UINT8 ubStrategicRobots, ubStrategicElites, ubStrategicTroops, ubStrategicAdmins, ubStrategicCreatures, ubStrategicTanks, ubStrategicJeeps;
|
||||
UINT16 ubNumRobots = 0, ubNumElites = 0, ubNumTroops = 0, ubNumAdmins = 0, ubNumCreatures = 0, ubNumTanks = 0, ubNumJeeps = 0;
|
||||
UINT16 ubStrategicRobots, ubStrategicElites, ubStrategicTroops, ubStrategicAdmins, ubStrategicCreatures, ubStrategicTanks, ubStrategicJeeps;
|
||||
|
||||
gfRestoringEnemySoldiersFromTempFile = TRUE;
|
||||
|
||||
@@ -695,8 +695,8 @@ BOOLEAN NewWayOfLoadingEnemySoldiersFromTempFile()
|
||||
#endif
|
||||
INT8 bSectorZ;
|
||||
UINT8 ubSectorID;
|
||||
UINT8 ubNumRobots = 0, ubNumElites = 0, ubNumTroops = 0, ubNumAdmins = 0, ubNumCreatures = 0, ubNumTanks = 0, ubNumJeeps = 0;
|
||||
UINT8 ubStrategicRobots = 0, ubStrategicElites, ubStrategicTroops, ubStrategicAdmins, ubStrategicCreatures, ubStrategicTanks, ubStrategicJeeps;
|
||||
UINT16 ubNumRobots = 0, ubNumElites = 0, ubNumTroops = 0, ubNumAdmins = 0, ubNumCreatures = 0, ubNumTanks = 0, ubNumJeeps = 0;
|
||||
UINT16 ubStrategicRobots = 0, ubStrategicElites, ubStrategicTroops, ubStrategicAdmins, ubStrategicCreatures, ubStrategicTanks, ubStrategicJeeps;
|
||||
|
||||
gfRestoringEnemySoldiersFromTempFile = TRUE;
|
||||
|
||||
@@ -1638,7 +1638,7 @@ BOOLEAN NewWayOfSavingEnemyAndCivliansToTempFile( INT16 sSectorX, INT16 sSectorY
|
||||
|
||||
|
||||
|
||||
BOOLEAN CountNumberOfElitesRegularsAdminsAndCreaturesFromEnemySoldiersTempFile( UINT8 *pubNumRobots, UINT8 *pubNumElites, UINT8 *pubNumRegulars, UINT8 *pubNumAdmins, UINT8 *pubNumCreatures, UINT8 *pubNumTanks, UINT8 *pubNumJeeps )
|
||||
BOOLEAN CountNumberOfElitesRegularsAdminsAndCreaturesFromEnemySoldiersTempFile( UINT16 *pubNumRobots, UINT16 *pubNumElites, UINT16 *pubNumRegulars, UINT16 *pubNumAdmins, UINT16 *pubNumCreatures, UINT16 *pubNumTanks, UINT16 *pubNumJeeps )
|
||||
{
|
||||
// SOLDIERINITNODE *curr;
|
||||
SOLDIERCREATE_STRUCT tempDetailedPlacement;
|
||||
|
||||
@@ -22475,7 +22475,7 @@ void SOLDIERTYPE::EVENT_SoldierBeginAttachCan( INT32 sGridNo, UINT8 ubDirection
|
||||
|
||||
}
|
||||
|
||||
extern UINT8 NumEnemiesInAnySector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ );
|
||||
extern UINT16 NumEnemiesInAnySector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ );
|
||||
|
||||
void SOLDIERTYPE::EVENT_SoldierBuildStructure( INT32 sGridNo, UINT8 ubDirection )
|
||||
{
|
||||
|
||||
@@ -318,8 +318,8 @@ BOOLEAN LoadSoldiersFromMap(INT8** hBuffer, FLOAT dMajorMapVersion, UINT8 ubMino
|
||||
AssertMsg(0, "Failed to allocate memory for new basic placement in LoadSoldiersFromMap.");
|
||||
return(FALSE);
|
||||
}
|
||||
Assert(cnt < 256);
|
||||
pNode->ubNodeID = (UINT8)cnt;
|
||||
Assert(cnt < MAX_INDIVIDUALS);
|
||||
pNode->ubNodeID = cnt;
|
||||
if(tempBasicPlacement.fDetailedPlacement)
|
||||
{
|
||||
// Add the static detailed placement information in the same newly created node as the basic placement. Read static detailed placement from file.
|
||||
@@ -369,7 +369,7 @@ BOOLEAN SaveSoldiersToMap(HWFILE hFile, FLOAT dMajorMapVersion, UINT8 ubMinorMap
|
||||
{
|
||||
if(!curr)
|
||||
return(FALSE);
|
||||
curr->ubNodeID = (UINT8)i;
|
||||
curr->ubNodeID = i;
|
||||
curr->pBasicPlacement->Save(hFile, dMajorMapVersion, ubMinorMapVersion);
|
||||
if(curr->pBasicPlacement->fDetailedPlacement)
|
||||
{
|
||||
@@ -577,7 +577,6 @@ void SortSoldierInitList()
|
||||
}
|
||||
|
||||
extern FLOAT gAmbushRadiusModifier;
|
||||
#pragma optimize("",off)
|
||||
BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *curr, GROUP *pGroup = NULL )
|
||||
{
|
||||
UINT8 ubProfile;
|
||||
@@ -855,7 +854,7 @@ BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *curr, GROUP *pGroup = NULL )
|
||||
if(is_server) ScreenMsg( FONT_YELLOW, MSG_MPSYSTEM, L"report this MP error (AddPlacementToWorld-FAIL!)");
|
||||
return FALSE;
|
||||
}
|
||||
#pragma optimize("",on)
|
||||
|
||||
void AddPlacementToWorldByProfileID( UINT8 ubProfile )
|
||||
{
|
||||
SOLDIERINITNODE * curr;
|
||||
@@ -874,12 +873,12 @@ void AddPlacementToWorldByProfileID( UINT8 ubProfile )
|
||||
}
|
||||
}
|
||||
|
||||
UINT8 AddSoldierInitListTeamToWorld( INT8 bTeam, UINT8 ubMaxNum )
|
||||
UINT16 AddSoldierInitListTeamToWorld( INT8 bTeam, UINT16 ubMaxNum )
|
||||
{
|
||||
UINT8 ubNumAdded = 0;
|
||||
UINT16 ubNumAdded = 0;
|
||||
SOLDIERINITNODE *mark;
|
||||
UINT8 ubSlotsToFill;
|
||||
UINT8 ubSlotsAvailable;
|
||||
UINT16 ubSlotsToFill;
|
||||
UINT16 ubSlotsAvailable;
|
||||
SOLDIERINITNODE *curr;
|
||||
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("AddSoldierInitListTeamToWorld"));
|
||||
@@ -1046,22 +1045,22 @@ UINT8 AddSoldierInitListTeamToWorld( INT8 bTeam, UINT8 ubMaxNum )
|
||||
|
||||
return ubNumAdded;
|
||||
}
|
||||
#pragma optimize("",off)
|
||||
void AddSoldierInitListEnemyDefenceSoldiers( UINT8 ubTotalAdmin, UINT8 ubTotalTroops, UINT8 ubTotalElite, UINT8 ubTotalRobots, UINT8 ubTotalTanks, UINT8 ubTotalJeeps )
|
||||
|
||||
void AddSoldierInitListEnemyDefenceSoldiers( UINT16 ubTotalAdmin, UINT16 ubTotalTroops, UINT16 ubTotalElite, UINT16 ubTotalRobots, UINT16 ubTotalTanks, UINT16 ubTotalJeeps )
|
||||
{
|
||||
SOLDIERINITNODE *mark;
|
||||
SOLDIERINITNODE *curr;
|
||||
INT32 iRandom;
|
||||
UINT8 ubMaxNum;
|
||||
UINT8 ubRobotPDSlots = 0, ubRobotDSlots = 0, ubRobotPSlots = 0, ubRobotBSlots = 0;
|
||||
UINT8 ubElitePDSlots = 0, ubEliteDSlots = 0, ubElitePSlots = 0, ubEliteBSlots = 0;
|
||||
UINT8 ubTroopPDSlots = 0, ubTroopDSlots = 0, ubTroopPSlots = 0, ubTroopBSlots = 0;
|
||||
UINT8 ubAdminPDSlots = 0, ubAdminDSlots = 0, ubAdminPSlots = 0, ubAdminBSlots = 0;
|
||||
UINT8 ubTankPDSlots = 0, ubTankDSlots = 0, ubTankPSlots = 0, ubTankBSlots = 0;
|
||||
UINT8 ubJeepPDSlots = 0, ubJeepDSlots = 0, ubJeepPSlots = 0, ubJeepBSlots = 0;
|
||||
UINT8 ubFreeSlots;
|
||||
UINT8 *pCurrSlots=NULL;
|
||||
UINT8 *pCurrTotal=NULL;
|
||||
UINT16 ubMaxNum;
|
||||
UINT16 ubRobotPDSlots = 0, ubRobotDSlots = 0, ubRobotPSlots = 0, ubRobotBSlots = 0;
|
||||
UINT16 ubElitePDSlots = 0, ubEliteDSlots = 0, ubElitePSlots = 0, ubEliteBSlots = 0;
|
||||
UINT16 ubTroopPDSlots = 0, ubTroopDSlots = 0, ubTroopPSlots = 0, ubTroopBSlots = 0;
|
||||
UINT16 ubAdminPDSlots = 0, ubAdminDSlots = 0, ubAdminPSlots = 0, ubAdminBSlots = 0;
|
||||
UINT16 ubTankPDSlots = 0, ubTankDSlots = 0, ubTankPSlots = 0, ubTankBSlots = 0;
|
||||
UINT16 ubJeepPDSlots = 0, ubJeepDSlots = 0, ubJeepPSlots = 0, ubJeepBSlots = 0;
|
||||
UINT16 ubFreeSlots;
|
||||
UINT16 *pCurrSlots=NULL;
|
||||
UINT16 *pCurrTotal=NULL;
|
||||
UINT8 ubCurrClass;
|
||||
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("AddSoldierInitListEnemyDefenceSoldiers"));
|
||||
@@ -1601,25 +1600,25 @@ void AddSoldierInitListEnemyDefenceSoldiers( UINT8 ubTotalAdmin, UINT8 ubTotalTr
|
||||
curr = curr->next;
|
||||
}
|
||||
}
|
||||
#pragma optimize("",on)
|
||||
|
||||
//If we are adding militia to our map, then we do a few things differently.
|
||||
//First of all, they exist exclusively to the enemy troops, so if the militia exists in the
|
||||
//sector, then they get to use the enemy placements. However, we remove any orders from
|
||||
//placements containing RNDPTPATROL or POINTPATROL orders, as well as remove any detailed
|
||||
//placement information.
|
||||
void AddSoldierInitListMilitia( UINT8 ubNumGreen, UINT8 ubNumRegs, UINT8 ubNumElites )
|
||||
void AddSoldierInitListMilitia( UINT16 ubNumGreen, UINT16 ubNumRegs, UINT16 ubNumElites )
|
||||
{
|
||||
SOLDIERINITNODE *mark;
|
||||
SOLDIERINITNODE *curr;
|
||||
INT32 iRandom;
|
||||
UINT8 ubMaxNum;
|
||||
UINT16 ubMaxNum;
|
||||
BOOLEAN fDoPlacement;
|
||||
UINT8 ubEliteSlots = 0;
|
||||
UINT8 ubRegSlots = 0;
|
||||
UINT8 ubGreenSlots = 0;
|
||||
UINT8 ubFreeSlots;
|
||||
UINT8 *pCurrSlots=NULL;
|
||||
UINT8 *pCurrTotal=NULL;
|
||||
UINT16 ubEliteSlots = 0;
|
||||
UINT16 ubRegSlots = 0;
|
||||
UINT16 ubGreenSlots = 0;
|
||||
UINT16 ubFreeSlots;
|
||||
UINT16 *pCurrSlots=NULL;
|
||||
UINT16 *pCurrTotal=NULL;
|
||||
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("AddSoldierInitListMilitia"));
|
||||
|
||||
@@ -1955,22 +1954,22 @@ void AddSoldierInitListMilitia( UINT8 ubNumGreen, UINT8 ubNumRegs, UINT8 ubNumEl
|
||||
}
|
||||
}
|
||||
|
||||
void AddSoldierInitListCreatures( BOOLEAN fQueen, UINT8 ubNumLarvae, UINT8 ubNumInfants,
|
||||
UINT8 ubNumYoungMales, UINT8 ubNumYoungFemales, UINT8 ubNumAdultMales,
|
||||
UINT8 ubNumAdultFemales )
|
||||
void AddSoldierInitListCreatures( BOOLEAN fQueen, UINT16 ubNumLarvae, UINT16 ubNumInfants,
|
||||
UINT16 ubNumYoungMales, UINT16 ubNumYoungFemales, UINT16 ubNumAdultMales,
|
||||
UINT16 ubNumAdultFemales )
|
||||
{
|
||||
SOLDIERINITNODE *curr;
|
||||
INT32 iRandom;
|
||||
UINT8 ubFreeSlots;
|
||||
UINT16 ubFreeSlots;
|
||||
BOOLEAN fDoPlacement;
|
||||
UINT8 ubNumCreatures;
|
||||
UINT16 ubNumCreatures;
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("AddSoldierInitListCreatures"));
|
||||
|
||||
SortSoldierInitList();
|
||||
|
||||
//Okay, if we have a queen, place her first. She MUST have a special placement, else
|
||||
//we can't use anything.
|
||||
ubNumCreatures = (UINT8)(ubNumLarvae + ubNumInfants + ubNumYoungMales + ubNumYoungFemales + ubNumAdultMales + ubNumAdultFemales);
|
||||
ubNumCreatures = (ubNumLarvae + ubNumInfants + ubNumYoungMales + ubNumYoungFemales + ubNumAdultMales + ubNumAdultFemales);
|
||||
if( fQueen )
|
||||
{
|
||||
curr = gSoldierInitHead;
|
||||
@@ -2292,10 +2291,9 @@ void UseEditorAlternateList()
|
||||
//if the map was loaded again!
|
||||
void EvaluateDeathEffectsToSoldierInitList( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
SOLDIERINITNODE *curr;
|
||||
UINT8 ubNodeID;
|
||||
curr = gSoldierInitHead;
|
||||
ubNodeID = 0;
|
||||
UINT16 ubNodeID = 0;
|
||||
SOLDIERINITNODE* curr = gSoldierInitHead;
|
||||
|
||||
if( pSoldier->bTeam == MILITIA_TEAM )
|
||||
return;
|
||||
while( curr )
|
||||
@@ -2319,7 +2317,7 @@ void EvaluateDeathEffectsToSoldierInitList( SOLDIERTYPE *pSoldier )
|
||||
}
|
||||
}
|
||||
|
||||
void RemoveDetailedPlacementInfo( UINT8 ubNodeID )
|
||||
void RemoveDetailedPlacementInfo( UINT16 ubNodeID )
|
||||
{
|
||||
SOLDIERINITNODE *curr;
|
||||
curr = gSoldierInitHead;
|
||||
@@ -2345,7 +2343,7 @@ BOOLEAN SaveSoldierInitListLinks( HWFILE hfile )
|
||||
{
|
||||
SOLDIERINITNODE *curr;
|
||||
UINT32 uiNumBytesWritten;
|
||||
UINT8 ubSlots = 0;
|
||||
UINT16 ubSlots = 0;
|
||||
|
||||
//count the number of soldier init nodes...
|
||||
curr = gSoldierInitHead;
|
||||
@@ -2355,8 +2353,8 @@ BOOLEAN SaveSoldierInitListLinks( HWFILE hfile )
|
||||
curr = curr->next;
|
||||
}
|
||||
//...and save it.
|
||||
FileWrite( hfile, &ubSlots, 1, &uiNumBytesWritten );
|
||||
if( uiNumBytesWritten != 1 )
|
||||
FileWrite( hfile, &ubSlots, 2, &uiNumBytesWritten );
|
||||
if( uiNumBytesWritten != 2 )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -2368,8 +2366,8 @@ BOOLEAN SaveSoldierInitListLinks( HWFILE hfile )
|
||||
{
|
||||
curr->ubSoldierID = 0;
|
||||
}
|
||||
FileWrite( hfile, &curr->ubNodeID, 1, &uiNumBytesWritten );
|
||||
if( uiNumBytesWritten != 1 )
|
||||
FileWrite( hfile, &curr->ubNodeID, 2, &uiNumBytesWritten );
|
||||
if( uiNumBytesWritten != 2 )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -2387,23 +2385,23 @@ BOOLEAN LoadSoldierInitListLinks( HWFILE hfile )
|
||||
{
|
||||
UINT32 uiNumBytesRead;
|
||||
SOLDIERINITNODE *curr;
|
||||
UINT8 ubSlots, ubNodeID;
|
||||
UINT16 ubSoldierID;
|
||||
UINT16 ubSlots;
|
||||
UINT16 ubSoldierID, ubNodeID;
|
||||
|
||||
FileRead( hfile, &ubSlots, 1, &uiNumBytesRead );
|
||||
if( uiNumBytesRead != 1 )
|
||||
FileRead( hfile, &ubSlots, 2, &uiNumBytesRead );
|
||||
if( uiNumBytesRead != 2 )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
while( ubSlots-- )
|
||||
{
|
||||
FileRead( hfile, &ubNodeID, 1, &uiNumBytesRead );
|
||||
if( uiNumBytesRead != 1 )
|
||||
FileRead( hfile, &ubNodeID, 2, &uiNumBytesRead );
|
||||
if( uiNumBytesRead != 2 )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
FileRead( hfile, &ubSoldierID, 1, &uiNumBytesRead );
|
||||
if( uiNumBytesRead != 1 )
|
||||
FileRead( hfile, &ubSoldierID, 2, &uiNumBytesRead );
|
||||
if( uiNumBytesRead != 2 )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -2799,18 +2797,18 @@ BOOLEAN NewWayOfLoadingEnemySoldierInitListLinks( HWFILE hfile )
|
||||
{
|
||||
UINT32 uiNumBytesRead;
|
||||
SOLDIERINITNODE *curr;
|
||||
UINT8 ubSlots, ubNodeID;
|
||||
UINT16 ubSoldierID;
|
||||
UINT16 ubSlots;
|
||||
UINT16 ubSoldierID, ubNodeID;
|
||||
|
||||
FileRead( hfile, &ubSlots, 1, &uiNumBytesRead );
|
||||
if( uiNumBytesRead != 1 )
|
||||
FileRead( hfile, &ubSlots, 2, &uiNumBytesRead );
|
||||
if( uiNumBytesRead != 2 )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
while( ubSlots-- )
|
||||
{
|
||||
FileRead( hfile, &ubNodeID, 1, &uiNumBytesRead );
|
||||
if( uiNumBytesRead != 1 )
|
||||
FileRead( hfile, &ubNodeID, 2, &uiNumBytesRead );
|
||||
if( uiNumBytesRead != 2 )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -2846,18 +2844,18 @@ BOOLEAN NewWayOfLoadingCivilianInitListLinks( HWFILE hfile )
|
||||
{
|
||||
UINT32 uiNumBytesRead;
|
||||
SOLDIERINITNODE *curr;
|
||||
UINT8 ubSlots, ubNodeID;
|
||||
UINT16 ubSoldierID;
|
||||
UINT16 ubSlots;
|
||||
UINT16 ubSoldierID, ubNodeID;
|
||||
|
||||
FileRead( hfile, &ubSlots, 1, &uiNumBytesRead );
|
||||
if( uiNumBytesRead != 1 )
|
||||
FileRead( hfile, &ubSlots, 2, &uiNumBytesRead );
|
||||
if( uiNumBytesRead != 2 )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
while( ubSlots-- )
|
||||
{
|
||||
FileRead( hfile, &ubNodeID, 1, &uiNumBytesRead );
|
||||
if( uiNumBytesRead != 1 )
|
||||
FileRead( hfile, &ubNodeID, 2, &uiNumBytesRead );
|
||||
if( uiNumBytesRead != 2 )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -2893,18 +2891,18 @@ BOOLEAN LookAtButDontProcessEnemySoldierInitListLinks( HWFILE hfile )
|
||||
{
|
||||
UINT32 uiNumBytesRead;
|
||||
SOLDIERINITNODE *curr;
|
||||
UINT8 ubSlots, ubNodeID;
|
||||
UINT16 ubSoldierID;
|
||||
UINT16 ubSlots;
|
||||
UINT16 ubSoldierID, ubNodeID;
|
||||
|
||||
FileRead( hfile, &ubSlots, 1, &uiNumBytesRead );
|
||||
if( uiNumBytesRead != 1 )
|
||||
FileRead( hfile, &ubSlots, 2, &uiNumBytesRead );
|
||||
if( uiNumBytesRead != 2 )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
while( ubSlots-- )
|
||||
{
|
||||
FileRead( hfile, &ubNodeID, 1, &uiNumBytesRead );
|
||||
if( uiNumBytesRead != 1 )
|
||||
FileRead( hfile, &ubNodeID, 2, &uiNumBytesRead );
|
||||
if( uiNumBytesRead != 2 )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -3329,4 +3327,4 @@ void SectorAddDownedPilot( INT16 sMapX, INT16 sMapY, INT16 sMapZ )
|
||||
// remove the flag. We can only find the pilot the first time we visit this sector after the heli was shut down
|
||||
pSector->usSectorInfoFlag &= ~SECTORINFO_ENEMYHELI_SHOTDOWN;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
typedef struct SOLDIERINITNODE
|
||||
{
|
||||
UINT8 ubNodeID;
|
||||
UINT16 ubNodeID;
|
||||
UINT16 ubSoldierID;
|
||||
BASIC_SOLDIERCREATE_STRUCT *pBasicPlacement;
|
||||
SOLDIERCREATE_STRUCT *pDetailedPlacement;
|
||||
@@ -39,13 +39,13 @@ SOLDIERINITNODE* AddBasicPlacementToSoldierInitList( BASIC_SOLDIERCREATE_STRUCT
|
||||
void RemoveSoldierNodeFromInitList( SOLDIERINITNODE *pNode );
|
||||
SOLDIERINITNODE* FindSoldierInitNodeWithID( UINT16 usID );
|
||||
|
||||
UINT8 AddSoldierInitListTeamToWorld( INT8 bTeam, UINT8 ubMaxNum );
|
||||
void AddSoldierInitListEnemyDefenceSoldiers( UINT8 ubTotalAdmin, UINT8 ubTotalTroops, UINT8 ubTotalElite, UINT8 ubTotalRobots, UINT8 ubTotalTanks, UINT8 ubTotalJeeps );
|
||||
void AddSoldierInitListCreatures( BOOLEAN fQueen, UINT8 ubNumLarvae, UINT8 ubNumInfants,
|
||||
UINT8 ubNumYoungMales, UINT8 ubNumYoungFemales, UINT8 ubNumAdultMales,
|
||||
UINT8 ubNumAdultFemales );
|
||||
UINT16 AddSoldierInitListTeamToWorld( INT8 bTeam, UINT16 ubMaxNum );
|
||||
void AddSoldierInitListEnemyDefenceSoldiers( UINT16 ubTotalAdmin, UINT16 ubTotalTroops, UINT16 ubTotalElite, UINT16 ubTotalRobots, UINT16 ubTotalTanks, UINT16 ubTotalJeeps );
|
||||
void AddSoldierInitListCreatures( BOOLEAN fQueen, UINT16 ubNumLarvae, UINT16 ubNumInfants,
|
||||
UINT16 ubNumYoungMales, UINT16 ubNumYoungFemales, UINT16 ubNumAdultMales,
|
||||
UINT16 ubNumAdultFemales );
|
||||
void AddSoldierInitListOtherCreatures( UINT8 usNum );
|
||||
void AddSoldierInitListMilitia( UINT8 ubNumGreen, UINT8 ubNumReg, UINT8 ubNumElites );
|
||||
void AddSoldierInitListMilitia( UINT16 ubNumGreen, UINT16 ubNumReg, UINT16 ubNumElites );
|
||||
void AddSoldierInitListMilitiaOnEdge( UINT8 ubStrategicInsertionCode, UINT8 ubNumGreen, UINT8 ubNumReg, UINT8 ubNumElites );
|
||||
|
||||
void AddSoldierInitListBloodcats();
|
||||
@@ -55,7 +55,7 @@ void UseEditorAlternateList();
|
||||
void AddPlacementToWorldByProfileID( UINT8 ubProfile );
|
||||
|
||||
void EvaluateDeathEffectsToSoldierInitList( SOLDIERTYPE *pSoldier );
|
||||
void RemoveDetailedPlacementInfo( UINT8 ubNodeID );
|
||||
void RemoveDetailedPlacementInfo( UINT16 ubNodeID );
|
||||
|
||||
void AddProfilesUsingProfileInsertionData();
|
||||
void AddProfilesNotUsingProfileInsertionData();
|
||||
@@ -69,4 +69,4 @@ void SectorAddPrisonersofWar( INT16 sMapX, INT16 sMapY, INT16 sMapZ );
|
||||
// Flugente: decide wether to add a downed pilot if a helicopter was shot down here
|
||||
void SectorAddDownedPilot( INT16 sMapX, INT16 sMapY, INT16 sMapZ );
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user