From d3082b2f9226b323e12533ef3739c7fca5ff2e43 Mon Sep 17 00:00:00 2001 From: Flugente Date: Mon, 15 Jun 2015 20:58:19 +0000 Subject: [PATCH] If prisoners give info on enemy patrol movements, patrols with tanks are handled first. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7892 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/Assignments.cpp | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/Strategic/Assignments.cpp b/Strategic/Assignments.cpp index 62b81efc..b9d9dad1 100644 --- a/Strategic/Assignments.cpp +++ b/Strategic/Assignments.cpp @@ -6789,7 +6789,40 @@ void HandlePrisonerProcessingInSector( INT16 sMapX, INT16 sMapY, INT8 bZ ) } } - BOOLEAN found = FALSE; + // mobile tanks are a serious threat. Learning of their location would be genuninely useful + // loop over all mobile enemy groups that have tanks that we don't yet know of, and pick one of them at random + std::vector sectorswithunknowntanksvector; + for ( GROUP *pGroup = gpGroupList; pGroup; pGroup = pGroup->next ) + { + if ( pGroup->usGroupTeam == ENEMY_TEAM && pGroup->pEnemyGroup->ubNumTanks ) + { + UINT8 tanksector = SECTOR( pGroup->ubSectorX, pGroup->ubSectorY ); + + // if we don't yet know that there are tanks here, this would be useful information + if ( !(SectorInfo[tanksector].uiFlags & SF_ASSIGN_NOTICED_ENEMIES_KNOW_NUMBER) ) + { + sectorswithunknowntanksvector.push_back( tanksector ); + } + } + } + + if ( !sectorswithunknowntanksvector.empty( ) ) + { + UINT8 tanksector = sectorswithunknowntanksvector[ Random( sectorswithunknowntanksvector.size( ) ) ]; + + SectorInfo[tanksector].uiFlags |= (SF_ASSIGN_NOTICED_ENEMIES_HERE | SF_ASSIGN_NOTICED_ENEMIES_KNOW_NUMBER); + + if ( Chance( gGameExternalOptions.ubPrisonerProcessInfoDirectionChance ) ) + { + // we also learned the direction of the patrol + SectorInfo[tanksector].uiFlags |= SF_ASSIGN_NOTICED_ENEMIES_KNOW_DIRECTION; + } + + ++revealedpositions; + + continue; + } + UINT8 maxtries = 20; for(UINT8 infotry = 0; infotry < maxtries; ++infotry) { @@ -6820,7 +6853,7 @@ void HandlePrisonerProcessingInSector( INT16 sMapX, INT16 sMapY, INT8 bZ ) } ++revealedpositions; - found = TRUE; + break; } }