Major rework of getting captured quests and mechanics.

- new feature: added Tixa as another prison where capture mercs can be held (Alma is still primary choice though)
- fix: all mercs in the map will be taken POW when surrendered, however only 3 will appear in Alma/Tixa/N7, rest will be POW forever without chance of getting free
- fix: whenever player liberates any of the POW sectors (Alma, Tixa, N7) the respective quest/cutscene with POW will be disabled in that sector until enemy recapture the sector
- robot will be destroyed when surrendered as it makes no sense to inprison mechanical units
- externalized the GridNos for freeing POW mercs into Mod_Settings.ini

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9095 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Shadooow
2021-06-21 13:53:56 +00:00
parent 0101ed3c58
commit f779c0cb37
11 changed files with 155 additions and 57 deletions
+16
View File
@@ -523,6 +523,22 @@ BOOLEAN SetThisSectorAsEnemyControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, BO
UpdateRefuelSiteAvailability( );
}
//shadooow: re-enable quest if player loses control of the N7 prison and quest was disabled previously
if (sMapX == gModSettings.ubMeanwhileInterrogatePOWSectorX && sMapY == gModSettings.ubMeanwhileInterrogatePOWSectorY && gubQuest[QUEST_INTERROGATION] == QUESTCANNOTSTART)
{
gubQuest[QUEST_INTERROGATION] = QUESTNOTSTARTED;
}
//shadooow: re-enable quest if player loses control of the Alma prison and quest was disabled previously
if (sMapX == gModSettings.ubInitialPOWSectorX && sMapY == gModSettings.ubInitialPOWSectorY && gubQuest[QUEST_HELD_IN_ALMA] == QUESTCANNOTSTART)
{
gubQuest[QUEST_HELD_IN_ALMA] = QUESTNOTSTARTED;
}
//shadooow: re-enable quest if player loses control of the Tixa prison and quest was disabled previously
if (sMapX == gModSettings.ubTixaPrisonSectorX && sMapY == gModSettings.ubTixaPrisonSectorY && gubQuest[QUEST_HELD_IN_TIXA] == QUESTCANNOTSTART)
{
gubQuest[QUEST_HELD_IN_TIXA] = QUESTNOTSTARTED;
}
// Flugente: reduce workforce
SectorInfo[SECTOR( sMapX, sMapY )].usWorkers = SectorInfo[SECTOR( sMapX, sMapY )].usWorkers * gGameExternalOptions.dInitialWorkerRate;
+31 -38
View File
@@ -2739,7 +2739,13 @@ void EndCaptureSequence( )
}
// CJC Dec 1 2002: fixing multiple captures:
//else if ( gubQuest[ QUEST_HELD_IN_ALMA ] == QUESTDONE )
else if ( gubQuest[ QUEST_HELD_IN_ALMA ] == QUESTDONE && gubQuest[ QUEST_INTERROGATION ] == QUESTNOTSTARTED )
else if (gubQuest[QUEST_HELD_IN_ALMA] != QUESTINPROGRESS && gubQuest[QUEST_HELD_IN_TIXA] == QUESTNOTSTARTED)
{
// CJC Dec 1 2002: fixing multiple captures:
gStrategicStatus.uiFlags |= STRATEGIC_PLAYER_CAPTURED_FOR_RESCUE;
StartQuest(QUEST_HELD_IN_TIXA, gWorldSectorX, gWorldSectorY);
}
else if (gubQuest[QUEST_HELD_IN_ALMA] != QUESTINPROGRESS && gubQuest[QUEST_HELD_IN_TIXA] != QUESTINPROGRESS && gubQuest[QUEST_INTERROGATION] == QUESTNOTSTARTED)
{
StartQuest( QUEST_INTERROGATION, gWorldSectorX, gWorldSectorY );
// CJC Dec 1 2002: fixing multiple captures:
@@ -2765,12 +2771,6 @@ void EnemyCapturesPlayerSoldier( SOLDIERTYPE *pSoldier )
BOOLEAN fMadeCorpse;
INT32 iNumEnemiesInSector;
// Buggler: Externalized Hardcoded grid number
//static INT32 sAlmaCaptureGridNos[] = { 9208, 9688, 9215 }; //dnl!!!
//static INT32 sAlmaCaptureItemsGridNo[] = { 12246, 12406, 12086 }; //dnl!!!
//static INT32 sInterrogationItemGridNo[] = { 12089, 12089, 12089 }; //dnl!!!
AssertNotNIL(pSoldier);
// ATE: Check first if ! in player captured sequence already
@@ -2780,38 +2780,22 @@ void EnemyCapturesPlayerSoldier( SOLDIERTYPE *pSoldier )
return;
}
// ATE: If maximum prisoners captured, return!
if ( gStrategicStatus.ubNumCapturedForRescue > 2 )
// If this is an EPC , just kill them...
if ( AM_AN_EPC( pSoldier ) || AM_A_ROBOT(pSoldier))
{
return;
pSoldier->stats.bLife = 0;
pSoldier->iHealableInjury = 0; // added by SANDRO
HandleSoldierDeath( pSoldier, &fMadeCorpse );
return;
}
// If this is an EPC , just kill them...
if ( AM_AN_EPC( pSoldier ) )
{
pSoldier->stats.bLife = 0;
pSoldier->iHealableInjury = 0; // added by SANDRO
HandleSoldierDeath( pSoldier, &fMadeCorpse );
return;
}
if ( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE )
{
return;
}
if ( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE )
{
return;
}
// ATE: Patch fix If in a vehicle, remove from vehicle...
TakeSoldierOutOfVehicle( pSoldier );
// Are there enemies in ALMA? ( I13 )
iNumEnemiesInSector = NumNonPlayerTeamMembersInSector( gModSettings.ubInitialPOWSectorX, gModSettings.ubInitialPOWSectorY, ENEMY_TEAM ); //(13, 9)
// IF there are no enemies, and we need to do alma, skip!
if ( gubQuest[ QUEST_HELD_IN_ALMA ] == QUESTNOTSTARTED && iNumEnemiesInSector == 0 )
{
InternalStartQuest( QUEST_HELD_IN_ALMA, gWorldSectorX, gWorldSectorY, FALSE );
InternalEndQuest( QUEST_HELD_IN_ALMA, gWorldSectorX, gWorldSectorY, FALSE );
}
// ATE: Patch fix If in a vehicle, remove from vehicle...
TakeSoldierOutOfVehicle( pSoldier );
HandleMoraleEvent( pSoldier, MORALE_MERC_CAPTURED, pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ );
@@ -2824,7 +2808,7 @@ void EnemyCapturesPlayerSoldier( SOLDIERTYPE *pSoldier )
ChangeSoldiersAssignment( pSoldier, ASSIGNMENT_POW );
// ATE: Make them neutral!
if ( gubQuest[ QUEST_HELD_IN_ALMA ] == QUESTNOTSTARTED )
if ( gubQuest[ QUEST_HELD_IN_ALMA ] == QUESTNOTSTARTED || gubQuest[QUEST_HELD_IN_TIXA] == QUESTNOTSTARTED)
{
pSoldier->aiData.bNeutral = TRUE;
}
@@ -2834,7 +2818,7 @@ void EnemyCapturesPlayerSoldier( SOLDIERTYPE *pSoldier )
WORLDITEM WorldItem;
std::vector<WORLDITEM> pWorldItem;
if ( gubQuest[QUEST_HELD_IN_ALMA] == QUESTNOTSTARTED || gubQuest[QUEST_HELD_IN_ALMA] == QUESTDONE )
if (gStrategicStatus.ubNumCapturedForRescue < 3 && (gubQuest[QUEST_HELD_IN_ALMA] == QUESTNOTSTARTED || gubQuest[QUEST_HELD_IN_TIXA] == QUESTNOTSTARTED || gubQuest[QUEST_INTERROGATION] == QUESTNOTSTARTED))
{
INT32 itemdropoffgridno = -1;
@@ -2848,6 +2832,15 @@ void EnemyCapturesPlayerSoldier( SOLDIERTYPE *pSoldier )
pSoldier->usStrategicInsertionData = gModSettings.iInitialPOWGridNo[gStrategicStatus.ubNumCapturedForRescue];
itemdropoffgridno = gModSettings.iInitialPOWItemGridNo[gStrategicStatus.ubNumCapturedForRescue];
}
else if (gubQuest[QUEST_HELD_IN_TIXA] == QUESTNOTSTARTED)
{
//-teleport him to Tixa as originally planned
pSoldier->sSectorX = gModSettings.ubTixaPrisonSectorX;
pSoldier->sSectorY = gModSettings.ubTixaPrisonSectorY;
pSoldier->bSectorZ = 0;
pSoldier->usStrategicInsertionData = gModSettings.iTixaPrisonPOWGridNo[gStrategicStatus.ubNumCapturedForRescue];
itemdropoffgridno = gModSettings.iTixaPrisonPOWItemGridNo[gStrategicStatus.ubNumCapturedForRescue];
}
else //if ( gubQuest[QUEST_HELD_IN_ALMA] == QUESTDONE )
{
//-teleport him to N7
@@ -2855,7 +2848,7 @@ void EnemyCapturesPlayerSoldier( SOLDIERTYPE *pSoldier )
pSoldier->sSectorY = gModSettings.ubMeanwhileInterrogatePOWSectorY; //14
pSoldier->bSectorZ = 0;
pSoldier->usStrategicInsertionData = gModSettings.iMeanwhileInterrogatePOWGridNo[gStrategicStatus.ubNumCapturedForRescue];
itemdropoffgridno = gModSettings.iMeanwhileInterrogatePOWItemGridNo[gStrategicStatus.ubNumCapturedForRescue];;
itemdropoffgridno = gModSettings.iMeanwhileInterrogatePOWItemGridNo[gStrategicStatus.ubNumCapturedForRescue];
}
// OK, drop all items!
+1
View File
@@ -1448,6 +1448,7 @@ void InternalEndQuest( UINT8 ubQuest, INT16 sSectorX, INT16 sSectorY, BOOLEAN fU
case QUEST_KINGPIN_IDOL :
case QUEST_CHITZENA_IDOL :
case QUEST_HELD_IN_ALMA :
case QUEST_HELD_IN_TIXA :
case QUEST_RUNAWAY_JOEY :
case QUEST_ESCORT_TOURISTS :
GiveQuestRewardPoint( sSectorX, sSectorY, 5, NO_PROFILE );
+3 -1
View File
@@ -7,7 +7,8 @@
// Quest.ubStatus values
#define QUESTNOTSTARTED 0
#define QUESTINPROGRESS 1
#define QUESTDONE 2
#define QUESTDONE 2
#define QUESTCANNOTSTART 255
#define MAX_QUESTS 255
#define MAX_OLD_QUESTS 30
@@ -80,6 +81,7 @@ enum Quests
QUEST_KILL_DEIDRANNA = 25,
QUEST_KINGPIN_ANGEL_MARIA, // Flugente: new quest: if the player rescued Maria without implicating himself, Kingpin hires bounty hunters to kill them
QUEST_HELD_IN_TIXA,//shadooow: new quest: captured mercs can appear in Tixa prison if conditions are met for players to free them
#endif
} ;
/*
+12 -2
View File
@@ -3273,7 +3273,8 @@ void UpdateMercsInSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ )
fPOWSquadSet = TRUE;
// ATE: If we are in i13 - pop up message!
if ( sSectorX == gModSettings.ubInitialPOWSectorX && sSectorY == gModSettings.ubInitialPOWSectorY ) //(13, 9)
if ((sSectorX == gModSettings.ubInitialPOWSectorX && sSectorY == gModSettings.ubInitialPOWSectorY) || //(13, 9)
(sSectorX == gModSettings.ubTixaPrisonSectorX && sSectorY == gModSettings.ubTixaPrisonSectorY))
{
swprintf( zTemp, TacticalStr[POW_MERCS_ARE_HERE], gMercProfiles[QUEEN].zNickname );
DoMessageBox( MSG_BOX_BASIC_STYLE, zTemp, GAME_SCREEN, (UINT8)MSG_BOX_FLAG_OK, NULL, NULL );
@@ -3287,7 +3288,8 @@ void UpdateMercsInSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ )
}
else
{
if ( sSectorX != gModSettings.ubInitialPOWSectorX && sSectorY != gModSettings.ubInitialPOWSectorY ) //(13, 9)
if ((sSectorX != gModSettings.ubInitialPOWSectorX && sSectorY != gModSettings.ubInitialPOWSectorY) && //(13, 9)
(sSectorX != gModSettings.ubTixaPrisonSectorX && sSectorY != gModSettings.ubTixaPrisonSectorY))
{
AddCharacterToSquad( pSoldier, ubPOWSquad );
}
@@ -3302,6 +3304,14 @@ void UpdateMercsInSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ )
// Do action
HandleNPCDoAction( 0, NPC_ACTION_GRANT_EXPERIENCE_3, 0 );
}
else if (gubQuest[QUEST_HELD_IN_TIXA] == QUESTINPROGRESS)
{
// Complete quest
EndQuest(QUEST_HELD_IN_TIXA, sSectorX, sSectorY);
// Do action
HandleNPCDoAction(0, NPC_ACTION_GRANT_EXPERIENCE_3, 0);
}
}
}
}