diff --git a/GameSettings.cpp b/GameSettings.cpp index 32e23606..471dc357 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -2725,12 +2725,24 @@ void LoadModSettings(){ gModSettings.iInitialPOWItemGridNo[0] = iniReader.ReadInteger("Alma", "INITIAL_POW_ITEM_POSITION_1", 12246); gModSettings.iInitialPOWItemGridNo[1] = iniReader.ReadInteger("Alma", "INITIAL_POW_ITEM_POSITION_2", 12406); gModSettings.iInitialPOWItemGridNo[2] = iniReader.ReadInteger("Alma", "INITIAL_POW_ITEM_POSITION_3", 12086); + gModSettings.iInitialPOWGetFreeGridNo[0] = iniReader.ReadInteger("Alma", "INITIAL_POW_GETFREE_GRIDNO_1", 10492); + gModSettings.iInitialPOWGetFreeGridNo[1] = iniReader.ReadInteger("Alma", "INITIAL_POW_GETFREE_GRIDNO_2", 10482); + gModSettings.iInitialPOWGetFreeGridNo[2] = iniReader.ReadInteger("Alma", "INITIAL_POW_GETFREE_GRIDNO_3", 9381); //[Grumm] //[Tixa] gModSettings.ubTixaPrisonSectorX = iniReader.ReadInteger("Tixa", "PRISON_SECTOR_X", 9); gModSettings.ubTixaPrisonSectorY = iniReader.ReadInteger("Tixa", "PRISON_SECTOR_Y", 10); + gModSettings.iTixaPrisonPOWGridNo[0] = iniReader.ReadInteger("Tixa", "PRISON_POW_POSITION_1", 12691); + gModSettings.iTixaPrisonPOWGridNo[1] = iniReader.ReadInteger("Tixa", "PRISON_POW_POSITION_2", 15891); + gModSettings.iTixaPrisonPOWGridNo[2] = iniReader.ReadInteger("Tixa", "PRISON_POW_POSITION_3", 13980); + gModSettings.iTixaPrisonPOWItemGridNo[0] = iniReader.ReadInteger("Tixa", "PRISON_POW_ITEM_POSITION_1", 10619); + gModSettings.iTixaPrisonPOWItemGridNo[1] = iniReader.ReadInteger("Tixa", "PRISON_POW_ITEM_POSITION_2", 10619); + gModSettings.iTixaPrisonPOWItemGridNo[2] = iniReader.ReadInteger("Tixa", "PRISON_POW_ITEM_POSITION_3", 10619); + gModSettings.iTixaPrisonPOWGetFreeGridNo[0] = iniReader.ReadInteger("Tixa", "PRISON_POW_GETFREE_GRIDNO_1", 14145); + gModSettings.iTixaPrisonPOWGetFreeGridNo[1] = iniReader.ReadInteger("Tixa", "PRISON_POW_GETFREE_GRIDNO_2", 14135); + gModSettings.iTixaPrisonPOWGetFreeGridNo[2] = iniReader.ReadInteger("Tixa", "PRISON_POW_GETFREE_GRIDNO_3", 13646); gModSettings.ubDyanmoCaptiveSectorX = iniReader.ReadInteger("Tixa", "DYNAMO_CAPTIVE_SECTOR_X", 9); gModSettings.ubDyanmoCaptiveSectorY = iniReader.ReadInteger("Tixa", "DYNAMO_CAPTIVE_SECTOR_Y", 10); diff --git a/GameSettings.h b/GameSettings.h index 81da06ad..be398428 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -2177,12 +2177,16 @@ typedef struct UINT8 ubInitialPOWSectorY; INT32 iInitialPOWGridNo[3]; INT32 iInitialPOWItemGridNo[3]; + INT32 iInitialPOWGetFreeGridNo[3]; //[Grumm] //[Tixa] UINT8 ubTixaPrisonSectorX; UINT8 ubTixaPrisonSectorY; + INT32 iTixaPrisonPOWGridNo[3]; + INT32 iTixaPrisonPOWItemGridNo[3]; + INT32 iTixaPrisonPOWGetFreeGridNo[3]; //Dynamo Captive Sector UINT8 ubDyanmoCaptiveSectorX; diff --git a/Strategic/Player Command.cpp b/Strategic/Player Command.cpp index 404a5e78..9d109433 100644 --- a/Strategic/Player Command.cpp +++ b/Strategic/Player Command.cpp @@ -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; diff --git a/Strategic/Queen Command.cpp b/Strategic/Queen Command.cpp index db29838c..c5af2d8d 100644 --- a/Strategic/Queen Command.cpp +++ b/Strategic/Queen Command.cpp @@ -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 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! diff --git a/Strategic/Quests.cpp b/Strategic/Quests.cpp index b0db2ec8..b59b6b4e 100644 --- a/Strategic/Quests.cpp +++ b/Strategic/Quests.cpp @@ -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 ); diff --git a/Strategic/Quests.h b/Strategic/Quests.h index fc0d1d73..f3a6b017 100644 --- a/Strategic/Quests.h +++ b/Strategic/Quests.h @@ -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 } ; /* diff --git a/Strategic/strategicmap.cpp b/Strategic/strategicmap.cpp index 2fc6f87c..3032d30c 100644 --- a/Strategic/strategicmap.cpp +++ b/Strategic/strategicmap.cpp @@ -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); + } } } } diff --git a/Tactical/Handle Doors.cpp b/Tactical/Handle Doors.cpp index b88052bd..97883825 100644 --- a/Tactical/Handle Doors.cpp +++ b/Tactical/Handle Doors.cpp @@ -1285,7 +1285,8 @@ BOOLEAN HandleDoorsOpenClose( SOLDIERTYPE *pSoldier, INT32 sGridNo, STRUCTURE * PlayJA2Sample( uiSoundID, RATE_11025, SoundVolume( MIDVOLUME, sGridNo ), 1, SoundDir( sGridNo ) ); } - if (gWorldSectorX == gModSettings.ubInitialPOWSectorX && gWorldSectorY == gModSettings.ubInitialPOWSectorY && gbWorldSectorZ == 0) + if (((gWorldSectorX == gModSettings.ubInitialPOWSectorX && gWorldSectorY == gModSettings.ubInitialPOWSectorY) || + (gWorldSectorX == gModSettings.ubTixaPrisonSectorX && gWorldSectorY == gModSettings.ubTixaPrisonSectorY)) && gbWorldSectorZ == 0) { DoPOWPathChecks(); } diff --git a/Tactical/Overhead.cpp b/Tactical/Overhead.cpp index 41e299d7..5f6d83ee 100644 --- a/Tactical/Overhead.cpp +++ b/Tactical/Overhead.cpp @@ -7599,11 +7599,31 @@ BOOLEAN CheckForEndOfBattle( BOOLEAN fAnEnemyRetreated ) // SANDRO - end quest if cleared the sector after interrogation (sector N7 by Meduna) if ( gWorldSectorX == gModSettings.ubMeanwhileInterrogatePOWSectorX && gWorldSectorY == gModSettings.ubMeanwhileInterrogatePOWSectorY && - gbWorldSectorZ == 0 && gubQuest[ QUEST_INTERROGATION ] == QUESTINPROGRESS ) + gbWorldSectorZ == 0) { - // Quest failed - InternalEndQuest( QUEST_INTERROGATION, gWorldSectorX, gWorldSectorY, FALSE ); + if (gubQuest[QUEST_INTERROGATION] == QUESTINPROGRESS) + { + // Quest failed + InternalEndQuest(QUEST_INTERROGATION, gWorldSectorX, gWorldSectorY, FALSE); + } + else if (gubQuest[QUEST_INTERROGATION] == QUESTCANNOTSTART) + { + //shadooow: re-enable quest if player loses control of the N7 prison and quest was disabled previously + gubQuest[QUEST_INTERROGATION] = QUESTNOTSTARTED; + } } + //shadooow: re-enable quest if player loses control of the Alma prison and quest was disabled previously + if (gWorldSectorX == gModSettings.ubInitialPOWSectorX && gWorldSectorY == gModSettings.ubInitialPOWSectorY && + gbWorldSectorZ == 0 && 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 (gWorldSectorX == gModSettings.ubTixaPrisonSectorX && gWorldSectorY == gModSettings.ubTixaPrisonSectorY && + gbWorldSectorZ == 0 && gubQuest[QUEST_HELD_IN_TIXA] == QUESTCANNOTSTART) + { + gubQuest[QUEST_HELD_IN_TIXA] = QUESTNOTSTARTED; + } // Play death music #ifdef NEWMUSIC @@ -7801,11 +7821,47 @@ BOOLEAN CheckForEndOfBattle( BOOLEAN fAnEnemyRetreated ) } // SANDRO - end quest if cleared the sector after interrogation (sector N7 by Meduna) if ( gWorldSectorX == gModSettings.ubMeanwhileInterrogatePOWSectorX && gWorldSectorY == gModSettings.ubMeanwhileInterrogatePOWSectorY && - gbWorldSectorZ == 0 && gubQuest[ QUEST_INTERROGATION ] == QUESTINPROGRESS ) + gbWorldSectorZ == 0) { - // Complete quest - EndQuest( QUEST_INTERROGATION, gWorldSectorX, gWorldSectorY ); + if (gubQuest[QUEST_INTERROGATION] == QUESTINPROGRESS) + { + // Complete quest + EndQuest( QUEST_INTERROGATION, gWorldSectorX, gWorldSectorY ); + } + else if(gubQuest[QUEST_INTERROGATION] == QUESTNOTSTARTED) + { + //shadooow: disable quest if player takes control of the N7 prison + gubQuest[QUEST_INTERROGATION] = QUESTCANNOTSTART; + } } + //shadooow: disable quest if player takes control of the Alma prison + if (gWorldSectorX == gModSettings.ubInitialPOWSectorX && gWorldSectorY == gModSettings.ubInitialPOWSectorY && + gbWorldSectorZ == 0) + { + if (gubQuest[QUEST_HELD_IN_ALMA] == QUESTINPROGRESS) + { + // Complete quest + EndQuest(QUEST_HELD_IN_ALMA, gWorldSectorX, gWorldSectorY); + } + else if (gubQuest[QUEST_HELD_IN_ALMA] == QUESTNOTSTARTED) + { + gubQuest[QUEST_HELD_IN_ALMA] = QUESTCANNOTSTART; + } + } + //shadooow: disable quest if player takes control of the Alma prison + if (gWorldSectorX == gModSettings.ubTixaPrisonSectorX && gWorldSectorY == gModSettings.ubTixaPrisonSectorY && + gbWorldSectorZ == 0 && gubQuest[QUEST_HELD_IN_TIXA] == QUESTNOTSTARTED) + { + if (gubQuest[QUEST_HELD_IN_TIXA] == QUESTINPROGRESS) + { + // Complete quest + EndQuest(QUEST_HELD_IN_TIXA, gWorldSectorX, gWorldSectorY); + } + else if (gubQuest[QUEST_HELD_IN_TIXA] == QUESTNOTSTARTED) + { + gubQuest[QUEST_HELD_IN_TIXA] = QUESTCANNOTSTART; + } + } // Say battle end quote.... @@ -8529,7 +8585,7 @@ BOOLEAN CheckForLosingEndOfBattle( ) { //if( GetWorldDay() > STARTDAY_ALLOW_PLAYER_CAPTURE_FOR_RESCUE && !( gStrategicStatus.uiFlags & STRATEGIC_PLAYER_CAPTURED_FOR_RESCUE )) { - if ( gubQuest[ QUEST_HELD_IN_ALMA ] == QUESTNOTSTARTED || ( gubQuest[ QUEST_HELD_IN_ALMA ] == QUESTDONE && gubQuest[ QUEST_INTERROGATION ] == QUESTNOTSTARTED ) ) + if ( gubQuest[ QUEST_HELD_IN_ALMA ] == QUESTNOTSTARTED || gubQuest[QUEST_HELD_IN_TIXA] == QUESTNOTSTARTED || (gubQuest[QUEST_HELD_IN_ALMA] != QUESTINPROGRESS && gubQuest[QUEST_HELD_IN_TIXA] != QUESTINPROGRESS && gubQuest[ QUEST_INTERROGATION ] == QUESTNOTSTARTED ) ) { fDoCapture = TRUE; // CJC Dec 1 2002: fix capture sequences @@ -10401,8 +10457,10 @@ void CaptureTimerCallback( ) void DoPOWPathChecks( ) { - INT32 iLoop; - SOLDIERTYPE * pSoldier; + INT32 iLoop; + SOLDIERTYPE *pSoldier; + + BOOLEAN is_this_tixa = (gWorldSectorX == gModSettings.ubTixaPrisonSectorX && gWorldSectorY == gModSettings.ubTixaPrisonSectorY); // loop through all mercs on our team and if they are POWs in sector, do POW path check and // put on a squad if available @@ -10415,15 +10473,15 @@ void DoPOWPathChecks( ) // check to see if POW has been freed! // this will be true if a path can be made from the POW to either of 3 gridnos // 10492 (hallway) or 10482 (outside), or 9381 (outside) - if ( FindBestPath( pSoldier, 10492, 0, WALKING, NO_COPYROUTE, PATH_THROUGH_PEOPLE ) )//dnl!!! + if (FindBestPath( pSoldier, is_this_tixa ? gModSettings.iTixaPrisonPOWGetFreeGridNo[0] : gModSettings.iInitialPOWGetFreeGridNo[0], 0, WALKING, NO_COPYROUTE, PATH_THROUGH_PEOPLE)) { // drop out of if } - else if ( FindBestPath( pSoldier, 10482, 0, WALKING, NO_COPYROUTE, PATH_THROUGH_PEOPLE ) )//dnl!!! + else if (FindBestPath( pSoldier, is_this_tixa ? gModSettings.iTixaPrisonPOWGetFreeGridNo[1] : gModSettings.iInitialPOWGetFreeGridNo[1], 0, WALKING, NO_COPYROUTE, PATH_THROUGH_PEOPLE)) { // drop out of if } - else if ( FindBestPath( pSoldier, 9381, 0, WALKING, NO_COPYROUTE, PATH_THROUGH_PEOPLE ) )//dnl!!! + else if (FindBestPath( pSoldier, is_this_tixa ? gModSettings.iTixaPrisonPOWGetFreeGridNo[2] : gModSettings.iInitialPOWGetFreeGridNo[2], 0, WALKING, NO_COPYROUTE, PATH_THROUGH_PEOPLE)) { // drop out of if } @@ -11206,7 +11264,7 @@ void PrisonerSurrenderMessageBoxCallBack( UINT8 ubExitValue ) // in order for this to work, there must be no militia present, the enemy must not already have offered asked you to surrender, and certain quests may not be active if ( !( gTacticalStatus.fEnemyFlags & ENEMY_OFFERED_SURRENDER ) && gTacticalStatus.Team[ MILITIA_TEAM ].bMenInSector == 0 ) { - if ( gubQuest[ QUEST_HELD_IN_ALMA ] == QUESTNOTSTARTED || ( gubQuest[ QUEST_HELD_IN_ALMA ] == QUESTDONE && gubQuest[ QUEST_INTERROGATION ] == QUESTNOTSTARTED ) ) + if (gubQuest[QUEST_HELD_IN_ALMA] == QUESTNOTSTARTED || gubQuest[QUEST_HELD_IN_TIXA] == QUESTNOTSTARTED || (gubQuest[QUEST_HELD_IN_ALMA] != QUESTINPROGRESS && gubQuest[QUEST_HELD_IN_TIXA] != QUESTINPROGRESS && gubQuest[QUEST_INTERROGATION] == QUESTNOTSTARTED)) { gTacticalStatus.fEnemyFlags |= ENEMY_OFFERED_SURRENDER; diff --git a/TacticalAI/DecideAction.cpp b/TacticalAI/DecideAction.cpp index 755defe7..c88e1c9a 100644 --- a/TacticalAI/DecideAction.cpp +++ b/TacticalAI/DecideAction.cpp @@ -5173,7 +5173,7 @@ INT16 ubMinAPCost; { //if( GetWorldDay() > STARTDAY_ALLOW_PLAYER_CAPTURE_FOR_RESCUE && !( gStrategicStatus.uiFlags & STRATEGIC_PLAYER_CAPTURED_FOR_RESCUE ) ) { - if ( gubQuest[ QUEST_HELD_IN_ALMA ] == QUESTNOTSTARTED || ( gubQuest[ QUEST_HELD_IN_ALMA ] == QUESTDONE && gubQuest[ QUEST_INTERROGATION ] == QUESTNOTSTARTED ) ) + if (gubQuest[QUEST_HELD_IN_ALMA] == QUESTNOTSTARTED || gubQuest[QUEST_HELD_IN_TIXA] == QUESTNOTSTARTED || (gubQuest[QUEST_HELD_IN_ALMA] != QUESTINPROGRESS && gubQuest[QUEST_HELD_IN_TIXA] != QUESTINPROGRESS && gubQuest[QUEST_INTERROGATION] == QUESTNOTSTARTED)) { gTacticalStatus.fEnemyFlags |= ENEMY_OFFERED_SURRENDER; return( AI_ACTION_OFFER_SURRENDER ); diff --git a/TileEngine/Explosion Control.cpp b/TileEngine/Explosion Control.cpp index e8a22d5b..4569ef95 100644 --- a/TileEngine/Explosion Control.cpp +++ b/TileEngine/Explosion Control.cpp @@ -3125,7 +3125,8 @@ void SpreadEffect( INT32 sGridNo, UINT8 ubRadius, UINT16 usItem, UINT8 ubOwner, // if anything has been done to change movement costs and this is a potential POW situation, check // paths for POWs - if (gWorldSectorX == gModSettings.ubInitialPOWSectorX && gWorldSectorY == gModSettings.ubInitialPOWSectorY && gbWorldSectorZ == 0) + if (((gWorldSectorX == gModSettings.ubInitialPOWSectorX && gWorldSectorY == gModSettings.ubInitialPOWSectorY) || + (gWorldSectorX == gModSettings.ubTixaPrisonSectorX && gWorldSectorY == gModSettings.ubTixaPrisonSectorY)) && gbWorldSectorZ == 0) { DoPOWPathChecks(); }