mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Merge branch 'master' into ExtraMercs
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Strategic All.h"
|
||||
#else
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include "PreBattle Interface.h"
|
||||
@@ -50,7 +47,7 @@
|
||||
#include "CampaignStats.h" // added by Flugente
|
||||
#include "militiasquads.h" // added by Flugente
|
||||
#include "SkillCheck.h" // added by Flugente
|
||||
#endif
|
||||
#include "Strategic Transport Groups.h"
|
||||
|
||||
#ifdef JA2UB
|
||||
#include "ub_config.h"
|
||||
@@ -442,7 +439,7 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
||||
}
|
||||
else if ( pBattleGroup && pBattleGroup->usGroupTeam != OUR_TEAM && NumNonPlayerTeamMembersInSector( pBattleGroup->ubSectorX, pBattleGroup->ubSectorY, MILITIA_TEAM ) > 0 )
|
||||
{
|
||||
SetEnemyEncounterCode( ENEMY_ENCOUNTER_CODE );
|
||||
SetEnemyEncounterCode( pBattleGroup->usGroupTeam == ENEMY_TEAM && pBattleGroup->pEnemyGroup->ubIntention == TRANSPORT ? TRANSPORT_INTERCEPT_CODE : ENEMY_ENCOUNTER_CODE );
|
||||
}
|
||||
else if( GetEnemyEncounterCode() == ENTERING_ENEMY_SECTOR_CODE ||
|
||||
GetEnemyEncounterCode() == ENEMY_ENCOUNTER_CODE ||
|
||||
@@ -456,7 +453,8 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
||||
GetEnemyEncounterCode() == CONCEALINSERTION_CODE ||
|
||||
GetEnemyEncounterCode() == BLOODCAT_ATTACK_CODE ||
|
||||
GetEnemyEncounterCode() == ZOMBIE_ATTACK_CODE ||
|
||||
GetEnemyEncounterCode() == BANDIT_ATTACK_CODE )
|
||||
GetEnemyEncounterCode() == BANDIT_ATTACK_CODE ||
|
||||
GetEnemyEncounterCode() == TRANSPORT_INTERCEPT_CODE )
|
||||
{
|
||||
//use same code
|
||||
SetExplicitEnemyEncounterCode( GetEnemyEncounterCode() );
|
||||
@@ -683,8 +681,24 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
||||
{
|
||||
SetEnemyEncounterCode( ENEMY_ENCOUNTER_CODE );
|
||||
|
||||
GROUP* pGroup = gpGroupList;
|
||||
BOOLEAN encounteredTransportGroup = FALSE;
|
||||
while (pGroup)
|
||||
{
|
||||
if (pGroup->usGroupTeam == ENEMY_TEAM && pGroup->pEnemyGroup->ubIntention == TRANSPORT && pGroup->ubSectorX == gpBattleGroup->ubSectorX && pGroup->ubSectorY == gpBattleGroup->ubSectorY && pGroup->ubSectorZ == gpBattleGroup->ubSectorZ)
|
||||
{
|
||||
encounteredTransportGroup = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
pGroup = pGroup->next;
|
||||
}
|
||||
if (encounteredTransportGroup)
|
||||
{
|
||||
SetEnemyEncounterCode( TRANSPORT_INTERCEPT_CODE );
|
||||
}
|
||||
// Flugente: no ambushes on an airdrop
|
||||
if ( !fAirDrop )
|
||||
else if ( !fAirDrop )
|
||||
{
|
||||
//Don't consider ambushes until the player has reached 25% (normal) progress
|
||||
if( gfHighPotentialForAmbush )
|
||||
@@ -802,7 +816,9 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
||||
}
|
||||
else
|
||||
{ //Are enemies invading a town, or just encountered the player.
|
||||
if( GetTownIdForSector( gubPBSectorX, gubPBSectorY ) )
|
||||
if (pBattleGroup && pBattleGroup->usGroupTeam == ENEMY_TEAM && pBattleGroup->pEnemyGroup->ubIntention == TRANSPORT)
|
||||
SetEnemyEncounterCode( TRANSPORT_INTERCEPT_CODE );
|
||||
else if( GetTownIdForSector( gubPBSectorX, gubPBSectorY ) )
|
||||
SetEnemyEncounterCode( ENEMY_INVASION_CODE );
|
||||
//SAM sites not in towns will also be considered to be important
|
||||
else if( pSector->uiFlags & SF_SAM_SITE )
|
||||
@@ -870,7 +886,7 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
||||
}
|
||||
HideButton( giMapContractButton );
|
||||
|
||||
if( GetEnemyEncounterCode() == ENEMY_ENCOUNTER_CODE )
|
||||
if( GetEnemyEncounterCode() == ENEMY_ENCOUNTER_CODE || GetEnemyEncounterCode() == TRANSPORT_INTERCEPT_CODE )
|
||||
{ //we know how many enemies are here, so until we leave the sector, we will continue to display the value.
|
||||
//the flag will get cleared when time advances after the fEnemyInSector flag is clear.
|
||||
|
||||
@@ -959,6 +975,7 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
||||
{
|
||||
case CREATURE_ATTACK_CODE:
|
||||
case ENEMY_ENCOUNTER_CODE:
|
||||
case TRANSPORT_INTERCEPT_CODE:
|
||||
case ENEMY_INVASION_CODE:
|
||||
case ENEMY_INVASION_AIRDROP_CODE:
|
||||
case BLOODCAT_ATTACK_CODE:
|
||||
@@ -1217,6 +1234,7 @@ void RenderPBHeader( INT32 *piX, INT32 *piWidth)
|
||||
swprintf( str, gpStrategicString[ STR_PB_ENEMYINVASION_HEADER ] );
|
||||
break;
|
||||
case ENEMY_ENCOUNTER_CODE:
|
||||
case TRANSPORT_INTERCEPT_CODE:
|
||||
swprintf( str, gpStrategicString[ STR_PB_ENEMYENCOUNTER_HEADER ] );
|
||||
break;
|
||||
case ENEMY_AMBUSH_CODE:
|
||||
@@ -2145,6 +2163,15 @@ void PutNonSquadMercsInPlayerGroupOnSquads( GROUP *pGroup, BOOLEAN fExitVehicles
|
||||
// because if this is a simultaneous group attack, the mercs could be coming from different sides, and the
|
||||
// placement screen can't handle mercs on the same squad arriving from difference edges!
|
||||
fSuccess = AddCharacterToSquad( pSoldier, bUniqueVehicleSquad );
|
||||
// if we failed, create another squad
|
||||
if (!fSuccess)
|
||||
{
|
||||
bUniqueVehicleSquad = GetFirstEmptySquad();
|
||||
if (bUniqueVehicleSquad != -1)
|
||||
{
|
||||
fSuccess = AddCharacterToSquad(pSoldier, bUniqueVehicleSquad);
|
||||
}
|
||||
}
|
||||
}
|
||||
//CHRISL: So what's supposed to happen in the merc is assigned to a vehicle but fExitVehicles is FALSE?
|
||||
else
|
||||
@@ -2376,6 +2403,7 @@ BOOLEAN PlayerMercInvolvedInThisCombat( SOLDIERTYPE *pSoldier )
|
||||
pSoldier->bAssignment != ASSIGNMENT_POW &&
|
||||
pSoldier->bAssignment != ASSIGNMENT_DEAD &&
|
||||
pSoldier->bAssignment != ASSIGNMENT_MINIEVENT &&
|
||||
pSoldier->bAssignment != ASSIGNMENT_REBELCOMMAND &&
|
||||
!(pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE) &&
|
||||
// Robot is involved if it has a valid controller with it, uninvolved otherwise
|
||||
( !AM_A_ROBOT( pSoldier ) || ( pSoldier->ubRobotRemoteHolderID != NOBODY ) ) &&
|
||||
@@ -2514,6 +2542,10 @@ void LogBattleResults( UINT8 ubVictoryCode)
|
||||
break;
|
||||
case CONCEALINSERTION_CODE:
|
||||
break;
|
||||
case TRANSPORT_INTERCEPT_CODE:
|
||||
AddHistoryToPlayersLog( HISTORY_INTERCEPTED_TRANSPORT_GROUP, 0, GetWorldTotalMin(), sSectorX, sSectorY );
|
||||
NotifyTransportGroupDefeated();
|
||||
break;
|
||||
}
|
||||
|
||||
// Flugente: campaign stats
|
||||
@@ -2528,6 +2560,7 @@ void LogBattleResults( UINT8 ubVictoryCode)
|
||||
AddHistoryToPlayersLog( HISTORY_LOSTTOWNSECTOR, 0, GetWorldTotalMin(), sSectorX, sSectorY );
|
||||
break;
|
||||
case ENEMY_ENCOUNTER_CODE:
|
||||
case TRANSPORT_INTERCEPT_CODE:
|
||||
AddHistoryToPlayersLog( HISTORY_LOSTBATTLE, 0, GetWorldTotalMin(), sSectorX, sSectorY );
|
||||
break;
|
||||
case ENEMY_AMBUSH_CODE:
|
||||
@@ -2561,6 +2594,7 @@ void LogBattleResults( UINT8 ubVictoryCode)
|
||||
gCurrentIncident.usIncidentFlags |= INCIDENT_ATTACK_ENEMY;
|
||||
break;
|
||||
case ENEMY_ENCOUNTER_CODE:
|
||||
case TRANSPORT_INTERCEPT_CODE:
|
||||
case ENTERING_ENEMY_SECTOR_CODE:
|
||||
case CREATURE_ATTACK_CODE:
|
||||
case ENTERING_BLOODCAT_LAIR_CODE:
|
||||
|
||||
Reference in New Issue
Block a user