mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
- New Feature: Enemy Generals are unique enemies whose location randomized and unknwon to the player. As long as they are alive, the enemy gets signifiant strategic boni. The player must learn of their location and take take them out, preferrably without alerting them prior.
- Covert Ops: Bleeding is deemed suspicious only if COVERT_DETECTEDIFBLEEDING is set to TRUE. - renamed special prisoners to officers. - lowered the priority of enemy troops becoming medics - prisoners in player-controlled prisons now use the prioner-colour scheme used by Shank and Dynamo Requires GameDir >= r2028. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7179 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+51
-10
@@ -6581,7 +6581,7 @@ void HandlePrisonerProcessingInSector( INT16 sMapX, INT16 sMapY, INT8 bZ )
|
||||
SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sMapX, sMapY ) ] );
|
||||
|
||||
UINT8 prisoners[PRISONER_MAX] = {0};
|
||||
UINT16 numprisoners = GetNumberOfPrisoners( pSectorInfo, &prisoners[PRISONER_SPECIAL], &prisoners[PRISONER_ELITE], &prisoners[PRISONER_REGULAR], &prisoners[PRISONER_ADMIN] );
|
||||
UINT16 numprisoners = GetNumberOfPrisoners( pSectorInfo, &prisoners[PRISONER_OFFICER], &prisoners[PRISONER_ELITE], &prisoners[PRISONER_REGULAR], &prisoners[PRISONER_ADMIN] );
|
||||
|
||||
// add interrogation progress from last hour and erase it in data
|
||||
UINT32 interrogationpoints = pSectorInfo->uiInterrogationHundredsLeft;
|
||||
@@ -6650,7 +6650,7 @@ void HandlePrisonerProcessingInSector( INT16 sMapX, INT16 sMapY, INT8 bZ )
|
||||
}
|
||||
}
|
||||
|
||||
UINT16 prisonersinterrogated = interrogatedprisoners[PRISONER_ADMIN] + interrogatedprisoners[PRISONER_REGULAR] + interrogatedprisoners[PRISONER_ELITE] + interrogatedprisoners[PRISONER_SPECIAL];
|
||||
UINT16 prisonersinterrogated = interrogatedprisoners[PRISONER_ADMIN] + interrogatedprisoners[PRISONER_REGULAR] + interrogatedprisoners[PRISONER_ELITE] + interrogatedprisoners[PRISONER_OFFICER];
|
||||
|
||||
// the part that gets left behind is saved to the map (but not the part that gets lost due to there not being enough prisoners)
|
||||
UINT32 losthundreds = interrogationpoints / 100;
|
||||
@@ -6687,6 +6687,47 @@ void HandlePrisonerProcessingInSector( INT16 sMapX, INT16 sMapY, INT8 bZ )
|
||||
// chance that prisoner will give us random info about enemy positions
|
||||
else if ( result < gGameExternalOptions.ubPrisonerProcessDefectChance + gGameExternalOptions.ubPrisonerProcessInfoBaseChance )
|
||||
{
|
||||
// if this guy is an elite or a special prisoner, there is a chance he might tell us about high-value targets!
|
||||
BOOLEAN fGetInfoOnHiddenVIPs = FALSE;
|
||||
if ( i < interrogatedprisoners[PRISONER_ADMIN] )
|
||||
{
|
||||
if ( Chance( gGameExternalOptions.ubPrisonerInterrogationEnemyGeneralInfoChance[PRISONER_ADMIN] ) )
|
||||
fGetInfoOnHiddenVIPs = TRUE;
|
||||
}
|
||||
else if ( i < interrogatedprisoners[PRISONER_REGULAR] )
|
||||
{
|
||||
if ( Chance( gGameExternalOptions.ubPrisonerInterrogationEnemyGeneralInfoChance[PRISONER_REGULAR] ) )
|
||||
fGetInfoOnHiddenVIPs = TRUE;
|
||||
}
|
||||
else if ( i < interrogatedprisoners[PRISONER_ELITE] )
|
||||
{
|
||||
if ( Chance( gGameExternalOptions.ubPrisonerInterrogationEnemyGeneralInfoChance[PRISONER_ELITE] ) )
|
||||
fGetInfoOnHiddenVIPs = TRUE;
|
||||
}
|
||||
else if ( i < interrogatedprisoners[PRISONER_OFFICER] )
|
||||
{
|
||||
if ( Chance( gGameExternalOptions.ubPrisonerInterrogationEnemyGeneralInfoChance[PRISONER_OFFICER] ) )
|
||||
fGetInfoOnHiddenVIPs = TRUE;
|
||||
}
|
||||
|
||||
if ( fGetInfoOnHiddenVIPs )
|
||||
{
|
||||
UINT16 unknownvipector = 0;
|
||||
if ( GetRandomUnknownVIPSector( unknownvipector ) )
|
||||
{
|
||||
// make this guy known to the player
|
||||
StrategicMap[unknownvipector].usFlags |= ENEMY_VIP_PRESENT_KNOWN;
|
||||
|
||||
CHAR16 str[128];
|
||||
GetSectorIDString( SECTORX( unknownvipector ), SECTORY( unknownvipector ), 0, str, TRUE );
|
||||
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szPrisonerTextStr[STR_PRISONER_DETECTION_VIP], str );
|
||||
|
||||
// enough info from this guy
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN found = FALSE;
|
||||
UINT8 maxtries = 20;
|
||||
for(UINT8 infotry = 0; infotry < maxtries; ++infotry)
|
||||
@@ -6761,7 +6802,7 @@ void HandlePrisonerProcessingInSector( INT16 sMapX, INT16 sMapY, INT8 bZ )
|
||||
}
|
||||
|
||||
// remove interrogated prisoners...
|
||||
ChangeNumberOfPrisoners( pSectorInfo, -interrogatedprisoners[PRISONER_SPECIAL], -interrogatedprisoners[PRISONER_ELITE], -interrogatedprisoners[PRISONER_REGULAR], -interrogatedprisoners[PRISONER_ADMIN], sMapX, sMapY );
|
||||
ChangeNumberOfPrisoners( pSectorInfo, -interrogatedprisoners[PRISONER_OFFICER], -interrogatedprisoners[PRISONER_ELITE], -interrogatedprisoners[PRISONER_REGULAR], -interrogatedprisoners[PRISONER_ADMIN], sMapX, sMapY );
|
||||
|
||||
// give experience rewards to the interrogators
|
||||
// total experience to share
|
||||
@@ -6824,13 +6865,13 @@ void HandlePrison( INT16 sMapX, INT16 sMapY, INT8 bZ )
|
||||
// Are there any prisoners in this prison?
|
||||
SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sMapX, sMapY ) ] );
|
||||
|
||||
UINT8 prisonersspecial = 0, prisonerselite = 0, prisonersregular = 0, prisonersadmin = 0;
|
||||
UINT16 numprisoners = GetNumberOfPrisoners( pSectorInfo, &prisonersspecial, &prisonerselite, &prisonersregular, &prisonersadmin );
|
||||
UINT8 prisonersofficer = 0, prisonerselite = 0, prisonersregular = 0, prisonersadmin = 0;
|
||||
UINT16 numprisoners = GetNumberOfPrisoners( pSectorInfo, &prisonersofficer, &prisonerselite, &prisonersregular, &prisonersadmin );
|
||||
|
||||
// for now, simply count specials as elites
|
||||
ChangeNumberOfPrisoners( pSectorInfo, -prisonersspecial, prisonersspecial, 0, 0 );
|
||||
prisonerselite += prisonersspecial;
|
||||
prisonersspecial = 0;
|
||||
// for now, simply count officers as elites
|
||||
ChangeNumberOfPrisoners( pSectorInfo, -prisonersofficer, prisonersofficer, 0, 0 );
|
||||
prisonerselite += prisonersofficer;
|
||||
prisonersofficer = 0;
|
||||
|
||||
if ( !numprisoners )
|
||||
return;
|
||||
@@ -6901,7 +6942,7 @@ void HandlePrison( INT16 sMapX, INT16 sMapY, INT8 bZ )
|
||||
pSectorInfo->ubNumAdmins = min(255, pSectorInfo->ubNumAdmins + escapedadmins);
|
||||
|
||||
// reduce prisoner count!
|
||||
ChangeNumberOfPrisoners( pSectorInfo, -prisonersspecial, -escapedelites, -escapedregulars, -escapedadmins, sMapX, sMapY );
|
||||
ChangeNumberOfPrisoners( pSectorInfo, -prisonersofficer, -escapedelites, -escapedregulars, -escapedadmins, sMapX, sMapY );
|
||||
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szPrisonerTextStr[STR_PRISONER_RIOT], wSectorName );
|
||||
}
|
||||
|
||||
@@ -424,7 +424,7 @@ typedef enum
|
||||
PRISONER_ADMIN = 0,
|
||||
PRISONER_REGULAR,
|
||||
PRISONER_ELITE,
|
||||
PRISONER_SPECIAL,
|
||||
PRISONER_OFFICER,
|
||||
PRISONER_MAX,
|
||||
} PrisonerType;
|
||||
|
||||
|
||||
+60
-1
@@ -492,6 +492,10 @@ void InitStrategicLayer( void )
|
||||
// re-set up leave list arrays for dismissed mercs
|
||||
InitLeaveList( );
|
||||
|
||||
// Flugente: se up VIP locations
|
||||
void InitVIPSectors( );
|
||||
|
||||
|
||||
#ifdef JA2UB
|
||||
LuaInitStrategicLayer(0); //JA25 UB InitStrategicLayer.lua
|
||||
#endif
|
||||
@@ -1219,7 +1223,7 @@ void ReStartingGame()
|
||||
if ( InAirRaid( ) )
|
||||
{
|
||||
EndAirRaid( );
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef JA2TESTVERSION
|
||||
//Reset so we can use the 'cheat key' to start with mercs
|
||||
@@ -1248,3 +1252,58 @@ void ReStartingGame()
|
||||
gubCheatLevel = 0;
|
||||
|
||||
}
|
||||
|
||||
// Flugente: set up VIP locations
|
||||
void InitVIPSectors()
|
||||
{
|
||||
if ( !gGameExternalOptions.fEnemyGenerals )
|
||||
return;
|
||||
|
||||
gStrategicStatus.usVIPsTotal = gGameExternalOptions.usEnemyGeneralsNumber;
|
||||
gStrategicStatus.usVIPsLeft = 0;
|
||||
|
||||
// first VIP is the general, if he is still alive
|
||||
if ( gMercProfiles[GENERAL].bLife > 0 )
|
||||
{
|
||||
UINT16 generalsector = SECTOR( gMercProfiles[GENERAL].sSectorX, gMercProfiles[GENERAL].sSectorY );
|
||||
|
||||
// place new VIP in sector
|
||||
StrategicMap[generalsector].usFlags |= ENEMY_VIP_PRESENT;
|
||||
|
||||
// no extra troops here. The player might have already taken the barracks but left the general alive
|
||||
//SectorInfo[generalsector].ubNumElites += 5;
|
||||
|
||||
++gStrategicStatus.usVIPsLeft;
|
||||
}
|
||||
|
||||
for ( UINT8 i = gStrategicStatus.usVIPsLeft; i < gStrategicStatus.usVIPsTotal; ++i )
|
||||
{
|
||||
UINT16 vipspawnsector = 0;
|
||||
if ( GetPossibleVIPSector( vipspawnsector ) )
|
||||
{
|
||||
// place new VIP in sector
|
||||
StrategicMap[vipspawnsector].usFlags |= ENEMY_VIP_PRESENT;
|
||||
|
||||
// increase troop count - VIP plus bodyguards
|
||||
SectorInfo[vipspawnsector].ubNumElites += 5;
|
||||
|
||||
// VIP placed
|
||||
++gStrategicStatus.usVIPsLeft;
|
||||
}
|
||||
// spawn the remaining generals in Meduna
|
||||
else
|
||||
{
|
||||
if ( GetRandomEnemyTownSector( MEDUNA, vipspawnsector ) )
|
||||
{
|
||||
// place new VIP in sector
|
||||
StrategicMap[vipspawnsector].usFlags |= ENEMY_VIP_PRESENT;
|
||||
|
||||
// increase troop count - VIP plus bodyguards
|
||||
SectorInfo[vipspawnsector].ubNumElites += 5;
|
||||
|
||||
// VIP placed
|
||||
++gStrategicStatus.usVIPsLeft;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,5 +14,8 @@ void ReStartingGame();
|
||||
|
||||
void InitBloodCatSectors();
|
||||
|
||||
// Flugente: se up VIP locations
|
||||
void InitVIPSectors();
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1289,6 +1289,47 @@ void ShowUncertainNumberEnemiesInSector( INT16 sSectorX, INT16 sSectorY )
|
||||
InvalidateRegion( sXPosition ,sYPosition, sXPosition + DMAP_GRID_X, sYPosition + DMAP_GRID_Y );
|
||||
}
|
||||
|
||||
void ShowVIPSymbol( INT16 sSectorX, INT16 sSectorY )
|
||||
{
|
||||
INT16 sXPosition = 0, sYPosition = 0;
|
||||
HVOBJECT hIconHandle;
|
||||
|
||||
UINT8 iconOffsetX = 0;
|
||||
UINT8 iconOffsetY = 0;
|
||||
|
||||
if ( iResolution >= _640x480 && iResolution < _800x600 )
|
||||
{
|
||||
iconOffsetX = 2;
|
||||
iconOffsetY = 9;
|
||||
}
|
||||
else if ( iResolution < _1024x768 )
|
||||
{
|
||||
iconOffsetX = 8;
|
||||
iconOffsetY = 12;
|
||||
}
|
||||
else
|
||||
{
|
||||
iconOffsetX = 12;
|
||||
iconOffsetY = 13;
|
||||
}
|
||||
|
||||
// grab the x and y postions
|
||||
sXPosition = sSectorX;
|
||||
sYPosition = sSectorY;
|
||||
|
||||
// get the video object
|
||||
GetVideoObject( &hIconHandle, guiCHARICONS );
|
||||
|
||||
// check if we are zoomed in...need to offset in case for scrolling purposes
|
||||
sXPosition = (INT16)(iconOffsetX + (MAP_VIEW_START_X + (sSectorX * MAP_GRID_X + 1)) - 1);
|
||||
sYPosition = (INT16)(((iconOffsetY + (sSectorY * MAP_GRID_Y) + 1)));
|
||||
sYPosition -= 2;
|
||||
|
||||
// small question mark
|
||||
BltVideoObject( guiSAVEBUFFER, hIconHandle, 10, sXPosition, sYPosition, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
InvalidateRegion( sXPosition, sYPosition, sXPosition + DMAP_GRID_X, sYPosition + DMAP_GRID_Y );
|
||||
}
|
||||
|
||||
|
||||
void ShowTeamAndVehicles(INT32 fShowFlags)
|
||||
{
|
||||
@@ -6493,6 +6534,10 @@ void HandleShowingOfEnemyForcesInSector( INT16 sSectorX, INT16 sSectorY, INT8 bS
|
||||
// get total number of badguys here
|
||||
sNumberOfEnemies = NumEnemiesInSector( sSectorX, sSectorY );
|
||||
|
||||
// Flugente: note if we have detected a VIP here
|
||||
if ( SectorHasVIP( sSectorX, sSectorY ) )//PlayerKnowsAboutVIP( sSectorX, sSectorY ) )
|
||||
ShowVIPSymbol( sSectorX, sSectorY );
|
||||
|
||||
// Flugente: snitch reports can be false - we assume an enemy patrol where there is none. Unfortunately, that would always be the case if fNoEnemyDetectionWithoutReconis false - we detect something everywhere,
|
||||
// so every sector gets a red question mark. In that case, get out of here
|
||||
// anv: probability of false enemy reports!
|
||||
|
||||
@@ -1155,6 +1155,14 @@ void InitStrategicAI()
|
||||
#ifdef JA2BETAVERSION
|
||||
ClearStrategicLog();
|
||||
#endif
|
||||
|
||||
// Flugente: enemy generals can speed up the AI decision process (justification: the generals are the ones planning the military operations, so if theay are around, the army is more efficient)
|
||||
FLOAT dEnemyGeneralsSpeedupFactor = 1.0f;
|
||||
if ( gGameExternalOptions.fEnemyRoles && gGameExternalOptions.fEnemyGenerals )
|
||||
{
|
||||
dEnemyGeneralsSpeedupFactor = max( 0.5f, dEnemyGeneralsSpeedupFactor - gStrategicStatus.usVIPsLeft * gGameExternalOptions.fEnemyGeneralStrategicDecisionSpeedBonus );
|
||||
}
|
||||
|
||||
switch( gGameOptions.ubDifficultyLevel )
|
||||
{
|
||||
case DIF_LEVEL_EASY:
|
||||
@@ -1167,7 +1175,7 @@ void InitStrategicAI()
|
||||
gfUnlimitedTroops = gGameExternalOptions.gfEasyUnlimitedTroops;
|
||||
gfAggressiveQueen = gGameExternalOptions.gfEasyAggressiveQueen;
|
||||
// 475 is 7:55am in minutes since midnight, the time the game starts on day 1
|
||||
AddStrategicEvent( EVENT_EVALUATE_QUEEN_SITUATION, 475 + gGameExternalOptions.ubEasyTimeEvaluateInMinutes + Random( gGameExternalOptions.ubEasyTimeEvaluateVariance ), 0 );
|
||||
AddStrategicEvent( EVENT_EVALUATE_QUEEN_SITUATION, 475 + dEnemyGeneralsSpeedupFactor * (gGameExternalOptions.ubEasyTimeEvaluateInMinutes + Random( gGameExternalOptions.ubEasyTimeEvaluateVariance )), 0 );
|
||||
break;
|
||||
case DIF_LEVEL_MEDIUM:
|
||||
giReinforcementPool = gGameExternalOptions.iReinforcementPoolExperienced;
|
||||
@@ -1178,7 +1186,7 @@ void InitStrategicAI()
|
||||
gubHoursGracePeriod = gGameExternalOptions.ubNormalGracePeriodInHours;
|
||||
gfUnlimitedTroops = gGameExternalOptions.gfNormalUnlimitedTroops;
|
||||
gfAggressiveQueen = gGameExternalOptions.gfNormalAggressiveQueen;
|
||||
AddStrategicEvent( EVENT_EVALUATE_QUEEN_SITUATION, 475 + gGameExternalOptions.ubNormalTimeEvaluateInMinutes + Random( gGameExternalOptions.ubNormalTimeEvaluateVariance ), 0 );
|
||||
AddStrategicEvent( EVENT_EVALUATE_QUEEN_SITUATION, 475 + dEnemyGeneralsSpeedupFactor * (gGameExternalOptions.ubNormalTimeEvaluateInMinutes + Random( gGameExternalOptions.ubNormalTimeEvaluateVariance )), 0);
|
||||
break;
|
||||
case DIF_LEVEL_HARD:
|
||||
giReinforcementPool = gGameExternalOptions.iReinforcementPoolExpert;
|
||||
@@ -1189,7 +1197,7 @@ void InitStrategicAI()
|
||||
gubHoursGracePeriod = gGameExternalOptions.ubHardGracePeriodInHours;
|
||||
gfUnlimitedTroops = gGameExternalOptions.gfHardUnlimitedTroops;
|
||||
gfAggressiveQueen = gGameExternalOptions.gfHardAggressiveQueen;
|
||||
AddStrategicEvent( EVENT_EVALUATE_QUEEN_SITUATION, 475 + gGameExternalOptions.ubHardTimeEvaluateInMinutes + Random( gGameExternalOptions.ubHardTimeEvaluateVariance ), 0 );
|
||||
AddStrategicEvent( EVENT_EVALUATE_QUEEN_SITUATION, 475 + dEnemyGeneralsSpeedupFactor * (gGameExternalOptions.ubHardTimeEvaluateInMinutes + Random( gGameExternalOptions.ubHardTimeEvaluateVariance )), 0);
|
||||
break;
|
||||
case DIF_LEVEL_INSANE:
|
||||
giReinforcementPool = gGameExternalOptions.iReinforcementPoolInsane;
|
||||
@@ -1200,7 +1208,7 @@ void InitStrategicAI()
|
||||
gubHoursGracePeriod = gGameExternalOptions.ubInsaneGracePeriodInHours;
|
||||
gfUnlimitedTroops = gGameExternalOptions.gfInsaneUnlimitedTroops;
|
||||
gfAggressiveQueen = gGameExternalOptions.gfInsaneAggressiveQueen;
|
||||
AddStrategicEvent( EVENT_EVALUATE_QUEEN_SITUATION, 475 + gGameExternalOptions.ubInsaneTimeEvaluateInMinutes + Random( gGameExternalOptions.ubInsaneTimeEvaluateVariance ), 0 );
|
||||
AddStrategicEvent( EVENT_EVALUATE_QUEEN_SITUATION, 475 + dEnemyGeneralsSpeedupFactor * (gGameExternalOptions.ubInsaneTimeEvaluateInMinutes + Random( gGameExternalOptions.ubInsaneTimeEvaluateVariance )), 0);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3257,19 +3265,27 @@ void EvaluateQueenSituation()
|
||||
// This can increase the decision intervals by up to 500 extra minutes (> 8 hrs)
|
||||
uiOffset = max( 100 - giRequestPoints, 0);
|
||||
uiOffset = uiOffset + Random( uiOffset * 4 );
|
||||
|
||||
// Flugente: enemy generals can speed up the AI decision process (justification: the generals are the ones planning the military operations, so if theay are around, the army is more efficient)
|
||||
FLOAT dEnemyGeneralsSpeedupFactor = 1.0f;
|
||||
if ( gGameExternalOptions.fEnemyRoles && gGameExternalOptions.fEnemyGenerals )
|
||||
{
|
||||
dEnemyGeneralsSpeedupFactor = max( 0.5f, dEnemyGeneralsSpeedupFactor - gStrategicStatus.usVIPsLeft * gGameExternalOptions.fEnemyGeneralStrategicDecisionSpeedBonus );
|
||||
}
|
||||
|
||||
switch( gGameOptions.ubDifficultyLevel )
|
||||
{
|
||||
case DIF_LEVEL_EASY:
|
||||
uiOffset += gGameExternalOptions.ubEasyTimeEvaluateInMinutes + Random( gGameExternalOptions.ubEasyTimeEvaluateVariance );
|
||||
uiOffset += dEnemyGeneralsSpeedupFactor * (gGameExternalOptions.ubEasyTimeEvaluateInMinutes + Random( gGameExternalOptions.ubEasyTimeEvaluateVariance ));
|
||||
break;
|
||||
case DIF_LEVEL_MEDIUM:
|
||||
uiOffset += gGameExternalOptions.ubNormalTimeEvaluateInMinutes + Random( gGameExternalOptions.ubNormalTimeEvaluateVariance );
|
||||
uiOffset += dEnemyGeneralsSpeedupFactor * (gGameExternalOptions.ubNormalTimeEvaluateInMinutes + Random( gGameExternalOptions.ubNormalTimeEvaluateVariance ));
|
||||
break;
|
||||
case DIF_LEVEL_HARD:
|
||||
uiOffset += gGameExternalOptions.ubHardTimeEvaluateInMinutes + Random( gGameExternalOptions.ubHardTimeEvaluateVariance );
|
||||
uiOffset += dEnemyGeneralsSpeedupFactor * (gGameExternalOptions.ubHardTimeEvaluateInMinutes + Random( gGameExternalOptions.ubHardTimeEvaluateVariance ));
|
||||
break;
|
||||
case DIF_LEVEL_INSANE:
|
||||
uiOffset += gGameExternalOptions.ubInsaneTimeEvaluateInMinutes + Random( gGameExternalOptions.ubInsaneTimeEvaluateVariance );
|
||||
uiOffset += dEnemyGeneralsSpeedupFactor * (gGameExternalOptions.ubInsaneTimeEvaluateInMinutes + Random( gGameExternalOptions.ubInsaneTimeEvaluateVariance ));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -3260,6 +3260,17 @@ INT32 GetSectorMvtTimeForGroup( UINT8 ubSector, UINT8 ubDirection, GROUP *pGroup
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( !pGroup->fPlayer )
|
||||
{
|
||||
// Flugente: enemy generals can speed up the AI decision process (justification: the generals are the ones planning the military operations, so if theay are around, the army is more efficient)
|
||||
FLOAT dEnemyGeneralsSpeedupFactor = 1.0f;
|
||||
if ( gGameExternalOptions.fEnemyRoles && gGameExternalOptions.fEnemyGenerals )
|
||||
{
|
||||
dEnemyGeneralsSpeedupFactor = max( 0.75f, dEnemyGeneralsSpeedupFactor - gStrategicStatus.usVIPsLeft * gGameExternalOptions.fEnemyGeneralStrategicMovementSpeedBonus );
|
||||
}
|
||||
|
||||
iBestTraverseTime = dEnemyGeneralsSpeedupFactor * iBestTraverseTime;
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
return iBestTraverseTime;
|
||||
@@ -5119,7 +5130,7 @@ void SetGroupArrivalTime( GROUP *pGroup, UINT32 uiArrivalTime )
|
||||
|
||||
// Also note that non-chopper groups can currently be delayed such that this assetion would fail - enemy groups by
|
||||
// DelayEnemyGroupsIfPathsCross(), and player groups via PrepareGroupsForSimultaneousArrival(). So we skip the assert.
|
||||
|
||||
|
||||
if ( IsGroupTheHelicopterGroup( pGroup ) )
|
||||
{
|
||||
// make sure it's valid (NOTE: the correct traverse time must be set first!)
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
#include "GameSettings.h"
|
||||
#include "history.h"
|
||||
#include "Strategic Town Loyalty.h"
|
||||
#include "Game Init.h" // added by Flugente
|
||||
#include "GameVersion.h" // added by Flugente
|
||||
#include "SaveLoadGame.h" // added by Flugente
|
||||
#endif
|
||||
|
||||
|
||||
@@ -42,8 +45,6 @@ BOOLEAN SaveStrategicStatusToSaveGameFile( HWFILE hFile )
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
|
||||
|
||||
BOOLEAN LoadStrategicStatusFromSaveGameFile( HWFILE hFile )
|
||||
{
|
||||
UINT32 uiNumBytesRead;
|
||||
@@ -55,6 +56,13 @@ BOOLEAN LoadStrategicStatusFromSaveGameFile( HWFILE hFile )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
// Flugente: enemy generals: if loading an old savegame that did not have this feature, or it was turned off and is now turned on, initialise generals
|
||||
if ( guiCurrentSaveGameVersion < ENEMY_VIPS || !gStrategicStatus.usVIPsTotal )
|
||||
{
|
||||
// Flugente: set up VIP locations
|
||||
InitVIPSectors();
|
||||
}
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,11 @@ typedef struct STRATEGIC_STATUS
|
||||
UINT8 ubNumNewSectorsVisitedToday;
|
||||
UINT8 ubNumberOfDaysOfInactivity;
|
||||
|
||||
INT8 bPadding[70];
|
||||
// Flugente: VIPs
|
||||
UINT8 usVIPsTotal;
|
||||
UINT8 usVIPsLeft;
|
||||
|
||||
INT8 bPadding[68];
|
||||
|
||||
} STRATEGIC_STATUS;
|
||||
|
||||
|
||||
@@ -43,6 +43,9 @@ enum
|
||||
#define MILITIA_MOVE_EAST 0x00000004 //4
|
||||
#define MILITIA_MOVE_SOUTH 0x00000008 //8
|
||||
|
||||
#define ENEMY_VIP_PRESENT 0x00000010 //16 // an enemy VIP is present in this sector
|
||||
#define ENEMY_VIP_PRESENT_KNOWN 0x00000020 //16 // player thinks a VIP is here
|
||||
|
||||
#define MILITIA_MOVE_ALLDIRS 0x0000000F // 15
|
||||
// -------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user