mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Externalizations (by Buggler)
- Strategic AI garrisons and patrol main spawning sector (thanks to Moa) - Tixa Sector; separated from Dynamo captive sector to allow modding flexibility git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6557 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+10
-3
@@ -2372,6 +2372,10 @@ void LoadSkillTraitsExternalSettings()
|
||||
//DBrot: Grids
|
||||
void LoadModSettings(){
|
||||
CIniReader iniReader(MOD_SETTINGS_FILE);
|
||||
|
||||
gModSettings.ubSAISpawnSectorX = iniReader.ReadInteger("AI", "STRATEGIC_AI_SPAWN_SECTOR_X", 3);
|
||||
gModSettings.ubSAISpawnSectorY = iniReader.ReadInteger("AI", "STRATEGIC_AI_SPAWN_SECTOR_Y", 16);
|
||||
|
||||
gModSettings.ubHideoutSectorX = iniReader.ReadInteger("Rebel Hideout", "HIDEOUT_SECTOR_X", 10, 1, 16);
|
||||
gModSettings.ubHideoutSectorY = iniReader.ReadInteger("Rebel Hideout", "HIDEOUT_SECTOR_Y", 1, 1, 16);
|
||||
gModSettings.ubHideoutSectorZ = iniReader.ReadInteger("Rebel Hideout", "HIDEOUT_SECTOR_Z", 1, 0, 3);
|
||||
@@ -2452,9 +2456,12 @@ void LoadModSettings(){
|
||||
//[Grumm]
|
||||
|
||||
//[Tixa]
|
||||
gModSettings.ubDyanmoPrisonSectorX = iniReader.ReadInteger("Tixa", "DYNAMO_PRISON_SECTOR_X", 9);
|
||||
gModSettings.ubDyanmoPrisonSectorY = iniReader.ReadInteger("Tixa", "DYNAMO_PRISON_SECTOR_Y", 10);
|
||||
gModSettings.ubDyanmoPrisonSectorZ = iniReader.ReadInteger("Tixa", "DYNAMO_PRISON_SECTOR_Z", 0);
|
||||
gModSettings.ubTixaPrisonSectorX = iniReader.ReadInteger("Tixa", "PRISON_SECTOR_X", 9);
|
||||
gModSettings.ubTixaPrisonSectorY = iniReader.ReadInteger("Tixa", "PRISON_SECTOR_Y", 10);
|
||||
|
||||
gModSettings.ubDyanmoCaptiveSectorX = iniReader.ReadInteger("Tixa", "DYNAMO_CAPTIVE_SECTOR_X", 9);
|
||||
gModSettings.ubDyanmoCaptiveSectorY = iniReader.ReadInteger("Tixa", "DYNAMO_CAPTIVE_SECTOR_Y", 10);
|
||||
gModSettings.ubDyanmoCaptiveSectorZ = iniReader.ReadInteger("Tixa", "DYNAMO_CAPTIVE_SECTOR_Z", 0);
|
||||
|
||||
//[Cambria]
|
||||
gModSettings.ubHospitalSectorX = iniReader.ReadInteger("Cambria", "HOSPITAL_SECTOR_X", 8);
|
||||
|
||||
+11
-5
@@ -1710,6 +1710,10 @@ typedef struct
|
||||
//DBrot: Grids
|
||||
typedef struct
|
||||
{
|
||||
//AI
|
||||
UINT8 ubSAISpawnSectorX;
|
||||
UINT8 ubSAISpawnSectorY;
|
||||
|
||||
//defines the basement and the bottom of the stairs
|
||||
UINT8 ubHideoutSectorX;
|
||||
UINT8 ubHideoutSectorY;
|
||||
@@ -1746,7 +1750,6 @@ typedef struct
|
||||
UINT8 ubAirport2X;
|
||||
UINT8 ubAirport2Y;
|
||||
|
||||
|
||||
//BobbyR stuff
|
||||
UINT8 ubBobbyRShipDestSectorX;
|
||||
UINT8 ubBobbyRShipDestSectorY;
|
||||
@@ -1775,10 +1778,13 @@ typedef struct
|
||||
//[Grumm]
|
||||
|
||||
//[Tixa]
|
||||
//Dynamo Prison Sector
|
||||
UINT8 ubDyanmoPrisonSectorX;
|
||||
UINT8 ubDyanmoPrisonSectorY;
|
||||
UINT8 ubDyanmoPrisonSectorZ;
|
||||
UINT8 ubTixaPrisonSectorX;
|
||||
UINT8 ubTixaPrisonSectorY;
|
||||
|
||||
//Dynamo Captive Sector
|
||||
UINT8 ubDyanmoCaptiveSectorX;
|
||||
UINT8 ubDyanmoCaptiveSectorY;
|
||||
UINT8 ubDyanmoCaptiveSectorZ;
|
||||
|
||||
//[Cambria]
|
||||
//Hospital Sector
|
||||
|
||||
@@ -1964,7 +1964,7 @@ void PrintDetailedEnemiesInSectorInfo( INT32 iScreenX, INT32 iScreenY, UINT8 ubS
|
||||
pFinalWaypoint = GetFinalWaypoint( pGroup );
|
||||
if( pFinalWaypoint )
|
||||
{
|
||||
if( pFinalWaypoint->x == 3 && pFinalWaypoint->y == 16 )
|
||||
if( pFinalWaypoint->x == gModSettings.ubSAISpawnSectorX && pFinalWaypoint->y == gModSettings.ubSAISpawnSectorY )
|
||||
{
|
||||
swprintf( wSubString, L" - group returning to pool.");
|
||||
}
|
||||
@@ -2006,7 +2006,7 @@ void PrintDetailedEnemiesInSectorInfo( INT32 iScreenX, INT32 iScreenY, UINT8 ubS
|
||||
pFinalWaypoint = GetFinalWaypoint( pGroup );
|
||||
if( pFinalWaypoint )
|
||||
{
|
||||
if( pFinalWaypoint->x == 3 && pFinalWaypoint->y == 16 )
|
||||
if( pFinalWaypoint->x == gModSettings.ubSAISpawnSectorX && pFinalWaypoint->y == gModSettings.ubSAISpawnSectorY )
|
||||
{
|
||||
swprintf( wSubString, L" - group returning to pool.");
|
||||
}
|
||||
|
||||
@@ -231,8 +231,8 @@ extern UINT16 MAP_LEVEL_STRING_Y;
|
||||
#define ORTA_SECTOR_X 4
|
||||
#define ORTA_SECTOR_Y 11
|
||||
|
||||
#define TIXA_SECTOR_X 9
|
||||
#define TIXA_SECTOR_Y 10
|
||||
#define TIXA_SECTOR_X gModSettings.ubTixaPrisonSectorX //9
|
||||
#define TIXA_SECTOR_Y gModSettings.ubTixaPrisonSectorY //10
|
||||
|
||||
// what are we showing?..teams/vehicles
|
||||
// Show values
|
||||
|
||||
@@ -925,8 +925,8 @@ BOOLEAN CheckFact( UINT16 usFact, UINT8 ubProfileID )
|
||||
gubFact[usFact] = IsHisMineAtMaxProduction( ubProfileID );
|
||||
break;
|
||||
case FACT_DYNAMO_IN_J9:
|
||||
gubFact[usFact] = CheckNPCSector( DYNAMO, gModSettings.ubDyanmoPrisonSectorX, gModSettings.ubDyanmoPrisonSectorY, gModSettings.ubDyanmoPrisonSectorZ ) &&
|
||||
NumEnemiesInAnySector( gModSettings.ubDyanmoPrisonSectorX, gModSettings.ubDyanmoPrisonSectorY, gModSettings.ubDyanmoPrisonSectorZ ); //( 9, 10, 0 )
|
||||
gubFact[usFact] = CheckNPCSector( DYNAMO, gModSettings.ubDyanmoCaptiveSectorX, gModSettings.ubDyanmoCaptiveSectorY, gModSettings.ubDyanmoCaptiveSectorZ ) &&
|
||||
NumEnemiesInAnySector( gModSettings.ubDyanmoCaptiveSectorX, gModSettings.ubDyanmoCaptiveSectorY, gModSettings.ubDyanmoCaptiveSectorZ ); //( 9, 10, 0 )
|
||||
break;
|
||||
case FACT_DYNAMO_ALIVE:
|
||||
gubFact[usFact] = ( gMercProfiles[ DYNAMO ].bMercStatus != MERC_IS_DEAD );
|
||||
|
||||
+33
-33
@@ -1368,7 +1368,7 @@ void InitStrategicAI()
|
||||
|
||||
if( iStartPop )
|
||||
{
|
||||
if( gGarrisonGroup[ i ].ubSectorID != SEC_P3 )
|
||||
if( gGarrisonGroup[ i ].ubSectorID != SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY ) )
|
||||
{
|
||||
// if population is less than maximum
|
||||
if( iStartPop != iMaxEnemyGroupSize )
|
||||
@@ -2125,7 +2125,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Strategic5");
|
||||
{
|
||||
pSector = &SectorInfo[ SECTOR( pGroup->ubSectorX, pGroup->ubSectorY ) ];
|
||||
|
||||
if( gGarrisonGroup[ i ].ubSectorID != SEC_P3 )
|
||||
if( gGarrisonGroup[ i ].ubSectorID != SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY ) )
|
||||
{
|
||||
EliminateSurplusTroopsForGarrison( pGroup, pSector );
|
||||
pSector->ubNumAdmins = (UINT8)(pSector->ubNumAdmins + pGroup->pEnemyGroup->ubNumAdmins);
|
||||
@@ -2314,8 +2314,8 @@ BOOLEAN StrategicAILookForAdjacentGroups( GROUP *pGroup )
|
||||
{
|
||||
//Wake up the queen now, if she hasn't woken up already.
|
||||
WakeUpQueen();
|
||||
if( pGroup->ubSectorX == 9 && pGroup->ubSectorY == 1 ||
|
||||
pGroup->ubSectorX == 3 && pGroup->ubSectorY == 16 )
|
||||
if( pGroup->ubSectorX == gGameExternalOptions.ubDefaultArrivalSectorX && pGroup->ubSectorY == gGameExternalOptions.ubDefaultArrivalSectorY ||
|
||||
pGroup->ubSectorX == gModSettings.ubSAISpawnSectorX && pGroup->ubSectorY == gModSettings.ubSAISpawnSectorY )
|
||||
{
|
||||
SendGroupToPool( &pGroup );
|
||||
if( !pGroup )
|
||||
@@ -2956,7 +2956,7 @@ void SendReinforcementsForGarrison( INT32 iDstGarrisonID, UINT16 usDefencePoints
|
||||
//KM : Sep 9, 1999
|
||||
//If the player owns sector P3, any troops that spawned there were causing serious problems, seeing battle checks
|
||||
//were not performed!
|
||||
if( !StrategicMap[ CALCULATE_STRATEGIC_INDEX( 3, 16 ) ].fEnemyControlled )
|
||||
if( !StrategicMap[ CALCULATE_STRATEGIC_INDEX( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY ) ].fEnemyControlled )
|
||||
{ //Queen can no longer send reinforcements from the palace if she doesn't control it!
|
||||
return;
|
||||
}
|
||||
@@ -2994,7 +2994,7 @@ void SendReinforcementsForGarrison( INT32 iDstGarrisonID, UINT16 usDefencePoints
|
||||
}
|
||||
|
||||
|
||||
pGroup = CreateNewEnemyGroupDepartingFromSector( SEC_P3, 0, (UINT8)iReinforcementsApproved, 0 );
|
||||
pGroup = CreateNewEnemyGroupDepartingFromSector( SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY ), 0, (UINT8)iReinforcementsApproved, 0 );
|
||||
ConvertGroupTroopsToComposition( pGroup, gGarrisonGroup[ iDstGarrisonID ].ubComposition );
|
||||
pGroup->ubOriginalSector = (UINT8)SECTOR( ubDstSectorX, ubDstSectorY );
|
||||
//Madd: unlimited reinforcements?
|
||||
@@ -3161,7 +3161,7 @@ void SendReinforcementsForPatrol( INT32 iPatrolID, GROUP **pOptionalGroup )
|
||||
if( iRandom < giReinforcementPool )
|
||||
{ //use the pool and send the requested amount from SECTOR P3 (queen's palace)
|
||||
iReinforcementsApproved = min( iReinforcementsRequested, giReinforcementPool );
|
||||
pGroup = CreateNewEnemyGroupDepartingFromSector( SEC_P3, 0, (UINT8)iReinforcementsApproved, 0 );
|
||||
pGroup = CreateNewEnemyGroupDepartingFromSector( SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY ), 0, (UINT8)iReinforcementsApproved, 0 );
|
||||
pGroup->ubOriginalSector = (UINT8)SECTOR( ubDstSectorX, ubDstSectorY );
|
||||
|
||||
//Madd: unlimited reinforcements?
|
||||
@@ -3824,7 +3824,7 @@ BOOLEAN LoadStrategicAI( HWFILE hFile )
|
||||
if( ubSAIVersion < 20 )
|
||||
{
|
||||
gArmyComp[ QUEEN_DEFENCE ].bDesiredPopulation = 32;
|
||||
SectorInfo[ SEC_P3 ].ubNumElites = 32;
|
||||
SectorInfo[ SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY ) ].ubNumElites = 32;
|
||||
}
|
||||
if( ubSAIVersion < 21 )
|
||||
{
|
||||
@@ -3860,9 +3860,9 @@ BOOLEAN LoadStrategicAI( HWFILE hFile )
|
||||
}
|
||||
if( ubSAIVersion < 23 )
|
||||
{
|
||||
if( gWorldSectorX != 3 || gWorldSectorY != 16 || !gbWorldSectorZ )
|
||||
if( gWorldSectorX != gModSettings.ubSAISpawnSectorX || gWorldSectorY != gModSettings.ubSAISpawnSectorY || !gbWorldSectorZ )
|
||||
{
|
||||
SectorInfo[ SEC_P3 ].ubNumElites = 32;
|
||||
SectorInfo[ SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY ) ].ubNumElites = 32;
|
||||
}
|
||||
}
|
||||
if( ubSAIVersion < 24 )
|
||||
@@ -3978,7 +3978,7 @@ BOOLEAN LoadStrategicAI( HWFILE hFile )
|
||||
if( ubSAIVersion < 28 )
|
||||
{
|
||||
GROUP *pNext;
|
||||
if( !StrategicMap[ CALCULATE_STRATEGIC_INDEX( 3, 16 ) ].fEnemyControlled )
|
||||
if( !StrategicMap[ CALCULATE_STRATEGIC_INDEX( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY ) ].fEnemyControlled )
|
||||
{ //Eliminate all enemy groups in this sector, because the player owns the sector, and it is not
|
||||
//possible for them to spawn there!
|
||||
pGroup = gpGroupList;
|
||||
@@ -3987,7 +3987,7 @@ BOOLEAN LoadStrategicAI( HWFILE hFile )
|
||||
pNext = pGroup->next;
|
||||
if( !pGroup->fPlayer )
|
||||
{
|
||||
if( pGroup->ubSectorX == 3 && pGroup->ubSectorY == 16 && !pGroup->ubPrevX && !pGroup->ubPrevY )
|
||||
if( pGroup->ubSectorX == gModSettings.ubSAISpawnSectorX && pGroup->ubSectorY == gModSettings.ubSAISpawnSectorY && !pGroup->ubPrevX && !pGroup->ubPrevY )
|
||||
{
|
||||
ClearPreviousAIGroupAssignment( pGroup );
|
||||
RemovePGroup( pGroup );
|
||||
@@ -4333,7 +4333,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
||||
|
||||
if ( !(SectorInfo[ ubSourceSectorID ].ubNumTroops > 0) )
|
||||
{
|
||||
ubSourceSectorID = SEC_P3;
|
||||
ubSourceSectorID = SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY );
|
||||
}
|
||||
|
||||
ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + gGameOptions.ubDifficultyLevel * 3);
|
||||
@@ -4403,7 +4403,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
||||
ubTargetSectorID = SEC_B2;
|
||||
|
||||
if ( !(SectorInfo[ ubSourceSectorID ].ubNumTroops > 0) )
|
||||
ubSourceSectorID = SEC_P3;
|
||||
ubSourceSectorID = SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY );
|
||||
|
||||
stagesector0 = ubSourceSectorID;
|
||||
stagesector1 = ubSourceSectorID;
|
||||
@@ -4421,7 +4421,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
||||
ubTargetSectorID = SEC_H3;
|
||||
|
||||
if ( !(SectorInfo[ ubSourceSectorID ].ubNumTroops > 0) )
|
||||
ubSourceSectorID = SEC_P3;
|
||||
ubSourceSectorID = SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY );
|
||||
|
||||
stagesector0 = SEC_M2;
|
||||
stagesector1 = ubSourceSectorID;
|
||||
@@ -4439,7 +4439,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
||||
ubTargetSectorID = SEC_H8;
|
||||
|
||||
if ( !(SectorInfo[ ubSourceSectorID ].ubNumTroops > 0) )
|
||||
ubSourceSectorID = SEC_P3;
|
||||
ubSourceSectorID = SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY );
|
||||
|
||||
stagesector0 = ubSourceSectorID;
|
||||
stagesector1 = ubSourceSectorID;
|
||||
@@ -4470,7 +4470,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
||||
ubTargetSectorID = SEC_I13;
|
||||
|
||||
if ( !(SectorInfo[ ubSourceSectorID ].ubNumTroops > 0) )
|
||||
ubSourceSectorID = SEC_P3;
|
||||
ubSourceSectorID = SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY );
|
||||
}
|
||||
|
||||
stagesector0 = ubSourceSectorID;
|
||||
@@ -4499,7 +4499,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
||||
ubTargetSectorID = SEC_L11;
|
||||
|
||||
if ( !(SectorInfo[ ubSourceSectorID ].ubNumTroops > 0) )
|
||||
ubSourceSectorID = SEC_P3;
|
||||
ubSourceSectorID = SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY );
|
||||
|
||||
stagesector0 = ubSourceSectorID;
|
||||
stagesector1 = ubSourceSectorID;
|
||||
@@ -4584,11 +4584,11 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
||||
ubTargetSectorID = SEC_H3;
|
||||
|
||||
if ( !(SectorInfo[ ubSourceSectorID ].ubNumTroops > 0) )
|
||||
ubSourceSectorID = SEC_P3;
|
||||
ubSourceSectorID = SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY );
|
||||
|
||||
pGroup0 = CreateNewEnemyGroupDepartingFromSector( SEC_P3, 0, grouptroops, groupelites );
|
||||
pGroup1 = CreateNewEnemyGroupDepartingFromSector( SEC_P3, 0, grouptroops, groupelites );
|
||||
pGroup2 = CreateNewEnemyGroupDepartingFromSector( SEC_P3, 0, grouptroops, groupelites );
|
||||
pGroup0 = CreateNewEnemyGroupDepartingFromSector( SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY ), 0, grouptroops, groupelites );
|
||||
pGroup1 = CreateNewEnemyGroupDepartingFromSector( SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY ), 0, grouptroops, groupelites );
|
||||
pGroup2 = CreateNewEnemyGroupDepartingFromSector( SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY ), 0, grouptroops, groupelites );
|
||||
pGroup3 = CreateNewEnemyGroupDepartingFromSector( ubSourceSectorID, 0, grouptroops, groupelites );
|
||||
|
||||
totalusedsoldiers += min(grouptroops + groupelites, (UINT32)gGameExternalOptions.iMaxEnemyGroupSize);
|
||||
@@ -4620,7 +4620,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
||||
|
||||
if ( fAttack_Cambria )
|
||||
{
|
||||
ubSourceSectorID = SEC_P3;
|
||||
ubSourceSectorID = SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY );
|
||||
|
||||
// if the SAM was liberated by the player, we cannot stage there...
|
||||
// however, the SAM itself is also a very promising target... If we conquer that, the player cannot move his forces via helicopter, thus he cannot reinforce his other cities against simultaneous attacks
|
||||
@@ -4681,7 +4681,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
||||
ubTargetSectorID = SEC_I13;
|
||||
|
||||
if ( !(SectorInfo[ ubSourceSectorID ].ubNumTroops > 0) )
|
||||
ubSourceSectorID = SEC_P3;
|
||||
ubSourceSectorID = SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY );
|
||||
|
||||
pGroup0 = CreateNewEnemyGroupDepartingFromSector( ubSourceSectorID, 0, grouptroops, groupelites );
|
||||
pGroup1 = CreateNewEnemyGroupDepartingFromSector( ubSourceSectorID, 0, grouptroops, groupelites );
|
||||
@@ -4721,7 +4721,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
||||
ubTargetSectorID = SEC_L11;
|
||||
|
||||
if ( !(SectorInfo[ ubSourceSectorID ].ubNumTroops > 0) )
|
||||
ubSourceSectorID = SEC_P3;
|
||||
ubSourceSectorID = SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY );
|
||||
|
||||
pGroup0 = CreateNewEnemyGroupDepartingFromSector( ubSourceSectorID, 0, grouptroops, groupelites );
|
||||
pGroup1 = CreateNewEnemyGroupDepartingFromSector( ubSourceSectorID, 0, grouptroops, groupelites );
|
||||
@@ -4811,7 +4811,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
||||
ubSectorID = (UINT8)STRATEGIC_INDEX_TO_SECTOR_INFO( sWorldSectorLocationOfFirstBattle );
|
||||
pSector = &SectorInfo[ ubSectorID ];
|
||||
ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + gGameOptions.ubDifficultyLevel * 4);
|
||||
pGroup = CreateNewEnemyGroupDepartingFromSector( SEC_P3, 0, ubNumSoldiers, 0 );
|
||||
pGroup = CreateNewEnemyGroupDepartingFromSector( SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY ), 0, ubNumSoldiers, 0 );
|
||||
|
||||
//Madd: unlimited reinforcements?
|
||||
if ( !gfUnlimitedTroops )
|
||||
@@ -4873,7 +4873,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
||||
|
||||
if ( !(SectorInfo[ ubSourceSectorID ].ubNumTroops > 0) )
|
||||
{
|
||||
ubSourceSectorID = SEC_P3;
|
||||
ubSourceSectorID = SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY );
|
||||
}
|
||||
|
||||
int groupCnt = 0;
|
||||
@@ -4957,7 +4957,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
||||
|
||||
if ( !(SectorInfo[ ubSourceSectorID ].ubNumTroops > 0) )
|
||||
{
|
||||
ubSourceSectorID = SEC_P3;
|
||||
ubSourceSectorID = SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY );
|
||||
}
|
||||
|
||||
int groupCnt = 0;
|
||||
@@ -4990,7 +4990,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
||||
|
||||
case NPC_ACTION_SEND_SOLDIERS_TO_OMERTA:
|
||||
ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + gGameOptions.ubDifficultyLevel * 6); //6, 12, or 18 based on difficulty.
|
||||
pGroup = CreateNewEnemyGroupDepartingFromSector( SEC_P3, 0, ubNumSoldiers, (UINT8)(ubNumSoldiers/7) ); //add 1 elite to normal, and 2 for hard
|
||||
pGroup = CreateNewEnemyGroupDepartingFromSector( SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY ), 0, ubNumSoldiers, (UINT8)(ubNumSoldiers/7) ); //add 1 elite to normal, and 2 for hard
|
||||
ubNumSoldiers = (UINT8)(ubNumSoldiers + ubNumSoldiers / 7);
|
||||
|
||||
//Madd: unlimited reinforcements
|
||||
@@ -5021,7 +5021,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
|
||||
giReinforcementPool -= ubNumSoldiers;
|
||||
|
||||
giReinforcementPool = max( giReinforcementPool, 0 );
|
||||
pGroup = CreateNewEnemyGroupDepartingFromSector( SEC_P3, 0, 0, ubNumSoldiers );
|
||||
pGroup = CreateNewEnemyGroupDepartingFromSector( SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY ), 0, 0, ubNumSoldiers );
|
||||
MoveSAIGroupToSector( &pGroup, ubSectorID, STAGE, REINFORCEMENTS );
|
||||
|
||||
// WANNE: This should fix the assertion in UC in the cutscene!
|
||||
@@ -5604,7 +5604,7 @@ void RequestHighPriorityGarrisonReinforcements( INT32 iGarrisonID, UINT8 ubSoldi
|
||||
}
|
||||
else
|
||||
{ //There are no groups that have enough troops. Send a new force from the palace instead.
|
||||
pGroup = CreateNewEnemyGroupDepartingFromSector( SEC_P3, 0, ubSoldiersRequested, 0 );
|
||||
pGroup = CreateNewEnemyGroupDepartingFromSector( SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY ), 0, ubSoldiersRequested, 0 );
|
||||
pGroup->ubMoveType = ONE_WAY;
|
||||
pGroup->pEnemyGroup->ubIntention = REINFORCEMENTS;
|
||||
gGarrisonGroup[ iGarrisonID ].ubPendingGroupID = pGroup->ubGroupID;
|
||||
@@ -6095,14 +6095,14 @@ void TransferGroupToPool( GROUP **pGroup )
|
||||
//NOTE: Make sure you call SetEnemyGroupSector() first if the group is between sectors!! See example in ReassignAIGroup()...
|
||||
void SendGroupToPool( GROUP **pGroup )
|
||||
{
|
||||
if( (*pGroup)->ubSectorX == 3 && (*pGroup)->ubSectorY == 16 )
|
||||
if( (*pGroup)->ubSectorX == gModSettings.ubSAISpawnSectorX && (*pGroup)->ubSectorY == gModSettings.ubSAISpawnSectorY )
|
||||
{
|
||||
TransferGroupToPool( pGroup );
|
||||
}
|
||||
else
|
||||
{
|
||||
(*pGroup)->ubSectorIDOfLastReassignment = (UINT8)SECTOR( (*pGroup)->ubSectorX, (*pGroup)->ubSectorY );
|
||||
MoveSAIGroupToSector( pGroup, SEC_P3, EVASIVE, REINFORCEMENTS );
|
||||
MoveSAIGroupToSector( pGroup, SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY ), EVASIVE, REINFORCEMENTS );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user