From e55b480996d2b653c8cd811eaad7546224bb3056 Mon Sep 17 00:00:00 2001 From: Flugente Date: Sun, 18 Feb 2018 23:17:34 +0000 Subject: [PATCH] New feature: Getting and using intel allows for more spy-related roleplay. For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=23643&goto=352475&#msg_352475 Requires GameDir >= r2401. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8522 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- GameSettings.cpp | 22 +- GameSettings.h | 9 +- GameVersion.cpp | 18 +- Init.h | 1 + Laptop/DropDown.h | 2 + Laptop/LaptopSave.h | 9 +- Laptop/Laptop_VS2005.vcproj | 8 + Laptop/Laptop_VS2008.vcproj | 8 + Laptop/Laptop_VS2010.vcxproj | 6 +- Laptop/Laptop_VS2010.vcxproj.filters | 8 +- Laptop/Laptop_VS2013.vcxproj | 2 + Laptop/Laptop_VS2013.vcxproj.filters | 8 +- Laptop/Laptop_VS2017.vcxproj | 2 + Laptop/email.cpp | 4 + Laptop/email.h | 3 + Laptop/laptop.cpp | 102 +- Laptop/laptop.h | 8 +- SaveLoadGame.cpp | 11 +- Strategic/ASD.cpp | 46 +- Strategic/ASD.h | 4 + Strategic/Assignments.cpp | 1322 +++++++++++++---- Strategic/Assignments.h | 32 +- Strategic/Auto Resolve.cpp | 24 +- Strategic/Campaign Types.h | 8 +- Strategic/Game Event Hook.cpp | 17 +- Strategic/Game Event Hook.h | 3 + Strategic/Hourly Update.cpp | 4 +- Strategic/LuaInitNPCs.cpp | 154 +- Strategic/LuaInitNPCs.h | 5 + Strategic/Map Screen Interface Map.cpp | 140 +- Strategic/Map Screen Interface Map.h | 7 +- .../Map Screen Interface TownMine Info.cpp | 4 +- Strategic/Map Screen Interface.cpp | 24 +- Strategic/Map Screen Interface.h | 1 + Strategic/PreBattle Interface.cpp | 215 ++- Strategic/PreBattle Interface.h | 7 +- Strategic/Strategic AI.cpp | 9 +- Strategic/Strategic Movement.cpp | 122 +- Strategic/Strategic Movement.h | 17 +- Strategic/Town Militia.cpp | 33 +- Strategic/Town Militia.h | 4 + Strategic/mapscreen.cpp | 87 +- Strategic/strategicmap.cpp | 77 +- Tactical/Arms Dealer Init.cpp | 120 +- Tactical/Arms Dealer Init.h | 4 + Tactical/Dialogue Control.cpp | 25 +- Tactical/Faces.cpp | 65 +- Tactical/Handle Items.cpp | 90 +- Tactical/Handle Items.h | 4 + Tactical/Handle UI.cpp | 8 + Tactical/Interface Cursors.cpp | 3 + Tactical/Interface Cursors.h | 3 + Tactical/Interface Enhanced.cpp | 17 + Tactical/Item Types.h | 2 +- Tactical/Overhead Types.h | 1 + Tactical/Overhead.cpp | 99 +- Tactical/Overhead.h | 1 + Tactical/ShopKeeper Interface.cpp | 155 +- Tactical/ShopKeeper Interface.h | 1 + Tactical/SkillCheck.cpp | 12 +- Tactical/SkillMenu.cpp | 34 +- Tactical/Soldier Add.cpp | 17 +- Tactical/Soldier Control.cpp | 421 ++++-- Tactical/Soldier Control.h | 15 + Tactical/Soldier Create.cpp | 2 +- Tactical/Soldier Init List.cpp | 4 +- Tactical/Squads.cpp | 4 + Tactical/UI Cursors.cpp | 38 +- Tactical/soldier profile type.h | 5 +- TacticalAI/Knowledge.cpp | 7 +- TileEngine/Map Edgepoints.cpp | 2 +- TileEngine/Tactical Placement GUI.cpp | 22 +- Utils/Cursors.cpp | 20 +- Utils/Cursors.h | 5 + Utils/Text.h | 60 +- Utils/_ChineseText.cpp | 107 +- Utils/_DutchText.cpp | 107 +- Utils/_EnglishText.cpp | 107 +- Utils/_FrenchText.cpp | 107 +- Utils/_GermanText.cpp | 109 +- Utils/_ItalianText.cpp | 107 +- Utils/_PolishText.cpp | 107 +- Utils/_RussianText.cpp | 107 +- 83 files changed, 3784 insertions(+), 937 deletions(-) diff --git a/GameSettings.cpp b/GameSettings.cpp index 762a95d2..4b41f2de 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -1912,11 +1912,8 @@ void LoadGameExternalOptions() gGameExternalOptions.fPlayerCanAsktoSurrender = iniReader.ReadBoolean("Strategic Gameplay Settings","PLAYER_CAN_ASK_TO_SURRENDER", TRUE); gGameExternalOptions.ubPrisonerReturntoQueenChance = iniReader.ReadInteger("Strategic Gameplay Settings","PRISONER_RETURN_TO_ARMY_CHANCE", 50, 0, 100); gGameExternalOptions.ubPrisonerProcessChance[PRISONER_INTERROGATION_DEFECT] = iniReader.ReadInteger( "Strategic Gameplay Settings", "PRISONER_DEFECT_CHANCE", 25, 0, 100 ); - gGameExternalOptions.ubPrisonerProcessChance[PRISONER_INTERROGATION_INFO] = iniReader.ReadInteger( "Strategic Gameplay Settings", "PRISONER_INFO_BASECHANCE", 25, 0, 100 ); - gGameExternalOptions.ubPrisonerProcessInfoNumberChance = iniReader.ReadInteger("Strategic Gameplay Settings","PRISONER_INFO_NUMBER_CHANCE", 30, 0, 100); - gGameExternalOptions.ubPrisonerProcessInfoDirectionChance = iniReader.ReadInteger("Strategic Gameplay Settings","PRISONER_INFO_DIRECTION_CHANCE", 40, 0, 100); + gGameExternalOptions.ubPrisonerProcessChance[PRISONER_INTERROGATION_INTEL] = iniReader.ReadInteger( "Strategic Gameplay Settings", "PRISONER_INTEL_CHANCE", 25, 0, 100 ); gGameExternalOptions.ubPrisonerProcessChance[PRISONER_INTERROGATION_RANSOM] = iniReader.ReadInteger( "Strategic Gameplay Settings", "PRISONER_RANSOM_CHANCE", 25, 0, 100 ); - gGameExternalOptions.ubPrisonerProcessChance[PRISONER_INTERROGATION_NOTHING] = iniReader.ReadInteger( "Strategic Gameplay Settings", "PRISONER_NOTHING_CHANCE", 25, 0, 100 ); gGameExternalOptions.ubPrisonerInterrogationPoints[PRISONER_ADMIN] = iniReader.ReadInteger("Strategic Gameplay Settings","PRISONER_INTERROGATION_POINTS_ADMIN", 30, 10, 1000); gGameExternalOptions.ubPrisonerInterrogationPoints[PRISONER_REGULAR] = iniReader.ReadInteger("Strategic Gameplay Settings","PRISONER_INTERROGATION_POINTS_REGULAR", 50, gGameExternalOptions.ubPrisonerInterrogationPoints[PRISONER_ADMIN], 1000); @@ -1926,16 +1923,7 @@ void LoadGameExternalOptions() gGameExternalOptions.ubPrisonerInterrogationPoints[PRISONER_CIVILIAN] = iniReader.ReadInteger("Strategic Gameplay Settings", "PRISONER_INTERROGATION_POINTS_CIVILIAN", 25, 10, 1000 ); gGameExternalOptions.ubPrisonerInterrogationPoints[PRISONER_SECRET1] = 100; gGameExternalOptions.ubPrisonerInterrogationPoints[PRISONER_SECRET2] = 100; - - gGameExternalOptions.ubPrisonerInterrogationEnemyGeneralInfoChance[PRISONER_ADMIN] = iniReader.ReadInteger( "Strategic Gameplay Settings", "PRISONER_INTERROGATION_ENEMY_GENERAL_CHANCE_ADMIN", 0, 0, 100 ); - gGameExternalOptions.ubPrisonerInterrogationEnemyGeneralInfoChance[PRISONER_REGULAR] = iniReader.ReadInteger( "Strategic Gameplay Settings", "PRISONER_INTERROGATION_ENEMY_GENERAL_CHANCE_REGULAR", 1, gGameExternalOptions.ubPrisonerInterrogationEnemyGeneralInfoChance[PRISONER_ADMIN], 100 ); - gGameExternalOptions.ubPrisonerInterrogationEnemyGeneralInfoChance[PRISONER_ELITE] = iniReader.ReadInteger( "Strategic Gameplay Settings", "PRISONER_INTERROGATION_ENEMY_GENERAL_CHANCE_ELITE", 10, gGameExternalOptions.ubPrisonerInterrogationEnemyGeneralInfoChance[PRISONER_REGULAR], 100 ); - gGameExternalOptions.ubPrisonerInterrogationEnemyGeneralInfoChance[PRISONER_OFFICER] = iniReader.ReadInteger( "Strategic Gameplay Settings", "PRISONER_INTERROGATION_ENEMY_GENERAL_CHANCE_OFFICER", 60, gGameExternalOptions.ubPrisonerInterrogationEnemyGeneralInfoChance[PRISONER_ELITE], 100 ); - gGameExternalOptions.ubPrisonerInterrogationEnemyGeneralInfoChance[PRISONER_GENERAL] = iniReader.ReadInteger( "Strategic Gameplay Settings", "PRISONER_INTERROGATION_ENEMY_GENERAL_CHANCE_GENERAL", 80, gGameExternalOptions.ubPrisonerInterrogationEnemyGeneralInfoChance[PRISONER_OFFICER], 100 ); - gGameExternalOptions.ubPrisonerInterrogationEnemyGeneralInfoChance[PRISONER_CIVILIAN] = iniReader.ReadInteger( "Strategic Gameplay Settings", "PRISONER_INTERROGATION_ENEMY_GENERAL_CHANCE_CIVILIAN", 0, 0, 100 ); - gGameExternalOptions.ubPrisonerInterrogationEnemyGeneralInfoChance[PRISONER_SECRET1] = 0; - gGameExternalOptions.ubPrisonerInterrogationEnemyGeneralInfoChance[PRISONER_SECRET2] = 0; - + // CHRISL: Determine how Skyrider should handle landing in enemy occupied sectors gGameExternalOptions.ubSkyriderHotLZ = iniReader.ReadInteger("Strategic Gameplay Settings", "ALLOW_SKYRIDER_HOT_LZ", 0, 0, 3); @@ -2338,6 +2326,9 @@ void LoadGameExternalOptions() gGameExternalOptions.fUseXMLSquadNames = iniReader.ReadBoolean("Strategic Assignment Settings", "USE_XML_SQUADNAMES", FALSE); + //################# Intel Settings ################## + gGameExternalOptions.fIntelResource = iniReader.ReadBoolean("Intel Settings", "RESOURCE_INTEL", TRUE ); + //SaveGame slot by Jazz // WANNE: No need to make it external to switch between old/new. We always use the new save/load screen with more save slots //gGameExternalOptions.fSaveGameSlot = iniReader.ReadBoolean("Extension","SAVE_GAMES_SLOT",FALSE); @@ -3347,7 +3338,8 @@ void LoadGameAPBPConstants() APBPConstants[AP_READFILE] = DynamicAdjustAPConstants( iniReader.ReadInteger( "APConstants", "AP_READFILE", 50 ), 50 ); APBPConstants[AP_WATERTAP] = DynamicAdjustAPConstants( iniReader.ReadInteger( "APConstants", "AP_WATERTAP", 20 ), 20 ); APBPConstants[AP_SODAMACHINE] = DynamicAdjustAPConstants( iniReader.ReadInteger( "APConstants", "AP_SODAMACHINE", 30 ), 30 ); - + APBPConstants[AP_CAMERA] = DynamicAdjustAPConstants( iniReader.ReadInteger( "APConstants", "AP_CAMERA", 30 ), 30 ); + APBPConstants[AP_ENTER_VEHICLE] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_ENTER_VEHICLE",30),30); APBPConstants[AP_EXIT_VEHICLE] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_EXIT_VEHICLE",30),30); APBPConstants[AP_CHANGE_SEAT_VEHICLE] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_CHANGE_SEAT_VEHICLE",20),20); diff --git a/GameSettings.h b/GameSettings.h index 86f12c62..45432b4b 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -205,9 +205,8 @@ enum enum { PRISONER_INTERROGATION_DEFECT = 0, - PRISONER_INTERROGATION_INFO, + PRISONER_INTERROGATION_INTEL, PRISONER_INTERROGATION_RANSOM, - PRISONER_INTERROGATION_NOTHING, PRISONER_INTERROGATION_MAX }; @@ -753,6 +752,9 @@ typedef struct INT32 ubRepairRateDivisor; INT32 ubCleaningRateDivisor; + // Flugente: intel + BOOLEAN fIntelResource; + //Misc settings BOOLEAN fAmmoDynamicWeight; //Pulmu BOOLEAN fEnableCrepitus; @@ -1424,10 +1426,7 @@ typedef struct BOOLEAN fPlayerCanAsktoSurrender; UINT8 ubPrisonerReturntoQueenChance; UINT8 ubPrisonerProcessChance[PRISONER_INTERROGATION_MAX]; - UINT8 ubPrisonerProcessInfoNumberChance; - UINT8 ubPrisonerProcessInfoDirectionChance; UINT16 ubPrisonerInterrogationPoints[8]; // points needed to interrogate a prisoner of a specific type - UINT8 ubPrisonerInterrogationEnemyGeneralInfoChance[8]; // chance that when getting info from interrogation, this prisoner will tell us about general we do not yet know about // Flugente: sexism/racism/etc. INT8 sMoraleModAppearance; diff --git a/GameVersion.cpp b/GameVersion.cpp index a14a9bf6..fbcbcb3e 100644 --- a/GameVersion.cpp +++ b/GameVersion.cpp @@ -15,9 +15,9 @@ #ifdef JA2EDITOR #ifdef JA2UB - CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.8516 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.8522 (Development Build)" }; #else - CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.8516 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.8522 (Development Build)" }; #endif // ------------------------------ @@ -27,11 +27,11 @@ //DEBUG BUILD VERSION #ifdef JA2UB - CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.8516 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.8522 (Development Build)" }; #elif defined (JA113DEMO) - CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.8516 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.8522 (Development Build)" }; #else - CHAR16 zVersionLabel[256] = { L"Debug: v1.13.8516 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Debug: v1.13.8522 (Development Build)" }; #endif #elif defined CRIPPLED_VERSION @@ -46,16 +46,16 @@ //RELEASE BUILD VERSION #ifdef JA2UB - CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.8516 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.8522 (Development Build)" }; #elif defined (JA113DEMO) - CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.8516 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.8522 (Development Build)" }; #else - CHAR16 zVersionLabel[256] = { L"Release v1.13.8516 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Release v1.13.8522 (Development Build)" }; #endif #endif -CHAR8 czVersionNumber[16] = { "Build 18.01.10" }; //YY.MM.DD +CHAR8 czVersionNumber[16] = { "Build 18.02.18" }; //YY.MM.DD CHAR16 zTrackingNumber[16] = { L"Z" }; // SAVE_GAME_VERSION is defined in header, change it there diff --git a/Init.h b/Init.h index 95236fc4..6af64855 100644 --- a/Init.h +++ b/Init.h @@ -159,6 +159,7 @@ AP_HACK, AP_READFILE, AP_WATERTAP, AP_SODAMACHINE, +AP_CAMERA, AP_ENTER_VEHICLE, AP_EXIT_VEHICLE, diff --git a/Laptop/DropDown.h b/Laptop/DropDown.h index e2171b6c..42ca005b 100644 --- a/Laptop/DropDown.h +++ b/Laptop/DropDown.h @@ -138,6 +138,8 @@ enum definedDropDowns DROPDOWNNR_MSGBOX_1, DROPDOWNNR_MSGBOX_2, + DROPDOWN_INTEL_BUY, + DROPDOWN_MILTIAWEBSITE_FILTER_DEAD, DROPDOWN_MILTIAWEBSITE_FILTER_RANK, DROPDOWN_MILTIAWEBSITE_FILTER_ORIGIN, diff --git a/Laptop/LaptopSave.h b/Laptop/LaptopSave.h index 7c7d424a..46333b89 100644 --- a/Laptop/LaptopSave.h +++ b/Laptop/LaptopSave.h @@ -67,6 +67,8 @@ enum BOBBYR_ALREADY_SENT_EMAIL, }; +// Flugente: intel +#define INTELINFO_MAXNUMBER 2 typedef struct { @@ -174,7 +176,12 @@ typedef struct FLOAT dMilitiaArmourPool; FLOAT dMilitiaMiscPool; - UINT8 bPadding[ 60 ]; + // Flugente: intel + FLOAT dIntelPool; + UINT32 usMapIntelFlags; + INT16 sIntelInfoForThisHour[INTELINFO_MAXNUMBER]; + + UINT8 bPadding[ 48 ]; } LaptopSaveInfoStruct; diff --git a/Laptop/Laptop_VS2005.vcproj b/Laptop/Laptop_VS2005.vcproj index b1dd93f0..5807b379 100644 --- a/Laptop/Laptop_VS2005.vcproj +++ b/Laptop/Laptop_VS2005.vcproj @@ -626,6 +626,10 @@ RelativePath=".\insurance.h" > + + @@ -976,6 +980,10 @@ RelativePath=".\insurance.cpp" > + + diff --git a/Laptop/Laptop_VS2008.vcproj b/Laptop/Laptop_VS2008.vcproj index 815c062b..1dd82bff 100644 --- a/Laptop/Laptop_VS2008.vcproj +++ b/Laptop/Laptop_VS2008.vcproj @@ -626,6 +626,10 @@ RelativePath="insurance.h" > + + @@ -978,6 +982,10 @@ RelativePath="insurance.cpp" > + + diff --git a/Laptop/Laptop_VS2010.vcxproj b/Laptop/Laptop_VS2010.vcxproj index ec73d4b3..3ed49a16 100644 --- a/Laptop/Laptop_VS2010.vcxproj +++ b/Laptop/Laptop_VS2010.vcxproj @@ -95,7 +95,8 @@ - + + @@ -184,7 +185,8 @@ - + + diff --git a/Laptop/Laptop_VS2010.vcxproj.filters b/Laptop/Laptop_VS2010.vcxproj.filters index 4b6c4d8b..650b847f 100644 --- a/Laptop/Laptop_VS2010.vcxproj.filters +++ b/Laptop/Laptop_VS2010.vcxproj.filters @@ -185,6 +185,9 @@ Header Files + + + Header Files Header Files @@ -452,7 +455,10 @@ Source Files - + + Source Files + + Source Files diff --git a/Laptop/Laptop_VS2013.vcxproj b/Laptop/Laptop_VS2013.vcxproj index c3cc9b2c..2702e9cb 100644 --- a/Laptop/Laptop_VS2013.vcxproj +++ b/Laptop/Laptop_VS2013.vcxproj @@ -95,6 +95,7 @@ + @@ -184,6 +185,7 @@ + diff --git a/Laptop/Laptop_VS2013.vcxproj.filters b/Laptop/Laptop_VS2013.vcxproj.filters index c55d11d5..5dd872fd 100644 --- a/Laptop/Laptop_VS2013.vcxproj.filters +++ b/Laptop/Laptop_VS2013.vcxproj.filters @@ -176,6 +176,9 @@ Header Files + + + Header Files Header Files @@ -443,7 +446,10 @@ Source Files - + + Source Files + + Source Files diff --git a/Laptop/Laptop_VS2017.vcxproj b/Laptop/Laptop_VS2017.vcxproj index 593b0ee5..a3ff7991 100644 --- a/Laptop/Laptop_VS2017.vcxproj +++ b/Laptop/Laptop_VS2017.vcxproj @@ -95,6 +95,7 @@ + @@ -184,6 +185,7 @@ + diff --git a/Laptop/email.cpp b/Laptop/email.cpp index e2ea2826..a084882f 100644 --- a/Laptop/email.cpp +++ b/Laptop/email.cpp @@ -3740,6 +3740,10 @@ BOOLEAN HandleMailSpecialMessages( UINT16 usMessageId, INT32 *iResults, EmailPtr fReDrawScreenFlag = TRUE; break; + case INTEL_ENRICO_INTRO: + SetBookMark( INTELMARKET_BOOKMARK ); + fReDrawScreenFlag = TRUE; + break; #endif } diff --git a/Laptop/email.h b/Laptop/email.h index ac2faeee..790d5c19 100644 --- a/Laptop/email.h +++ b/Laptop/email.h @@ -384,6 +384,9 @@ #define MILITIAROSTER_INTRO (KINGPIN_BOUNTY_TARGET_GOTAWAY + KINGPIN_BOUNTY_TARGET_GOTAWAY_LENGTH) #define MILITIAROSTER_INTRO_LENGTH 4 + #define INTEL_ENRICO_INTRO (MILITIAROSTER_INTRO + MILITIAROSTER_INTRO_LENGTH) + #define INTEL_ENRICO_INTRO_LENGTH 5 + #endif // WANNE: New 1.13 MERC merc mail text for level up that Speck sends diff --git a/Laptop/laptop.cpp b/Laptop/laptop.cpp index 805b42d2..9b1f8e84 100644 --- a/Laptop/laptop.cpp +++ b/Laptop/laptop.cpp @@ -91,6 +91,7 @@ #include "WHO.h" // added by Flugente #include "PMC.h" // added by Flugente #include "MilitiaWebsite.h" // added by Flugente + #include "Intelmarket.h" // added by Flugente #endif #include "connect.h" @@ -1071,6 +1072,9 @@ INT32 EnterLaptop() SetBookMark( WHO_BOOKMARK ); else RemoveBookmark( WHO_BOOKMARK ); + + if ( !gGameExternalOptions.fIntelResource ) + RemoveBookmark( INTELMARKET_BOOKMARK ); } LoadLoadPending( ); @@ -1505,6 +1509,18 @@ void RenderLaptop() case LAPTOP_MODE_MILITIAROSTER_MAIN: RenderMilitiaWebsiteMain( ); break; + + case LAPTOP_MODE_INTELMARKET_BUYINFO: + RenderIntelmarket(); + break; + + case LAPTOP_MODE_INTELMARKET_SELLINFO: + RenderIntelmarket_Sell(); + break; + + case LAPTOP_MODE_INTELMARKET_ABOUT: + RenderIntelmarket_About(); + break; } if( guiCurrentLaptopMode >= LAPTOP_MODE_WWW ) @@ -1969,6 +1985,18 @@ void EnterNewLaptopMode() case LAPTOP_MODE_MILITIAROSTER_MAIN: EnterMilitiaWebsiteMain( ); break; + + case LAPTOP_MODE_INTELMARKET_BUYINFO: + EnterIntelmarket(); + break; + + case LAPTOP_MODE_INTELMARKET_SELLINFO: + EnterIntelmarket_Sell(); + break; + + case LAPTOP_MODE_INTELMARKET_ABOUT: + EnterIntelmarket_About(); + break; } // first time using webbrowser in this laptop session @@ -2248,8 +2276,19 @@ void HandleLapTopHandles() case LAPTOP_MODE_MILITIAROSTER_MAIN: HandleMilitiaWebsiteMain( ); break; - } + case LAPTOP_MODE_INTELMARKET_BUYINFO: + HandleIntelmarket(); + break; + + case LAPTOP_MODE_INTELMARKET_SELLINFO: + HandleIntelmarket_Sell(); + break; + + case LAPTOP_MODE_INTELMARKET_ABOUT: + HandleIntelmarket_About(); + break; + } } extern BOOLEAN gfPrintFrameBuffer; @@ -2835,6 +2874,18 @@ UINT32 ExitLaptopMode(UINT32 uiMode) case LAPTOP_MODE_MILITIAROSTER_MAIN: ExitMilitiaWebsiteMain(); break; + + case LAPTOP_MODE_INTELMARKET_BUYINFO: + ExitIntelmarket(); + break; + + case LAPTOP_MODE_INTELMARKET_SELLINFO: + ExitIntelmarket_Sell(); + break; + + case LAPTOP_MODE_INTELMARKET_ABOUT: + ExitIntelmarket_About(); + break; } if( ( uiMode != LAPTOP_MODE_NONE )&&( uiMode < LAPTOP_MODE_WWW ) ) @@ -4479,6 +4530,27 @@ void GoToWebPage(INT32 iPageId ) } } break; + + case INTELMARKET_BOOKMARK: + { + guiCurrentWWWMode = LAPTOP_MODE_INTELMARKET_BUYINFO; + guiCurrentLaptopMode = LAPTOP_MODE_INTELMARKET_BUYINFO; + + // do we have to have a World Wide Wait + if ( LaptopSaveInfo.fVisitedBookmarkAlready[INTELMARKET_BOOKMARK] == FALSE ) + { + // reset flag and set load pending flag + LaptopSaveInfo.fVisitedBookmarkAlready[INTELMARKET_BOOKMARK] = TRUE; + fLoadPendingFlag = TRUE; + } + else + { + // fast reload + fLoadPendingFlag = TRUE; + fFastLoadFlag = TRUE; + } + } + break; } #ifdef JA2UB @@ -6254,21 +6326,27 @@ void HandleKeyBoardShortCutsForLapTop( UINT16 usEvent, UINT32 usParam, UINT16 us } else if ((usEvent == KEY_DOWN )&& ( usParam == 's' )) { - if( ( usKeyState & ALT_DOWN ) ) - { - SetBookMark( AIM_BOOKMARK ); - SetBookMark( BOBBYR_BOOKMARK ); - SetBookMark( IMP_BOOKMARK ); - SetBookMark( MERC_BOOKMARK ); - SetBookMark( FUNERAL_BOOKMARK ); - SetBookMark( FLORIST_BOOKMARK ); + if( ( usKeyState & ALT_DOWN ) ) + { + SetBookMark( AIM_BOOKMARK ); + SetBookMark( BOBBYR_BOOKMARK ); + SetBookMark( IMP_BOOKMARK ); + SetBookMark( MERC_BOOKMARK ); + SetBookMark( FUNERAL_BOOKMARK ); + SetBookMark( FLORIST_BOOKMARK ); #ifdef JA2UB - if (gGameUBOptions.LaptopLinkInsurance == TRUE ) + if (gGameUBOptions.LaptopLinkInsurance == TRUE ) SetBookMark( INSURANCE_BOOKMARK ); #else - SetBookMark( INSURANCE_BOOKMARK ); + SetBookMark( INSURANCE_BOOKMARK ); #endif - } + SetBookMark( CAMPAIGNHISTORY_BOOKMARK ); + SetBookMark( MERCCOMPARE_BOOKMARK ); + SetBookMark( WHO_BOOKMARK ); + SetBookMark( PMC_BOOKMARK ); + SetBookMark( MILITIAROSTER_BOOKMARK ); + SetBookMark( INTELMARKET_BOOKMARK ); + } } //help screen stuff diff --git a/Laptop/laptop.h b/Laptop/laptop.h index baa0523e..1189d426 100644 --- a/Laptop/laptop.h +++ b/Laptop/laptop.h @@ -95,7 +95,7 @@ extern BOOLEAN fReDrawBookMarkInfo; enum { - LAPTOP_MODE_NONE=0, + LAPTOP_MODE_NONE = 0, LAPTOP_MODE_FINANCES, LAPTOP_MODE_PERSONNEL, LAPTOP_MODE_HISTORY, @@ -164,6 +164,11 @@ enum // Flugente: militia roster LAPTOP_MODE_MILITIAROSTER_MAIN, + + // Flugente: intel websites + LAPTOP_MODE_INTELMARKET_BUYINFO, + LAPTOP_MODE_INTELMARKET_SELLINFO, + LAPTOP_MODE_INTELMARKET_ABOUT, LAPTOP_MODE_BOBBYR_SHIPMENTS, @@ -245,6 +250,7 @@ enum{ WHO_BOOKMARK, // added by Flugente PMC_BOOKMARK, // added by Flugente MILITIAROSTER_BOOKMARK, // added by Flugente + INTELMARKET_BOOKMARK, // added by Flugente TEXT_NUM_LAPTOP_BOOKMARKS }; diff --git a/SaveLoadGame.cpp b/SaveLoadGame.cpp index 8a48ad0c..ac201613 100644 --- a/SaveLoadGame.cpp +++ b/SaveLoadGame.cpp @@ -906,6 +906,9 @@ BOOLEAN LoadArmsDealerInventoryFromSavedGameFile( HWFILE hFile ) delete [] pOldArmsDealersInventory; } + // we need to refresh our selection at this point, as lua data may depend on campaign specifics + HandlePossibleArmsDealerIntelRefresh( TRUE ); + return( TRUE ); } @@ -8526,8 +8529,8 @@ BOOLEAN SaveGeneralInfo( HWFILE hFile ) //New stuff for the Prebattle interface / autoresolve sGeneralInfo.fPersistantPBI = gfPersistantPBI; - sGeneralInfo.ubEnemyEncounterCode = gubEnemyEncounterCode; - sGeneralInfo.ubExplicitEnemyEncounterCode = gubExplicitEnemyEncounterCode; + sGeneralInfo.ubEnemyEncounterCode = GetEnemyEncounterCode(); + sGeneralInfo.ubExplicitEnemyEncounterCode = GetExplicitEnemyEncounterCode(); sGeneralInfo.fBlitBattleSectorLocator = gfBlitBattleSectorLocator; sGeneralInfo.ubPBSectorX = gubPBSectorX; sGeneralInfo.ubPBSectorY = gubPBSectorY; @@ -9101,8 +9104,8 @@ BOOLEAN LoadGeneralInfo( HWFILE hFile ) //New stuff for the Prebattle interface / autoresolve gfPersistantPBI = sGeneralInfo.fPersistantPBI; - gubEnemyEncounterCode = sGeneralInfo.ubEnemyEncounterCode; - gubExplicitEnemyEncounterCode = sGeneralInfo.ubExplicitEnemyEncounterCode; + SetEnemyEncounterCode( sGeneralInfo.ubEnemyEncounterCode ); + SetExplicitEnemyEncounterCode( sGeneralInfo.ubExplicitEnemyEncounterCode ); gfBlitBattleSectorLocator = sGeneralInfo.fBlitBattleSectorLocator; gubPBSectorX = sGeneralInfo.ubPBSectorX; gubPBSectorY = sGeneralInfo.ubPBSectorY; diff --git a/Strategic/ASD.cpp b/Strategic/ASD.cpp index fb0b1bd9..2593684b 100644 --- a/Strategic/ASD.cpp +++ b/Strategic/ASD.cpp @@ -74,7 +74,8 @@ UINT32 gASD_Flags = 0; // enemy heli constants #define ENEMYHELI_DESTROYED 0x00000001 #define ENEMYHELI_ORDER_GOTODESTINATION 0x00000002 -#define ENEMYHELI_KNOWNTOPLAYER 0x00000008 // the player knows about this heli (it will this be displayed on the map) +#define ENEMYHELI_KNOWNBYINTEL 0x00000004 // the player knows about this heli from intel (it will be displayed on the map) +#define ENEMYHELI_KNOWNTOPLAYER 0x00000008 // the player knows about this heli (it will be displayed on the map) #define ENEMYHELI_ORDER_DROPTROOPS 0x00000010 #define ENEMYHELI_ORDER_PICKUPTROOPS 0x00000020 @@ -585,7 +586,7 @@ void ENEMY_HELI::Destroy( ) flagmask |= ENEMYHELI_DESTROYED; // if the player knows about this heli, play a sound and leave a message - if ( flagmask & ENEMYHELI_KNOWNTOPLAYER ) + if ( flagmask & (ENEMYHELI_KNOWNBYINTEL|ENEMYHELI_KNOWNTOPLAYER) ) { CHAR16 pStr2[128]; GetSectorIDString( SECTORX( sector_current ), SECTORY( sector_current ), 0, pStr2, FALSE ); @@ -740,7 +741,7 @@ std::set GetEnemyHeliSectors( BOOLEAN afKnownToPlayer ) continue; // if the player doesn't know about this heli, don't add this - if ( afKnownToPlayer && !((*it).flagmask & ENEMYHELI_KNOWNTOPLAYER) ) + if ( afKnownToPlayer && !((*it).flagmask & (ENEMYHELI_KNOWNBYINTEL|ENEMYHELI_KNOWNTOPLAYER)) ) continue; set.insert( (*it).sector_current ); @@ -749,6 +750,39 @@ std::set GetEnemyHeliSectors( BOOLEAN afKnownToPlayer ) return set; } +std::vector GetEnemyHeliIDKnowledgeStatus() +{ + INT16 id = -1; + std::vector vec; + + std::vector::iterator itend = gEnemyHeliVector.end(); + for ( std::vector::iterator it = gEnemyHeliVector.begin(); it != itend; ++it ) + { + ++id; + + if ( ( ( *it ).flagmask & ( ENEMYHELI_DESTROYED | ENEMYHELI_KNOWNBYINTEL | ENEMYHELI_KNOWNTOPLAYER ) ) ) + vec.push_back( -1 ); + else + vec.push_back( id ); + } + + return vec; +} + +void BuyHeliInfoWithIntel( INT16 id ) +{ + if ( id >= 0 && id < gEnemyHeliVector.size() ) + { + ENEMY_HELI& heli = gEnemyHeliVector[id]; + + // if the heli is already destroyed, nothing to do here + if ( heli.flagmask & ENEMYHELI_DESTROYED ) + return; + + heli.flagmask |= ENEMYHELI_KNOWNBYINTEL; + } +} + void UpdateEnemyHeliRepair( INT16 id ) { if ( id >= 0 && id < gEnemyHeliVector.size( ) ) @@ -1094,7 +1128,7 @@ void EnemyHeliMANPADSCheck( INT16 id ) return; // if the player doesn't know about this heli, he can't shoot it down - if ( !(heli.flagmask & ENEMYHELI_KNOWNTOPLAYER) ) + if ( !(heli.flagmask & ( ENEMYHELI_KNOWNBYINTEL|ENEMYHELI_KNOWNTOPLAYER)) ) return; INT8 heli_x = SECTORX( heli.sector_current ); @@ -1205,6 +1239,10 @@ void EnemyHeliCheckPlayerKnowledge( INT16 id ) if ( id >= 0 && id < gEnemyHeliVector.size( ) ) { ENEMY_HELI& heli = gEnemyHeliVector[id]; + + // if we already know about this from intel, nothing to do here + if ( heli.flagmask & ENEMYHELI_KNOWNBYINTEL ) + return; INT8 current_x = SECTORX( heli.sector_current ); INT8 current_y = SECTORY( heli.sector_current ); diff --git a/Strategic/ASD.h b/Strategic/ASD.h index 20da9679..8f321679 100644 --- a/Strategic/ASD.h +++ b/Strategic/ASD.h @@ -92,6 +92,10 @@ void EnemyHeliTroopDrop( UINT8 aSector ); std::set GetEnemyHeliSectors( BOOLEAN afKnownToPlayer ); +// returns vector of all helis, -1 if known to player, id otherwise +std::vector GetEnemyHeliIDKnowledgeStatus(); + +void BuyHeliInfoWithIntel( INT16 id ); void UpdateEnemyHeliRepair( INT16 id ); void UpdateEnemyHeliRefuel( INT16 id ); void UpdateEnemyHeli( INT16 id ); diff --git a/Strategic/Assignments.cpp b/Strategic/Assignments.cpp index a66e588f..cd2301fa 100644 --- a/Strategic/Assignments.cpp +++ b/Strategic/Assignments.cpp @@ -72,6 +72,8 @@ #include "PMC.h" // added by Flugente #include "Drugs And Alcohol.h" // added by Flugente for DoesMercHaveDisability( ... ) #include "MilitiaIndividual.h" // added by Flugente + #include "Militia Control.h" // added by Flugente + #include "ASD.h" // added by Flugente #endif #include #include @@ -146,6 +148,12 @@ enum { DISEASE_MENU_CANCEL, }; +enum { + INTEL_MENU_CONCEAL, + INTEL_MENU_GETINTEL, + INTEL_MENU_CANCEL, +}; + /* CHRISL: Adjusted enumerations to allow for seperation of the three different pocket types in the new inventory system. */ @@ -193,6 +201,7 @@ INT32 ghVehicleBox = -1; INT32 ghRepairBox = -1; INT32 ghMoveItemBox = -1; INT32 ghDiseaseBox = -1; +INT32 ghSpyBox = -1; INT32 ghTrainingBox = -1; INT32 ghAttributeBox = -1; INT32 ghRemoveMercAssignBox = -1; @@ -225,6 +234,7 @@ MOUSE_REGION gEpcMenuRegion[ MAX_EPC_MENU_STRING_COUNT ]; MOUSE_REGION gRepairMenuRegion[ 20 ]; MOUSE_REGION gMoveItem[MOVEITEM_MAX_SECTORS_WITH_MODIFIER + 1]; MOUSE_REGION gDisease[DISEASE_MENU_CANCEL + 1]; +MOUSE_REGION gSpy[INTEL_MENU_CANCEL + 1]; UINT16 usMoveItemSectors[MOVEITEM_MAX_SECTORS_WITH_MODIFIER]; @@ -250,6 +260,7 @@ BOOLEAN fShowVehicleMenu = FALSE; BOOLEAN fShowRepairMenu = FALSE; BOOLEAN fShowMoveItemMenu = FALSE; BOOLEAN fShowDiseaseMenu = FALSE; +BOOLEAN fShowSpyMenu = FALSE; BOOLEAN fShownContractMenu = FALSE; // anv: snitch menus BOOLEAN fShowSnitchMenu = FALSE; @@ -484,6 +495,9 @@ void HandleSpreadingPropagandaInSector( INT16 sMapX, INT16 sMapY, INT8 bZ ); // Flugente: handle militia command void HandleMilitiaCommand(); +// Flugente: handle spy assignments +void HandleSpyAssignments(); + // is the character between secotrs in mvt BOOLEAN CharacterIsBetweenSectors( SOLDIERTYPE *pSoldier ); @@ -513,6 +527,7 @@ void HandleShadingOfLinesForVehicleMenu( void ); void HandleShadingOfLinesForRepairMenu( void ); void HandleShadingOfLinesForMoveItemMenu( void ); void HandleShadingOfLinesForDiseaseMenu(); +void HandleShadingOfLinesForSpyMenu(); void HandleShadingOfLinesForTrainingMenu( void ); void HandleShadingOfLinesForAttributeMenus( void ); // HEADROCK HAM 3.6: Shade Facility Box Lines @@ -538,12 +553,10 @@ BOOLEAN DisplayRepairMenu( SOLDIERTYPE *pSoldier ); BOOLEAN DisplayFacilityMenu( SOLDIERTYPE *pSoldier ); BOOLEAN DisplayFacilityAssignmentMenu( SOLDIERTYPE *pSoldier, UINT8 ubFacilityType ); -// Flugente: move items menu +// Flugente: menus BOOLEAN DisplayMoveItemsMenu( SOLDIERTYPE *pSoldier ); - -// Flugente: disease menu BOOLEAN DisplayDiseaseMenu( SOLDIERTYPE *pSoldier ); - +BOOLEAN DisplaySpyMenu( SOLDIERTYPE *pSoldier ); // create menus void CreateEPCBox( void ); @@ -552,6 +565,7 @@ void CreateVehicleBox(); void CreateRepairBox( void ); void CreateMoveItemBox( void ); void CreateDiseaseBox(); +void CreateSpyBox(); // HEADROCK HAM 3.6: Facility Box. void CreateFacilityBox( void ); void CreateFacilityAssignmentBox( void ); @@ -715,6 +729,22 @@ void ChangeSoldiersAssignment( SOLDIERTYPE *pSoldier, INT8 bAssignment ) AssertNotNIL(pSoldier); + // Flugente: SPY_LOCATION-assignments use a different Z-sector value (to avoid numerous conflicts with strategic AI etc.) + // This is exclusive, so make sure this is set correctly whenever we change assignments + if ( SPY_LOCATION(bAssignment) ) + { + if ( pSoldier->bSectorZ < 10 ) + pSoldier->bSectorZ += 10; + } + else if ( pSoldier->bSectorZ >= 10 ) + { + pSoldier->bSectorZ -= 10; + } + + // if we are no longer a POW, erase possible knowledge flag + if ( pSoldier->bAssignment == ASSIGNMENT_POW ) + pSoldier->usSoldierFlagMask2 &= ~SOLDIER_MERC_POW_LOCATIONKNOWN; + pSoldier->bAssignment = bAssignment; /// don't kill iVehicleId, though, 'cause militia training tries to put guys back in their vehicles when it's done(!) @@ -729,7 +759,7 @@ void ChangeSoldiersAssignment( SOLDIERTYPE *pSoldier, INT8 bAssignment ) { AddStrategicEvent( EVENT_BANDAGE_BLEEDING_MERCS, GetWorldTotalMin() + 1, 0 ); } - + // update character info, and the team panel fCharacterInfoPanelDirty = TRUE; fTeamPanelDirty = TRUE; @@ -867,6 +897,10 @@ BOOLEAN CanCharacterDoctor( SOLDIERTYPE *pSoldier ) return( FALSE ); } + // Flugente: we can't perform most assignments while concealed + if ( SPY_LOCATION( pSoldier->bAssignment ) ) + return( FALSE ); + if( CanCharacterDoctorButDoesntHaveMedKit( pSoldier ) == FALSE ) { return( FALSE ); @@ -904,6 +938,10 @@ BOOLEAN CanCharacterDiagnoseDisease( SOLDIERTYPE *pSoldier ) if ( !BasicCanCharacterAssignment( pSoldier, TRUE ) ) return(FALSE); + // Flugente: we can't perform most assignments while concealed + if ( SPY_LOCATION( pSoldier->bAssignment ) ) + return( FALSE ); + // all criteria fit, can doctor return TRUE; } @@ -922,6 +960,10 @@ BOOLEAN CanCharacterTreatSectorDisease( SOLDIERTYPE *pSoldier ) if ( !BasicCanCharacterAssignment( pSoldier, TRUE ) ) return(FALSE); + // Flugente: we can't perform most assignments while concealed + if ( SPY_LOCATION( pSoldier->bAssignment ) ) + return( FALSE ); + if ( !CanCharacterDoctorButDoesntHaveMedKit( pSoldier ) ) return(FALSE); @@ -940,6 +982,10 @@ BOOLEAN CanCharacterTreatSectorDisease( SOLDIERTYPE *pSoldier ) BOOLEAN CanCharacterFortify( SOLDIERTYPE *pSoldier ) { + // Flugente: we can't perform most assignments while concealed + if ( SPY_LOCATION( pSoldier->bAssignment ) ) + return( FALSE ); + if ( pSoldier->bSectorZ ) { UNDERGROUND_SECTORINFO *pSectorInfo; @@ -960,6 +1006,26 @@ BOOLEAN CanCharacterFortify( SOLDIERTYPE *pSoldier ) return FALSE; } +BOOLEAN CanCharacterSpyAssignment( SOLDIERTYPE *pSoldier ) +{ + if ( !gGameExternalOptions.fIntelResource ) + return FALSE; + + AssertNotNIL( pSoldier ); + + if ( !BasicCanCharacterAssignment( pSoldier, TRUE ) ) + return( FALSE ); + + // we can only give this assignment if we already are concealed (which means that we initially need to assign this from tactical) + if ( !SPY_LOCATION( pSoldier->bAssignment ) ) + return FALSE; + + if ( !pSoldier->CanUseSkill( SKILLS_INTEL_CONCEAL, FALSE ) ) + return( FALSE ); + + return TRUE; +} + BOOLEAN IsAnythingAroundForSoldierToRepair( SOLDIERTYPE * pSoldier ) { AssertNotNIL(pSoldier); @@ -1273,6 +1339,10 @@ BOOLEAN CanCharacterRepair( SOLDIERTYPE *pSoldier ) return( FALSE ); } + // Flugente: we can't perform most assignments while concealed + if ( SPY_LOCATION( pSoldier->bAssignment ) ) + return( FALSE ); + if ( BasicCanCharacterRepair( pSoldier ) == FALSE ) { return( FALSE ); @@ -1314,6 +1384,10 @@ BOOLEAN CanCharacterPatient( SOLDIERTYPE *pSoldier ) return( FALSE ); } + // Flugente: we can't perform most assignments while concealed + if ( SPY_LOCATION( pSoldier->bAssignment ) ) + return( FALSE ); + // Robot must be REPAIRED to be "healed", not doctored if( ( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) || AM_A_ROBOT( pSoldier ) ) { @@ -1397,6 +1471,10 @@ BOOLEAN BasicCanCharacterTrainMilitia( SOLDIERTYPE *pSoldier ) return( FALSE ); } + // Flugente: we can't perform most assignments while concealed + if ( SPY_LOCATION( pSoldier->bAssignment ) ) + return( FALSE ); + // make sure character is alive and conscious if( pSoldier->stats.bLife < OKLIFE ) { @@ -1763,6 +1841,10 @@ BOOLEAN CanCharacterTrainStat( SOLDIERTYPE *pSoldier, INT8 bStat, BOOLEAN fTrain return( FALSE ); } + // Flugente: we can't perform most assignments while concealed + if ( SPY_LOCATION( pSoldier->bAssignment ) ) + return( FALSE ); + // alive and conscious if( pSoldier->stats.bLife < OKLIFE ) { @@ -2015,6 +2097,10 @@ BOOLEAN CanCharacterPractise( SOLDIERTYPE *pSoldier ) return( FALSE ); } + // Flugente: we can't perform most assignments while concealed + if ( SPY_LOCATION( pSoldier->bAssignment ) ) + return( FALSE ); + // only need to be alive and well to do so right now // alive and conscious if( pSoldier->stats.bLife < OKLIFE ) @@ -2139,8 +2225,7 @@ BOOLEAN CanCharacterSleep( SOLDIERTYPE *pSoldier, BOOLEAN fExplainWhyNot ) { return( FALSE ); } - - + // traveling? if ( pSoldier->flags.fBetweenSectors ) { @@ -2265,6 +2350,10 @@ BOOLEAN CanCharacterVehicle( SOLDIERTYPE *pSoldier ) return( FALSE ); } + // Flugente: we can't perform most assignments while concealed + if ( SPY_LOCATION( pSoldier->bAssignment ) ) + return( FALSE ); + // only need to be alive and well to do so right now // alive and conscious if( pSoldier->stats.bLife < OKLIFE ) @@ -2413,6 +2502,10 @@ BOOLEAN CanCharacterSnitch( SOLDIERTYPE *pSoldier ) { AssertNotNIL(pSoldier); + // Flugente: we can't perform most assignments while concealed + if ( SPY_LOCATION( pSoldier->bAssignment ) ) + return( FALSE ); + // has character a snitch trait if( ProfileHasSkillTrait( pSoldier->ubProfile, SNITCH_NT ) ) { @@ -2645,6 +2738,9 @@ void UpdateAssignments() // Flugente: PMC recruits new personnel HourlyUpdatePMC(); + // Flugente: handle spy assignments + HandleSpyAssignments(); + // handle fortification HandleFortification(); @@ -5807,7 +5903,6 @@ void HandleRadioScanInSector( INT16 sMapX, INT16 sMapY, INT8 bZ ) FLOAT detect_rangefactor = .0f; FLOAT detect_sizefactor = .0f; FLOAT detect_chance = .0f; - FLOAT scandirectionmalus = .2f; FLOAT scanexactnumbermalus = .3f; UINT8 patrolsize = 0; @@ -5847,15 +5942,6 @@ void HandleRadioScanInSector( INT16 sMapX, INT16 sMapY, INT8 bZ ) // our scan was very good, we even got the exact enemy numbers SectorInfo[ SECTOR( sX, sY ) ].uiFlags |= SF_ASSIGN_NOTICED_ENEMIES_KNOW_NUMBER; } - - // we roll again to decide wether we know the direction this patrol is moving in - scanresult = Random(100); - - if ( scanresult < 100 * (detect_chance - scandirectionmalus) ) - { - // we were succesful in deducting the direction they are moving in - SectorInfo[ SECTOR( sX, sY ) ].uiFlags |= SF_ASSIGN_NOTICED_ENEMIES_KNOW_DIRECTION; - } } } } @@ -6029,6 +6115,113 @@ void HandleMilitiaCommand() } } +// Flugente: handle spy assignments +void HandleSpyAssignments() +{ + if ( !gGameExternalOptions.fIntelResource ) + return; + + // we recalculate what info is available on the intel website every 8 hours + if ( ( GetWorldHour() % 8 ) == 0 ) + { + BuildIntelInfoArray(); + CalcIntelInfoOfferings(); + + LaptopSaveInfo.usMapIntelFlags = 0; + } + + std::vector vector_uncoveredmercs; + FLOAT intelgained = 0.0f; + + SOLDIERTYPE *pSoldier = NULL; + UINT32 uiCnt = 0; + UINT32 firstid = gTacticalStatus.Team[gbPlayerNum].bFirstID; + UINT32 lastid = gTacticalStatus.Team[gbPlayerNum].bLastID; + for ( uiCnt = firstid, pSoldier = MercPtrs[uiCnt]; uiCnt <= lastid; ++uiCnt, ++pSoldier ) + { + if ( pSoldier ) + { + if ( SPY_LOCATION( pSoldier->bAssignment ) ) + { + INT8 sectorz = max( 0, pSoldier->bSectorZ - 10 ); + + // if this sector no longer has an enemy presence, we cannot conceal anymore + if ( NumEnemiesInAnySector( pSoldier->sSectorX, pSoldier->sSectorY, sectorz ) == 0 ) + { + // drop us into the sector on duty + INT8 bNewSquad = GetFirstEmptySquad(); + if ( bNewSquad >= 0 ) + { + pSoldier->usSoldierFlagMask2 |= SOLDIER_CONCEALINSERTION; + + AddCharacterToSquad( pSoldier, bNewSquad ); + + UpdateMercsInSector( pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ ); + + GroupArrivedAtSector( pSoldier->ubGroupID, TRUE, TRUE ); + + ScreenMsg( FONT_MCOLOR_RED, MSG_INTERFACE, szIntelText[0], pSoldier->GetName() ); + } + } + else + { + // first, check whether we will be uncovered + UINT8 uncoverrisk = pSoldier->GetUncoverRisk(); + + // TODO: prerandom numbers to stop players from savescumming? + if ( Chance( uncoverrisk ) ) + { + // if we are already in hiding, we will be uncovered + if ( pSoldier->usSkillCooldown[SOLDIER_COOLDOWN_INTEL_PENALTY] ) + vector_uncoveredmercs.push_back( uiCnt ); + + // we get a penalty, and a chance to be uncovered + pSoldier->usSkillCooldown[SOLDIER_COOLDOWN_INTEL_PENALTY] += 2 + Random( 3 ); + + ScreenMsg( FONT_MCOLOR_RED, MSG_INTERFACE, szIntelText[1], pSoldier->GetName(), (pSoldier->usSkillCooldown[SOLDIER_COOLDOWN_INTEL_PENALTY] - 1) ); + + continue; + } + + if ( EnoughTimeOnAssignment( pSoldier ) ) + intelgained += pSoldier->GetIntelGain(); + } + } + + // penalty runs out for every soldier, regardless of whether they are on an intel assignment + if ( pSoldier->usSkillCooldown[SOLDIER_COOLDOWN_INTEL_PENALTY] ) + pSoldier->usSkillCooldown[SOLDIER_COOLDOWN_INTEL_PENALTY]--; + } + } + + // give us intel and tell us about it + if ( intelgained > 0 ) + AddIntel( intelgained, TRUE ); + + // We don't want to start a battle when there is already one going on... + if ( !( gTacticalStatus.uiFlags & INCOMBAT ) && !vector_uncoveredmercs.empty() ) + { + UINT16 usIdOfUncoveredMerc = vector_uncoveredmercs[ Random( vector_uncoveredmercs.size() ) ]; + + // drop us into combat + INT8 bNewSquad = GetFirstEmptySquad(); + if ( bNewSquad >= 0 ) + { + SOLDIERTYPE* pSoldier = MercPtrs[usIdOfUncoveredMerc]; + + pSoldier->usSoldierFlagMask2 |= (SOLDIER_CONCEALINSERTION|SOLDIER_CONCEALINSERTION_DISCOVERED); + + AddCharacterToSquad( pSoldier, bNewSquad ); + + UpdateMercsInSector( pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ ); + + GroupArrivedAtSector( pSoldier->ubGroupID, TRUE, TRUE ); + + ScreenMsg( FONT_MCOLOR_RED, MSG_INTERFACE, szIntelText[2], pSoldier->GetName() ); + } + } +} + // handle snitch spreading propaganda assignment // totally not a copy of HandleRadioScanInSector void HandleSpreadingPropagandaInSector( INT16 sMapX, INT16 sMapY, INT8 bZ ) @@ -6171,7 +6364,7 @@ void HandleGatheringInformationBySoldier( SOLDIERTYPE* pSoldier ) { for(INT16 sY = 1; sY < MAP_WORLD_X - 1; ++sY ) { - if( SectorInfo[ SECTOR( sX, sY ) ].uiFlags & ( SF_ASSIGN_NOTICED_ENEMIES_HERE | SF_ASSIGN_NOTICED_ENEMIES_KNOW_NUMBER | SF_ASSIGN_NOTICED_ENEMIES_KNOW_DIRECTION ) ) + if( SectorInfo[ SECTOR( sX, sY ) ].uiFlags & ( SF_ASSIGN_NOTICED_ENEMIES_HERE | SF_ASSIGN_NOTICED_ENEMIES_KNOW_NUMBER ) ) { // no point if we already know about enemies there continue; @@ -6903,6 +7096,209 @@ BOOLEAN TrainTownInSector( SOLDIERTYPE *pTrainer, INT16 sMapX, INT16 sMapY, INT1 extern INT32 giReinforcementPool; +void Interrogateprisoner(UINT8 aPrisonerType, FLOAT aChanceModifier, INT8& arMilitiaType, UINT32& arRansom, FLOAT& arIntel ) +{ + arMilitiaType = -1; + + // determine chances + // get base chance + UINT8 chances[PRISONER_INTERROGATION_MAX] = { 0 }; + for ( int j = PRISONER_INTERROGATION_DEFECT; j < PRISONER_INTERROGATION_MAX; ++j ) + chances[j] = aChanceModifier * gGameExternalOptions.ubPrisonerProcessChance[j]; + + // depending on prisoner type, the chances for different results may differ + // for example, generals cannot be recruited + if ( aPrisonerType == PRISONER_GENERAL ) + chances[PRISONER_INTERROGATION_DEFECT] = 0; + + if ( !gGameExternalOptions.fIntelResource ) + chances[PRISONER_INTERROGATION_INTEL] = 0; + + // for normalisation, get sum of chances + UINT16 sumchance = 0; + for ( int j = PRISONER_INTERROGATION_DEFECT; j < PRISONER_INTERROGATION_MAX; ++j ) + sumchance += chances[j]; + + // ic sum chances > 100, fix that + if ( sumchance > 100 ) + { + for ( int j = PRISONER_INTERROGATION_DEFECT; j < PRISONER_INTERROGATION_MAX; ++j ) + chances[j] = (chances[j] * 100) / sumchance; + } + + // we determine what happens to the prisoners + UINT8 result = Random( 100 ); + + // chance that prisoner will work on our side as militia + if ( result < chances[PRISONER_INTERROGATION_DEFECT] ) + { + // troops are converted to militia, but there is a chance that they will be demoted in the process + + if ( aPrisonerType >= PRISONER_OFFICER && Chance( 80 ) ) + arMilitiaType = ELITE_MILITIA; + else if ( aPrisonerType >= PRISONER_ELITE && Chance( 80 ) ) + arMilitiaType = ELITE_MILITIA; + else if ( aPrisonerType >= PRISONER_REGULAR && Chance( 80 ) ) + arMilitiaType = REGULAR_MILITIA; + else if ( aPrisonerType >= PRISONER_ADMIN && Chance( 80 ) ) + arMilitiaType = GREEN_MILITIA; + else + // some might even fail to qualify as admins, these are volunteers - we have to 'retrain' them + arMilitiaType = MAX_MILITIA_LEVELS; + } + // chance that prisoner will give us random info about enemy positions + else if ( result < chances[PRISONER_INTERROGATION_DEFECT] + chances[PRISONER_INTERROGATION_INTEL] ) + { + switch ( aPrisonerType ) + { + case PRISONER_ADMIN: arIntel += (FLOAT)( 100.0f + Random( 200 ) ) / 100.0f; + case PRISONER_REGULAR: arIntel += (FLOAT)( 150.0f + Random( 250 ) ) / 100.0f; + case PRISONER_ELITE: arIntel += (FLOAT)( 225.0f + Random( 250 ) ) / 100.0f; + case PRISONER_OFFICER: arIntel += (FLOAT)( 400.0f + Random( 400 ) ) / 100.0f; + case PRISONER_GENERAL: arIntel += (FLOAT)( 2500.0f + Random( 1500 ) ) / 100.0f; + case PRISONER_CIVILIAN: arIntel += (FLOAT)( 100.0f + Random( 100 ) ) / 100.0f; + default: arIntel += (FLOAT)( 100.0f + Random( 100 ) ) / 100.0f; + } + } + // chance prisoner will grant us ransom money + else if ( result < chances[PRISONER_INTERROGATION_DEFECT] + chances[PRISONER_INTERROGATION_INTEL] + chances[PRISONER_INTERROGATION_RANSOM] ) + { + UINT32 ransom = ( 1 + Random( 5 ) ) * 100; + + // different prisoners give a different amount of ransom + if ( aPrisonerType == PRISONER_ADMIN || aPrisonerType == PRISONER_CIVILIAN ) + ransom *= 0.5f; + else if ( aPrisonerType == PRISONER_OFFICER ) + ransom *= 3; + else if ( aPrisonerType == PRISONER_GENERAL ) + ransom *= 10; + else if ( aPrisonerType == PRISONER_ELITE ) + ransom *= 1.5f; + + arRansom += ransom; + } + // we have to let him go without any benefits + else + { + + } + + // there is a chance that freed prisoners may return to the queen... + if ( arMilitiaType < 0 && aPrisonerType != PRISONER_CIVILIAN && Chance( gGameExternalOptions.ubPrisonerReturntoQueenChance ) ) + { + ++giReinforcementPool; + } +} + +void DoInterrogation( INT16 sMapX, INT16 sMapY, FLOAT aChanceModifier, INT16 aPrisoners[] ) +{ + CHAR16 sText[256]; + swprintf( sText, L"Interrogated" ); + + int numprisonersinterrogated = 0; + for ( int i = 0; i < PRISONER_MAX; ++i ) + { + if ( aPrisoners[i] ) + { + numprisonersinterrogated += aPrisoners[i]; + + CHAR16 wString[64]; + swprintf( wString, L"" ); + //AddMonoString( &hStringHandle, wString ); + swprintf( wString, pwTownInfoStrings[15 + i], aPrisoners[i] ); + + //strcat( sText, wString ); + + swprintf( sText, L"%s %s", sText, wString ); + } + } + + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, sText ); + + UINT16 turnedmilitia[PRISONER_MAX] = { 0 }; + UINT16 volunteers = 0; + FLOAT intelgained = 0.0f; + UINT32 ransommoney = 0; + for ( UINT32 i = 0; i < numprisonersinterrogated; ++i ) + { + // what kind of a prisoner is this? + UINT8 prisonertype = PRISONER_CIVILIAN; + if ( i < aPrisoners[PRISONER_ADMIN] ) + prisonertype = PRISONER_ADMIN; + else if ( i < aPrisoners[PRISONER_ADMIN] + aPrisoners[PRISONER_REGULAR] ) + prisonertype = PRISONER_REGULAR; + else if ( i < aPrisoners[PRISONER_ADMIN] + aPrisoners[PRISONER_REGULAR] + aPrisoners[PRISONER_ELITE] ) + prisonertype = PRISONER_ELITE; + else if ( i < aPrisoners[PRISONER_ADMIN] + aPrisoners[PRISONER_REGULAR] + aPrisoners[PRISONER_ELITE] + aPrisoners[PRISONER_OFFICER] ) + prisonertype = PRISONER_OFFICER; + else if ( i < aPrisoners[PRISONER_ADMIN] + aPrisoners[PRISONER_REGULAR] + aPrisoners[PRISONER_ELITE] + aPrisoners[PRISONER_OFFICER] + aPrisoners[PRISONER_GENERAL] ) + prisonertype = PRISONER_GENERAL; + + INT8 militiatype; + + Interrogateprisoner( prisonertype, aChanceModifier, militiatype, ransommoney, intelgained ); + + if ( militiatype == MAX_MILITIA_LEVELS ) + ++volunteers; + else if ( militiatype > -1 ) + { + turnedmilitia[militiatype]++; + } + } + + if ( turnedmilitia[PRISONER_ADMIN] + turnedmilitia[PRISONER_REGULAR] + turnedmilitia[PRISONER_ELITE] + turnedmilitia[PRISONER_OFFICER] ) + { + // we need to remove resources for these guys + if ( gGameExternalOptions.fMilitiaResources && !gGameExternalOptions.fMilitiaUseSectorInventory ) + { + AddResources( -turnedmilitia[PRISONER_ADMIN] - turnedmilitia[PRISONER_REGULAR] - ( turnedmilitia[PRISONER_ELITE] + turnedmilitia[PRISONER_OFFICER] ), + -turnedmilitia[PRISONER_REGULAR] - ( turnedmilitia[PRISONER_ELITE] + turnedmilitia[PRISONER_OFFICER] ), + -( turnedmilitia[PRISONER_ELITE] + turnedmilitia[PRISONER_OFFICER] ) ); + } + + // add these guys to the local garrison as green militias + StrategicAddMilitiaToSector( sMapX, sMapY, GREEN_MILITIA, turnedmilitia[PRISONER_ADMIN] ); + StrategicAddMilitiaToSector( sMapX, sMapY, REGULAR_MILITIA, turnedmilitia[PRISONER_REGULAR] ); + StrategicAddMilitiaToSector( sMapX, sMapY, ELITE_MILITIA, turnedmilitia[PRISONER_ELITE] + turnedmilitia[PRISONER_OFFICER] ); + + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szPrisonerTextStr[STR_PRISONER_TURN_MILITIA], turnedmilitia[PRISONER_OFFICER], turnedmilitia[PRISONER_ELITE], turnedmilitia[PRISONER_REGULAR], turnedmilitia[PRISONER_ADMIN] ); + + // Flugente: create individual militia + for ( int i = 0; i < turnedmilitia[PRISONER_ADMIN]; ++i ) + CreateNewIndividualMilitia( GREEN_MILITIA, MO_DEFECTOR, SECTOR( sMapX, sMapY ) ); + + for ( int i = 0; i < turnedmilitia[PRISONER_REGULAR]; ++i ) + CreateNewIndividualMilitia( REGULAR_MILITIA, MO_DEFECTOR, SECTOR( sMapX, sMapY ) ); + + for ( int i = 0; i < turnedmilitia[PRISONER_ELITE] + turnedmilitia[PRISONER_OFFICER]; ++i ) + CreateNewIndividualMilitia( ELITE_MILITIA, MO_DEFECTOR, SECTOR( sMapX, sMapY ) ); + + if ( !IsBookMarkSet( MILITIAROSTER_BOOKMARK ) ) + AddStrategicEvent( EVENT_MILITIAROSTER_EMAIL, GetWorldTotalMin() + 60 * ( 1 + Random( 4 ) ), 0 ); + + HandleMilitiaPromotions(); + } + + if ( volunteers ) + { + AddVolunteers( volunteers ); + + // we add the volunteers anyway, but only show the message if this feature is on + if ( gGameExternalOptions.fMilitiaVolunteerPool ) + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szPrisonerTextStr[STR_PRISONER_TURN_VOLUNTEER], volunteers ); + } + + if ( intelgained ) + AddIntel( intelgained, TRUE ); + + if ( ransommoney ) + { + AddTransactionToPlayersBook( PRISONER_RANSOM, 0, GetWorldTotalMin(), ransommoney ); + + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szPrisonerTextStr[STR_PRISONER_RANSOM], ransommoney ); + } +} + // handle processing of prisoners void HandlePrisonerProcessingInSector( INT16 sMapX, INT16 sMapY, INT8 bZ ) { @@ -7074,180 +7470,7 @@ void HandlePrisonerProcessingInSector( INT16 sMapX, INT16 sMapY, INT8 bZ ) if ( !prisonersinterrogated ) return; - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szPrisonerTextStr[STR_PRISONER_PROCESSED], - interrogatedprisoners[PRISONER_OFFICER], interrogatedprisoners[PRISONER_ELITE], interrogatedprisoners[PRISONER_REGULAR], - interrogatedprisoners[PRISONER_ADMIN], interrogatedprisoners[PRISONER_GENERAL], interrogatedprisoners[PRISONER_CIVILIAN] ); - - UINT16 turnedmilitia[PRISONER_MAX] = { 0 }; - UINT16 volunteers = 0; - UINT32 revealedpositions = 0; - UINT32 ransomscollected = 0; - UINT32 ransommoney = 0; - for ( UINT32 i = 0; i < prisonersinterrogated; ++i ) - { - // what kind of a prisoner is this? - UINT8 prisonertype = PRISONER_CIVILIAN; - if ( i < interrogatedprisoners[PRISONER_ADMIN] ) - prisonertype = PRISONER_ADMIN; - else if ( i < interrogatedprisoners[PRISONER_ADMIN] + interrogatedprisoners[PRISONER_REGULAR] ) - prisonertype = PRISONER_REGULAR; - else if ( i < interrogatedprisoners[PRISONER_ADMIN] + interrogatedprisoners[PRISONER_REGULAR] + interrogatedprisoners[PRISONER_ELITE] ) - prisonertype = PRISONER_ELITE; - else if ( i < interrogatedprisoners[PRISONER_ADMIN] + interrogatedprisoners[PRISONER_REGULAR] + interrogatedprisoners[PRISONER_ELITE] + interrogatedprisoners[PRISONER_OFFICER] ) - prisonertype = PRISONER_OFFICER; - else if ( i < interrogatedprisoners[PRISONER_ADMIN] + interrogatedprisoners[PRISONER_REGULAR] + interrogatedprisoners[PRISONER_ELITE] + interrogatedprisoners[PRISONER_OFFICER] + interrogatedprisoners[PRISONER_GENERAL] ) - prisonertype = PRISONER_GENERAL; - - // get base chance - UINT8 chances[PRISONER_INTERROGATION_MAX] = {0}; - for ( int j = PRISONER_INTERROGATION_DEFECT; j < PRISONER_INTERROGATION_MAX; ++j ) - chances[j] = gGameExternalOptions.ubPrisonerProcessChance[j]; - - // depending on prisoner type, the chances for different results may differ - // for example, generals cannot be recruited - if ( prisonertype == PRISONER_GENERAL ) - chances[PRISONER_INTERROGATION_DEFECT] = 0; - - // civilians know nothing about army movement - if ( prisonertype == PRISONER_CIVILIAN ) - chances[PRISONER_INTERROGATION_INFO] = 0; - - // for normalisation, get sum of chances - UINT16 sumchance = 0; - for ( int j = PRISONER_INTERROGATION_DEFECT; j < PRISONER_INTERROGATION_MAX; ++j ) - sumchance += chances[j]; - - // if nothing is set, 100% chance to get nothing - if ( !sumchance ) - { - chances[PRISONER_INTERROGATION_NOTHING] = 100; - sumchance = 100; - } - - // normalize to 100 - for ( int j = PRISONER_INTERROGATION_DEFECT; j < PRISONER_INTERROGATION_MAX; ++j ) - chances[j] = (chances[j] * 100) / sumchance; - - // we determine what happens to the prisoners - UINT8 result = Random( 100 ); - - // chance that prisoner will work on our side as militia - if ( result < chances[PRISONER_INTERROGATION_DEFECT] ) - { - // troops are converted to militia, but there is a chance that they will be demoted in the process - - // civilians need to receive basic training - these are volunteers - if ( prisonertype == PRISONER_CIVILIAN ) - ++volunteers; - else if ( prisonertype >= PRISONER_OFFICER && Chance( 80 ) ) - ++turnedmilitia[PRISONER_OFFICER]; - else if ( prisonertype >= PRISONER_ELITE && Chance( 80 ) ) - ++turnedmilitia[PRISONER_ELITE]; - else if ( prisonertype >= PRISONER_REGULAR && Chance( 80 ) ) - ++turnedmilitia[PRISONER_REGULAR]; - else if ( prisonertype >= PRISONER_ADMIN && Chance( 80 ) ) - ++turnedmilitia[PRISONER_ADMIN]; - else - // some might even fail to qualify as admins, these are volunteers - we have to 'retrain' them - ++volunteers; - - // we continue so that this guy cannot also run back to the queen - continue; - } - // chance that prisoner will give us random info about enemy positions - else if ( result < chances[PRISONER_INTERROGATION_DEFECT] + chances[PRISONER_INTERROGATION_INFO] ) - { - UINT8 infotype = INFO_TYPE_NORMAL; - - // there is a chance this guy might tell us about high-value targets! - if ( Chance( gGameExternalOptions.ubPrisonerInterrogationEnemyGeneralInfoChance[prisonertype] ) ) - infotype = INFO_TYPE_VIP; - - if ( GiveInfoToPlayer( infotype ) ) - ++revealedpositions; - } - // chance prisoner will grant us ransom money - else if ( result < chances[PRISONER_INTERROGATION_DEFECT] + chances[PRISONER_INTERROGATION_INFO] + chances[PRISONER_INTERROGATION_RANSOM] ) - { - UINT32 ransom = (1 + Random( 5 )) * 100; - - // different prisoners give a different amount of ransom - if ( prisonertype == PRISONER_ADMIN ) - ransom *= 0.5f; - else if ( prisonertype == PRISONER_OFFICER ) - ransom *= 3; - else if ( prisonertype == PRISONER_GENERAL ) - ransom *= 10; - else if ( prisonertype == PRISONER_CIVILIAN ) - ransom *= 0.5f; - - ransommoney += ransom; - - ++ransomscollected; - } - // we have to let him go without any benefits - else - { - - } - - // there is a chance that escaped prisoners may return to the queen... - if ( Random( 100 ) < gGameExternalOptions.ubPrisonerReturntoQueenChance ) - { - // but not for civilians - if ( prisonertype != PRISONER_CIVILIAN ) - ++giReinforcementPool; - } - } - - if ( turnedmilitia[PRISONER_ADMIN] + turnedmilitia[PRISONER_REGULAR] + turnedmilitia[PRISONER_ELITE] + turnedmilitia[PRISONER_OFFICER] ) - { - // we need to remove resources for these guys - if ( gGameExternalOptions.fMilitiaResources && !gGameExternalOptions.fMilitiaUseSectorInventory ) - { - AddResources( -turnedmilitia[PRISONER_ADMIN] - turnedmilitia[PRISONER_REGULAR] - (turnedmilitia[PRISONER_ELITE] + turnedmilitia[PRISONER_OFFICER]), - -turnedmilitia[PRISONER_REGULAR] - (turnedmilitia[PRISONER_ELITE] + turnedmilitia[PRISONER_OFFICER]), - -(turnedmilitia[PRISONER_ELITE] + turnedmilitia[PRISONER_OFFICER]) ); - } - - // add these guys to the local garrison as green militias - StrategicAddMilitiaToSector( sMapX, sMapY, GREEN_MILITIA, turnedmilitia[PRISONER_ADMIN] ); - StrategicAddMilitiaToSector( sMapX, sMapY, REGULAR_MILITIA, turnedmilitia[PRISONER_REGULAR] ); - StrategicAddMilitiaToSector( sMapX, sMapY, ELITE_MILITIA, turnedmilitia[PRISONER_ELITE] + turnedmilitia[PRISONER_OFFICER] ); - - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szPrisonerTextStr[STR_PRISONER_TURN_MILITIA], turnedmilitia[PRISONER_OFFICER], turnedmilitia[PRISONER_ELITE], turnedmilitia[PRISONER_REGULAR], turnedmilitia[PRISONER_ADMIN] ); - - // Flugente: create individual militia - for ( int i = 0; i < turnedmilitia[PRISONER_ADMIN]; ++i ) - CreateNewIndividualMilitia( GREEN_MILITIA, MO_DEFECTOR, SECTOR( sMapX, sMapY ) ); - - for ( int i = 0; i < turnedmilitia[PRISONER_REGULAR]; ++i ) - CreateNewIndividualMilitia( REGULAR_MILITIA, MO_DEFECTOR, SECTOR( sMapX, sMapY ) ); - - for ( int i = 0; i < turnedmilitia[PRISONER_ELITE] + turnedmilitia[PRISONER_OFFICER]; ++i ) - CreateNewIndividualMilitia( ELITE_MILITIA, MO_DEFECTOR, SECTOR( sMapX, sMapY ) ); - - AddStrategicEvent( EVENT_MILITIAROSTER_EMAIL, GetWorldTotalMin( ) + 60 * (1 + Random( 4 )), 0 ); - } - - if ( volunteers ) - { - AddVolunteers( volunteers ); - - // we add the volunteers anyway, but only show the message if this feature is on - if ( gGameExternalOptions.fMilitiaVolunteerPool ) - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szPrisonerTextStr[STR_PRISONER_TURN_VOLUNTEER], volunteers ); - } - - if ( revealedpositions ) - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szPrisonerTextStr[STR_PRISONER_DETECTION], revealedpositions ); - - if ( ransomscollected ) - { - AddTransactionToPlayersBook( PRISONER_RANSOM, 0, GetWorldTotalMin(), ransommoney ); - - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szPrisonerTextStr[STR_PRISONER_RANSOM], ransomscollected ); - } + DoInterrogation( sMapX, sMapY, 1.0f, interrogatedprisoners ); // give experience rewards to the interrogators // exp gained depends on prisoner type @@ -7300,94 +7523,185 @@ void HandlePrisonerProcessingInSector( INT16 sMapX, INT16 sMapY, INT8 bZ ) ChangeNumberOfPrisoners( pSectorInfo, interrogatedprisoners ); } -// this function gives a random bit of information to the player. The type of info depends on aInfoType. -// If higher-order info cannot be given (for example if all info is already known to the player), lower-order info wil be given instead -// returns TRUE if info was given, FALSE if not -BOOLEAN GiveInfoToPlayer(UINT8 aInfoType) +// In the intel market, the player can spend intel to buy information +// possible informations are: +// - position of enemy VIPs +// - position of enemy helis +// - position of POWs +// - position of terrorists +// - position of possible RPCs (Manuel, Maddog...) +// +// There are always up to INTELINFO_MAXNUMBER different informations available at a time. Every x hours these change. +// It thus follows that we first need a huge array for numbering the info. +// We then select up to INTELINFO_MAXNUMBER out of that array, depending on the hour and some number-crunching. +// As a result, the player can only change what is offered by progressing time. +#define INTEL_MAXINFO 128 +int intelarray[INTEL_MAXINFO]; + +void BuildIntelInfoArray() { - // there is a chance this guy might tell us about high-value targets! - if ( aInfoType == INFO_TYPE_VIP ) + int lastsectorofunknowngeneral = -1; + + for ( int i = 0; i < INTEL_MAXINFO; ++i ) { - UINT16 unknownvipector = 0; - if ( GetRandomUnknownVIPSector( unknownvipector ) ) + intelarray[i] = -1; + + // next gStrategicStatus.usVIPsTotal: generals + if ( i < 0 + gStrategicStatus.usVIPsTotal ) { - // make this guy known to the player - StrategicMap[unknownvipector].usFlags |= ENEMY_VIP_PRESENT_KNOWN; + int general = i - 0; - CHAR16 str[128]; - GetSectorIDString( SECTORX( unknownvipector ), SECTORY( unknownvipector ), 0, str, TRUE ); - - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szPrisonerTextStr[STR_PRISONER_DETECTION_VIP], str ); - - return TRUE; - } - } - - // mobile tanks are a serious threat. Learning of their location would be genuinely 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) ) + if ( general < gStrategicStatus.usVIPsLeft ) { - sectorswithunknowntanksvector.push_back( tanksector ); + for ( int sector = lastsectorofunknowngeneral + 1; sector < MAP_WORLD_X*MAP_WORLD_Y; ++sector ) + { + if ( ( StrategicMap[sector].usFlags & ENEMY_VIP_PRESENT ) && !( StrategicMap[sector].usFlags & ENEMY_VIP_PRESENT_KNOWN ) ) + { + intelarray[i] = sector; + + // we need to remember the last sector, otherwise we'd get the same guy again + lastsectorofunknowngeneral = sector; + + break; + } + } } } - } + // next gEnemyHeliVector.size(): enemy helis + else if ( i < 0 + gStrategicStatus.usVIPsTotal + gEnemyHeliVector.size() ) + { + int cnt = i - ( 0 + gStrategicStatus.usVIPsTotal ); - if ( !sectorswithunknowntanksvector.empty( ) ) + std::vector helivector = GetEnemyHeliIDKnowledgeStatus(); + + if ( cnt < helivector.size() ) + intelarray[i] = helivector[cnt]; + } + // next size of our team: POWs + else if ( i < 0 + gStrategicStatus.usVIPsTotal + gEnemyHeliVector.size() + gTacticalStatus.Team[gbPlayerNum].bLastID - gTacticalStatus.Team[gbPlayerNum].bFirstID ) + { + int ubID = i - ( 0 + gStrategicStatus.usVIPsTotal + gEnemyHeliVector.size() ); + + SOLDIERTYPE *pSoldier = MercPtrs[ubID]; + + // if this is a POW, and we don't know their location, we can use that + if ( pSoldier && pSoldier->bAssignment == ASSIGNMENT_POW && !( pSoldier->usSoldierFlagMask2 & SOLDIER_MERC_POW_LOCATIONKNOWN ) ) + intelarray[i] = ubID; + } + // and so on... + + } +} + +void CalcIntelInfoOfferings() +{ + int hour = 24 * GetWorldDay() + 3 * (GetWorldHour() / 8); + + int prime = 163; + int iteratornumber = 0; + int safetycounter = 0; + int maxchecks = min( 20, INTEL_MAXINFO ); // we only do this until a certain point - so it is possible to not get a result + int checkcounter = 0; + + for ( int i = 0; i < INTELINFO_MAXNUMBER; ++i ) { - UINT8 tanksector = sectorswithunknowntanksvector[Random( sectorswithunknowntanksvector.size( ) )]; + LaptopSaveInfo.sIntelInfoForThisHour[i] = -2; + checkcounter = 0; - SectorInfo[tanksector].uiFlags |= (SF_ASSIGN_NOTICED_ENEMIES_HERE | SF_ASSIGN_NOTICED_ENEMIES_KNOW_NUMBER); - - if ( Chance( gGameExternalOptions.ubPrisonerProcessInfoDirectionChance ) ) + while ( LaptopSaveInfo.sIntelInfoForThisHour[i] < 0 && checkcounter < maxchecks ) { - // we also learned the direction of the patrol - SectorInfo[tanksector].uiFlags |= SF_ASSIGN_NOTICED_ENEMIES_KNOW_DIRECTION; + iteratornumber = ( hour + safetycounter * prime ) % INTEL_MAXINFO; + + if ( intelarray[iteratornumber] > -1 ) + { + BOOLEAN alreadyselected = FALSE; + + for ( int j = 0; j < i; ++j ) + { + if ( iteratornumber == LaptopSaveInfo.sIntelInfoForThisHour[j] ) + { + alreadyselected = TRUE; + break; + } + } + + if ( !alreadyselected ) + LaptopSaveInfo.sIntelInfoForThisHour[i] = iteratornumber; + } + + ++safetycounter; + ++checkcounter; } - - return TRUE; } +} - UINT8 maxtries = 20; - for ( UINT8 infotry = 0; infotry < maxtries; ++infotry ) +void GetIntelInfoOfferings( int aInfo[] ) +{ + for ( int i = 0; i < INTELINFO_MAXNUMBER; ++i ) { - UINT8 usX = 1 + Random( MAP_WORLD_X - 2 ); - UINT8 usY = 1 + Random( MAP_WORLD_Y - 2 ); - - // not if we already know about this sector - if ( SectorInfo[SECTOR( usX, usY )].uiFlags & SF_ASSIGN_NOTICED_ENEMIES_HERE ) - continue; - - // there need to be mobile enemies here - that the queen has troops in towns we do not own is hardly worthy information, and empty sectors aren't interesting - if ( NumMobileEnemiesInSector( usX, usY ) == 0 ) - continue; - - // enemy patrol detected - SectorInfo[SECTOR( usX, usY )].uiFlags |= SF_ASSIGN_NOTICED_ENEMIES_HERE; - - if ( Chance( gGameExternalOptions.ubPrisonerProcessInfoNumberChance ) ) - { - // we also learned the number of enemies - SectorInfo[SECTOR( usX, usY )].uiFlags |= SF_ASSIGN_NOTICED_ENEMIES_KNOW_NUMBER; - } - - if ( Chance( gGameExternalOptions.ubPrisonerProcessInfoDirectionChance ) ) - { - // we also learned the direction of the patrol - SectorInfo[SECTOR( usX, usY )].uiFlags |= SF_ASSIGN_NOTICED_ENEMIES_KNOW_DIRECTION; - } - - return TRUE; + if ( LaptopSaveInfo.sIntelInfoForThisHour[i] >= 0 && intelarray[LaptopSaveInfo.sIntelInfoForThisHour[i]] > -1 ) + aInfo[i] = LaptopSaveInfo.sIntelInfoForThisHour[i]; + else if ( LaptopSaveInfo.sIntelInfoForThisHour[i] == -2 ) + aInfo[i] = LaptopSaveInfo.sIntelInfoForThisHour[i]; + else + aInfo[i] = -1; } +} - return FALSE; +void GetIntelInfoTextAndPrice(int aInfoNumber, STR16 aString, int& arIntelCost ) +{ + wcscpy( aString, L"No data found" ); + arIntelCost = 0; + + if ( aInfoNumber < 0 ) + { + wcscpy( aString, L"Data no longer eligible." ); + arIntelCost = 0; + } + else if ( aInfoNumber < 0 + gStrategicStatus.usVIPsTotal ) + { + wcscpy( aString, L"Whereabouts of a high-ranking officer of the royal army." ); + arIntelCost = 50; + } + else if ( aInfoNumber < 0 + gStrategicStatus.usVIPsTotal + gEnemyHeliVector.size() ) + { + wcscpy( aString, L"Flight plans of a airforce helicopter." ); + arIntelCost = 30; + } + else if ( aInfoNumber < 0 + gStrategicStatus.usVIPsTotal + gEnemyHeliVector.size() + gTacticalStatus.Team[gbPlayerNum].bLastID - gTacticalStatus.Team[gbPlayerNum].bFirstID ) + { + wcscpy( aString, L"Coordinates of a recently imprisoned member of your force." ); + arIntelCost = 30; + } +} + +void BuyIntelInfo( int aInfoNumber ) +{ + // next gStrategicStatus.usVIPsTotal: generals + if ( aInfoNumber < 0 + gStrategicStatus.usVIPsTotal ) + { + int sector = intelarray[aInfoNumber]; + + if ( ( StrategicMap[sector].usFlags & ENEMY_VIP_PRESENT ) ) + StrategicMap[sector].usFlags |= ENEMY_VIP_PRESENT_KNOWN; + } + // next gEnemyHeliVector.size(): enemy helis + else if ( aInfoNumber < 0 + gStrategicStatus.usVIPsTotal + gEnemyHeliVector.size() ) + { + BuyHeliInfoWithIntel( aInfoNumber - ( 0 + gStrategicStatus.usVIPsTotal ) ); + } + else if ( aInfoNumber < 0 + gStrategicStatus.usVIPsTotal + gEnemyHeliVector.size() + gTacticalStatus.Team[gbPlayerNum].bLastID - gTacticalStatus.Team[gbPlayerNum].bFirstID ) + { + int ubID = aInfoNumber - ( 0 + gStrategicStatus.usVIPsTotal + gEnemyHeliVector.size() ); + + SOLDIERTYPE *pSoldier = MercPtrs[ubID]; + + if ( pSoldier && pSoldier->bAssignment == ASSIGNMENT_POW ) + pSoldier->usSoldierFlagMask2 |= SOLDIER_MERC_POW_LOCATIONKNOWN; + } + // and so on... + + intelarray[aInfoNumber] = -1; } // Flugente: prisons can riot if there aren't enough guards around @@ -9592,6 +9906,16 @@ void HandleShadingOfLinesForAssignmentMenus( void ) // shade patient line ShadeStringInBox( ghAssignmentBox, ASSIGN_MENU_FORTIFY ); } + + // spy + if ( CanCharacterSpyAssignment( pSoldier ) ) + { + UnShadeStringInBox( ghAssignmentBox, ASSIGN_MENU_SPY ); + } + else + { + ShadeStringInBox( ghAssignmentBox, ASSIGN_MENU_SPY ); + } } } @@ -9609,6 +9933,7 @@ void HandleShadingOfLinesForAssignmentMenus( void ) // disease menu HandleShadingOfLinesForDiseaseMenu(); + HandleShadingOfLinesForSpyMenu(); // training submenu HandleShadingOfLinesForTrainingMenu( ); @@ -9677,6 +10002,7 @@ void DetermineWhichAssignmentMenusCanBeShown( void ) fShowRepairMenu = FALSE; fShowMoveItemMenu = FALSE; fShowDiseaseMenu = FALSE; + fShowSpyMenu = FALSE; // HEADROCK HAM 3.6: Reset Facility menu fShowFacilityMenu = FALSE; // anv: reset show snitch menu @@ -9694,6 +10020,7 @@ void DetermineWhichAssignmentMenusCanBeShown( void ) CreateDestroyMouseRegionForRepairMenu( ); CreateDestroyMouseRegionForMoveItemMenu(); CreateDestroyMouseRegionForDiseaseMenu(); + CreateDestroyMouseRegionForSpyMenu(); // HEADROCK HAM 3.6: Facility Menu, Submenu CreateDestroyMouseRegionForFacilityMenu( ); CreateDestroyMouseRegionsForFacilityAssignmentMenu( ); @@ -9742,6 +10069,12 @@ void DetermineWhichAssignmentMenusCanBeShown( void ) fTeamPanelDirty = TRUE; gfRenderPBInterface = TRUE; } + if ( IsBoxShown( ghSpyBox ) ) + { + HideBox( ghSpyBox ); + fTeamPanelDirty = TRUE; + gfRenderPBInterface = TRUE; + } if ( IsBoxShown( ghAttributeBox ) ) { HideBox( ghAttributeBox ); @@ -9828,6 +10161,7 @@ void DetermineWhichAssignmentMenusCanBeShown( void ) CreateDestroyMouseRegionForRepairMenu( ); CreateDestroyMouseRegionForMoveItemMenu(); CreateDestroyMouseRegionForDiseaseMenu( ); + CreateDestroyMouseRegionForSpyMenu(); CreateDestroyMouseRegionsForSnitchMenu( ); CreateDestroyMouseRegionsForSnitchToggleMenu( ); CreateDestroyMouseRegionsForSnitchSectorMenu( ); @@ -9925,6 +10259,24 @@ void DetermineWhichAssignmentMenusCanBeShown( void ) gfRenderPBInterface = TRUE; } } + + // spy menu + if ( fShowSpyMenu ) + { + HandleShadingOfLinesForSpyMenu(); + ShowBox( ghSpyBox ); + } + else + { + // hide box + if ( IsBoxShown( ghSpyBox ) ) + { + HideBox( ghSpyBox ); + fTeamPanelDirty = TRUE; + fMapPanelDirty = TRUE; + gfRenderPBInterface = TRUE; + } + } // ATTRIBUTE menu if( fShowAttributeMenu == TRUE ) @@ -10167,6 +10519,7 @@ void ClearScreenMaskForMapScreenExit( void ) CreateDestroyMouseRegionForRepairMenu( ); CreateDestroyMouseRegionForMoveItemMenu(); CreateDestroyMouseRegionForDiseaseMenu( ); + CreateDestroyMouseRegionForSpyMenu(); // HEADROCK HAM 3.6: Facility Menu CreateDestroyMouseRegionForFacilityMenu( ); CreateDestroyMouseRegionsForSnitchMenu( ); @@ -11767,6 +12120,14 @@ void SquadMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason ) AddCharacterToSquad( pSoldier, ( INT8 )iValue ); + // Flugente: if we manually set a concealed merc to no longer be concealed, we have to check on whether they enter combat + if ( SPY_LOCATION( pSoldier->bOldAssignment ) ) + { + UpdateMercsInSector( pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ ); + + GroupArrivedAtSector( pSoldier->ubGroupID, TRUE, TRUE ); + } + if( pSoldier->bOldAssignment == VEHICLE ) { SetSoldierExitVehicleInsertionData( pSoldier, pSoldier->iVehicleId, pSoldier->ubGroupID ); @@ -12548,6 +12909,7 @@ void SetShowAllMenus( BOOLEAN fShowMenu ) fShowRepairMenu = fShowMenu; fShowMoveItemMenu = fShowMenu; fShowDiseaseMenu = fShowMenu; + fShowSpyMenu = fShowMenu; fShowSnitchMenu = fShowMenu; } @@ -12563,7 +12925,7 @@ void AssignmentMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason ) if (iReason & MSYS_CALLBACK_REASON_LBUTTON_UP) { // HEADROCK HAM 3.6: Added facility menu. - if ( fShowAttributeMenu || fShowTrainingMenu || fShowRepairMenu || fShowMoveItemMenu || fShowDiseaseMenu || fShowVehicleMenu || fShowSquadMenu || fShowFacilityMenu || fShowFacilityAssignmentMenu || fShowSnitchMenu ) + if ( fShowAttributeMenu || fShowTrainingMenu || fShowRepairMenu || fShowMoveItemMenu || fShowDiseaseMenu || fShowSpyMenu || fShowVehicleMenu || fShowSquadMenu || fShowFacilityMenu || fShowFacilityAssignmentMenu || fShowSnitchMenu ) { return; } @@ -12732,6 +13094,7 @@ void AssignmentMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason ) fShowRepairMenu = FALSE; fShowMoveItemMenu = FALSE; fShowDiseaseMenu = FALSE; + fShowSpyMenu = FALSE; } break; case( ASSIGN_MENU_DOCTOR ): @@ -12804,6 +13167,7 @@ void AssignmentMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason ) fShowFacilityMenu = FALSE; // HEADROCK HAM 3.6: Facility Menu fShowPrisonerMenu = FALSE; fShowDiseaseMenu = FALSE; + fShowSpyMenu = FALSE; fShowRepairMenu = FALSE; fShownContractMenu = FALSE; fTeamPanelDirty = TRUE; @@ -12937,6 +13301,7 @@ void AssignmentMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason ) fShowPrisonerMenu = FALSE; fShowMoveItemMenu = FALSE; fShowDiseaseMenu = FALSE; + fShowSpyMenu = FALSE; fTeamPanelDirty = TRUE; fMapScreenBottomDirty = TRUE; @@ -13014,6 +13379,7 @@ void AssignmentMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason ) fShowTrainingMenu = FALSE; fShowMoveItemMenu = FALSE; fShowDiseaseMenu = FALSE; + fShowSpyMenu = FALSE; fShowFacilityMenu = FALSE; fShowPrisonerMenu = FALSE; @@ -13031,6 +13397,7 @@ void AssignmentMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason ) fShowRepairMenu = FALSE; fShowMoveItemMenu = FALSE; fShowDiseaseMenu = FALSE; + fShowSpyMenu = FALSE; fShowFacilityMenu = FALSE; // HEADROCK HAM 3.6: Facility Menu fShowPrisonerMenu = FALSE; fShowSnitchMenu = FALSE; @@ -13049,6 +13416,7 @@ void AssignmentMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason ) fShowFacilityMenu = FALSE; // HEADROCK HAM 3.6: Facility Menu fShowPrisonerMenu = FALSE; fShowDiseaseMenu = FALSE; + fShowSpyMenu = FALSE; //fShownAssignmentMenu = FALSE; fShowRepairMenu = FALSE; fShownContractMenu = FALSE; @@ -13114,6 +13482,31 @@ void AssignmentMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason ) } break; + case ASSIGN_MENU_SPY: + if ( CanCharacterSpyAssignment( pSoldier ) ) + { + fShowSquadMenu = FALSE; + fShowTrainingMenu = FALSE; + fShowVehicleMenu = FALSE; + fShowFacilityMenu = FALSE; + fShowPrisonerMenu = FALSE; + fShowDiseaseMenu = FALSE; + fShowSpyMenu = FALSE; + fShowRepairMenu = FALSE; + fShownContractMenu = FALSE; + fTeamPanelDirty = TRUE; + fMapScreenBottomDirty = TRUE; + + pSoldier->bOldAssignment = pSoldier->bAssignment; + + if ( DisplaySpyMenu( pSoldier ) ) + { + fShowSpyMenu = TRUE; + DetermineBoxPositions(); + } + } + break; + // HEADROCK HAM 3.6: New assignments for Facility operation. case( ASSIGN_MENU_FACILITY ): if ( BasicCanCharacterFacility( pSoldier ) ) @@ -13125,6 +13518,7 @@ void AssignmentMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason ) fShowRepairMenu = FALSE; fShowMoveItemMenu = FALSE; fShowDiseaseMenu = FALSE; + fShowSpyMenu = FALSE; fShowFacilityMenu = TRUE; // HEADROCK HAM 3.6: Facility Menu fShowPrisonerMenu = FALSE; fTeamPanelDirty = TRUE; @@ -13160,13 +13554,14 @@ void AssignmentMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason ) else if( iReason & MSYS_CALLBACK_REASON_RBUTTON_UP ) { // HEADROCK HAM 3.6: Added facility menu - if ( fShowAttributeMenu || fShowTrainingMenu || fShowRepairMenu || fShowMoveItemMenu || fShowDiseaseMenu || fShowVehicleMenu || fShowSquadMenu || fShowFacilityMenu || fShowFacilityAssignmentMenu || fShowSnitchMenu ) + if ( fShowAttributeMenu || fShowTrainingMenu || fShowRepairMenu || fShowMoveItemMenu || fShowDiseaseMenu || fShowSpyMenu || fShowVehicleMenu || fShowSquadMenu || fShowFacilityMenu || fShowFacilityAssignmentMenu || fShowSnitchMenu ) { fShowAttributeMenu = FALSE; fShowTrainingMenu = FALSE; fShowRepairMenu = FALSE; fShowMoveItemMenu = FALSE; fShowDiseaseMenu = FALSE; + fShowSpyMenu = FALSE; fShowVehicleMenu = FALSE; fShowSquadMenu = FALSE; fShowFacilityMenu = FALSE; // Added facilities @@ -13550,6 +13945,37 @@ void CreateDiseaseBox() SetBoxPosition( ghDiseaseBox, pPoint ); } +void CreateSpyBox() +{ + SGPPoint pPoint; + SGPRect pDimensions; + + CreatePopUpBox( &ghSpyBox, FacilityAssignmentDimensions, FacilityAssignmentPosition, ( POPUP_BOX_FLAG_CLIP_TEXT | POPUP_BOX_FLAG_CENTER_TEXT | POPUP_BOX_FLAG_RESIZE ) ); + SetBoxBuffer( ghSpyBox, FRAME_BUFFER ); + SetBorderType( ghSpyBox, guiPOPUPBORDERS ); + SetBackGroundSurface( ghSpyBox, guiPOPUPTEX ); + SetMargins( ghSpyBox, 6, 6, 4, 4 ); + SetLineSpace( ghSpyBox, 2 ); + + // set current box to this one + SetCurrentBox( ghSpyBox ); + + // resize box to text + ResizeBoxToText( ghSpyBox ); + + DetermineBoxPositions(); + + GetBoxPosition( ghSpyBox, &pPoint ); + GetBoxSize( ghSpyBox, &pDimensions ); + + if ( giBoxY + pDimensions.iBottom > 479 ) + { + pPoint.iY = FacilityAssignmentPosition.iY = 479 - pDimensions.iBottom; + } + + SetBoxPosition( ghSpyBox, pPoint ); +} + void CreateSnitchBox() { UINT32 hStringHandle; @@ -14282,6 +14708,9 @@ BOOLEAN CreateDestroyAssignmentPopUpBoxes( void ) RemoveBox( ghDiseaseBox); ghDiseaseBox = -1; + RemoveBox( ghSpyBox ); + ghSpyBox = -1; + RemoveBox(ghTrainingBox); ghTrainingBox = -1; @@ -14367,7 +14796,6 @@ void DetermineBoxPositions( void ) if( ( fShowRepairMenu == TRUE ) && ( ghRepairBox != -1 ) ) { - //CreateDestroyMouseRegionForRepairMenu( ); pNewPoint.iY += ( ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_REPAIR ); SetBoxPosition( ghRepairBox, pNewPoint ); @@ -14376,7 +14804,6 @@ void DetermineBoxPositions( void ) if( ( fShowMoveItemMenu == TRUE ) && ( ghMoveItemBox != -1 ) ) { - //CreateDestroyMouseRegionForMoveItemMenu( ); pNewPoint.iY += ( ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_MOVE_ITEMS ); SetBoxPosition( ghMoveItemBox, pNewPoint ); @@ -14385,13 +14812,20 @@ void DetermineBoxPositions( void ) if ( (fShowDiseaseMenu == TRUE) && (ghDiseaseBox != -1) ) { - //CreateDestroyMouseRegionForMoveItemMenu( ); pNewPoint.iY += ((GetFontHeight( MAP_SCREEN_FONT ) + 2) * ASSIGN_MENU_DOCTOR_DIAGNOSIS); SetBoxPosition( ghDiseaseBox, pNewPoint ); CreateDestroyMouseRegionForDiseaseMenu( ); } + if ( fShowSpyMenu && ( ghSpyBox != -1) ) + { + pNewPoint.iY += ( ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_SPY ); + + SetBoxPosition( ghSpyBox, pNewPoint ); + CreateDestroyMouseRegionForSpyMenu(); + } + if( ( fShowTrainingMenu == TRUE ) && ( ghTrainingBox != -1 ) ) { pNewPoint.iY += ( ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_TRAIN ); @@ -14661,8 +15095,7 @@ void CheckAndUpdateTacticalAssignmentPopUpPositions( void ) else if( fShowSquadMenu == TRUE ) { GetBoxSize( ghSquadBox, &pDimensions ); - - + if( gsAssignmentBoxesX + pDimensions2.iRight + pDimensions.iRight >= SCREEN_WIDTH ) { gsAssignmentBoxesX = ( INT16 ) ( (SCREEN_WIDTH - 1) - ( pDimensions2.iRight + pDimensions.iRight ) ); @@ -14718,8 +15151,6 @@ void CheckAndUpdateTacticalAssignmentPopUpPositions( void ) pPoint.iY += ( ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_TRAIN ); SetBoxPosition( ghTrainingBox, pPoint ); - - } else if( fShowTrainingMenu == TRUE ) { @@ -14737,8 +15168,6 @@ void CheckAndUpdateTacticalAssignmentPopUpPositions( void ) SetRenderFlags( RENDER_FLAG_FULL ); } - - pPoint.iX = gsAssignmentBoxesX + pDimensions2.iRight; pPoint.iY = gsAssignmentBoxesY; pPoint.iY += ( ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_TRAIN ); @@ -14789,7 +15218,28 @@ void CheckAndUpdateTacticalAssignmentPopUpPositions( void ) SetBoxPosition( ghDiseaseBox, pPoint ); } + else if ( fShowSpyMenu ) + { + GetBoxSize( ghSpyBox, &pDimensions ); + if ( gsAssignmentBoxesX + pDimensions2.iRight + pDimensions.iRight >= SCREEN_WIDTH ) + { + gsAssignmentBoxesX = (INT16)( ( SCREEN_WIDTH - 1 ) - ( pDimensions2.iRight + pDimensions.iRight ) ); + SetRenderFlags( RENDER_FLAG_FULL ); + } + + if ( gsAssignmentBoxesY + pDimensions2.iBottom + ( ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_SPY ) >= ( SCREEN_HEIGHT - 120 ) ) + { + gsAssignmentBoxesY = (INT16)( ( SCREEN_HEIGHT - 121 ) - ( pDimensions2.iBottom ) - ( ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_SPY ) ); + SetRenderFlags( RENDER_FLAG_FULL ); + } + + pPoint.iX = gsAssignmentBoxesX + pDimensions2.iRight; + pPoint.iY = gsAssignmentBoxesY; + pPoint.iY += ( ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_SPY ); + + SetBoxPosition( ghSpyBox, pPoint ); + } // HEADROCK HAM 3.6: Facility Sub-menu else if( fShowFacilityAssignmentMenu == TRUE ) { @@ -14820,8 +15270,6 @@ void CheckAndUpdateTacticalAssignmentPopUpPositions( void ) pPoint.iY += ( ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_FACILITY ); SetBoxPosition( ghFacilityBox, pPoint ); - - } // HEADROCK HAM 3.6: Facility Menu @@ -16078,6 +16526,11 @@ BOOLEAN HandleAssignmentExpansionAndHighLightForAssignMenu( SOLDIERTYPE *pSoldie HighLightBoxLine( ghAssignmentBox, ASSIGN_MENU_DOCTOR_DIAGNOSIS ); return(TRUE); } + else if ( fShowSpyMenu ) + { + HighLightBoxLine( ghAssignmentBox, ASSIGN_MENU_SPY ); + return( TRUE ); + } else if( fShowVehicleMenu ) { // highlight vehicle line the previous menu @@ -17209,6 +17662,11 @@ void ReEvaluateEveryonesNothingToDo( BOOLEAN aDoExtensiveCheck ) fNothingToDo = !CanCharacterFortify( pSoldier ); break; + case CONCEALED: + case GATHERINTEL: + fNothingToDo = !CanCharacterSpyAssignment( pSoldier ); + break; + case VEHICLE: default: // squads fNothingToDo = FALSE; @@ -17360,7 +17818,7 @@ void SetAssignmentForList( INT8 bAssignment, INT8 bParam ) if ( pSoldier->CanUseRadio() ) { pSoldier->bOldAssignment = pSoldier->bAssignment; - SetSoldierAssignment( pSoldier, RADIO_SCAN, bParam, 0,0 ); + SetSoldierAssignment( pSoldier, bAssignment, bParam, 0,0 ); fItWorked = TRUE; } break; @@ -17368,7 +17826,7 @@ void SetAssignmentForList( INT8 bAssignment, INT8 bParam ) if( CanCharacterTrainStat( pSoldier, bParam , TRUE, FALSE ) ) { pSoldier->bOldAssignment = pSoldier->bAssignment; - SetSoldierAssignment( pSoldier, TRAIN_SELF, bParam, 0,0 ); + SetSoldierAssignment( pSoldier, bAssignment, bParam, 0,0 ); fItWorked = TRUE; } break; @@ -17376,7 +17834,7 @@ void SetAssignmentForList( INT8 bAssignment, INT8 bParam ) if( CanCharacterTrainMilitia( pSoldier ) ) { pSoldier->bOldAssignment = pSoldier->bAssignment; - SetSoldierAssignment( pSoldier, TRAIN_TOWN, 0, 0, 0 ); + SetSoldierAssignment( pSoldier, bAssignment, 0, 0, 0 ); fItWorked = TRUE; } break; @@ -17384,7 +17842,7 @@ void SetAssignmentForList( INT8 bAssignment, INT8 bParam ) if( CanCharacterTrainMobileMilitia( pSoldier ) ) { pSoldier->bOldAssignment = pSoldier->bAssignment; - SetSoldierAssignment( pSoldier, TRAIN_MOBILE, 0, 0, 0 ); + SetSoldierAssignment( pSoldier, bAssignment, 0, 0, 0 ); fItWorked = TRUE; } break; @@ -17392,7 +17850,7 @@ void SetAssignmentForList( INT8 bAssignment, INT8 bParam ) if( CanCharacterTrainWorkers( pSoldier ) ) { pSoldier->bOldAssignment = pSoldier->bAssignment; - SetSoldierAssignment( pSoldier, TRAIN_WORKERS, 0, 0, 0 ); + SetSoldierAssignment( pSoldier, bAssignment, 0, 0, 0 ); fItWorked = TRUE; } break; @@ -17400,7 +17858,7 @@ void SetAssignmentForList( INT8 bAssignment, INT8 bParam ) if( CanCharacterTrainStat( pSoldier, bParam, FALSE, TRUE ) ) { pSoldier->bOldAssignment = pSoldier->bAssignment; - SetSoldierAssignment( pSoldier, TRAIN_TEAMMATE, bParam, 0,0 ); + SetSoldierAssignment( pSoldier, bAssignment, bParam, 0,0 ); fItWorked = TRUE; } break; @@ -17408,7 +17866,7 @@ void SetAssignmentForList( INT8 bAssignment, INT8 bParam ) if( CanCharacterTrainStat( pSoldier, bParam, TRUE, FALSE ) ) { pSoldier->bOldAssignment = pSoldier->bAssignment; - SetSoldierAssignment( pSoldier, TRAIN_BY_OTHER, bParam, 0,0 ); + SetSoldierAssignment( pSoldier, bAssignment, bParam, 0,0 ); fItWorked = TRUE; } break; @@ -17417,7 +17875,7 @@ void SetAssignmentForList( INT8 bAssignment, INT8 bParam ) //if( CanCharacterTrainStat( pSoldier, bParam, TRUE, FALSE ) ) { pSoldier->bOldAssignment = pSoldier->bAssignment; - SetSoldierAssignment( pSoldier, MOVE_EQUIPMENT, bParam, 0,0 ); + SetSoldierAssignment( pSoldier, bAssignment, bParam, 0,0 ); fItWorked = TRUE; } break; @@ -17426,7 +17884,7 @@ void SetAssignmentForList( INT8 bAssignment, INT8 bParam ) if( CanCharacterSpreadPropaganda( pSoldier ) ) { pSoldier->bOldAssignment = pSoldier->bAssignment; - SetSoldierAssignment( pSoldier, SNITCH_SPREAD_PROPAGANDA, bParam, 0,0 ); + SetSoldierAssignment( pSoldier, bAssignment, bParam, 0,0 ); fItWorked = TRUE; } break; @@ -17435,7 +17893,7 @@ void SetAssignmentForList( INT8 bAssignment, INT8 bParam ) if( CanCharacterGatherInformation( pSoldier ) ) { pSoldier->bOldAssignment = pSoldier->bAssignment; - SetSoldierAssignment( pSoldier, SNITCH_GATHER_RUMOURS, bParam, 0,0 ); + SetSoldierAssignment( pSoldier, bAssignment, bParam, 0,0 ); fItWorked = TRUE; } break; @@ -17457,7 +17915,7 @@ void SetAssignmentForList( INT8 bAssignment, INT8 bParam ) { pSoldier->bOldAssignment = pSoldier->bAssignment; MakeSoldierKnownAsMercInPrison( pSoldier, pSoldier->sSectorX, pSoldier->sSectorY ); - ChangeSoldiersAssignment( pSoldier, FACILITY_INTERROGATE_PRISONERS ); + ChangeSoldiersAssignment( pSoldier, bAssignment ); pSoldier->sFacilityTypeOperated = bParam; fItWorked = TRUE; } @@ -17467,7 +17925,7 @@ void SetAssignmentForList( INT8 bAssignment, INT8 bParam ) if( CanCharacterFacility( pSoldier, bParam, FAC_PRISON_SNITCH ) && CanCharacterSnitchInPrison( pSoldier ) ) { pSoldier->bOldAssignment = pSoldier->bAssignment; - SetSoldierAssignment( pSoldier, FACILITY_PRISON_SNITCH, bParam, 0,0 ); + SetSoldierAssignment( pSoldier, bAssignment, bParam, 0,0 ); fItWorked = TRUE; } break; @@ -17476,7 +17934,7 @@ void SetAssignmentForList( INT8 bAssignment, INT8 bParam ) if( CanCharacterFacility( pSoldier, bParam, FAC_SPREAD_PROPAGANDA ) && CanCharacterSpreadPropaganda( pSoldier ) ) { pSoldier->bOldAssignment = pSoldier->bAssignment; - SetSoldierAssignment( pSoldier, FACILITY_SPREAD_PROPAGANDA, bParam, 0,0 ); + SetSoldierAssignment( pSoldier, bAssignment, bParam, 0,0 ); fItWorked = TRUE; } break; @@ -17484,7 +17942,7 @@ void SetAssignmentForList( INT8 bAssignment, INT8 bParam ) if( CanCharacterFacility( pSoldier, bParam, FAC_SPREAD_PROPAGANDA_GLOBAL ) && CanCharacterSpreadPropaganda( pSoldier ) ) { pSoldier->bOldAssignment = pSoldier->bAssignment; - SetSoldierAssignment( pSoldier, FACILITY_SPREAD_PROPAGANDA_GLOBAL, bParam, 0,0 ); + SetSoldierAssignment( pSoldier, bAssignment, bParam, 0,0 ); fItWorked = TRUE; } break; @@ -17492,7 +17950,7 @@ void SetAssignmentForList( INT8 bAssignment, INT8 bParam ) if( CanCharacterFacility( pSoldier, bParam, FAC_GATHER_RUMOURS ) && CanCharacterGatherInformation( pSoldier ) ) { pSoldier->bOldAssignment = pSoldier->bAssignment; - SetSoldierAssignment( pSoldier, FACILITY_GATHER_RUMOURS, bParam, 0,0 ); + SetSoldierAssignment( pSoldier, bAssignment, bParam, 0,0 ); fItWorked = TRUE; } break; @@ -17500,7 +17958,7 @@ void SetAssignmentForList( INT8 bAssignment, INT8 bParam ) if( CanCharacterFacility( pSoldier, bParam, FAC_STRATEGIC_MILITIA_MOVEMENT ) ) { pSoldier->bOldAssignment = pSoldier->bAssignment; - SetSoldierAssignment( pSoldier, FACILITY_STRATEGIC_MILITIA_MOVEMENT, bParam, 0,0 ); + SetSoldierAssignment( pSoldier, bAssignment, bParam, 0,0 ); fItWorked = TRUE; } break; @@ -17508,7 +17966,7 @@ void SetAssignmentForList( INT8 bAssignment, INT8 bParam ) if ( CanCharacterDiagnoseDisease( pSoldier ) ) { pSoldier->bOldAssignment = pSoldier->bAssignment; - SetSoldierAssignment( pSoldier, DISEASE_DIAGNOSE, bParam, 0, 0 ); + SetSoldierAssignment( pSoldier, bAssignment, bParam, 0, 0 ); fItWorked = TRUE; } break; @@ -17516,7 +17974,7 @@ void SetAssignmentForList( INT8 bAssignment, INT8 bParam ) if ( CanCharacterTreatSectorDisease( pSoldier ) ) { pSoldier->bOldAssignment = pSoldier->bAssignment; - SetSoldierAssignment( pSoldier, DISEASE_DOCTOR_SECTOR, bParam, 0, 0 ); + SetSoldierAssignment( pSoldier, bAssignment, bParam, 0, 0 ); fItWorked = TRUE; } break; @@ -17524,10 +17982,21 @@ void SetAssignmentForList( INT8 bAssignment, INT8 bParam ) if ( CanCharacterFortify( pSoldier ) ) { pSoldier->bOldAssignment = pSoldier->bAssignment; - SetSoldierAssignment( pSoldier, FORTIFICATION, bParam, 0, 0 ); + SetSoldierAssignment( pSoldier, bAssignment, bParam, 0, 0 ); fItWorked = TRUE; } break; + + case CONCEALED: + case GATHERINTEL: + if ( CanCharacterSpyAssignment( pSoldier ) ) + { + pSoldier->bOldAssignment = pSoldier->bAssignment; + SetSoldierAssignment( pSoldier, bAssignment, bParam, 0, 0 ); + fItWorked = TRUE; + } + break; + case( SQUAD_1 ): case( SQUAD_2 ): case( SQUAD_3 ): @@ -18022,11 +18491,12 @@ BOOLEAN CanCharacterRepairAnotherSoldiersStuff( SOLDIERTYPE *pSoldier, SOLDIERTY } if ( ( pOtherSoldier->bAssignment == IN_TRANSIT ) || - ( pOtherSoldier->bAssignment == ASSIGNMENT_POW ) || - ( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) || - ( AM_A_ROBOT( pSoldier ) ) || - ( pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__EPC ) || - ( pOtherSoldier->bAssignment == ASSIGNMENT_DEAD ) ) + ( pOtherSoldier->bAssignment == ASSIGNMENT_POW ) || + ( SPY_LOCATION( pOtherSoldier->bAssignment ) ) || + ( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) || + ( AM_A_ROBOT( pSoldier ) ) || + ( pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__EPC ) || + ( pOtherSoldier->bAssignment == ASSIGNMENT_DEAD ) ) { return( FALSE ); } @@ -18909,6 +19379,10 @@ BOOLEAN CanCharacterTrainWorkers( SOLDIERTYPE *pSoldier ) if ( !gGameExternalOptions.fMineRequiresWorkers ) return FALSE; + // Flugente: we can't perform most assignments while concealed + if ( SPY_LOCATION( pSoldier->bAssignment ) ) + return( FALSE ); + if( NumEnemiesInAnySector( pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ ) ) { return( FALSE ); @@ -19920,6 +20394,10 @@ BOOLEAN CanCharacterFacility( SOLDIERTYPE *pSoldier, UINT8 ubFacilityType, UINT8 return( FALSE ); } + // Flugente: we can't perform most assignments while concealed + if ( SPY_LOCATION( pSoldier->bAssignment ) ) + return( FALSE ); + if( NumEnemiesInAnySector( pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ ) ) { return( FALSE ); @@ -21958,13 +22436,6 @@ BOOLEAN MercStaffsMilitaryHQ() - - - - - - - // Flugente: disease menu BOOLEAN DisplayDiseaseMenu( SOLDIERTYPE *pSoldier ) { @@ -21998,7 +22469,6 @@ BOOLEAN DisplayDiseaseMenu( SOLDIERTYPE *pSoldier ) return TRUE; } - void HandleShadingOfLinesForDiseaseMenu( void ) { INT32 iVehicleIndex = 0; @@ -22203,4 +22673,238 @@ void DiseaseMenuMvtCallback( MOUSE_REGION * pRegion, INT32 iReason ) // unhighlight all strings in box UnHighLightBox( ghDiseaseBox ); } -} \ No newline at end of file +} + +// Flugente: spy menu +BOOLEAN DisplaySpyMenu( SOLDIERTYPE *pSoldier ) +{ + INT32 hStringHandle = 0; + INT32 iCount = 0; + + // first, clear pop up box + RemoveBox( ghSpyBox ); + ghSpyBox = -1; + + CreateSpyBox(); + SetCurrentBox( ghSpyBox ); + + AddMonoString( (UINT32 *)&hStringHandle, szSpyText[TEXT_SPY_CONCEAL] ); + AddMonoString( (UINT32 *)&hStringHandle, szSpyText[TEXT_SPY_GETINTEL] ); + + // cancel + AddMonoString( (UINT32 *)&hStringHandle, szDiseaseText[TEXT_DISEASE_CANCEL] ); + + SetBoxFont( ghSpyBox, MAP_SCREEN_FONT ); + SetBoxHighLight( ghSpyBox, FONT_WHITE ); + SetBoxShade( ghSpyBox, FONT_GRAY7 ); + SetBoxForeground( ghSpyBox, FONT_LTGREEN ); + SetBoxBackground( ghSpyBox, FONT_BLACK ); + + // resize box to text + ResizeBoxToText( ghSpyBox ); + + CheckAndUpdateTacticalAssignmentPopUpPositions(); + + return TRUE; +} + +void HandleShadingOfLinesForSpyMenu( void ) +{ + if ( ( fShowSpyMenu == FALSE ) || ( ghSpyBox == -1 ) ) + return; + + SOLDIERTYPE* pSoldier = GetSelectedAssignSoldier( FALSE ); + + if ( !pSoldier ) + return; + + if ( pSoldier->CanUseSkill( SKILLS_INTEL_CONCEAL, FALSE) ) + UnShadeStringInBox( ghSpyBox, INTEL_MENU_CONCEAL ); + else + ShadeStringInBox( ghSpyBox, INTEL_MENU_CONCEAL ); + + if ( pSoldier->CanUseSkill( SKILLS_INTEL_GATHERINTEL, FALSE ) ) + UnShadeStringInBox( ghSpyBox, INTEL_MENU_GETINTEL ); + else + ShadeStringInBox( ghSpyBox, INTEL_MENU_GETINTEL ); +} + + +void CreateDestroyMouseRegionForSpyMenu( void ) +{ + static BOOLEAN fCreated = FALSE; + + UINT32 uiCounter = 0; + INT32 iCount = 0; + INT32 iFontHeight = 0; + INT32 iBoxXPosition = 0; + INT32 iBoxYPosition = 0; + SGPPoint pPosition; + INT32 iBoxWidth = 0; + SGPRect pDimensions; + SOLDIERTYPE *pSoldier = NULL; + + if ( fShowSpyMenu && !fCreated ) + { + // grab height of font + iFontHeight = GetLineSpace( ghSpyBox ) + GetFontHeight( GetBoxFont( ghSpyBox ) ); + + // get x.y position of box + GetBoxPosition( ghSpyBox, &pPosition ); + + // grab box x and y position + iBoxXPosition = pPosition.iX; + iBoxYPosition = pPosition.iY; + + // get dimensions..mostly for width + GetBoxSize( ghSpyBox, &pDimensions ); + + // get width + iBoxWidth = pDimensions.iRight; + + SetCurrentBox( ghSpyBox ); + + pSoldier = GetSelectedAssignSoldier( FALSE ); + + // conceal assignment + MSYS_DefineRegion( &gSpy[iCount], (INT16)( iBoxXPosition ), (INT16)( iBoxYPosition + GetTopMarginSize( ghAssignmentBox ) + (iFontHeight)* iCount ), (INT16)( iBoxXPosition + iBoxWidth ), (INT16)( iBoxYPosition + GetTopMarginSize( ghAssignmentBox ) + ( iFontHeight )* ( iCount + 1 ) ), MSYS_PRIORITY_HIGHEST - 4, + MSYS_NO_CURSOR, SpyMenuMvtCallback, SpyMenuBtnCallback ); + + MSYS_SetRegionUserData( &gSpy[iCount], 0, iCount ); + MSYS_SetRegionUserData( &gSpy[iCount], 1, INTEL_MENU_CONCEAL ); + ++iCount; + + // get intel assignment + MSYS_DefineRegion( &gSpy[iCount], (INT16)( iBoxXPosition ), (INT16)( iBoxYPosition + GetTopMarginSize( ghAssignmentBox ) + (iFontHeight)* iCount ), (INT16)( iBoxXPosition + iBoxWidth ), (INT16)( iBoxYPosition + GetTopMarginSize( ghAssignmentBox ) + ( iFontHeight )* ( iCount + 1 ) ), MSYS_PRIORITY_HIGHEST - 4, + MSYS_NO_CURSOR, SpyMenuMvtCallback, SpyMenuBtnCallback ); + + MSYS_SetRegionUserData( &gSpy[iCount], 0, iCount ); + MSYS_SetRegionUserData( &gSpy[iCount], 1, INTEL_MENU_GETINTEL ); + ++iCount; + + // cancel + MSYS_DefineRegion( &gSpy[iCount], (INT16)( iBoxXPosition ), (INT16)( iBoxYPosition + GetTopMarginSize( ghAssignmentBox ) + (iFontHeight)* iCount ), (INT16)( iBoxXPosition + iBoxWidth ), (INT16)( iBoxYPosition + GetTopMarginSize( ghAssignmentBox ) + ( iFontHeight )* ( iCount + 1 ) ), MSYS_PRIORITY_HIGHEST - 4, + MSYS_NO_CURSOR, SpyMenuMvtCallback, SpyMenuBtnCallback ); + + MSYS_SetRegionUserData( &gSpy[iCount], 0, iCount ); + MSYS_SetRegionUserData( &gSpy[iCount], 1, INTEL_MENU_CANCEL ); + + PauseGame(); + + // unhighlight all strings in box + UnHighLightBox( ghSpyBox ); + + fCreated = TRUE; + } + else if ( ( !fShowSpyMenu || !fShowAssignmentMenu ) && fCreated ) + { + fCreated = FALSE; + + // remove these regions + for ( uiCounter = 0; uiCounter < GetNumberOfLinesOfTextInBox( ghSpyBox ); ++uiCounter ) + { + MSYS_RemoveRegion( &gSpy[uiCounter] ); + } + + fShowSpyMenu = FALSE; + + SetRenderFlags( RENDER_FLAG_FULL ); + + HideBox( ghSpyBox ); + + fMapPanelDirty = TRUE; + + if ( fShowAssignmentMenu ) + { + // remove highlight on the parent menu + UnHighLightBox( ghAssignmentBox ); + } + } +} + +void SpyMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason ) +{ + INT32 iValue = MSYS_GetRegionUserData( pRegion, 0 ); + + // ignore clicks on disabled lines + if ( GetBoxShadeFlag( ghSpyBox, iValue ) ) + return; + + // WHAT is being repaired is stored in the second user data argument + INT32 iWhat = MSYS_GetRegionUserData( pRegion, 1 ); + + SOLDIERTYPE* pSoldier = GetSelectedAssignSoldier( FALSE ); + + if ( pSoldier && pSoldier->bActive && ( iReason & MSYS_CALLBACK_REASON_LBUTTON_UP ) ) + { + if ( iWhat < INTEL_MENU_CANCEL ) + { + pSoldier->bOldAssignment = pSoldier->bAssignment; + + INT8 newassignment = CONCEALED + iWhat; + + if ( pSoldier->bAssignment != newassignment ) + { + SetTimeOfAssignmentChangeForMerc( pSoldier ); + } + + if ( pSoldier->bOldAssignment == VEHICLE ) + { + TakeSoldierOutOfVehicle( pSoldier ); + } + + // remove from squad + //RemoveCharacterFromSquads( pSoldier ); + + ChangeSoldiersAssignment( pSoldier, newassignment ); + + // assign to a movement group + //AssignMercToAMovementGroup( pSoldier ); + + // set assignment for group + SetAssignmentForList( (INT8)newassignment, 0 ); + fShowAssignmentMenu = FALSE; + } + else + { + // CANCEL + fShowSpyMenu = FALSE; + } + + // update mapscreen + fCharacterInfoPanelDirty = TRUE; + fTeamPanelDirty = TRUE; + fMapScreenBottomDirty = TRUE; + + giAssignHighLine = -1; + } +} + + +void SpyMenuMvtCallback( MOUSE_REGION * pRegion, INT32 iReason ) +{ + // mvt callback handler for assignment region + INT32 iValue = MSYS_GetRegionUserData( pRegion, 0 ); + + if ( iReason & MSYS_CALLBACK_REASON_GAIN_MOUSE ) + { + if ( iValue < INTEL_MENU_CANCEL ) + { + if ( GetBoxShadeFlag( ghSpyBox, iValue ) == FALSE ) + { + // highlight choice + HighLightBoxLine( ghSpyBox, iValue ); + } + } + else + { + // highlight cancel line + HighLightBoxLine( ghSpyBox, GetNumberOfLinesOfTextInBox( ghSpyBox ) - 1 ); + } + } + else if ( iReason & MSYS_CALLBACK_REASON_LOST_MOUSE ) + { + // unhighlight all strings in box + UnHighLightBox( ghSpyBox ); + } +} diff --git a/Strategic/Assignments.h b/Strategic/Assignments.h index 9c8edcec..15301d66 100644 --- a/Strategic/Assignments.h +++ b/Strategic/Assignments.h @@ -92,6 +92,8 @@ enum FACILITY_REPAIR, FORTIFICATION, // Flugente: sectors can be fortified according to external layout plans TRAIN_WORKERS, + CONCEALED, // Flugente: spy hides among the population + GATHERINTEL, // gathers information while disguised in enemy territory NUM_ASSIGNMENTS, }; @@ -107,6 +109,8 @@ enum #define IS_REPAIR(assignment) ((assignment == REPAIR) || (assignment == FACILITY_REPAIR)) #define CASE_REPAIR case REPAIR: case FACILITY_REPAIR +#define SPY_LOCATION(assignment) ((assignment == CONCEALED) || (assignment == GATHERINTEL) ) + // strings for snitch exposition enum { @@ -176,6 +180,8 @@ BOOLEAN CanCharacterTreatSectorDisease( SOLDIERTYPE *pSoldier ); BOOLEAN CanCharacterFortify( SOLDIERTYPE *pSoldier ); +BOOLEAN CanCharacterSpyAssignment( SOLDIERTYPE *pSoldier ); + // can this character be assigned as a repairman? BOOLEAN CanCharacterRepair( SOLDIERTYPE *pCharacter ); @@ -280,19 +286,12 @@ FLOAT GetBestSAMOperatorCTH_Player( INT16 sSectorX, INT16 sSectorY, INT16 sSecto INT16 GetTrainWorkerPts(SOLDIERTYPE *pSoldier); -// Flugente: via various means, the player can get info on the enemy - this can be enemy positions, movement, or the position of important targets -enum -{ - INFO_TYPE_NORMAL, - INFO_TYPE_VIP, - - INFO_TYPE_MAX, -}; - -// this function gives a random bit of information to the player. The type of info depends on aInfoType. -// If higher-order info cannot be given (for example if all info is already known to the player), lower-order info wil be given instead -// returns TRUE if info was given, FALSE if not -BOOLEAN GiveInfoToPlayer( UINT8 aInfoType ); +// Flugente: intel shenanigans +void BuildIntelInfoArray(); +void CalcIntelInfoOfferings(); +void GetIntelInfoOfferings( int aInfo[] ); +void GetIntelInfoTextAndPrice( int aInfoNumber, STR16 aString, int& arIntelCost ); +void BuyIntelInfo( int aInfoNumber ); // get bonus tarining pts due to an instructor for this student // HEADROCK HAM 3.5: Three functions below have lost an argument which is no longer required ("uiAtGunRange", which was "uiAtFacility" in HAM 3.4) @@ -319,6 +318,7 @@ extern INT32 ghRepairBox; extern INT32 ghTrainingBox; extern INT32 ghMoveItemBox; extern INT32 ghDiseaseBox; +extern INT32 ghSpyBox; extern INT32 ghAttributeBox; extern INT32 ghRemoveMercAssignBox; extern INT32 ghContractBox; @@ -354,6 +354,7 @@ extern BOOLEAN fShownAssignmentMenu; extern BOOLEAN fShowRepairMenu; extern BOOLEAN fShowMoveItemMenu; extern BOOLEAN fShowDiseaseMenu; +extern BOOLEAN fShowSpyMenu; extern BOOLEAN fFirstClickInAssignmentScreenMask; @@ -401,6 +402,11 @@ void CreateDestroyMouseRegionForDiseaseMenu( void ); void DiseaseMenuMvtCallback( MOUSE_REGION * pRegion, INT32 iReason ); void DiseaseMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason ); +// Flugente: spy menu +void CreateDestroyMouseRegionForSpyMenu( void ); +void SpyMenuMvtCallback( MOUSE_REGION * pRegion, INT32 iReason ); +void SpyMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason ); + // HEADROCK HAM 3.6: Facility Menu void CreateDestroyMouseRegionForFacilityMenu( void ); void FacilityMenuMvtCallback(MOUSE_REGION * pRegion, INT32 iReason ); diff --git a/Strategic/Auto Resolve.cpp b/Strategic/Auto Resolve.cpp index 269ada5d..89904183 100644 --- a/Strategic/Auto Resolve.cpp +++ b/Strategic/Auto Resolve.cpp @@ -621,7 +621,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Autoresolve1"); gpAR->uiPreRandomIndex = guiPreRandomIndex; //Determine who gets the defensive advantage - switch( gubEnemyEncounterCode ) + switch( GetEnemyEncounterCode() ) { case ENEMY_ENCOUNTER_CODE: gpAR->ubPlayerDefenceAdvantage = 21; //Skewed to the player's advantage for convenience purposes. @@ -635,7 +635,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Autoresolve1"); default: //shouldn't happen #ifdef JA2BETAVERSION - ScreenMsg( FONT_RED, MSG_ERROR, L"Autoresolving with entering enemy sector code %d -- illegal KM:1", gubEnemyEncounterCode ); + ScreenMsg( FONT_RED, MSG_ERROR, L"Autoresolving with entering enemy sector code %d -- illegal KM:1", GetEnemyEncounterCode() ); #endif break; } @@ -750,7 +750,7 @@ void AssociateEnemiesWithStrategicGroups() UINT8 ubDirAmount; UINT8 ubCurrSI; - if( gubEnemyEncounterCode == CREATURE_ATTACK_CODE ) + if( GetEnemyEncounterCode() == CREATURE_ATTACK_CODE ) return; pSector = &SectorInfo[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ]; @@ -1100,7 +1100,7 @@ void CalculateSoldierCells( BOOLEAN fReset ) gpEnemies[ index ].xp = (UINT16)(gpAR->sCenterStartX + 141 + 55*x); gpEnemies[ index ].yp = iStartY + y*47; - if( gubEnemyEncounterCode != CREATURE_ATTACK_CODE ) + if( GetEnemyEncounterCode() != CREATURE_ATTACK_CODE ) { if ( index < gpAR->ubElites ) gpEnemies[ index ].uiFlags = CELL_ELITE; @@ -1671,7 +1671,7 @@ void RenderAutoResolve() SetFontForeground( FONT_WHITE ); SetFontShadow( FONT_NEARBLACK ); - switch( gubEnemyEncounterCode ) + switch( GetEnemyEncounterCode() ) { case NO_ENCOUNTER_CODE: swprintf( str, gpStrategicString[STR_AR_ATTACK_HEADER] ); @@ -1807,7 +1807,7 @@ void RenderAutoResolve() case BATTLE_DEFEAT: HandleMoraleEvent( NULL, MORALE_HEARD_BATTLE_LOST, gpAR->ubSectorX, gpAR->ubSectorY, 0 ); if( ProcessLoyalty() )HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_BATTLE_LOST, gpAR->ubSectorX, gpAR->ubSectorY, 0 ); - if( gubEnemyEncounterCode != CREATURE_ATTACK_CODE ) + if( GetEnemyEncounterCode() != CREATURE_ATTACK_CODE ) { gsEnemyGainedControlOfSectorID = (INT16)SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ); } @@ -1833,7 +1833,7 @@ void RenderAutoResolve() gpAR->uiTotalElapsedBattleTimeInMilliseconds += 300000; if( ProcessLoyalty() )HandleLoyaltyImplicationsOfMercRetreat( RETREAT_AUTORESOLVE, gpAR->ubSectorX, gpAR->ubSectorY, 0 ); - if( gubEnemyEncounterCode != CREATURE_ATTACK_CODE ) + if( GetEnemyEncounterCode() != CREATURE_ATTACK_CODE ) { gsEnemyGainedControlOfSectorID = (INT16)SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ); } @@ -2148,7 +2148,7 @@ void CreateAutoResolveInterface() ARCreateMilitiaSquad( &cnt, ubEliteMilitia, ubRegMilitia, ubGreenMilitia, sX, sY ); } - if( gubEnemyEncounterCode != CREATURE_ATTACK_CODE ) + if( GetEnemyEncounterCode() != CREATURE_ATTACK_CODE ) { for( i = 0, index = 0; i < gpAR->ubElites; ++i, ++index ) { @@ -2620,7 +2620,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Autoresolve2"); gpBattleGroup = NULL; - if( gubEnemyEncounterCode == CREATURE_ATTACK_CODE ) + if( GetEnemyEncounterCode() == CREATURE_ATTACK_CODE ) { gubNumCreaturesAttackingTown = 0; gubSectorIDOfCreatureAttack = 0; @@ -2919,7 +2919,7 @@ void CalculateAutoResolveInfo() Assert( gpAR->ubSectorX >= 1 && gpAR->ubSectorX <= 16 ); Assert( gpAR->ubSectorY >= 1 && gpAR->ubSectorY <= 16 ); - if( gubEnemyEncounterCode != CREATURE_ATTACK_CODE ) + if( GetEnemyEncounterCode() != CREATURE_ATTACK_CODE ) { // GetNumberOfEnemiesInSector( gpAR->ubSectorX, gpAR->ubSectorY, GetNumberOfEnemiesInFiveSectors( gpAR->ubSectorX, gpAR->ubSectorY, @@ -5190,7 +5190,7 @@ BOOLEAN IsBattleOver() { if( gpEnemies[ i ].pSoldier->stats.bLife ) { - if( gubEnemyEncounterCode != CREATURE_ATTACK_CODE ) + if( GetEnemyEncounterCode() != CREATURE_ATTACK_CODE ) { gpEnemies[ i ].pSoldier->DoMercBattleSound( BATTLE_SOUND_LAUGH1 ); } @@ -5477,7 +5477,7 @@ void ProcessBattleFrame() return; } CONTINUE_BATTLE: - if( IsBattleOver() || gubEnemyEncounterCode != CREATURE_ATTACK_CODE && AttemptPlayerCapture() ) + if( IsBattleOver() || GetEnemyEncounterCode() != CREATURE_ATTACK_CODE && AttemptPlayerCapture() ) return; iRandom = PreRandom( iTotal ); diff --git a/Strategic/Campaign Types.h b/Strategic/Campaign Types.h index 115900a1..46f2c8f2 100644 --- a/Strategic/Campaign Types.h +++ b/Strategic/Campaign Types.h @@ -95,9 +95,11 @@ enum //strategic values for each sector #define SF_HAVE_SAID_PLAYER_QUOTE_NEW_SECTOR 0x00001000 #endif -#define SF_ASSIGN_NOTICED_ENEMIES_HERE 0x00002000 // Flugente: info from assigment: enemies were found -#define SF_ASSIGN_NOTICED_ENEMIES_KNOW_NUMBER 0x00004000 // Flugente: info from assigment: enemies were found, and we know their number -#define SF_ASSIGN_NOTICED_ENEMIES_KNOW_DIRECTION 0x00008000 // Flugente: info from assigment: enemies were found, and we know the direction they are moving in +#define SF_ASSIGN_NOTICED_ENEMIES_HERE 0x00002000 // Flugente: flag deleted after 1 hour, info from assigment: enemies were found +#define SF_ASSIGN_NOTICED_ENEMIES_KNOW_NUMBER 0x00004000 // Flugente: flag deleted after 1 hour, info from assigment: enemies were found, and we know their number + +#define SF_ASSIGN_PERMAINFO_ENEMIES_HERE 0x00008000 // Flugente: permanent flag, info from buying info: enemies were found +#define SF_ASSIGN_PERMAINFO_ENEMIES_KNOW_NUMBER 0x00010000 // Flugente: permanent flag, info from buying info: enemies were found, and we know their number #define SF_SMOKE_EFFECTS_TEMP_FILE_EXISTS 0x00100000 //Temp File starts with sm_ #define SF_LIGHTING_EFFECTS_TEMP_FILE_EXISTS 0x00200000 //Temp File starts with l_ diff --git a/Strategic/Game Event Hook.cpp b/Strategic/Game Event Hook.cpp index f598dde4..e6fff5a6 100644 --- a/Strategic/Game Event Hook.cpp +++ b/Strategic/Game Event Hook.cpp @@ -49,6 +49,7 @@ #include "finances.h" // added by Flugente #include "ASD.h" // added by Flugente #include "Player Command.h" // added by Flugente + #include "LuaInitNPCs.h" // added by Flugente #endif #include "connect.h" @@ -502,9 +503,7 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent ) // No PCM in UB #else case EVENT_PMC_EMAIL: - // only send the email if we hven't already visited the site, otherwise continue to spam ;-) - if ( !IsBookMarkSet(PMC_BOOKMARK) ) - AddEmail( PMC_INTRO, PMC_INTRO_LENGTH, PMC, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT ); + AddEmail( PMC_INTRO, PMC_INTRO_LENGTH, PMC, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT ); break; #endif @@ -613,9 +612,7 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent ) // No Kingpin Events in UB #else case EVENT_MILITIAROSTER_EMAIL: - // only send the email if we haven't already visited the site, otherwise continue to spam ;-) - if ( !IsBookMarkSet( MILITIAROSTER_BOOKMARK ) ) - AddEmail( MILITIAROSTER_INTRO, MILITIAROSTER_INTRO_LENGTH, MAIL_ENRICO, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT ); + AddEmail( MILITIAROSTER_INTRO, MILITIAROSTER_INTRO_LENGTH, MAIL_ENRICO, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT ); break; #endif @@ -639,6 +636,14 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent ) case EVENT_WEATHER_SNOW: ChangeWeather( (UINT8)pEvent->uiParam, WEATHER_FORECAST_SNOW ); break; + + case EVENT_INTEL_ENRICO_EMAIL: + AddEmail( INTEL_ENRICO_INTRO, INTEL_ENRICO_INTRO_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT ); + break; + + case EVENT_INTEL_PHOTOFACT_VERIFY: + LuaVerifyPhotoState( (INT16)pEvent->uiParam ); + break; } gfPreventDeletionOfAnyEvent = fOrigPreventFlag; return TRUE; diff --git a/Strategic/Game Event Hook.h b/Strategic/Game Event Hook.h index c94d7bbf..6fa8c7a3 100644 --- a/Strategic/Game Event Hook.h +++ b/Strategic/Game Event Hook.h @@ -140,6 +140,9 @@ enum EVENT_WEATHER_SANDSTORM, EVENT_WEATHER_SNOW, + EVENT_INTEL_ENRICO_EMAIL, // Flugente: Enrico sends us an email introduction to intel + EVENT_INTEL_PHOTOFACT_VERIFY, // verification of a photo fact + NUMBER_OF_EVENT_TYPES_PLUS_ONE, NUMBER_OF_EVENT_TYPES = NUMBER_OF_EVENT_TYPES_PLUS_ONE - 1 }; diff --git a/Strategic/Hourly Update.cpp b/Strategic/Hourly Update.cpp index 000ffbae..85cfd333 100644 --- a/Strategic/Hourly Update.cpp +++ b/Strategic/Hourly Update.cpp @@ -661,7 +661,7 @@ void HourlyStealUpdate() pSoldier = MercPtrs[ cnt ]; // merc must be alive, not travelling and awake. If he is in the currently loaded sector, we may not be in tactical (we would see an item suddenly disappearing) and not in combat - if ( pSoldier && !pSoldier->flags.fBetweenSectors && pSoldier->bActive && !pSoldier->flags.fMercAsleep && pSoldier->bAssignment != IN_TRANSIT && pSoldier->bAssignment != ASSIGNMENT_POW && + if ( pSoldier && !pSoldier->flags.fBetweenSectors && pSoldier->bActive && !pSoldier->flags.fMercAsleep && pSoldier->bAssignment != IN_TRANSIT && pSoldier->bAssignment != ASSIGNMENT_POW && !SPY_LOCATION( pSoldier->bAssignment ) && !( ( ( gWorldSectorX == pSoldier->sSectorX ) && ( gWorldSectorY == pSoldier->sSectorY ) && (gbWorldSectorZ == pSoldier->bSectorZ ) ) && (gTacticalStatus.fEnemyInSector || guiCurrentScreen == GAME_SCREEN )) ) { if ( pSoldier->HasBackgroundFlag( BACKGROUND_SCROUNGING ) ) @@ -675,7 +675,7 @@ void HourlyStealUpdate() { pOtherSoldier = MercPtrs[ cnt2 ]; // note - snitches stop others, but can scrounge themselves (if they have scrounging specifically set in background...) - if( pOtherSoldier && !pOtherSoldier->flags.fBetweenSectors && pOtherSoldier->bAssignment != IN_TRANSIT && pOtherSoldier->bAssignment != ASSIGNMENT_POW && + if( pOtherSoldier && !pOtherSoldier->flags.fBetweenSectors && pOtherSoldier->bAssignment != IN_TRANSIT && pOtherSoldier->bAssignment != ASSIGNMENT_POW && SPY_LOCATION( pOtherSoldier->bAssignment ) && pOtherSoldier->bActive && !pOtherSoldier->flags.fMercAsleep && pSoldier->ubProfile != pOtherSoldier->ubProfile ) { if ( ProfileHasSkillTrait( pOtherSoldier->ubProfile, SNITCH_NT ) && !( pSoldier->usSoldierFlagMask2 & SOLDIER_PREVENT_MISBEHAVIOUR_OFF ) ) diff --git a/Strategic/LuaInitNPCs.cpp b/Strategic/LuaInitNPCs.cpp index 8b481739..03398e63 100644 --- a/Strategic/LuaInitNPCs.cpp +++ b/Strategic/LuaInitNPCs.cpp @@ -842,7 +842,7 @@ static int l_ProfilesStrategicInsertionData (lua_State *L); static int l_ResetBoxers( lua_State *L ); static int l_AddVolunteers( lua_State *L ); -static int l_AddInfo( lua_State *L ); +static int l_AddIntel( lua_State *L ); static int l_CreateArmedCivilain( lua_State *L ); static int l_CreateCivilian( lua_State *L ); @@ -871,6 +871,10 @@ static int l_SoldierSpendMoney( lua_State *L ); static int l_SetAdditionalDialogue( lua_State *L ); static int l_PlaySound( lua_State *L ); +static int l_AddArmsDealerAdditionalIntelDataItem( lua_State *L ); + +static int l_SetPhotoFactLaptopData( lua_State *L ); +static int l_GetNumHostilesInSector( lua_State *L ); using namespace std; @@ -1721,7 +1725,7 @@ void IniFunction(lua_State *L, BOOLEAN bQuests ) lua_register(L,"StartDialogueMessageBox", l_StartDialogueMessageBox); lua_register( L, "AddVolunteers", l_AddVolunteers ); - lua_register( L, "AddInfo", l_AddInfo ); + lua_register( L, "AddIntel", l_AddIntel ); lua_register(L, "CreateArmedCivilain", l_CreateArmedCivilain ); lua_register( L, "CreateCivilian", l_CreateCivilian ); @@ -1750,6 +1754,10 @@ void IniFunction(lua_State *L, BOOLEAN bQuests ) lua_register( L, "SetAdditionalDialogue", l_SetAdditionalDialogue ); lua_register( L, "PlaySound", l_PlaySound ); + lua_register( L, "AddArmsDealerAdditionalIntelDataItem", l_AddArmsDealerAdditionalIntelDataItem ); + + lua_register( L, "SetPhotoFactLaptopData", l_SetPhotoFactLaptopData ); + lua_register( L, "GetNumHostilesInSector", l_GetNumHostilesInSector ); } #ifdef NEWMUSIC BOOLEAN LetLuaMusicControl(UINT8 Init) @@ -3620,15 +3628,13 @@ return 1; static int l_CurrentPlayerProgressPercentage(lua_State *L) { -UINT8 n = lua_gettop(L); - -UINT8 val; - - val = CurrentPlayerProgressPercentage( ); + UINT8 n = lua_gettop(L); + + UINT8 val = CurrentPlayerProgressPercentage( ); lua_pushinteger(L, val); -return 1; + return 1; } static int l_SetgMercProfilesbTown(lua_State *L) @@ -13054,13 +13060,13 @@ static int l_AddVolunteers( lua_State *L ) } // add info -static int l_AddInfo( lua_State *L ) +static int l_AddIntel( lua_State *L ) { if ( lua_gettop( L ) ) { - UINT8 infotype = lua_tointeger( L, 1 ); + int intel = lua_tointeger( L, 1 ); - GiveInfoToPlayer( infotype ); + AddIntel( intel, TRUE ); } return 0; @@ -13432,3 +13438,129 @@ void LuaHandleAdditionalDialogue( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, LuaFunction( _LS.L, "HandleAdditionalDialogue" ).Param( sSectorX ).Param( sSectorY ).Param( bSectorZ ).Param( ubProfile ).Param( iFaceIndex ).Param( usEventNr ).Param( aData1 ).Param( aData2 ).Param( aData3 ).Call( 9 ); } + +void LuaAddArmsDealerAdditionalIntelData() +{ + const char* filename = "scripts\\Overhead.lua"; + + LuaScopeState _LS( true ); + + IniFunction( _LS.L(), TRUE ); + IniGlobalGameSetting( _LS.L() ); + + SGP_THROW_IFFALSE( _LS.L.EvalFile( filename ), _BS( "Cannot open file: " ) << filename << _BS::cget ); + + LuaFunction( _LS.L, "AddArmsDealerAdditionalIntelData" ).Call( 0 ); +} + +extern void AddArmsDealerAdditionalIntelData( UINT16 ausDealer, UINT16 usItem, INT16 sIntelPrice, INT16 sOptimalNumber ); + +static int l_AddArmsDealerAdditionalIntelDataItem( lua_State *L ) +{ + if ( lua_gettop( L ) >= 4 ) + { + UINT16 usDealer = lua_tointeger( L, 1 ); + UINT16 usItem = lua_tointeger( L, 2 ); + INT16 sIntelPrice = lua_tointeger( L, 3 ); + INT16 sOptimalNumber = lua_tointeger( L, 4 ); + + AddArmsDealerAdditionalIntelData( usDealer, usItem, sIntelPrice, sOptimalNumber ); + } + + return 0; +} + +void LuaAddPhotoData( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, INT32 sGridNo, INT8 bLevel, UINT8 ubPhotographerProfile, UINT16 room, UINT8 usTargetProfile ) +{ + const char* filename = "scripts\\Overhead.lua"; + + LuaScopeState _LS( true ); + + IniFunction( _LS.L(), TRUE ); + IniGlobalGameSetting( _LS.L() ); + + SGP_THROW_IFFALSE( _LS.L.EvalFile( filename ), _BS( "Cannot open file: " ) << filename << _BS::cget ); + + LuaFunction( _LS.L, "AddPhotoData" ).Param( sSectorX ).Param( sSectorY ).Param( bSectorZ ).Param( sGridNo ).Param( bLevel ).Param( ubPhotographerProfile ).Param( room ).Param( usTargetProfile ).Call( 6 ); +} + +void LuaGetPhotoData( UINT8 aType ) +{ + const char* filename = "scripts\\Overhead.lua"; + + LuaScopeState _LS( true ); + + IniFunction( _LS.L(), TRUE ); + IniGlobalGameSetting( _LS.L() ); + + SGP_THROW_IFFALSE( _LS.L.EvalFile( filename ), _BS( "Cannot open file: " ) << filename << _BS::cget ); + + LuaFunction( _LS.L, "GetPhotoData" ).Param( aType ).Call( 1 ); +} + +void LuaSetPhotoState( INT16 asIndex, UINT8 aState ) +{ + const char* filename = "scripts\\Overhead.lua"; + + LuaScopeState _LS( true ); + + IniFunction( _LS.L(), TRUE ); + IniGlobalGameSetting( _LS.L() ); + + SGP_THROW_IFFALSE( _LS.L.EvalFile( filename ), _BS( "Cannot open file: " ) << filename << _BS::cget ); + + LuaFunction( _LS.L, "SetPhotoState" ).Param( asIndex ).Param( aState ).Call( 2 ); +} + +void LuaVerifyPhotoState( INT16 asIndex ) +{ + const char* filename = "scripts\\Overhead.lua"; + + LuaScopeState _LS( true ); + + IniFunction( _LS.L(), TRUE ); + IniGlobalGameSetting( _LS.L() ); + + SGP_THROW_IFFALSE( _LS.L.EvalFile( filename ), _BS( "Cannot open file: " ) << filename << _BS::cget ); + + LuaFunction( _LS.L, "VerifyPhotoState" ).Param( asIndex ).Call( 1 ); +} + +extern void AddPhotoFactTaken( UINT8 aType, INT16 asIndex, STR16 aText ); + +static int l_SetPhotoFactLaptopData( lua_State *L ) +{ + if ( lua_gettop( L ) >= 3 ) + { + UINT8 type = lua_tointeger( L, 1 ); + INT16 sIndex = lua_tointeger( L, 2 ); + + size_t len = 0; + const char* str = lua_tolstring( L, 3, &len ); + + CHAR16 w_str[1000]; + + MultiByteToWideChar( CP_UTF8, 0, str, -1, w_str, sizeof( w_str ) / sizeof( w_str[0] ) ); + w_str[sizeof( w_str ) / sizeof( w_str[0] ) - 1] = '\0'; + + AddPhotoFactTaken( type, sIndex, w_str ); + } + + return 0; +} + +extern UINT8 NumHostilesInSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ ); + +static int l_GetNumHostilesInSector( lua_State *L ) +{ + if ( lua_gettop( L ) >= 3 ) + { + INT16 sSectorX = lua_tointeger( L, 1 ); + INT16 sSectorY = lua_tointeger( L, 2 ); + INT16 sSectorZ = lua_tointeger( L, 3 ); + + lua_pushinteger( L, NumHostilesInSector( sSectorX, sSectorY, sSectorZ ) ); + } + + return 1; +} diff --git a/Strategic/LuaInitNPCs.h b/Strategic/LuaInitNPCs.h index b7fa1851..780e7639 100644 --- a/Strategic/LuaInitNPCs.h +++ b/Strategic/LuaInitNPCs.h @@ -93,4 +93,9 @@ extern BOOLEAN LuaIDScripts(UINT8 Init, UINT8 ubTargetNPC, UINT16 usActionCode, extern BOOLEAN LetLuaMusicControl(UINT8 Init); void LuaHandleAdditionalDialogue( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, UINT8 ubProfile, INT32 iFaceIndex, UINT16 usEventNr, UINT32 aData1, UINT32 aData2, UINT32 aData3 ); +void LuaAddArmsDealerAdditionalIntelData(); +void LuaAddPhotoData( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, INT32 sGridNo, INT8 bLevel, UINT8 ubPhotographerProfile, UINT16 room, UINT8 usTargetProfile ); +void LuaGetPhotoData( UINT8 aType ); +void LuaSetPhotoState( INT16 asIndex, UINT8 aState ); +void LuaVerifyPhotoState( INT16 asIndex ); #endif diff --git a/Strategic/Map Screen Interface Map.cpp b/Strategic/Map Screen Interface Map.cpp index ece282ac..5f1cf7f2 100644 --- a/Strategic/Map Screen Interface Map.cpp +++ b/Strategic/Map Screen Interface Map.cpp @@ -1222,10 +1222,11 @@ INT32 ShowAssignedTeam(INT16 sMapX, INT16 sMapY, INT32 iCount) // given number of on duty members, find number of assigned chars // start at beginning of list, look for people who are in sector and assigned + // Flugente: concealed mercs also show up here, to give the illusion they are present if( !( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) && ( pSoldier->sSectorX == sMapX) && ( pSoldier->sSectorY == sMapY) && - ( pSoldier->bSectorZ == iCurrentMapSectorZ ) && + ( ( pSoldier->bSectorZ == iCurrentMapSectorZ ) || ( SPY_LOCATION( pSoldier->bAssignment) && ( pSoldier->bSectorZ - 10 == iCurrentMapSectorZ ) ) ) && ( pSoldier->bAssignment >= ON_DUTY ) && ( pSoldier->bAssignment != VEHICLE ) && ( pSoldier->bAssignment != IN_TRANSIT ) && ( pSoldier->bAssignment != ASSIGNMENT_POW ) && @@ -6573,15 +6574,59 @@ UINT32 WhatPlayerKnowsAboutEnemiesInSector( INT16 sSectorX, INT16 sSectorY ) // making it easier to detect or even count enemies in distant sectors. // This option can be combined with either of the two above. + // Facilities can set a flag that allows detection in some sectors. We can read flags directly from the sector + // data to know whether we should show the enemies there. This overrides ANYTHING else. + if ( SectorInfo[SECTOR( sSectorX, sSectorY )].ubDetectionLevel & 1 ) + { + fDetection = TRUE; + fDirection = TRUE; + } + + if ( SectorInfo[SECTOR( sSectorX, sSectorY )].ubDetectionLevel & ( 1 << 2 ) ) + { + fDetection = TRUE; + fCount = TRUE; + fDirection = TRUE; + } + + // Flugente: check intel sector flags + int mapregion = ( (sSectorX - 1) / 4 ) + 4 * ( (sSectorY - 1) / 4 ); + + if ( LaptopSaveInfo.usMapIntelFlags & ( 1 << mapregion ) ) + { + fDetection = TRUE; + + if ( LaptopSaveInfo.usMapIntelFlags & ( 1 << (16 + mapregion) ) ) + { + fCount = TRUE; + fDirection = TRUE; + } + } + + if ( uiSectorFlags & ( SF_ASSIGN_NOTICED_ENEMIES_HERE | SF_ASSIGN_PERMAINFO_ENEMIES_HERE ) ) + { + fDetection = TRUE; + + // we know how many there are + if ( uiSectorFlags & ( SF_ASSIGN_NOTICED_ENEMIES_KNOW_NUMBER | SF_ASSIGN_PERMAINFO_ENEMIES_KNOW_NUMBER ) ) + { + fCount = TRUE; + } + } + + // Flugente: we can buy info on enemy groups with intel + GetInfoFromGroupsInSector( sSectorX, sSectorY, ENEMY_TEAM, fDetection, fCount, fDirection ); // Detection through active recon. // Mercs provide recon in the same sector they're in. // Militia provide recon in any adjacent sector (diagonals included) // There's also a special case flag used when players encounter enemies in a sector, then retreat. You can only // see the size of their force while the clock is paused. When unpaused, the flag is reset. - if ( CanMercsScoutThisSector( sSectorX, sSectorY, 0 ) || - CanSomeoneNearbyScoutThisSector( sSectorX, sSectorY, FALSE ) || // merged militia check with scouting check - SANDRO - ( uiSectorFlags & SF_PLAYER_KNOWS_ENEMIES_ARE_HERE ) ) + // only do this check if we don't already know what's here + if ( !(fDetection && fCount) && + ( ( uiSectorFlags & (SF_PLAYER_KNOWS_ENEMIES_ARE_HERE| SF_ASSIGN_PERMAINFO_ENEMIES_HERE ) ) || + CanMercsScoutThisSector( sSectorX, sSectorY, 0 ) || + CanSomeoneNearbyScoutThisSector( sSectorX, sSectorY, FALSE ) ) )// merged militia check with scouting check - SANDRO { fDetection = TRUE; @@ -6592,34 +6637,29 @@ UINT32 WhatPlayerKnowsAboutEnemiesInSector( INT16 sSectorX, INT16 sSectorY ) fCount = TRUE; } } + // SADNRO - Scouting trait check for detection of nearby enemies - if (CanSomeoneNearbyScoutThisSector( sSectorX, sSectorY, TRUE )) // scouting trait check + if ( !( fDetection && fCount ) && gSkillTraitValues.fSCCanDetectEnemyPresenseAround && CanSomeoneNearbyScoutThisSector( sSectorX, sSectorY, TRUE ) ) // scouting trait check { - if (gSkillTraitValues.fSCCanDetectEnemyPresenseAround) - { - // show their presence - fDetection = TRUE; - // show their numbers - if (gSkillTraitValues.fSCCanDetermineEnemyNumbersAround) - fCount = TRUE; - } + // show their presence + fDetection = TRUE; + + // show their numbers + if ( gSkillTraitValues.fSCCanDetermineEnemyNumbersAround ) + fCount = TRUE; } // Explored Sector Detection // Enemy can be detected in any previously-visited sector. // This is also enabled by some facilities, provided a merc is present and available to do it. - if( GetSectorFlagStatus( sSectorX, sSectorY, 0, SF_ALREADY_VISITED ) == TRUE ) + // HEADROCK HAM 3.2: When enabled, this INI setting disallows detection of enemy roamers beyond merc/militia recon range. + if( !fDetection && !gGameExternalOptions.fNoEnemyDetectionWithoutRecon && GetSectorFlagStatus( sSectorX, sSectorY, 0, SF_ALREADY_VISITED ) == TRUE ) { - // HEADROCK HAM 3.2: When enabled, this INI setting disallows detection of enemy roamers beyond merc/militia - // recon range. - if (!gGameExternalOptions.fNoEnemyDetectionWithoutRecon) - { - // then he always knows about any enemy presence for the remainder of the game, but not exact numbers - fDetection = TRUE; - } + // then he always knows about any enemy presence for the remainder of the game, but not exact numbers + fDetection = TRUE; } - // if Skyrider noticed the enemis in the sector recently + // if Skyrider noticed the enemies in the sector recently if ( uiSectorFlags & SF_SKYRIDER_NOTICED_ENEMIES_HERE ) { // and Skyrider is still in this sector, flying @@ -6634,38 +6674,7 @@ UINT32 WhatPlayerKnowsAboutEnemiesInSector( INT16 sSectorX, INT16 sSectorY ) SectorInfo[ SECTOR( sSectorX, sSectorY ) ].uiFlags &= ~SF_SKYRIDER_NOTICED_ENEMIES_HERE; } } - - // Flugente: we know that enemies are here - if ( uiSectorFlags & SF_ASSIGN_NOTICED_ENEMIES_HERE ) - { - fDetection = TRUE; - - // we know how many there are - if ( uiSectorFlags & SF_ASSIGN_NOTICED_ENEMIES_KNOW_NUMBER ) - { - fCount = TRUE; - } - - // we know the direction they are moving in - if ( uiSectorFlags & SF_ASSIGN_NOTICED_ENEMIES_KNOW_DIRECTION ) - { - fDirection = TRUE; - } - } - - // Facilities can set a flag that allows detection in some sectors. We can read flags directly from the sector - // data to know whether we should show the enemies there. This overrides ANYTHING else. - if (SectorInfo[ SECTOR( sSectorX, sSectorY ) ].ubDetectionLevel & 1) - { - fDetection = TRUE; - fDirection = TRUE; - } - if (SectorInfo[ SECTOR( sSectorX, sSectorY ) ].ubDetectionLevel & (1<<2) ) - { - fCount = TRUE; - fDirection = TRUE; - } - + // HEADROCK HAM 5: New cases below if (!fDetection) { @@ -6685,11 +6694,11 @@ UINT32 WhatPlayerKnowsAboutEnemiesInSector( INT16 sSectorX, INT16 sSectorY ) else if (!fDirection) { // Accurate information - return KNOWS_HOW_MANY; + return KNOWS_THEYRE_THERE_AND_HOW_MANY; } // Accurate information including direction of travel! - return KNOWS_HOW_MANY_AND_WHERE_GOING; + return KNOWS_THEYRE_THERE_AND_WHERE_GOING_AND_HOW_MANY; } @@ -6836,7 +6845,7 @@ void HandleShowingOfEnemyForcesInSector( INT16 sSectorX, INT16 sSectorY, INT8 bS ShowNonPlayerGroupsInMotion( sSectorX, sSectorY, ENEMY_TEAM ); break; - case KNOWS_HOW_MANY: + case KNOWS_THEYRE_THERE_AND_HOW_MANY: { // Flugente: tanks get a special icon, so we need to count them separately usNumEnemyArmedVehicles = NumEnemyArmedVehiclesInSector( sSectorX, sSectorY, ENEMY_TEAM ); @@ -6847,7 +6856,7 @@ void HandleShowingOfEnemyForcesInSector( INT16 sSectorX, INT16 sSectorY, INT8 bS break; // HEADROCK HAM 5: New case for showing enemy groups AND where the are headed. - case KNOWS_HOW_MANY_AND_WHERE_GOING: + case KNOWS_THEYRE_THERE_AND_WHERE_GOING_AND_HOW_MANY: { // Flugente: tanks get a special icon, so we need to count them separately usNumEnemyArmedVehicles = NumEnemyArmedVehiclesInSector( sSectorX, sSectorY, ENEMY_TEAM ); @@ -7988,6 +7997,21 @@ void DisplayMilitiaGroupBox() swprintf( sString, L"%5.2f", val_armour ); mprintf( x, y, sString ); } + + y -= GetFontHeight( FONT12ARIAL ) + 2; + + if ( gGameExternalOptions.fIntelResource ) + { + x = MapScreenRect.iLeft + 20; + + CHAR16 sString[200]; + + FLOAT intel = GetIntel(); + + SetFontForeground( FONT_FCOLOR_GREEN ); + swprintf( sString, L"Intel: %5.2f", intel ); + mprintf( x, y, sString ); + } } if ( !gMilitiaGroupBoxCreated ) diff --git a/Strategic/Map Screen Interface Map.h b/Strategic/Map Screen Interface Map.h index 1a888275..67d74070 100644 --- a/Strategic/Map Screen Interface Map.h +++ b/Strategic/Map Screen Interface Map.h @@ -231,7 +231,6 @@ void CopyPathToCharactersSquadIfInOne( SOLDIERTYPE *pCharacter ); void InitMapSecrets( void ); - enum { ABORT_PLOTTING = 0, PATH_CLEARED, @@ -243,14 +242,12 @@ enum { KNOWS_NOTHING = 0, KNOWS_THEYRE_THERE, KNOWS_THEYRE_THERE_AND_WHERE_GOING, - KNOWS_HOW_MANY, - KNOWS_HOW_MANY_AND_WHERE_GOING, + KNOWS_THEYRE_THERE_AND_HOW_MANY, + KNOWS_THEYRE_THERE_AND_WHERE_GOING_AND_HOW_MANY, }; - - // scroll bounds #define EAST_ZOOM_BOUND 378 #define WEST_ZOOM_BOUND 42 diff --git a/Strategic/Map Screen Interface TownMine Info.cpp b/Strategic/Map Screen Interface TownMine Info.cpp index dd4e6ef5..be7dd7d2 100644 --- a/Strategic/Map Screen Interface TownMine Info.cpp +++ b/Strategic/Map Screen Interface TownMine Info.cpp @@ -935,8 +935,8 @@ void AddCommonInfoToBox(void) break; // HEADROCK HAM 5: New case - case KNOWS_HOW_MANY: - case KNOWS_HOW_MANY_AND_WHERE_GOING: + case KNOWS_THEYRE_THERE_AND_HOW_MANY: + case KNOWS_THEYRE_THERE_AND_WHERE_GOING_AND_HOW_MANY: // show exactly how many if (numEnemiesOnMap != ubNumEnemies) swprintf( wString, L"%d (%d)", numEnemiesOnMap, ubNumEnemies ); diff --git a/Strategic/Map Screen Interface.cpp b/Strategic/Map Screen Interface.cpp index 2c579258..f2f09738 100644 --- a/Strategic/Map Screen Interface.cpp +++ b/Strategic/Map Screen Interface.cpp @@ -1612,7 +1612,11 @@ void HandleLeavingOfEquipmentInCurrentSector( UINT32 uiMercId ) //INT32 iCounter = 0; INT32 sGridNo, sTempGridNo; - if( Menptr[ uiMercId ].sSectorX != gWorldSectorX || Menptr[ uiMercId ].sSectorY != gWorldSectorY || Menptr[ uiMercId ].bSectorZ != gbWorldSectorZ ) + INT8 sectorz = Menptr[uiMercId].bSectorZ; + if ( SPY_LOCATION( Menptr[uiMercId].bAssignment ) ) + sectorz = max( 0, sectorz - 10 ); + + if( Menptr[ uiMercId ].sSectorX != gWorldSectorX || Menptr[ uiMercId ].sSectorY != gWorldSectorY || sectorz != gbWorldSectorZ ) { // ATE: Use insertion gridno if not nowhere and insertion is gridno if ( Menptr[ uiMercId ].ubStrategicInsertionCode == INSERTION_CODE_GRIDNO && !TileIsOutOfBounds(Menptr[ uiMercId ].usStrategicInsertionData) ) @@ -1649,7 +1653,7 @@ void HandleLeavingOfEquipmentInCurrentSector( UINT32 uiMercId ) UINT32 uiFoundItems = 0; Inventory invTemporaryBeforeDrop; - if( Menptr[ uiMercId ].sSectorX != gWorldSectorX || Menptr[ uiMercId ].sSectorY != gWorldSectorY || Menptr[ uiMercId ].bSectorZ != gbWorldSectorZ ) + if( Menptr[ uiMercId ].sSectorX != gWorldSectorX || Menptr[ uiMercId ].sSectorY != gWorldSectorY || sectorz != gbWorldSectorZ ) { for( UINT32 iCounter = 0; iCounter < invsize; ++iCounter ) { @@ -1662,7 +1666,7 @@ void HandleLeavingOfEquipmentInCurrentSector( UINT32 uiMercId ) } } // anv: add all items at once (less file operations = less lag) - AddItemsToUnLoadedSector( Menptr[ uiMercId ].sSectorX, Menptr[ uiMercId ].sSectorY, Menptr[ uiMercId ].bSectorZ , sGridNo, uiFoundItems, &(invTemporaryBeforeDrop[0]) , Menptr[ uiMercId ].pathing.bLevel, WOLRD_ITEM_FIND_SWEETSPOT_FROM_GRIDNO | WORLD_ITEM_REACHABLE, 0, 1, FALSE ); + AddItemsToUnLoadedSector( Menptr[ uiMercId ].sSectorX, Menptr[ uiMercId ].sSectorY, sectorz, sGridNo, uiFoundItems, &(invTemporaryBeforeDrop[0]) , Menptr[ uiMercId ].pathing.bLevel, WOLRD_ITEM_FIND_SWEETSPOT_FROM_GRIDNO | WORLD_ITEM_REACHABLE, 0, 1, FALSE ); } else { @@ -2299,6 +2303,14 @@ void UpdateMapScreenAssignmentPositions( void ) SetBoxPosition( ghDiseaseBox, pPoint ); } + if ( fShowSpyMenu ) + { + GetBoxPosition( ghSpyBox, &pPoint ); + pPoint.iY = giBoxY + ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_SPY; + + SetBoxPosition( ghSpyBox, pPoint ); + } + // HEADROCK HAM 3.6: Facility Menu if( fShowFacilityMenu ) { @@ -3743,7 +3755,7 @@ void SetUpMovingListsForSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ ) pSoldier = MercPtrs[ gCharactersList[ iCounter ].usSolID ]; if( ( pSoldier->bActive ) && - ( pSoldier->bAssignment != IN_TRANSIT ) && ( pSoldier->bAssignment != ASSIGNMENT_POW ) && + ( pSoldier->bAssignment != IN_TRANSIT ) && ( pSoldier->bAssignment != ASSIGNMENT_POW ) && !SPY_LOCATION( pSoldier->bAssignment ) && ( pSoldier->sSectorX == sSectorX ) && ( pSoldier->sSectorY == sSectorY ) && ( pSoldier->bSectorZ == sSectorZ ) ) { if ( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) @@ -5769,12 +5781,12 @@ BOOLEAN HandleTimeCompressWithTeamJackedInAndGearedToGo( void ) if ( NumNonPlayerTeamMembersInSector( gubPBSectorX, gubPBSectorY, ENEMY_TEAM ) > 0 ) { gfBlitBattleSectorLocator = TRUE; - gubEnemyEncounterCode = ENTERING_ENEMY_SECTOR_CODE; + SetEnemyEncounterCode(ENTERING_ENEMY_SECTOR_CODE); } else { gfBlitBattleSectorLocator = FALSE; - gubEnemyEncounterCode = NO_ENCOUNTER_CODE; + SetEnemyEncounterCode(NO_ENCOUNTER_CODE); } InitHelicopterEntranceByMercs( ); diff --git a/Strategic/Map Screen Interface.h b/Strategic/Map Screen Interface.h index aea5e72c..c9603d21 100644 --- a/Strategic/Map Screen Interface.h +++ b/Strategic/Map Screen Interface.h @@ -131,6 +131,7 @@ enum { ASSIGN_MENU_TRAIN, ASSIGN_MENU_MOVE_ITEMS, // added by Flugente ASSIGN_MENU_FORTIFY, // added by Flugente + ASSIGN_MENU_SPY, // added by Flugente ASSIGN_MENU_FACILITY, // HEAROCK HAM 3.6: Facility List menu ASSIGN_MENU_CANCEL, MAX_ASSIGN_STRING_COUNT, diff --git a/Strategic/PreBattle Interface.cpp b/Strategic/PreBattle Interface.cpp index 4e11e594..34da347b 100644 --- a/Strategic/PreBattle Interface.cpp +++ b/Strategic/PreBattle Interface.cpp @@ -175,6 +175,9 @@ BOOLEAN gfPersistantPBI = FALSE; //dictates the header that is used at the top of the PBI. UINT8 gubEnemyEncounterCode = NO_ENCOUNTER_CODE; +UINT8 GetEnemyEncounterCode() { return gubEnemyEncounterCode;} +void SetEnemyEncounterCode( UINT8 aCode ) { gubEnemyEncounterCode = aCode; } + //The autoresolve during tactical battle option needs more detailed information than the //gubEnemyEncounterCode can provide. The explicit version contains possibly unique codes //for reasons not normally used in the PBI. For example, if we were fighting the enemy @@ -182,6 +185,9 @@ UINT8 gubEnemyEncounterCode = NO_ENCOUNTER_CODE; //would turn hostile, which would disable the ability to autoresolve the battle. BOOLEAN gubExplicitEnemyEncounterCode = NO_ENCOUNTER_CODE; +UINT8 GetExplicitEnemyEncounterCode() { return gubExplicitEnemyEncounterCode; } +void SetExplicitEnemyEncounterCode( UINT8 aCode ) { gubExplicitEnemyEncounterCode = aCode; } + BOOLEAN gubSpecialEncounterCodeForEnemyHeli = FALSE; //Location of the current battle (determines where the animated icon is blitted) and if the @@ -327,7 +333,7 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI ) // InitializeTacticalStatusAtBattleStart(); // CJC, Oct 5 98: this is all we should need from InitializeTacticalStatusAtBattleStart() - if( gubEnemyEncounterCode != BLOODCAT_AMBUSH_CODE && gubEnemyEncounterCode != ENTERING_BLOODCAT_LAIR_CODE ) + if( GetEnemyEncounterCode() != BLOODCAT_AMBUSH_CODE && GetEnemyEncounterCode() != ENTERING_BLOODCAT_LAIR_CODE ) { if ( !CheckFact( FACT_FIRST_BATTLE_FOUGHT, 0 ) ) { @@ -406,40 +412,44 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI ) if( HostileCiviliansPresent() ) { //There are hostile civilians, so no autoresolve allowed. - gubExplicitEnemyEncounterCode = HOSTILE_CIVILIANS_CODE; + SetExplicitEnemyEncounterCode( HOSTILE_CIVILIANS_CODE ); } else if( HostileBloodcatsPresent() ) { //There are bloodcats in the sector, so no autoresolve allowed - gubExplicitEnemyEncounterCode = HOSTILE_BLOODCATS_CODE; + SetExplicitEnemyEncounterCode( HOSTILE_BLOODCATS_CODE ); } else if( gbWorldSectorZ > 0 ) { + UNDERGROUND_SECTORINFO *pUnderGroundSector = FindUnderGroundSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ); + Assert( pUnderGroundSector ); + //We are underground, so no autoresolve allowed - if( pSector->ubCreaturesInBattle ) + if( pUnderGroundSector->ubCreaturesInBattle ) { - gubExplicitEnemyEncounterCode = FIGHTING_CREATURES_CODE; + SetExplicitEnemyEncounterCode( FIGHTING_CREATURES_CODE ); } - else if( pSector->ubAdminsInBattle || pSector->ubTroopsInBattle || pSector->ubElitesInBattle ) + else if( pUnderGroundSector->ubAdminsInBattle || pUnderGroundSector->ubTroopsInBattle || pUnderGroundSector->ubElitesInBattle || pUnderGroundSector->ubTanksInBattle || pUnderGroundSector->ubJeepsInBattle ) { - gubExplicitEnemyEncounterCode = ENTERING_ENEMY_SECTOR_CODE; + SetExplicitEnemyEncounterCode( ENTERING_ENEMY_SECTOR_CODE ); } } else if ( pBattleGroup && pBattleGroup->usGroupTeam != OUR_TEAM && NumNonPlayerTeamMembersInSector( pBattleGroup->ubSectorX, pBattleGroup->ubSectorY, MILITIA_TEAM ) > 0 ) { - gubEnemyEncounterCode = ENEMY_ENCOUNTER_CODE; + SetEnemyEncounterCode( ENEMY_ENCOUNTER_CODE ); } - else if( gubEnemyEncounterCode == ENTERING_ENEMY_SECTOR_CODE || - gubEnemyEncounterCode == ENEMY_ENCOUNTER_CODE || - gubEnemyEncounterCode == ENEMY_AMBUSH_CODE || - gubEnemyEncounterCode == ENEMY_INVASION_CODE || - gubEnemyEncounterCode == BLOODCAT_AMBUSH_CODE || - gubEnemyEncounterCode == ENTERING_BLOODCAT_LAIR_CODE || - gubEnemyEncounterCode == CREATURE_ATTACK_CODE || - gubEnemyEncounterCode == ENEMY_AMBUSH_DEPLOYMENT_CODE || - gubEnemyEncounterCode == ENEMY_INVASION_AIRDROP_CODE ) + else if( GetEnemyEncounterCode() == ENTERING_ENEMY_SECTOR_CODE || + GetEnemyEncounterCode() == ENEMY_ENCOUNTER_CODE || + GetEnemyEncounterCode() == ENEMY_AMBUSH_CODE || + GetEnemyEncounterCode() == ENEMY_INVASION_CODE || + GetEnemyEncounterCode() == BLOODCAT_AMBUSH_CODE || + GetEnemyEncounterCode() == ENTERING_BLOODCAT_LAIR_CODE || + GetEnemyEncounterCode() == CREATURE_ATTACK_CODE || + GetEnemyEncounterCode() == ENEMY_AMBUSH_DEPLOYMENT_CODE || + GetEnemyEncounterCode() == ENEMY_INVASION_AIRDROP_CODE || + GetEnemyEncounterCode() == CONCEALINSERTION_CODE ) { //use same code - gubExplicitEnemyEncounterCode = gubEnemyEncounterCode; + SetExplicitEnemyEncounterCode( GetEnemyEncounterCode() ); } else { @@ -596,6 +606,10 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI ) usDeploymentLeadership = max( usDeploymentLeadership, deploymentleadership ); gAmbushRadiusModifier = max( gAmbushRadiusModifier, ambushradiusmodifier / 100 ); + + // Flugente: if a merc is inserted from concealed state, retreat is forbidden, as at least this merc will have to extract manually + if ( MercPtrs[i]->usSoldierFlagMask2 & SOLDIER_CONCEALINSERTION ) + fRetreatAnOption = FALSE; } else { @@ -616,26 +630,31 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI ) { if ( gubSpecialEncounterCodeForEnemyHeli ) { - if ( gubEnemyEncounterCode != ENEMY_INVASION_AIRDROP_CODE ) - gubEnemyEncounterCode = ENEMY_INVASION_CODE; + if ( GetEnemyEncounterCode() != ENEMY_INVASION_AIRDROP_CODE ) + SetEnemyEncounterCode( ENEMY_INVASION_CODE); } else { //creature's attacking! - gubEnemyEncounterCode = CREATURE_ATTACK_CODE; + SetEnemyEncounterCode( CREATURE_ATTACK_CODE); } } else if ( gpBattleGroup->usGroupTeam == OUR_TEAM ) { - if( gubEnemyEncounterCode != BLOODCAT_AMBUSH_CODE && gubEnemyEncounterCode != ENTERING_BLOODCAT_LAIR_CODE ) + if( GetEnemyEncounterCode() != BLOODCAT_AMBUSH_CODE && GetEnemyEncounterCode() != ENTERING_BLOODCAT_LAIR_CODE ) { - if( ubNumStationaryEnemies ) + // Flugente: if the group that causes a battle is a result of a merc no longer being concealed, special code + if ( gpBattleGroup->pPlayerList->pSoldier->usSoldierFlagMask2 & SOLDIER_CONCEALINSERTION ) { - gubEnemyEncounterCode = ENTERING_ENEMY_SECTOR_CODE; + SetEnemyEncounterCode( CONCEALINSERTION_CODE ); + } + else if( ubNumStationaryEnemies ) + { + SetEnemyEncounterCode( ENTERING_ENEMY_SECTOR_CODE); } else { - gubEnemyEncounterCode = ENEMY_ENCOUNTER_CODE; + SetEnemyEncounterCode( ENEMY_ENCOUNTER_CODE ); // Flugente: no ambushes on an airdrop if ( !fAirDrop ) @@ -648,7 +667,7 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI ) // SANDRO - Scout prevents ambushes no matter what if ( !fScoutPresent ) { - gubEnemyEncounterCode = ENEMY_AMBUSH_CODE; + SetEnemyEncounterCode( ENEMY_AMBUSH_CODE ); } else { @@ -663,7 +682,7 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI ) // SANDRO - Scout prevents ambushes no matter what if ( !fScoutPresent ) { - gubEnemyEncounterCode = ENEMY_AMBUSH_CODE; + SetEnemyEncounterCode( ENEMY_AMBUSH_CODE ); } else { @@ -733,7 +752,7 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI ) { if ( !fScoutPresent ) { - gubEnemyEncounterCode = ENEMY_AMBUSH_CODE; + SetEnemyEncounterCode( ENEMY_AMBUSH_CODE ); } else { @@ -746,9 +765,9 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI ) } // Flugente: improved ambush: if a real squadleader is present, we may deploy our mercs instead of having them being dropped into combat randomly - if ( gubEnemyEncounterCode == ENEMY_AMBUSH_CODE && usDeploymentLeadership > 120 ) + if ( GetEnemyEncounterCode() == ENEMY_AMBUSH_CODE && usDeploymentLeadership > 120 ) { - gubEnemyEncounterCode = ENEMY_AMBUSH_DEPLOYMENT_CODE; + SetEnemyEncounterCode( ENEMY_AMBUSH_DEPLOYMENT_CODE ); } ////////////////////////////////////////////////////////////////////////////////////////////////////////////// } @@ -757,12 +776,18 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI ) else { //Are enemies invading a town, or just encountered the player. if( GetTownIdForSector( gubPBSectorX, gubPBSectorY ) ) - gubEnemyEncounterCode = ENEMY_INVASION_CODE; + SetEnemyEncounterCode( ENEMY_INVASION_CODE ); //SAM sites not in towns will also be considered to be important else if( pSector->uiFlags & SF_SAM_SITE ) - gubEnemyEncounterCode = ENEMY_INVASION_CODE; + SetEnemyEncounterCode( ENEMY_INVASION_CODE ); else - gubEnemyEncounterCode = ENEMY_ENCOUNTER_CODE; + SetEnemyEncounterCode( ENEMY_ENCOUNTER_CODE ); + } + + // haxx + if ( pBattleGroup && pBattleGroup->usGroupTeam == OUR_TEAM && pBattleGroup->pPlayerList->pSoldier->usSoldierFlagMask2 & SOLDIER_CONCEALINSERTION ) + { + //SetEnemyEncounterCode( CONCEALINSERTION_CODE ); } } @@ -770,7 +795,7 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI ) ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // SANDRO - merc records - ambush experienced - if ( gubEnemyEncounterCode == ENEMY_AMBUSH_CODE || gubEnemyEncounterCode == BLOODCAT_AMBUSH_CODE || gubEnemyEncounterCode == ENEMY_AMBUSH_DEPLOYMENT_CODE || fAmbushPrevented ) + if ( GetEnemyEncounterCode() == ENEMY_AMBUSH_CODE || GetEnemyEncounterCode() == BLOODCAT_AMBUSH_CODE || GetEnemyEncounterCode() == ENEMY_AMBUSH_DEPLOYMENT_CODE || fAmbushPrevented ) { for( i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++i ) { @@ -778,7 +803,7 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI ) { if ( PlayerMercInvolvedInThisCombat( MercPtrs[ i ] ) && MercPtrs[ i ]->ubProfile != NO_PROFILE ) { - if ( gubEnemyEncounterCode == ENEMY_AMBUSH_CODE || gubEnemyEncounterCode == BLOODCAT_AMBUSH_CODE || gubEnemyEncounterCode == ENEMY_AMBUSH_DEPLOYMENT_CODE ) + if ( GetEnemyEncounterCode() == ENEMY_AMBUSH_CODE || GetEnemyEncounterCode() == BLOODCAT_AMBUSH_CODE || GetEnemyEncounterCode() == ENEMY_AMBUSH_DEPLOYMENT_CODE ) gMercProfiles[ MercPtrs[ i ]->ubProfile ].records.usAmbushesExperienced++; else if ( fAmbushPrevented && HAS_SKILL_TRAIT( MercPtrs[ i ], SCOUTING_NT ) ) // Scouts actually get this as number of prevented ambushes gMercProfiles[ MercPtrs[ i ]->ubProfile ].records.usAmbushesExperienced++; @@ -818,7 +843,7 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI ) } HideButton( giMapContractButton ); - if( gubEnemyEncounterCode == ENEMY_ENCOUNTER_CODE ) + if( GetEnemyEncounterCode() == ENEMY_ENCOUNTER_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. @@ -831,20 +856,29 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI ) //when necessary. if( gfPersistantPBI ) { - if( gubEnemyEncounterCode == ENTERING_ENEMY_SECTOR_CODE || - gubEnemyEncounterCode == ENTERING_BLOODCAT_LAIR_CODE ) + if( GetEnemyEncounterCode() == ENTERING_ENEMY_SECTOR_CODE || + GetEnemyEncounterCode() == ENTERING_BLOODCAT_LAIR_CODE ) { //Don't allow autoresolve for player initiated invasion battle types DisableButton( iPBButton[ 0 ] ); SetButtonFastHelpText( iPBButton[ 0 ], gpStrategicString[ STR_PB_DISABLED_AUTORESOLVE_FASTHELP ] ); } - else if( gubEnemyEncounterCode == ENEMY_AMBUSH_CODE || - gubEnemyEncounterCode == BLOODCAT_AMBUSH_CODE || - gubEnemyEncounterCode == ENEMY_AMBUSH_DEPLOYMENT_CODE ) + else if( GetEnemyEncounterCode() == ENEMY_AMBUSH_CODE || + GetEnemyEncounterCode() == BLOODCAT_AMBUSH_CODE || + GetEnemyEncounterCode() == ENEMY_AMBUSH_DEPLOYMENT_CODE ) { //Don't allow autoresolve for ambushes DisableButton( iPBButton[ 0 ] ); SetButtonFastHelpText( iPBButton[ 0 ], gzNonPersistantPBIText[ 3 ] ); } + else if ( GetEnemyEncounterCode() == CONCEALINSERTION_CODE ) + { + // Don't allow autoresolve + DisableButton( iPBButton[0] ); + SetButtonFastHelpText( iPBButton[0], gpStrategicString[STR_PB_DISABLED_AUTORESOLVE_FASTHELP] ); + + // No retreat possible, we must go to tactical + fRetreatAnOption = FALSE; + } else { SetButtonFastHelpText( iPBButton[ 0 ], gpStrategicString[ STR_PB_AUTORESOLVE_FASTHELP ] ); @@ -863,10 +897,10 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI ) } if( gfAutomaticallyStartAutoResolve || !fRetreatAnOption || - gubEnemyEncounterCode == ENEMY_AMBUSH_CODE || - gubEnemyEncounterCode == BLOODCAT_AMBUSH_CODE || - gubEnemyEncounterCode == ENEMY_AMBUSH_DEPLOYMENT_CODE || - gubEnemyEncounterCode == CREATURE_ATTACK_CODE || + GetEnemyEncounterCode() == ENEMY_AMBUSH_CODE || + GetEnemyEncounterCode() == BLOODCAT_AMBUSH_CODE || + GetEnemyEncounterCode() == ENEMY_AMBUSH_DEPLOYMENT_CODE || + GetEnemyEncounterCode() == CREATURE_ATTACK_CODE || is_client) { DisableButton( iPBButton[ 2 ] ); @@ -891,7 +925,7 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI ) DisableButton( iPBButton[ 2 ] ); SetButtonFastHelpText( iPBButton[ 2 ], gzNonPersistantPBIText[ 0 ] ); SetButtonFastHelpText( iPBButton[ 1 ], gzNonPersistantPBIText[ 1 ] ); - switch( gubExplicitEnemyEncounterCode ) + switch( GetExplicitEnemyEncounterCode() ) { case CREATURE_ATTACK_CODE: case ENEMY_ENCOUNTER_CODE: @@ -922,6 +956,15 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI ) DisableButton( iPBButton[ 0 ] ); SetButtonFastHelpText( iPBButton[ 0 ], gzNonPersistantPBIText[ 7 ] ); break; + case CONCEALINSERTION_CODE: + // Don't allow autoresolve + DisableButton( iPBButton[0] ); + SetButtonFastHelpText( iPBButton[0], gpStrategicString[STR_PB_DISABLED_AUTORESOLVE_FASTHELP] ); + + // No retreat possible, we must go to tactical + DisableButton( iPBButton[2] ); + SetButtonFastHelpText( iPBButton[2], gzNonPersistantPBIText[9] ); + break; } } @@ -1135,7 +1178,7 @@ void RenderPBHeader( INT32 *piX, INT32 *piWidth) { swprintf( str, gzNonPersistantPBIText[8] ); } - else switch( gubEnemyEncounterCode ) + else switch( GetEnemyEncounterCode() ) { case ENEMY_INVASION_CODE: swprintf( str, gpStrategicString[ STR_PB_ENEMYINVASION_HEADER ] ); @@ -1165,6 +1208,9 @@ void RenderPBHeader( INT32 *piX, INT32 *piWidth) case ENEMY_INVASION_AIRDROP_CODE: swprintf( str, gpStrategicString[STR_PB_ENEMYINVASION_AIRDROP_HEADER] ); break; + case CONCEALINSERTION_CODE: + swprintf( str, gpStrategicString[STR_PB_ENEMYENCOUNTER_HEADER] ); + break; } width = StringPixLength( str, FONT10ARIALBOLD ); x = 130 - width / 2; @@ -1257,18 +1303,19 @@ void RenderPreBattleInterface() mprintf( 65 - width + xResOffset , 17 + yResOffset, str ); SetFont( BLOCKFONT ); - if( gubEnemyEncounterCode != CREATURE_ATTACK_CODE ) + if( GetEnemyEncounterCode() == CREATURE_ATTACK_CODE ) { - swprintf( str, gpStrategicString[ STR_PB_ENEMIES ] ); + swprintf( str, gpStrategicString[STR_PB_CREATURES ] ); } - else if( gubEnemyEncounterCode == BLOODCAT_AMBUSH_CODE || gubEnemyEncounterCode == ENTERING_BLOODCAT_LAIR_CODE ) + else if( GetEnemyEncounterCode() == BLOODCAT_AMBUSH_CODE || GetEnemyEncounterCode() == ENTERING_BLOODCAT_LAIR_CODE ) { swprintf( str, gpStrategicString[ STR_PB_BLOODCATS ] ); } else { - swprintf( str, gpStrategicString[ STR_PB_CREATURES ] ); + swprintf( str, gpStrategicString[ STR_PB_ENEMIES ] ); } + width = StringPixLength( str, BLOCKFONT ); if( width > 52 ) { @@ -1321,10 +1368,10 @@ void RenderPreBattleInterface() //enemy SetFont( FONT14ARIAL ); - if( gubEnemyEncounterCode == CREATURE_ATTACK_CODE || - gubEnemyEncounterCode == BLOODCAT_AMBUSH_CODE || - gubEnemyEncounterCode == ENTERING_BLOODCAT_LAIR_CODE || - WhatPlayerKnowsAboutEnemiesInSector( gubPBSectorX, gubPBSectorY ) < KNOWS_HOW_MANY ) // HEADROCK HAM 5: New case above this one... + if( GetEnemyEncounterCode() == CREATURE_ATTACK_CODE || + GetEnemyEncounterCode() == BLOODCAT_AMBUSH_CODE || + GetEnemyEncounterCode() == ENTERING_BLOODCAT_LAIR_CODE || + WhatPlayerKnowsAboutEnemiesInSector( gubPBSectorX, gubPBSectorY ) < KNOWS_THEYRE_THERE_AND_HOW_MANY ) // HEADROCK HAM 5: New case above this one... { // don't know how many swprintf( str, L"?" ); @@ -1549,10 +1596,11 @@ void GoToSectorCallback( GUI_BUTTON *btn, INT32 reason ) } if ( gfPersistantPBI && gpBattleGroup && gpBattleGroup->usGroupTeam == OUR_TEAM && - gubEnemyEncounterCode != ENEMY_AMBUSH_CODE && - gubEnemyEncounterCode != CREATURE_ATTACK_CODE && - gubEnemyEncounterCode != BLOODCAT_AMBUSH_CODE && - gubEnemyEncounterCode != ENEMY_INVASION_AIRDROP_CODE ) + GetEnemyEncounterCode() != ENEMY_AMBUSH_CODE && + GetEnemyEncounterCode() != CREATURE_ATTACK_CODE && + GetEnemyEncounterCode() != BLOODCAT_AMBUSH_CODE && + GetEnemyEncounterCode() != ENEMY_INVASION_AIRDROP_CODE && + GetEnemyEncounterCode() != CONCEALINSERTION_CODE ) { gfEnterTacticalPlacementGUI = TRUE; } @@ -1874,46 +1922,53 @@ void CalculateNonPersistantPBIInfo() { //Either the locator isn't on or the locator info is in a different sector //Calculated the encounter type - gubEnemyEncounterCode = NO_ENCOUNTER_CODE; - gubExplicitEnemyEncounterCode = NO_ENCOUNTER_CODE; + SetEnemyEncounterCode( NO_ENCOUNTER_CODE ); + SetExplicitEnemyEncounterCode( NO_ENCOUNTER_CODE ); + if( HostileCiviliansPresent() ) - { //There are hostile civilians, so no autoresolve allowed. - gubExplicitEnemyEncounterCode = HOSTILE_CIVILIANS_CODE; + { + //There are hostile civilians, so no autoresolve allowed. + SetExplicitEnemyEncounterCode( HOSTILE_CIVILIANS_CODE ); } else if( HostileBloodcatsPresent() ) - { //There are bloodcats in the sector, so no autoresolve allowed - gubExplicitEnemyEncounterCode = HOSTILE_BLOODCATS_CODE; + { + //There are bloodcats in the sector, so no autoresolve allowed + SetExplicitEnemyEncounterCode( HOSTILE_BLOODCATS_CODE ); } else if( gbWorldSectorZ > 0 ) { UNDERGROUND_SECTORINFO *pSector = FindUnderGroundSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ); Assert( pSector ); + if( pSector->ubCreaturesInBattle ) { - gubExplicitEnemyEncounterCode = FIGHTING_CREATURES_CODE; + SetExplicitEnemyEncounterCode( FIGHTING_CREATURES_CODE ); } - else if( pSector->ubAdminsInBattle || pSector->ubTroopsInBattle || pSector->ubElitesInBattle ) + else if( pSector->ubAdminsInBattle || pSector->ubTroopsInBattle || pSector->ubElitesInBattle || pSector->ubTanksInBattle || pSector->ubJeepsInBattle ) { - gubExplicitEnemyEncounterCode = ENTERING_ENEMY_SECTOR_CODE; - gubEnemyEncounterCode = ENTERING_ENEMY_SECTOR_CODE; + SetExplicitEnemyEncounterCode( ENTERING_ENEMY_SECTOR_CODE ); + SetEnemyEncounterCode( ENTERING_ENEMY_SECTOR_CODE ); } } else { SECTORINFO *pSector = &SectorInfo[ SECTOR( gWorldSectorX, gWorldSectorY ) ]; Assert( pSector ); + if( pSector->ubCreaturesInBattle ) { - gubExplicitEnemyEncounterCode = FIGHTING_CREATURES_CODE; + SetExplicitEnemyEncounterCode( FIGHTING_CREATURES_CODE ); } - else if( pSector->ubAdminsInBattle || pSector->ubTroopsInBattle || pSector->ubElitesInBattle ) + else if( pSector->ubAdminsInBattle || pSector->ubTroopsInBattle || pSector->ubElitesInBattle || pSector->ubTanksInBattle || pSector->ubJeepsInBattle ) { - gubExplicitEnemyEncounterCode = ENTERING_ENEMY_SECTOR_CODE; - gubEnemyEncounterCode = ENTERING_ENEMY_SECTOR_CODE; + SetExplicitEnemyEncounterCode( ENTERING_ENEMY_SECTOR_CODE ); + SetEnemyEncounterCode( ENTERING_ENEMY_SECTOR_CODE ); } } - if( gubExplicitEnemyEncounterCode != NO_ENCOUNTER_CODE ) - { //Set up the location as well as turning on the blit flag. + + if ( GetExplicitEnemyEncounterCode() != NO_ENCOUNTER_CODE ) + { + //Set up the location as well as turning on the blit flag. gubPBSectorX = (UINT8)gWorldSectorX; gubPBSectorY = (UINT8)gWorldSectorY; gubPBSectorZ = (UINT8)gbWorldSectorZ; @@ -2347,7 +2402,7 @@ void LogBattleResults( UINT8 ubVictoryCode) GetCurrentBattleSectorXYZ( &sSectorX, &sSectorY, &sSectorZ ); if( ubVictoryCode == LOG_VICTORY ) { - switch( gubEnemyEncounterCode ) + switch( GetEnemyEncounterCode() ) { case ENEMY_INVASION_CODE: AddHistoryToPlayersLog( HISTORY_DEFENDEDTOWNSECTOR, 0, GetWorldTotalMin(), sSectorX, sSectorY ); @@ -2370,6 +2425,8 @@ void LogBattleResults( UINT8 ubVictoryCode) case ENTERING_BLOODCAT_LAIR_CODE: AddHistoryToPlayersLog( HISTORY_SLAUGHTEREDBLOODCATS, 0, GetWorldTotalMin(), sSectorX, sSectorY ); break; + case CONCEALINSERTION_CODE: + break; } // Flugente: campaign stats @@ -2377,7 +2434,7 @@ void LogBattleResults( UINT8 ubVictoryCode) } else { - switch( gubEnemyEncounterCode ) + switch( GetEnemyEncounterCode() ) { case ENEMY_INVASION_CODE: AddHistoryToPlayersLog( HISTORY_LOSTTOWNSECTOR, 0, GetWorldTotalMin(), sSectorX, sSectorY ); @@ -2400,10 +2457,12 @@ void LogBattleResults( UINT8 ubVictoryCode) case ENTERING_BLOODCAT_LAIR_CODE: AddHistoryToPlayersLog( HISTORY_KILLEDBYBLOODCATS, 0, GetWorldTotalMin(), sSectorX, sSectorY ); break; + case CONCEALINSERTION_CODE: + break; } } - switch( gubEnemyEncounterCode ) + switch( GetEnemyEncounterCode() ) { case ENEMY_INVASION_CODE: gCurrentIncident.usIncidentFlags |= INCIDENT_ATTACK_ENEMY; diff --git a/Strategic/PreBattle Interface.h b/Strategic/PreBattle Interface.h index 00af57e4..80f241e6 100644 --- a/Strategic/PreBattle Interface.h +++ b/Strategic/PreBattle Interface.h @@ -42,6 +42,7 @@ enum ENEMY_AMBUSH_DEPLOYMENT_CODE, // Flugente: an ambush in which we can deploy our mercs (somewhat) ENEMY_INVASION_AIRDROP_CODE, // Flugente: enemy airdrop + CONCEALINSERTION_CODE, // Flugente: a spy is no longer concealed, this causes us to drop into combat }; extern BOOLEAN gfAutoAmbush; @@ -64,14 +65,16 @@ extern BOOLEAN gfPersistantPBI; //Contains general information about the type of encounter the player is faced with. This //determines whether or not you can autoresolve the battle or even retreat. This code //dictates the header that is used at the top of the PBI. -extern UINT8 gubEnemyEncounterCode; +UINT8 GetEnemyEncounterCode(); +void SetEnemyEncounterCode( UINT8 aCode ); //The autoresolve during tactical battle option needs more detailed information than the //gubEnemyEncounterCode can provide. The explicit version contains possibly unique codes //for reasons not normally used in the PBI. For example, if we were fighting the enemy //in a normal situation, then shot at a civilian, the civilians associated with the victim //would turn hostile, which would disable the ability to autoresolve the battle. -extern BOOLEAN gubExplicitEnemyEncounterCode; +UINT8 GetExplicitEnemyEncounterCode(); +void SetExplicitEnemyEncounterCode( UINT8 aCode ); //Location of the current battle (determines where the animated icon is blitted) and if the //icon is to be blitted. diff --git a/Strategic/Strategic AI.cpp b/Strategic/Strategic AI.cpp index 90bda79c..7d1f23dc 100644 --- a/Strategic/Strategic AI.cpp +++ b/Strategic/Strategic AI.cpp @@ -3931,13 +3931,14 @@ BOOLEAN LoadStrategicAI( HWFILE hFile ) InitBloodCatSectors(); //This info is used to clean up the two new codes inserted into the //middle of the enumeration for battle codes. - if( gubEnemyEncounterCode > CREATURE_ATTACK_CODE ) + if( GetEnemyEncounterCode() > CREATURE_ATTACK_CODE ) { - gubEnemyEncounterCode += 2; + SetEnemyEncounterCode( GetEnemyEncounterCode() + 2 ); } - if( gubExplicitEnemyEncounterCode > CREATURE_ATTACK_CODE ) + + if( GetExplicitEnemyEncounterCode() > CREATURE_ATTACK_CODE ) { - gubExplicitEnemyEncounterCode += 2; + SetExplicitEnemyEncounterCode( GetExplicitEnemyEncounterCode() + 2 ); } } diff --git a/Strategic/Strategic Movement.cpp b/Strategic/Strategic Movement.cpp index ab9b3f12..2b0b52a7 100644 --- a/Strategic/Strategic Movement.cpp +++ b/Strategic/Strategic Movement.cpp @@ -120,7 +120,7 @@ UINT32 uniqueIDMask[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; UINT8 AddGroupToList( GROUP *pGroup ); -void HandleOtherGroupsArrivingSimultaneously( UINT8 ubSectorX, UINT8 ubSectorY, UINT8 ubSectorZ ); +void HandleOtherGroupsArrivingSimultaneously( UINT8 ubSectorX, UINT8 ubSectorY, UINT8 ubSectorZ, GROUP* pArrivingGroup = NULL ); BOOLEAN PossibleToCoordinateSimultaneousGroupArrivals( GROUP *pGroup ); void HandleNonCombatGroupArrival( GROUP *pGroup, BOOLEAN fMainGroup, BOOLEAN fNeverLeft ); @@ -241,6 +241,11 @@ BOOLEAN AddPlayerToGroup( UINT8 ubGroupID, SOLDIERTYPE *pSoldier ) if( !pGroup->pPlayerList ) { pGroup->pPlayerList = pPlayer; + + // Flugente: no groups in odd locations + if ( pSoldier->bSectorZ >= 10 ) + pSoldier->bSectorZ -= 10; + pGroup->ubGroupSize = 1; pGroup->ubPrevX = SECTORX( pSoldier->ubPrevSectorID ); pGroup->ubPrevY = SECTORY( pSoldier->ubPrevSectorID ); @@ -1193,10 +1198,10 @@ BOOLEAN CheckConditionsForBattle( GROUP *pGroup ) if( !DidGameJustStart() ) { - gubEnemyEncounterCode = NO_ENCOUNTER_CODE; + SetEnemyEncounterCode( NO_ENCOUNTER_CODE ); } - HandleOtherGroupsArrivingSimultaneously( pGroup->ubSectorX, pGroup->ubSectorY, pGroup->ubSectorZ ); + HandleOtherGroupsArrivingSimultaneously( pGroup->ubSectorX, pGroup->ubSectorY, pGroup->ubSectorZ, pGroup ); curr = gpGroupList; while( curr ) @@ -1274,7 +1279,7 @@ BOOLEAN CheckConditionsForBattle( GROUP *pGroup ) StopTimeCompression(); } - if( fBattlePending && (!fBloodCatAmbush || gubEnemyEncounterCode == ENTERING_BLOODCAT_LAIR_CODE) ) + if( fBattlePending && (!fBloodCatAmbush || GetEnemyEncounterCode() == ENTERING_BLOODCAT_LAIR_CODE) ) { if( PossibleToCoordinateSimultaneousGroupArrivals( pGroup ) ) { @@ -1351,7 +1356,7 @@ BOOLEAN CheckConditionsForBattle( GROUP *pGroup ) gpInitPrebattleGroup = pGroup; - if( gubEnemyEncounterCode == BLOODCAT_AMBUSH_CODE || gubEnemyEncounterCode == ENTERING_BLOODCAT_LAIR_CODE ) + if( GetEnemyEncounterCode() == BLOODCAT_AMBUSH_CODE || GetEnemyEncounterCode() == ENTERING_BLOODCAT_LAIR_CODE ) { NotifyPlayerOfBloodcatBattle( pGroup->ubSectorX, pGroup->ubSectorY ); return TRUE; @@ -2045,6 +2050,11 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe ubInsertionDirection = SOUTHEAST; ubStrategicInsertionCode = INSERTION_CODE_NORTH; } + else if ( pGroup->usGroupTeam == OUR_TEAM && pGroup->pPlayerList->pSoldier->usSoldierFlagMask2 & SOLDIER_CONCEALINSERTION ) + { + ubInsertionDirection = DIRECTION_IRRELEVANT; + ubStrategicInsertionCode = INSERTION_CODE_GRIDNO; + } else { Assert(0); @@ -2260,7 +2270,7 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe else { //Handle cases for pre battle conditions - pGroup->uiFlags = 0; + pGroup->uiFlags &= ~GROUPFLAGS_TODELETE; if( gubNumAwareBattles ) { @@ -2449,8 +2459,9 @@ void HandleNonCombatGroupArrival( GROUP *pGroup, BOOLEAN fMainGroup, BOOLEAN fNe RemovePGroup( pGroup ); } } + //Clear the non-persistant flags. - pGroup->uiFlags = 0; + pGroup->uiFlags &= ~GROUPFLAGS_TODELETE; } @@ -2459,7 +2470,7 @@ void HandleNonCombatGroupArrival( GROUP *pGroup, BOOLEAN fMainGroup, BOOLEAN fNe //groups that may arrive at the same time -- enemies or players, and blindly add them to the sector //without checking for battle conditions, as it has already determined that a new battle is about to //start. -void HandleOtherGroupsArrivingSimultaneously( UINT8 ubSectorX, UINT8 ubSectorY, UINT8 ubSectorZ ) +void HandleOtherGroupsArrivingSimultaneously( UINT8 ubSectorX, UINT8 ubSectorY, UINT8 ubSectorZ, GROUP* pArrivingGroup ) { STRATEGICEVENT *pEvent; UINT32 uiCurrTimeStamp; @@ -2479,7 +2490,7 @@ void HandleOtherGroupsArrivingSimultaneously( UINT8 ubSectorX, UINT8 ubSectorY, { GroupArrivedAtSector( (UINT8)pEvent->uiParam, FALSE, FALSE ); pGroup->uiFlags |= GROUPFLAG_GROUP_ARRIVED_SIMULTANEOUSLY; - gubNumGroupsArrivedSimultaneously++; + ++gubNumGroupsArrivedSimultaneously; DeleteStrategicEvent( EVENT_GROUP_ARRIVAL, pGroup->ubGroupID ); pEvent = gpEventList; continue; @@ -2488,6 +2499,30 @@ void HandleOtherGroupsArrivingSimultaneously( UINT8 ubSectorX, UINT8 ubSectorY, } pEvent = pEvent->next; } + + // Flugente: concealed spies are added if a battle occurs + if ( !IsGroupTheHelicopterGroup( pArrivingGroup ) ) + { + UINT16 uiCnt = 0; + SOLDIERTYPE* pSoldier = NULL; + + for ( uiCnt = 0, pSoldier = MercPtrs[uiCnt]; uiCnt <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++uiCnt, ++pSoldier ) + { + if ( pSoldier && pSoldier->bActive && pSoldier->stats.bLife >= OKLIFE && SPY_LOCATION( pSoldier->bAssignment ) ) + { + if ( ( pSoldier->sSectorX == ubSectorX ) && ( pSoldier->sSectorY == ubSectorY ) && ( pSoldier->bSectorZ - 10 == ubSectorZ ) ) + { + INT8 bNewSquad = GetFirstEmptySquad(); + if ( bNewSquad == -1 ) + continue; + + pSoldier->usSoldierFlagMask2 |= SOLDIER_CONCEALINSERTION; + + AddCharacterToSquad( pSoldier, bNewSquad ); + } + } + } + } } //The user has just approved to plan a simultaneous arrival. So we will syncronize all of the involved @@ -2634,7 +2669,7 @@ BOOLEAN PossibleToCoordinateSimultaneousGroupArrivals( GROUP *pFirstGroup ) { pStr = gpStrategicString[ STR_DETECTED_PLURAL ]; } - if( gubEnemyEncounterCode == ENTERING_BLOODCAT_LAIR_CODE ) + if( GetEnemyEncounterCode() == ENTERING_BLOODCAT_LAIR_CODE ) { pEnemyType = gpStrategicString[ STR_PB_BLOODCATS ]; } @@ -5361,7 +5396,7 @@ BOOLEAN TestForBloodcatAmbush( GROUP *pGroup ) // We know about the lair if( gubFact[ FACT_PLAYER_KNOWS_ABOUT_BLOODCAT_LAIR ] ) { - gubEnemyEncounterCode = ENTERING_BLOODCAT_LAIR_CODE; + SetEnemyEncounterCode( ENTERING_BLOODCAT_LAIR_CODE ); } else { @@ -5373,12 +5408,12 @@ BOOLEAN TestForBloodcatAmbush( GROUP *pGroup ) fBloodCatAmbushPrevented = TRUE; - gubEnemyEncounterCode = ENTERING_BLOODCAT_LAIR_CODE; + SetEnemyEncounterCode( ENTERING_BLOODCAT_LAIR_CODE ); } else { // Ambush in the lair. - gubEnemyEncounterCode = BLOODCAT_AMBUSH_CODE; + SetEnemyEncounterCode( BLOODCAT_AMBUSH_CODE ); } } } @@ -5392,12 +5427,12 @@ BOOLEAN TestForBloodcatAmbush( GROUP *pGroup ) ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, New113Message[MSG113_BLOODCATS_AMBUSH_PREVENTED] ); fBloodCatAmbushPrevented = TRUE; - gubEnemyEncounterCode = NO_ENCOUNTER_CODE; + SetEnemyEncounterCode( NO_ENCOUNTER_CODE ); } else { // Ambush occurs. - gubEnemyEncounterCode = BLOODCAT_AMBUSH_CODE; + SetEnemyEncounterCode( BLOODCAT_AMBUSH_CODE ); } } // merc recoeds - get a point to scouts @@ -5417,13 +5452,13 @@ BOOLEAN TestForBloodcatAmbush( GROUP *pGroup ) } } } - return( ( gubEnemyEncounterCode == NO_ENCOUNTER_CODE ) ? FALSE : TRUE); + return( ( GetEnemyEncounterCode() == NO_ENCOUNTER_CODE ) ? FALSE : TRUE); /////////////////////////////////////////////////////////////////////////////////////////// } else { // No special bloodcat encounter. This ALWAYS happens in STATIC PLACEMENT sectors. - gubEnemyEncounterCode = NO_ENCOUNTER_CODE; + SetEnemyEncounterCode( NO_ENCOUNTER_CODE ); return FALSE; } #endif @@ -5433,12 +5468,12 @@ void NotifyPlayerOfBloodcatBattle( UINT8 ubSectorX, UINT8 ubSectorY ) { CHAR16 str[ 256 ]; CHAR16 zTempString[ 128 ]; - if( gubEnemyEncounterCode == BLOODCAT_AMBUSH_CODE ) + if( GetEnemyEncounterCode() == BLOODCAT_AMBUSH_CODE ) { GetSectorIDString( ubSectorX, ubSectorY, 0, zTempString, TRUE ); swprintf( str, pMapErrorString[ 12 ], zTempString ); } - else if( gubEnemyEncounterCode == ENTERING_BLOODCAT_LAIR_CODE ) + else if( GetEnemyEncounterCode() == ENTERING_BLOODCAT_LAIR_CODE ) { GetSectorIDString( ubSectorX, ubSectorY, 0, zTempString, FALSE ); swprintf( str, pMapErrorString[ 13 ], zTempString ); @@ -5815,8 +5850,9 @@ BOOLEAN GroupHasInTransitDeadOrPOWMercs( GROUP *pGroup ) if ( pPlayer->pSoldier ) { if( ( pPlayer->pSoldier->bAssignment == IN_TRANSIT ) || - ( pPlayer->pSoldier->bAssignment == ASSIGNMENT_POW ) || - ( pPlayer->pSoldier->bAssignment == ASSIGNMENT_DEAD ) ) + ( pPlayer->pSoldier->bAssignment == ASSIGNMENT_POW ) || + SPY_LOCATION( pPlayer->pSoldier->bAssignment ) || + ( pPlayer->pSoldier->bAssignment == ASSIGNMENT_DEAD ) ) { // yup! return( TRUE ); @@ -5923,6 +5959,29 @@ BOOLEAN ScoutIsPresentInSquad( INT16 ubSectorNumX, INT16 ubSectorNumY ) return ( fScoutPresent ); } +// Flugente: concealed mercs are in a different sector level, but we pretend they aren't... so we gain scout vision if a concealed merc is 'present' +BOOLEAN ConcealedMercInSector( INT16 ubSectorNumX, INT16 ubSectorNumY, BOOLEAN aScoutsOnly ) +{ + if ( !gGameOptions.fNewTraitSystem ) + return FALSE; + + for ( int i = gTacticalStatus.Team[OUR_TEAM].bFirstID; i <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++i ) + { + if ( MercPtrs[i]->bActive && MercPtrs[i]->stats.bLife >= OKLIFE && SPY_LOCATION( MercPtrs[i]->bAssignment ) ) + { + if ( MercPtrs[i]->sSectorX == ubSectorNumX && MercPtrs[i]->sSectorY == ubSectorNumY && MercPtrs[i]->bSectorZ == 10 ) + { + if ( !aScoutsOnly || HAS_SKILL_TRAIT( MercPtrs[i], SCOUTING_NT ) ) + { + return TRUE; + } + } + } + } + + return FALSE; +} + #ifdef JA2UB GROUP* CreateNewEnemyGroupDepartingFromSectorUsingZLevel( UINT32 uiSector, UINT8 ubSectorZ, UINT8 ubNumAdmins, UINT8 ubNumTroops, UINT8 ubNumElites, UINT8 ubNumTanks ) { @@ -5996,13 +6055,13 @@ void CheckCombatInSectorDueToUnusualEnemyArrival( UINT8 aTeam, INT16 sX, INT16 s BOOLEAN fCombatAbleMerc = FALSE; BOOLEAN fBloodCatAmbush = FALSE; - gubEnemyEncounterCode = ENEMY_INVASION_AIRDROP_CODE; + SetEnemyEncounterCode( ENEMY_INVASION_AIRDROP_CODE ); gubSectorIDOfCreatureAttack = SECTOR(sX, sY); gubSpecialEncounterCodeForEnemyHeli = TRUE; - HandleOtherGroupsArrivingSimultaneously( sX, sY, sZ ); + HandleOtherGroupsArrivingSimultaneously( sX, sY, sZ, NULL ); curr = gpGroupList; while ( curr ) @@ -6125,7 +6184,7 @@ void CheckCombatInSectorDueToUnusualEnemyArrival( UINT8 aTeam, INT16 sX, INT16 s //gpInitPrebattleGroup = pGroup; - if ( gubEnemyEncounterCode == BLOODCAT_AMBUSH_CODE || gubEnemyEncounterCode == ENTERING_BLOODCAT_LAIR_CODE ) + if ( GetEnemyEncounterCode() == BLOODCAT_AMBUSH_CODE || GetEnemyEncounterCode() == ENTERING_BLOODCAT_LAIR_CODE ) { NotifyPlayerOfBloodcatBattle( sX, sY ); @@ -6175,3 +6234,18 @@ void CheckCombatInSectorDueToUnusualEnemyArrival( UINT8 aTeam, INT16 sX, INT16 s } } } + +void GetInfoFromGroupsInSector( INT16 sSectorX, INT16 sSectorY, UINT8 ubTeam, BOOLEAN& arDetection, BOOLEAN& arCount, BOOLEAN& arDirection ) +{ + GROUP* pGroup = gpGroupList; + while ( pGroup ) + { + if ( pGroup->usGroupTeam == ubTeam && pGroup->ubSectorX == sSectorX && pGroup->ubSectorY == sSectorY ) + { + if ( pGroup->uiFlags & GROUPFLAG_KNOWN_POSITION ) arDetection = TRUE; + if ( pGroup->uiFlags & GROUPFLAG_KNOWN_NUMBER ) arCount = TRUE; + if ( pGroup->uiFlags & GROUPFLAG_KNOWN_DIRECTION ) arDirection = TRUE; + } + pGroup = pGroup->next; + } +} \ No newline at end of file diff --git a/Strategic/Strategic Movement.h b/Strategic/Strategic Movement.h index 9cc3fb86..2c751981 100644 --- a/Strategic/Strategic Movement.h +++ b/Strategic/Strategic Movement.h @@ -80,19 +80,25 @@ typedef struct ENEMYGROUP //NOTE: ALL FLAGS ARE CLEARED WHENEVER A GROUP ARRIVES IN A SECTOR, OR ITS WAYPOINTS ARE // DELETED!!! -#define GROUPFLAG_SIMULTANEOUSARRIVAL_APPROVED 0x00000001 +#define GROUPFLAG_SIMULTANEOUSARRIVAL_APPROVED 0x00000001 #define GROUPFLAG_SIMULTANEOUSARRIVAL_CHECKED 0x00000002 //I use this flag when traversing through a list to determine which groups meet whatever conditions, //then add this marker flag. The second time I traverse the list, I simply check for this flag, //apply my modifications to the group, and remove the flag. If you decide to use it, make sure the //flag is cleared. -#define GROUPFLAG_MARKER 0x00000004 +#define GROUPFLAG_MARKER 0x00000004 //Set whenever a group retreats from battle. If the group arrives in the next sector and enemies are there //retreat will not be an option. #define GROUPFLAG_JUST_RETREATED_FROM_BATTLE 0x00000008 #define GROUPFLAG_HIGH_POTENTIAL_FOR_AMBUSH 0x00000010 -#define GROUPFLAG_GROUP_ARRIVED_SIMULTANEOUSLY 0x00000020 +#define GROUPFLAG_GROUP_ARRIVED_SIMULTANEOUSLY 0x00000020 +#define GROUPFLAGS_TODELETE 0x0000003F + +// Flugente: these flags determine whether a group will always be visible on the map +#define GROUPFLAG_KNOWN_POSITION 0x00000040 +#define GROUPFLAG_KNOWN_DIRECTION 0x00000080 +#define GROUPFLAG_KNOWN_NUMBER 0x00000100 typedef struct GROUP { @@ -320,6 +326,11 @@ BOOLEAN GroupHasInTransitDeadOrPOWMercs( GROUP *pGroup ); BOOLEAN ScoutIsPresentInSquad( INT16 ubSectorNumX, INT16 ubSectorNumY ); // added by SANDRO +// Flugente: concealed mercs are in a different sector level, but we pretend they aren't... so we gain scout vision if a concealed merc is 'present' +BOOLEAN ConcealedMercInSector( INT16 ubSectorNumX, INT16 ubSectorNumY, BOOLEAN aScoutsOnly ); + void CheckCombatInSectorDueToUnusualEnemyArrival( UINT8 aTeam, INT16 sX, INT16 sY, INT8 sZ ); +void GetInfoFromGroupsInSector( INT16 sSectorX, INT16 sSectorY, UINT8 ubTeam, BOOLEAN& arDetection, BOOLEAN& arCount, BOOLEAN& arDirection ); + #endif diff --git a/Strategic/Town Militia.cpp b/Strategic/Town Militia.cpp index 9fb78db8..c13c14fa 100644 --- a/Strategic/Town Militia.cpp +++ b/Strategic/Town Militia.cpp @@ -33,6 +33,7 @@ #include "Game Event Hook.h" // added by Flugente #include "MilitiaIndividual.h" // added by Flugente #include "Campaign.h" // added by Flugente + #include "message.h" // added by Flugente #endif // HEADROCK HAM 3: include these files so that a militia trainer's Effective Leadership can be determined. Used @@ -432,10 +433,11 @@ void TownMilitiaTrainingCompleted( SOLDIERTYPE *pTrainer, INT16 sMapX, INT16 sMa } // Flugente: if we trained militia, the PMC notices us and offers their services - if ( gGameExternalOptions.fPMC ) + if ( gGameExternalOptions.fPMC && !IsBookMarkSet( PMC_BOOKMARK ) ) AddStrategicEvent( EVENT_PMC_EMAIL, GetWorldTotalMin() + 60 * (1 + Random(6)), 0 ); - AddStrategicEvent( EVENT_MILITIAROSTER_EMAIL, GetWorldTotalMin( ) + 60 * (1 + Random( 4 )), 0 ); + if ( !IsBookMarkSet( MILITIAROSTER_BOOKMARK ) ) + AddStrategicEvent( EVENT_MILITIAROSTER_EMAIL, GetWorldTotalMin( ) + 60 * (1 + Random( 4 )), 0 ); } @@ -1382,6 +1384,9 @@ BOOLEAN CanSomeoneNearbyScoutThisSector( INT16 sSectorX, INT16 sSectorY, BOOLEAN UINT8 ubScoutingRange = 1; BOOLEAN bScout = FALSE; + if ( ConcealedMercInSector( sSectorX, sSectorY, FALSE ) ) + return TRUE; + // get the sector value sSector = sSectorX + sSectorY * MAP_WORLD_X; @@ -1404,7 +1409,7 @@ BOOLEAN CanSomeoneNearbyScoutThisSector( INT16 sSectorX, INT16 sSectorY, BOOLEAN } // SANDRO - STOMP traits - Scouting check - if (fScoutTraitCheck && gGameOptions.fNewTraitSystem && ScoutIsPresentInSquad( sCounterA, sCounterB )) + if (fScoutTraitCheck && gGameOptions.fNewTraitSystem && ( ScoutIsPresentInSquad( sCounterA, sCounterB ) || ConcealedMercInSector( sCounterA, sCounterB, TRUE ) ) ) { // if diagonal sector and not allowed if (!gSkillTraitValues.fSCDetectionInDiagonalSectors && @@ -2809,3 +2814,25 @@ void DevalueResources( UINT8 aOldProgress, UINT8 aNewProgress ) LaptopSaveInfo.dMilitiaArmourPool *= modifier; LaptopSaveInfo.dMilitiaMiscPool *= modifier; } + +// Flugente: intel +void AddIntel( FLOAT aValue, BOOLEAN aDoMessage ) +{ + LaptopSaveInfo.dIntelPool = max( 0, LaptopSaveInfo.dIntelPool + aValue ); + + if ( aDoMessage ) + { + if ( aValue >= 0.0f ) + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Gained %.2f intel.", aValue ); + else + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Spent %.2f intel.", -aValue ); + } + + if ( !IsBookMarkSet( INTELMARKET_BOOKMARK ) ) + AddStrategicEvent( EVENT_INTEL_ENRICO_EMAIL, GetWorldTotalMin() + 60 * ( 1 + Random( 3 ) ), 0 ); +} + +FLOAT GetIntel() +{ + return LaptopSaveInfo.dIntelPool; +} diff --git a/Strategic/Town Militia.h b/Strategic/Town Militia.h index 912c042f..f85cfade 100644 --- a/Strategic/Town Militia.h +++ b/Strategic/Town Militia.h @@ -133,4 +133,8 @@ void GetResources( FLOAT& arValue_Gun, FLOAT& arValue_Armour, FLOAT& arValue_Mis FLOAT ResourceProgressModifier( UINT8 aProgress ); void DevalueResources(UINT8 aOldProgress, UINT8 aNewProgress); +// Flugente: intel +void AddIntel( FLOAT aValue, BOOLEAN aDoMessage = FALSE ); +FLOAT GetIntel(); + #endif \ No newline at end of file diff --git a/Strategic/mapscreen.cpp b/Strategic/mapscreen.cpp index cb1f42a6..c3e584e1 100644 --- a/Strategic/mapscreen.cpp +++ b/Strategic/mapscreen.cpp @@ -6926,8 +6926,7 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent ) { case ESC: gfDontStartTransitionFromLaptop = TRUE; - - + if( gfPreBattleInterfaceActive && !gfPersistantPBI ) { //Non persistant PBI. Allow ESC to close it and return to mapscreen. KillPreBattleInterface(); @@ -6977,47 +6976,17 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent ) fMapPanelDirty = TRUE; fCharacterInfoPanelDirty = TRUE; - // stop showing current assignment box - if( fShowAttributeMenu == TRUE ) - { - fShowAttributeMenu = FALSE; - fMapPanelDirty = TRUE; - } - // stop showing current assignment box - if( fShowFacilityAssignmentMenu == TRUE ) - { - fShowFacilityAssignmentMenu = FALSE; - fMapPanelDirty = TRUE; - } - else if( fShowTrainingMenu == TRUE ) - { - fShowTrainingMenu = FALSE; - } - else if( fShowSquadMenu == TRUE ) - { - fShowSquadMenu = FALSE; - } - else if( fShowRepairMenu == TRUE ) - { - fShowRepairMenu = FALSE; - } - else if( fShowMoveItemMenu == TRUE ) - { - fShowMoveItemMenu = FALSE; - } - else if ( fShowDiseaseMenu == TRUE ) - { - fShowDiseaseMenu = FALSE; - } - // HEADROCK HAM 3.6: Facility Menu - else if( fShowFacilityMenu == TRUE ) - { - fShowFacilityMenu = FALSE; - } - else - { - fShowAssignmentMenu = FALSE; - } + fShowAttributeMenu = FALSE; + fShowFacilityAssignmentMenu = FALSE; + fShowTrainingMenu = FALSE; + fShowSquadMenu = FALSE; + fShowRepairMenu = FALSE; + fShowMoveItemMenu = FALSE; + fShowDiseaseMenu = FALSE; + fShowSpyMenu = FALSE; + fShowFacilityMenu = FALSE; + fShowAssignmentMenu = FALSE; + giAssignHighLine = -1; // restore background to glow region RestoreBackgroundForAssignmentGlowRegionList( ); @@ -10833,7 +10802,7 @@ void TeamListInfoRegionBtnCallBack(MOUSE_REGION *pRegion, INT32 iReason ) fPlotForMilitia = FALSE; // if not dead or POW, select his sector - if( ( pSoldier->stats.bLife > 0 ) && ( pSoldier->bAssignment != ASSIGNMENT_POW ) ) + if( ( pSoldier->stats.bLife > 0 ) && ( pSoldier->bAssignment != ASSIGNMENT_POW ) )//&& !SPY_LOCATION( pSoldier->bAssignment ) ) { ChangeSelectedMapSector( pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ ); } @@ -10886,7 +10855,7 @@ void TeamListInfoRegionBtnCallBack(MOUSE_REGION *pRegion, INT32 iReason ) fPlotForMilitia = FALSE; // if not dead or POW, select his sector - if( ( pSoldier->stats.bLife > 0 ) && ( pSoldier->bAssignment != ASSIGNMENT_POW ) ) + if( ( pSoldier->stats.bLife > 0 ) && ( pSoldier->bAssignment != ASSIGNMENT_POW ) && !SPY_LOCATION( pSoldier->bAssignment ) ) { ChangeSelectedMapSector( pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ ); } @@ -11075,7 +11044,7 @@ void TeamListAssignmentRegionBtnCallBack(MOUSE_REGION *pRegion, INT32 iReason ) // Select all characters in squad INT16 iCounter; - for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ ) + for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; ++iCounter ) { if( gCharactersList[ iCounter ].fValid == TRUE ) { @@ -14605,6 +14574,10 @@ void ChangeSelectedMapSector( INT16 sMapX, INT16 sMapY, INT8 bMapZ ) // disallow going underground while plotting (surface) movement if ( ( bMapZ != 0 ) && ( ( bSelectedDestChar != -1 ) || fPlotForHelicopter ) ) return; + + // make sure we don' try to display bad levels + if ( bMapZ >= 10 ) + bMapZ -= 10; sSelMapX = sMapX; sSelMapY = sMapY; @@ -15364,9 +15337,10 @@ BOOLEAN AnyMovableCharsInOrBetweenThisSector( INT16 sSectorX, INT16 sSectorY, IN // POWs, dead guys, guys in transit can't move if ( ( pSoldier->bAssignment == IN_TRANSIT ) || - ( pSoldier->bAssignment == ASSIGNMENT_POW ) || - ( pSoldier->bAssignment == ASSIGNMENT_DEAD ) || - ( pSoldier->stats.bLife == 0 ) ) + ( pSoldier->bAssignment == ASSIGNMENT_POW ) || + SPY_LOCATION( pSoldier->bAssignment ) || + ( pSoldier->bAssignment == ASSIGNMENT_DEAD ) || + ( pSoldier->stats.bLife == 0 ) ) { continue; } @@ -15957,11 +15931,19 @@ void GetMapscreenMercLocationString( SOLDIERTYPE *pSoldier, CHAR16 sString[] ) } else { - if( pSoldier->bAssignment == ASSIGNMENT_POW ) + // Flugente: if we have intel on a POW, DO show their location + if ( pSoldier->bAssignment == ASSIGNMENT_POW && !( pSoldier->usSoldierFlagMask2 & SOLDIER_MERC_POW_LOCATIONKNOWN )) { // POW - location unknown swprintf( sString, L"%s", pPOWStrings[ 1 ] ); } + else if ( SPY_LOCATION( pSoldier->bAssignment ) ) + { + swprintf( pTempString, L"%s%s%s", + pMapVertIndex[pSoldier->sSectorY], pMapHortIndex[pSoldier->sSectorX], pMapDepthIndex[max(0, pSoldier->bSectorZ - 10)] ); + + swprintf( sString, L"%s*", pTempString ); + } else { swprintf( pTempString, L"%s%s%s", @@ -15993,8 +15975,9 @@ void GetMapscreenMercDestinationString( SOLDIERTYPE *pSoldier, CHAR16 sString[] // if dead or POW - has no destination (no longer part of a group, for that matter) if( ( pSoldier->bAssignment == ASSIGNMENT_DEAD ) || - ( pSoldier->bAssignment == ASSIGNMENT_POW ) || - ( pSoldier->stats.bLife == 0 ) ) + ( pSoldier->bAssignment == ASSIGNMENT_POW ) || + SPY_LOCATION( pSoldier->bAssignment ) || + ( pSoldier->stats.bLife == 0 ) ) { return; } diff --git a/Strategic/strategicmap.cpp b/Strategic/strategicmap.cpp index 51d7aa83..acac4eed 100644 --- a/Strategic/strategicmap.cpp +++ b/Strategic/strategicmap.cpp @@ -2222,7 +2222,7 @@ BOOLEAN SetCurrentWorldSector( INT16 sMapX, INT16 sMapY, INT8 bMapZ ) // GridNo = NOWHERE, which causes this assertion to fail //CHRISL: There's also an issue with vehicles. Soldiers in any vehicle are considered to be in sGridNo = NOWHERE // This will result in an assertion error, so let's skip the assertion if the merc is assigned to a vehicle - if ( !(MercPtrs[i]->flags.uiStatusFlags & SOLDIER_DEAD) && MercPtrs[i]->bAssignment != VEHICLE ) + if ( !(MercPtrs[i]->flags.uiStatusFlags & SOLDIER_DEAD) && MercPtrs[i]->bAssignment != VEHICLE && !SPY_LOCATION( MercPtrs[i]->bAssignment ) ) { //Assert( !MercPtrs[i]->bActive || !MercPtrs[i]->bInSector || MercPtrs[i]->sGridNo != NOWHERE || MercPtrs[i]->bVehicleID == iHelicopterVehicleId ); Assert( !MercPtrs[i]->bActive || !MercPtrs[i]->bInSector || !TileIsOutOfBounds( MercPtrs[i]->sGridNo ) || MercPtrs[i]->bVehicleID == iHelicopterVehicleId ); @@ -2729,7 +2729,7 @@ void PrepareLoadedSector( ) PostSchedules( ); } - if ( gubEnemyEncounterCode == ENEMY_AMBUSH_CODE || gubEnemyEncounterCode == BLOODCAT_AMBUSH_CODE || gubEnemyEncounterCode == ENEMY_AMBUSH_DEPLOYMENT_CODE ) + if ( GetEnemyEncounterCode() == ENEMY_AMBUSH_CODE || GetEnemyEncounterCode() == BLOODCAT_AMBUSH_CODE || GetEnemyEncounterCode() == ENEMY_AMBUSH_DEPLOYMENT_CODE ) { if ( gMapInformation.sCenterGridNo != NOWHERE ) { @@ -3221,37 +3221,44 @@ void UpdateMercsInSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ ) if ( pSoldier->bActive ) { - if ( !(gTacticalStatus.uiFlags & LOADING_SAVED_GAME) ) - { - if ( gMapInformation.sCenterGridNo != NOWHERE && gfBlitBattleSectorLocator && - (gubEnemyEncounterCode == ENEMY_AMBUSH_CODE || gubEnemyEncounterCode == BLOODCAT_AMBUSH_CODE) && pSoldier->bTeam != CIV_TEAM ) - { - // Flugente: improved ambush - if ( gGameExternalOptions.fAmbushSpreadMercs ) - { - UINT8 ubDirection; - - pSoldier->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO; - pSoldier->usStrategicInsertionData = FindRandomGridNoFromSweetSpotExcludingSweetSpot( pSoldier, gMapInformation.sCenterGridNo, gGameExternalOptions.usAmbushSpreadRadiusMercs, &ubDirection ); - - // have the merc look outward. We add + 100 because later on we use this to signify that we want really enforce this direction - pSoldier->ubInsertionDirection = (UINT8)GetDirectionToGridNoFromGridNo( gMapInformation.sCenterGridNo, pSoldier->usStrategicInsertionData ) + 100; - } - else - { - pSoldier->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO; - pSoldier->usStrategicInsertionData = gMapInformation.sCenterGridNo; - } - } - else if ( gfOverrideInsertionWithExitGrid ) - { - pSoldier->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO; - pSoldier->usStrategicInsertionData = gExitGrid.usGridNo; - } - } - if ( pSoldier->sSectorX == sSectorX && pSoldier->sSectorY == sSectorY && pSoldier->bSectorZ == bSectorZ && !pSoldier->flags.fBetweenSectors ) { + if ( !( gTacticalStatus.uiFlags & LOADING_SAVED_GAME ) ) + { + if ( gMapInformation.sCenterGridNo != NOWHERE && gfBlitBattleSectorLocator && + ( GetEnemyEncounterCode() == ENEMY_AMBUSH_CODE || GetEnemyEncounterCode() == BLOODCAT_AMBUSH_CODE ) && pSoldier->bTeam != CIV_TEAM ) + { + // Flugente: improved ambush + if ( gGameExternalOptions.fAmbushSpreadMercs ) + { + UINT8 ubDirection; + + pSoldier->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO; + pSoldier->usStrategicInsertionData = FindRandomGridNoFromSweetSpotExcludingSweetSpot( pSoldier, gMapInformation.sCenterGridNo, gGameExternalOptions.usAmbushSpreadRadiusMercs, &ubDirection ); + + // have the merc look outward. We add + 100 because later on we use this to signify that we want really enforce this direction + pSoldier->ubInsertionDirection = (UINT8)GetDirectionToGridNoFromGridNo( gMapInformation.sCenterGridNo, pSoldier->usStrategicInsertionData ) + 100; + } + else + { + pSoldier->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO; + pSoldier->usStrategicInsertionData = gMapInformation.sCenterGridNo; + } + } + else if ( gfOverrideInsertionWithExitGrid ) + { + pSoldier->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO; + pSoldier->usStrategicInsertionData = gExitGrid.usGridNo; + } + + // Flugente: override if entering from concealment + if ( pSoldier->usSoldierFlagMask2 & SOLDIER_CONCEALINSERTION ) + { + pSoldier->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO; + pSoldier->usStrategicInsertionData = pSoldier->sMTActionGridNo; + } + } + gbMercIsNewInThisSector[pSoldier->ubID] = 1; UpdateMercInSector( pSoldier, sSectorX, sSectorY, bSectorZ ); @@ -3297,10 +3304,10 @@ void UpdateMercsInSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ ) } } } - else + /*else { pSoldier->bInSector = FALSE; - } + }*/ } } } @@ -6521,9 +6528,9 @@ BOOLEAN HandlePotentialBringUpAutoresolveToFinishBattle( int pSectorX, int pSect gubPBSectorZ = (UINT8)pSectorZ; gfBlitBattleSectorLocator = TRUE; gfTransferTacticalOppositionToAutoResolve = TRUE; - if ( gubEnemyEncounterCode != CREATURE_ATTACK_CODE ) + if ( GetEnemyEncounterCode() != CREATURE_ATTACK_CODE ) { - gubEnemyEncounterCode = ENEMY_INVASION_CODE; //has to be, if militia are here. + SetEnemyEncounterCode( ENEMY_INVASION_CODE ); //has to be, if militia are here. } else { diff --git a/Tactical/Arms Dealer Init.cpp b/Tactical/Arms Dealer Init.cpp index 1b56c35c..13f48eca 100644 --- a/Tactical/Arms Dealer Init.cpp +++ b/Tactical/Arms Dealer Init.cpp @@ -18,6 +18,7 @@ #include "Scheduling.h" #include "GameSettings.h" #include "Overhead.h" // added by Flugente for MercPtrs[] + #include "LuaInitNPCs.h" // added by Flugente #endif #ifdef JA2UB @@ -42,6 +43,9 @@ void ConvertCreatureBloodToElixir( void ); +// Flugente: if we are a lua-based merchant, stop selling items we didn't explicitly want to be sold +void RemoveNonIntelItems(); + UINT8 gubLastSpecialItemAddedAtElement = 255; // Flugente 2012-12-19: merchant data has been externalised - see XML_Merchants.cpp @@ -237,6 +241,64 @@ void ShutDownArmsDealers() gArmsDealersInventory.clear(); } +typedef struct +{ + UINT16 usItem; + INT16 sIntelPrice; + INT16 sOptimalNumber; + +} ARMS_DEALER_ITEM_INTEL; + +std::map > gArmsDealerAdditionalIntelData; + +void AddArmsDealerAdditionalIntelData( UINT16 ausDealer, UINT16 usItem, INT16 sIntelPrice, INT16 sOptimalNumber ) +{ + ARMS_DEALER_ITEM_INTEL data; + data.usItem = usItem; + data.sIntelPrice = sIntelPrice; + data.sOptimalNumber = sOptimalNumber; + + gArmsDealerAdditionalIntelData[ausDealer].push_back( data ); +} + +void ArmsDealers_ReadIntelData() +{ + gArmsDealerAdditionalIntelData.clear(); + + // ask lua on what to use + LuaAddArmsDealerAdditionalIntelData(); +} + +void HandlePossibleArmsDealerIntelRefresh( BOOLEAN aForceReread ) +{ + if ( gArmsDealerAdditionalIntelData.empty() || aForceReread ) + { + ArmsDealers_ReadIntelData(); + + // replace xml-based possible inventory with what lua gave us + for ( std::map >::iterator it = gArmsDealerAdditionalIntelData.begin(); it != gArmsDealerAdditionalIntelData.end(); ++it) + { + UINT16 dealerid = ( *it ).first; + + DEALER_POSSIBLE_INV* pDealerInv = GetPointerToDealersPossibleInventory( dealerid ); + + memset( pDealerInv, 0, sizeof( DEALER_POSSIBLE_INV )*MAXITEMS ); + + int cnt = 0; + for ( std::vector::iterator it2 = (*it).second.begin(); it2 != ( *it ).second.end(); ++it2 ) + { + ARMS_DEALER_ITEM_INTEL data = ( *it2 ); + + pDealerInv[cnt].uiIndex = cnt; + pDealerInv[cnt].sItemIndex = data.usItem; + pDealerInv[cnt].ubOptimalNumber = data.sOptimalNumber; + + ++cnt; + } + } + } +} + BOOLEAN SaveArmsDealerInventoryToSaveGameFile( HWFILE hFile ) { UINT32 uiNumBytesWritten; @@ -313,7 +375,7 @@ void DailyUpdateOfArmsDealersInventory() { // if Gabby has creature blood, start turning it into extra elixir ConvertCreatureBloodToElixir(); - + //Simulate other customers buying inventory from the dealer SimulateArmsDealerCustomer(); @@ -323,6 +385,10 @@ void DailyUpdateOfArmsDealersInventory() #else DailyCheckOnItemQuantities(); #endif + + // Flugente: if we are a lua-based merchant, stop selling items we didn't explicitly want to be sold + RemoveNonIntelItems(); + //make sure certain items are in stock and certain limits are respected AdjustCertainDealersInventory( ); } @@ -423,6 +489,8 @@ void DailyCheckOnItemQuantities() UINT32 uiArrivalDay; UINT8 ubReorderDays; + HandlePossibleArmsDealerIntelRefresh(TRUE); + //loop through all the arms dealers for( ubArmsDealer=0;ubArmsDealer baditemsvector; + + for ( DealerItemList::iterator iter = gArmsDealersInventory[ubArmsDealer].begin(); iter != gArmsDealersInventory[ubArmsDealer].end(); ++iter ) + { + if ( iter->ItemIsInInventory() == true && CalcValueOfItemToDealer( ubArmsDealer, iter->object.usItem, TRUE ) < 1 ) + baditemsvector.push_back( iter->object.usItem ); + } + + for ( std::vector::iterator it2 = baditemsvector.begin(); it2 != baditemsvector.end(); ++it2 ) + { + RemoveItemFromArmsDealerInventory( ubArmsDealer, (*it2), 100 ); + } + } + } +} + BOOLEAN AdjustCertainDealersInventory( ) { //Adjust Tony's items (this restocks *instantly* 1/day, doesn't use the reorder system) @@ -2083,15 +2177,15 @@ UINT32 CalculateSimpleItemRepairCost( UINT8 ubArmsDealer, UINT16 usItemIndex, IN BOOLEAN DoesItemAppearInDealerInventoryList( UINT8 ubArmsDealer, UINT16 usItemIndex, BOOLEAN fPurchaseFromPlayer ) { - DEALER_POSSIBLE_INV *pDealerInv=NULL; - UINT16 usCnt; + // Flugente: a dealer's inventory is defined in lua if they deal in intel + HandlePossibleArmsDealerIntelRefresh(FALSE); // the others will buy only things that appear in their own "for sale" inventory lists - pDealerInv = GetPointerToDealersPossibleInventory( ubArmsDealer ); + DEALER_POSSIBLE_INV* pDealerInv = GetPointerToDealersPossibleInventory( ubArmsDealer ); Assert( pDealerInv != NULL ); // loop through the dealers' possible inventory and see if the item exists there - usCnt = 0; + UINT16 usCnt = 0; while( pDealerInv[ usCnt ].sItemIndex != LAST_DEALER_ITEM ) { //if the initial dealer inv contains the required item, the dealer can sell the item @@ -2119,6 +2213,22 @@ UINT16 CalcValueOfItemToDealer( UINT8 ubArmsDealer, UINT16 usItemIndex, BOOLEAN usBasePrice = Item[ usItemIndex ].usPrice; + // Flugente: if we deal with intel, get the price of an item straight from LUA + if ( ( armsDealerInfo[ubArmsDealer].uiFlags & ARMS_DEALER_DEALWITHINTEL ) ) + { + if ( !gArmsDealerAdditionalIntelData[ubArmsDealer].empty() ) + { + for ( std::vector::iterator it = gArmsDealerAdditionalIntelData[ubArmsDealer].begin(); it != gArmsDealerAdditionalIntelData[ubArmsDealer].end(); ++it ) + { + if ( ( *it ).usItem == usItemIndex ) + return ( *it ).sIntelPrice; + } + } + + return 0; + } + + if ( usBasePrice == 0 ) { // worthless to any dealer diff --git a/Tactical/Arms Dealer Init.h b/Tactical/Arms Dealer Init.h index b2d16ce1..b95c9699 100644 --- a/Tactical/Arms Dealer Init.h +++ b/Tactical/Arms Dealer Init.h @@ -101,6 +101,7 @@ enum #define ARMS_DEALER_HARDWARE 0x00400000 | ARMS_DEALER_KIT #define ARMS_DEALER_MEDICAL 0x00800000 | ARMS_DEALER_MEDKIT +#define ARMS_DEALER_DEALWITHINTEL 0x01000000 // 16777216 // Flugente: this dealer does not accept money, only intel #define ARMS_DEALER_CREATURE_PARTS 0x02000000 // 33554432 #define ARMS_DEALER_ROCKET_RIFLE 0x04000000 // 67108864 #define ARMS_DEALER_ONLY_USED_ITEMS 0x08000000 // 134217728 @@ -348,6 +349,9 @@ void RemoveItemFromArmsDealerInventory( UINT8 ubArmsDealer, UINT16 usItemIndex, BOOLEAN IsMercADealer( UINT8 ubMercID ); INT8 GetArmsDealerIDFromMercID( UINT8 ubMercID ); +// Flugente: update possible intel data +void HandlePossibleArmsDealerIntelRefresh(BOOLEAN aForceReread); + BOOLEAN SaveArmsDealerInventoryToSaveGameFile( HWFILE hFile ); void DailyUpdateOfArmsDealersInventory(); diff --git a/Tactical/Dialogue Control.cpp b/Tactical/Dialogue Control.cpp index 717587b8..ffe79500 100644 --- a/Tactical/Dialogue Control.cpp +++ b/Tactical/Dialogue Control.cpp @@ -1128,7 +1128,6 @@ void HandleDialogue( ) if ( QItem->uiSpecialEventFlag & DIALOGUE_SPECIAL_EVENT_SHOPKEEPER ) { - if( QItem->uiSpecialEventData < 3 ) { // post a notice if the player wants to withdraw money from thier account to cover the difference? @@ -1136,8 +1135,14 @@ void HandleDialogue( ) InsertCommasForDollarFigure( zMoney ); InsertDollarSignInToString( zMoney ); } + else if ( QItem->uiSpecialEventData > 7 ) + { + // post a notice if the player wants to withdraw money from thier account to cover the difference? + swprintf( zMoney, L"%d", QItem->uiSpecialEventData2 ); + InsertCommasForDollarFigure( zMoney ); + } - switch( QItem->uiSpecialEventData ) + switch( QItem->uiSpecialEventData ) { case( 0 ): swprintf( zText, SkiMessageBoxText[ SKI_SHORT_FUNDS_TEXT ], zMoney ); @@ -1184,6 +1189,22 @@ void HandleDialogue( ) EnableButton( guiSKI_TransactionButton ); } break; + + case8: + //if the player is trading items + swprintf( zText, SkiMessageBoxText[SKI_QUESTION_TO_DEDUCT_INTEL_FROM_PLAYERS_ACCOUNT_TO_COVER_DIFFERENCE], zMoney ); + + //ask them if we should deduct money out the players account to cover the difference + DoSkiMessageBox( MSG_BOX_BASIC_STYLE, zText, SHOPKEEPER_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmToDeductIntelFromPlayersAccountMessageBoxCallBack ); + + break; + + case 9: + swprintf( zText, SkiMessageBoxText[SKI_QUESTION_TO_DEDUCT_INTEL_FROM_PLAYERS_ACCOUNT_TO_COVER_COST], zMoney ); + + //ask them if we should deduct money out the players account to cover the difference + DoSkiMessageBox( MSG_BOX_BASIC_STYLE, zText, SHOPKEEPER_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmToDeductIntelFromPlayersAccountMessageBoxCallBack ); + break; } } diff --git a/Tactical/Faces.cpp b/Tactical/Faces.cpp index 1b2339a6..74262386 100644 --- a/Tactical/Faces.cpp +++ b/Tactical/Faces.cpp @@ -1647,9 +1647,10 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE FLOAT bPtsAvailable = 0.0; // Flugente: sometimes, we want to display float values... UINT16 usMaximumPts = 0; CHAR16 sString[ 32 ]; - UINT16 usTextWidth; + UINT16 usTextWidth = 0; BOOLEAN fShowNumber = FALSE; BOOLEAN fShowMaximum = FALSE; + BOOLEAN fShowCustomText = FALSE; SOLDIERTYPE *pSoldier; INT16 sFontX, sFontY; INT16 sX1, sY1, sY2, sX2; @@ -1670,9 +1671,7 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE UINT32 uiFaceTwo=0; BOOLEAN drawOpponentCount = FALSE; - - CHAR16 wShortText[ 8 ]; // added by Flugente to display sector names - + // If we are using an extern buffer... if ( fUseExternBuffer ) { @@ -2375,11 +2374,10 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE { sIconIndex_Assignment = 15; fDoIcon_Assignment = TRUE; - - GetShortSectorString( SECTORX(pSoldier->usItemMoveSectorID), SECTORY(pSoldier->usItemMoveSectorID), wShortText ); - fShowNumber = TRUE; - fShowMaximum = TRUE; + fShowCustomText = TRUE; + + GetShortSectorString( SECTORX(pSoldier->usItemMoveSectorID), SECTORY(pSoldier->usItemMoveSectorID), sString ); } break; @@ -2467,6 +2465,27 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE usMaximumPts = (INT16)(pSectorInfo->dFortification_MaxPossible); } } + break; + + case CONCEALED: + case GATHERINTEL: + sIconIndex_Assignment = 34; + fDoIcon_Assignment = TRUE; + fShowCustomText = TRUE; + + if ( pSoldier->usSkillCooldown[SOLDIER_COOLDOWN_INTEL_PENALTY] ) + { + swprintf( sString, L"Hide %dh", pSoldier->usSkillCooldown[SOLDIER_COOLDOWN_INTEL_PENALTY] ); + } + else + { + bPtsAvailable = MercPtrs[pFace->ubSoldierID]->GetIntelGain(); + usMaximumPts = (UINT16)( MercPtrs[pFace->ubSoldierID]->GetUncoverRisk() ); + + swprintf( sString, L"%4.2f/%d%%%%", bPtsAvailable, usMaximumPts ); + + usTextWidth = StringPixLength( sString, FONT10ARIAL ) - 10; + } break; } @@ -2494,30 +2513,32 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE BltVideoObjectFromIndex( uiRenderBuffer, guiASSIGNMENTICONS, sIconIndex_Assignment, sIconX, sIconY, VO_BLT_SRCTRANSPARENCY, NULL ); // ATE: Show numbers only in mapscreen - if( fShowNumber ) + if ( fShowNumber || fShowCustomText ) { + if ( fShowNumber ) + { + if ( fShowMaximum ) + { + swprintf( sString, L"%d/%d", sPtsAvailable, usMaximumPts ); + } + else + { + swprintf( sString, L"%d", sPtsAvailable ); + } + } + SetFontDestBuffer( uiRenderBuffer, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE ); - if ( fShowMaximum ) - { - if ( pSoldier->bAssignment == MOVE_EQUIPMENT ) - swprintf( sString, L"%s", wShortText ); - else - swprintf( sString, L"%d/%d", sPtsAvailable, usMaximumPts ); - } - else - { - swprintf( sString, L"%d", sPtsAvailable ); - } + if ( !usTextWidth ) + usTextWidth = StringPixLength( sString, FONT10ARIAL ); - usTextWidth = StringPixLength( sString, FONT10ARIAL ); usTextWidth += 1; SetFont( FONT10ARIAL ); SetFontForeground( FONT_YELLOW ); SetFontBackground( FONT_BLACK ); - mprintf( sFaceX + pFace->usFaceWidth - usTextWidth, ( INT16 )( sFaceY + 3 ), sString ); + mprintf( sFaceX + pFace->usFaceWidth - usTextWidth, (INT16)( sFaceY + 3 ), sString ); SetFontDestBuffer( FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE ); } } diff --git a/Tactical/Handle Items.cpp b/Tactical/Handle Items.cpp index 184fd3d8..48262e28 100644 --- a/Tactical/Handle Items.cpp +++ b/Tactical/Handle Items.cpp @@ -1421,6 +1421,30 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa } } + // Flugente: camera + if ( HasItemFlag( usHandItem, CAMERA ) ) + { + sAPCost = APBPConstants[AP_CAMERA]; + + if ( EnoughPoints( pSoldier, sAPCost, 0, fFromUI ) ) + { + if ( SoldierTo3DLocationLineOfSightTest( pSoldier, sGridNo, gsInterfaceLevel, 0, TRUE, CALC_FROM_WANTED_DIR, TRUE ) ) + { + TakePhoto( pSoldier, usMapPos, gsInterfaceLevel ); + + return( ITEM_HANDLE_OK ); + } + else + { + return( ITEM_HANDLE_CANNOT_GETTO_LOCATION ); + } + } + else + { + return( ITEM_HANDLE_NOAPS ); + } + } + // Flugente: apply misc items to other soldiers if ( ItemCanBeAppliedToOthers( usHandItem ) ) { @@ -9238,6 +9262,9 @@ void ReadEquipmentTable( SOLDIERTYPE* pSoldier, std::string name ) // the temperature of the water in this sector (temperature reflects the quality) FLOAT wateraddtemperature = OVERHEATING_MAX_TEMPERATURE; + + // if we try to add an attachment that cannot be added by this function (we don't perform skill checks here), warn the player of the offending item + UINT16 attachmenttowarnabout = NOTHING; // 1. loop over the gear we should pick up and remove mismatching items if we can find a fitting one in the sector for (std::vector::iterator it = vec.begin(); it != vec.end(); ++it) @@ -9381,7 +9408,7 @@ void ReadEquipmentTable( SOLDIERTYPE* pSoldier, std::string name ) UINT8 index = 0; if ( GetBetterObject_InventoryPool( item_attachment, 0, poolslot, index ) ) { - (pInventoryPoolList[poolslot].object).RemoveObjectAtIndex( index, &gItemPointer ); + ( pInventoryPoolList[poolslot].object ).RemoveObjectAtIndex( index, &gItemPointer ); BOOLEAN isAttachedNow = pObj->AttachObject( pSoldier, &gItemPointer, FALSE, i ); //do the actual attaching @@ -9396,6 +9423,10 @@ void ReadEquipmentTable( SOLDIERTYPE* pSoldier, std::string name ) } } } + else + { + attachmenttowarnabout = item_attachment; + } } } } @@ -9657,7 +9688,11 @@ void ReadEquipmentTable( SOLDIERTYPE* pSoldier, std::string name ) DeleteObj( &gItemPointer ); } } - } + } + else + { + attachmenttowarnabout = item_attachment; + } } } } @@ -9809,6 +9844,12 @@ void ReadEquipmentTable( SOLDIERTYPE* pSoldier, std::string name ) else if ( attachmentsound ) PlayJA2Sample( ATTACH_TO_GUN, RATE_11025, HIGHVOLUME, 1, MIDDLEPAN ); + // warn us if we tried to attach something we can't attach + if ( attachmenttowarnabout != NOTHING ) + { + ScreenMsg( color, MSG_INTERFACE, szGearTemplateText[5], Item[attachmenttowarnabout].szItemName, attachmenttowarnabout ); + } + // 6. redraw inventory fTeamPanelDirty = TRUE; fMapPanelDirty = TRUE; @@ -9820,3 +9861,48 @@ void ReadEquipmentTable( SOLDIERTYPE* pSoldier, std::string name ) MarkAButtonDirty( giItemDescAmmoButton ); // Required for tactical screen } } + +// Flugente: intel +void TakePhoto(SOLDIERTYPE* pSoldier, INT32 sGridNo, INT8 bLevel ) +{ + if ( !pSoldier || TileIsOutOfBounds( sGridNo ) ) + return; + + // if we take a photo, take note of all rooms & NPC we see. We then send that to LUA, where we store anything worthwhile + // later on, we can then sell worthwhile information 'gathered' this way for intel + + // to make this simple, check only tiles in a radius around the gridno we targetted + INT16 sBaseX, sBaseY; + ConvertGridNoToXY( sGridNo, &sBaseX, &sBaseY ); + + int radius = 3; + + for ( int x = -radius; x < radius; ++x ) + { + int diff = sqrt( radius*radius - x*x ); + + for ( int y = -diff; y < diff; ++y ) + { + INT32 newgridno = MAPROWCOLTOPOS( (sBaseY + y), ( sBaseX + x )); + + // can we see this gridno? + if ( SoldierTo3DLocationLineOfSightTest( pSoldier, newgridno, bLevel, 0, TRUE, CALC_FROM_WANTED_DIR, TRUE ) ) + { + // check if this is a room + UINT16 room = NO_ROOM; + if ( !bLevel ) + InARoom( newgridno, &room ); + + // check if there is someone here + UINT16 ubid = WhoIsThere2( newgridno, bLevel ); + + LuaAddPhotoData( gWorldSectorX, gWorldSectorY, gbWorldSectorZ, newgridno, bLevel, pSoldier->ubProfile, room, ( ubid == NOBODY ) ? NO_PROFILE : MercPtrs[ubid]->ubProfile ); + } + } + } + + DeductPoints( pSoldier, APBPConstants[AP_CAMERA], 0, 0 ); + + // Play sound + PlayJA2SampleFromFile( "Sounds\\camera1.wav", RATE_11025, HIGHVOLUME, 1, MIDDLEPAN ); +} diff --git a/Tactical/Handle Items.h b/Tactical/Handle Items.h index 71aa4fa6..6648f413 100644 --- a/Tactical/Handle Items.h +++ b/Tactical/Handle Items.h @@ -305,4 +305,8 @@ extern ITEM_POOL *gpItemPool;//dnl ch26 210909 void DoInteractiveAction( INT32 sGridNo, SOLDIERTYPE *pSoldier ); void DoInteractiveActionDefaultResult( INT32 sGridNo, UINT8 ubID, BOOLEAN aSuccess ); BOOLEAN SpendMoney( SOLDIERTYPE *pSoldier, UINT32 aAmount ); // character spends money - either from inventory or the account + +// Flugente: intel +void TakePhoto( SOLDIERTYPE* pSoldier, INT32 sGridNo, INT8 bLevel ); + #endif \ No newline at end of file diff --git a/Tactical/Handle UI.cpp b/Tactical/Handle UI.cpp index 881ca9ee..8f0ec301 100644 --- a/Tactical/Handle UI.cpp +++ b/Tactical/Handle UI.cpp @@ -4660,6 +4660,14 @@ BOOLEAN UIMouseOnValidAttackLocation( SOLDIERTYPE *pSoldier ) return( FALSE ); } + if ( ubItemCursor == CAMERACURS ) + { + if ( HasItemFlag( ( &( pSoldier->inv[HANDPOS] ) )->usItem, CAMERA ) && SoldierTo3DLocationLineOfSightTest( pSoldier, usMapPos, gsInterfaceLevel, 0, TRUE, CALC_FROM_WANTED_DIR, TRUE ) ) + return TRUE; + + return FALSE; + } + if ( ubItemCursor == APPLYITEMCURS ) { if ( ItemCanBeAppliedToOthers( (&(pSoldier->inv[HANDPOS]))->usItem ) ) diff --git a/Tactical/Interface Cursors.cpp b/Tactical/Interface Cursors.cpp index 99b2c808..18d1bbe9 100644 --- a/Tactical/Interface Cursors.cpp +++ b/Tactical/Interface Cursors.cpp @@ -233,6 +233,9 @@ UICursor gUICursors[ NUM_UI_CURSORS ] = MINIGAME_GREY_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_MINIGAME, 0, MINIGAME_RED_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_MINIGAME_RED, 0, + CAMERA_GREY_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_CAMERA, 0, + CAMERA_RED_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_CAMERA_RED, 0, + }; diff --git a/Tactical/Interface Cursors.h b/Tactical/Interface Cursors.h index 553b8db7..b2e40776 100644 --- a/Tactical/Interface Cursors.h +++ b/Tactical/Interface Cursors.h @@ -210,6 +210,9 @@ typedef enum MINIGAME_GREY_UICURSOR, MINIGAME_RED_UICURSOR, + CAMERA_GREY_UICURSOR, + CAMERA_RED_UICURSOR, + NUM_UI_CURSORS } UICursorDefines; diff --git a/Tactical/Interface Enhanced.cpp b/Tactical/Interface Enhanced.cpp index 5095409e..e258ba1a 100644 --- a/Tactical/Interface Enhanced.cpp +++ b/Tactical/Interface Enhanced.cpp @@ -2720,6 +2720,15 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr MSYS_EnableRegion( &gUDBFasthelpRegions[iFirstDataRegion + cnt] ); ++cnt; } + + //////////////////// CAMERA + if ( HasItemFlag( gpItemDescObject->usItem, CAMERA ) ) + { + swprintf( pStr, L"%s%s", szUDBGenSecondaryStatsTooltipText[41], szUDBGenSecondaryStatsExplanationsTooltipText[41] ); + SetRegionFastHelpText( &( gUDBFasthelpRegions[iFirstDataRegion + cnt] ), pStr ); + MSYS_EnableRegion( &gUDBFasthelpRegions[iFirstDataRegion + cnt] ); + ++cnt; + } } ////////////////////////////////////////////////////// @@ -6256,6 +6265,14 @@ void DrawSecondaryStats( OBJECTTYPE * gpItemDescObject ) BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 38, gItemDescGenSecondaryRegions[cnt].sLeft + sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); ++cnt; } + + //////////////////// CAMERA + if ( ( HasItemFlag( gpItemDescObject->usItem, CAMERA ) && !fComparisonMode ) || + ( fComparisonMode && HasItemFlag( gpComparedItemDescObject->usItem, CAMERA ) ) ) + { + BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoSecondaryIcon, 39, gItemDescGenSecondaryRegions[cnt].sLeft + sOffsetX, gItemDescGenSecondaryRegions[cnt].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL ); + cnt++; + } } void DrawPropertyValueInColour( INT16 iValue, UINT8 ubNumLine, UINT8 ubNumRegion, BOOLEAN fComparisonMode, BOOLEAN fModifier, BOOLEAN fHigherBetter, UINT16 uiOverwriteColour = 0, BOOLEAN fPercentSign = FALSE ) diff --git a/Tactical/Item Types.h b/Tactical/Item Types.h index fe26ba3e..8e575c69 100644 --- a/Tactical/Item Types.h +++ b/Tactical/Item Types.h @@ -737,7 +737,7 @@ extern OBJECTTYPE gTempObject; //#define EMPTY_SANDBAG 0x00000001 //1 #define MANPAD 0x00000002 //2 // this item is a MAn-Portable Air-Defense System #define BEARTRAP 0x00000004 //4 // a mechanical trap that does no explosion, but causes leg damage to whoever activates it -//#define CONCERTINA 0x00000008 //8 +#define CAMERA 0x00000008 //8 #define WATER_DRUM 0x00000010 //16 // water drums allow to refill canteens in the sector they are in #define MEAT_BLOODCAT 0x00000020 //32 // retrieve this by gutting a bloodcat diff --git a/Tactical/Overhead Types.h b/Tactical/Overhead Types.h index d90a947c..f55c2416 100644 --- a/Tactical/Overhead Types.h +++ b/Tactical/Overhead Types.h @@ -373,6 +373,7 @@ enum FACTORY_GROUP, ADMINISTRATIVE_STAFF_GROUP, LOYAL_CIV_GROUP, // civil population deeply loyal to the queen + BLACKMARKET_GROUP, // black market dealer and bodyguards UNNAMED_CIV_GROUP_34, UNNAMED_CIV_GROUP_35, UNNAMED_CIV_GROUP_36, diff --git a/Tactical/Overhead.cpp b/Tactical/Overhead.cpp index ef065202..1d3772f0 100644 --- a/Tactical/Overhead.cpp +++ b/Tactical/Overhead.cpp @@ -6774,51 +6774,53 @@ BOOLEAN GetPlayerControlledPrisonList( std::vector& arSectorIDVector ) return ( !arSectorIDVector.empty() ); } -extern INT32 giReinforcementPool; +extern void DoInterrogation( INT16 sMapX, INT16 sMapY, FLOAT aChanceModifier, INT16 aPrisoners[] ); // we cannot simply move all prisoners of a sector. It might be a prison we are already using, so we would move all inmates, not just the new ones INT16 gsNumPrisoner[PRISONER_MAX] = {0}; void PrisonerMessageBoxCallBack( UINT8 ubExitValue ) { - UINT8 usSectorID = (UINT8)(DropDownTemplate::getInstance( ).GetSelectedEntryKey( )); - - // if sector is still not set, then we did not select one - release prisoners - if ( usSectorID == 0 ) + if ( DropDownTemplate::getInstance().GetSelectedEntryKey() < 0 ) { - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szPrisonerTextStr[STR_PRISONER_RELEASED] ); + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, TacticalStr[PRISONER_FIELDINTERROGATION_STR] ); + + DoInterrogation( gWorldSectorX, gWorldSectorY, 0.5f, gsNumPrisoner ); } - - BOOLEAN success = FALSE; - INT16 prisonerstobemoved = 0; - for ( int i = PRISONER_ADMIN; i < PRISONER_MAX; ++i ) - prisonerstobemoved += gsNumPrisoner[i]; - - if ( usSectorID > 0 ) + else { - SECTORINFO *pPrisonSectorInfo = &(SectorInfo[usSectorID]); + UINT8 usSectorID = (UINT8)( DropDownTemplate::getInstance().GetSelectedEntryKey() ); - if ( pPrisonSectorInfo ) + // if sector is still not set, then we did not select one - release prisoners + if ( usSectorID == 0 ) { - success = TRUE; + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szPrisonerTextStr[STR_PRISONER_RELEASED] ); + } - ChangeNumberOfPrisoners( pPrisonSectorInfo, gsNumPrisoner ); + BOOLEAN success = FALSE; + INT16 prisonerstobemoved = 0; + for ( int i = PRISONER_ADMIN; i < PRISONER_MAX; ++i ) + prisonerstobemoved += gsNumPrisoner[i]; - CHAR16 wString[128]; - GetSectorIDString( SECTORX( usSectorID ), SECTORY( usSectorID ), 0, wString, TRUE ); - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szPrisonerTextStr[STR_PRISONER_SENTTOSECTOR], prisonerstobemoved, wString ); + if ( usSectorID > 0 ) + { + SECTORINFO *pPrisonSectorInfo = &( SectorInfo[usSectorID] ); + + if ( pPrisonSectorInfo ) + { + success = TRUE; + + ChangeNumberOfPrisoners( pPrisonSectorInfo, gsNumPrisoner ); + + CHAR16 wString[128]; + GetSectorIDString( SECTORX( usSectorID ), SECTORY( usSectorID ), 0, wString, TRUE ); + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szPrisonerTextStr[STR_PRISONER_SENTTOSECTOR], prisonerstobemoved, wString ); + } } } for ( int i = PRISONER_ADMIN; i < PRISONER_MAX; ++i ) gsNumPrisoner[i] = 0; - - if ( !success ) - { - // send some prisoners back to queen's pool - // there is a chance that escaped prisoners may return to the queen... - giReinforcementPool += (prisonerstobemoved * gGameExternalOptions.ubPrisonerReturntoQueenChance) / 100; - } } @@ -6960,7 +6962,7 @@ void RemoveCapturedEnemiesFromSectorInfo( INT16 sMapX, INT16 sMapY, INT8 bMapZ ) gsNumPrisoner[i] = sNumPrisoner[i]; std::vector > dropdownvector_1; - + std::vector::iterator itend = prisonsectorvector.end( ); for ( std::vector::iterator it = prisonsectorvector.begin( ); it != itend; ++it ) { @@ -6970,6 +6972,9 @@ void RemoveCapturedEnemiesFromSectorInfo( INT16 sMapX, INT16 sMapY, INT8 bMapZ ) dropdownvector_1.push_back( std::make_pair( (INT16)(usSectorID), gPrisonSectorNamesStr[usSectorID] ) ); } + + // field interogation is always possible + dropdownvector_1.push_back( std::make_pair( -1, TacticalStr[PRISONER_FIELDINTERROGATION_SHORT_STR] ) ); DropDownTemplate::getInstance( ).SetEntries( dropdownvector_1 ); @@ -6978,22 +6983,12 @@ void RemoveCapturedEnemiesFromSectorInfo( INT16 sMapX, INT16 sMapY, INT8 bMapZ ) DoMessageBox( MSG_BOX_BASIC_MEDIUM_BUTTONS, sString, GAME_SCREEN, (MSG_BOX_FLAG_OK | MSG_BOX_FLAG_DROPDOWN_1), PrisonerMessageBoxCallBack, NULL ); } - // if we control no prison, we have to let them go... + // if we control no prison, do a field interrogation else { - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, TacticalStr[PRISONER_NO_PRISONS_STR] ); + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, TacticalStr[PRISONER_FIELDINTERROGATION_STR] ); - // some prisoners volunteer to work for us - UINT16 volunteers = Random( ubNumPrisoners / 3 ); - - if ( volunteers ) - { - AddVolunteers( volunteers ); - - // we add the volunteers anyway, but only show the message if this feature is on - if ( gGameExternalOptions.fMilitiaVolunteerPool ) - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szPrisonerTextStr[STR_PRISONER_TURN_VOLUNTEER], volunteers ); - } + DoInterrogation( sMapX, sMapY, 0.5f, sNumPrisoner ); } } } @@ -10089,6 +10084,28 @@ BOOLEAN HostileZombiesPresent( ) return( FALSE ); } +BOOLEAN HostileCreaturesPresent() +{ + SOLDIERTYPE* pSoldier; + + if ( gTacticalStatus.Team[CREATURE_TEAM].bTeamActive == FALSE ) + { + return( FALSE ); + } + + for ( INT32 iLoop = gTacticalStatus.Team[CREATURE_TEAM].bFirstID; iLoop <= gTacticalStatus.Team[CREATURE_TEAM].bLastID; ++iLoop ) + { + pSoldier = MercPtrs[iLoop]; + + if ( pSoldier && pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife > 0 ) + { + return( TRUE ); + } + } + + return( FALSE ); +} + void HandleCreatureTenseQuote( ) { // WDS - make number of mercenaries, etc. be configurable diff --git a/Tactical/Overhead.h b/Tactical/Overhead.h index c68c8d4e..6c118bed 100644 --- a/Tactical/Overhead.h +++ b/Tactical/Overhead.h @@ -319,6 +319,7 @@ BOOLEAN HostileCiviliansWithGunsPresent( ); BOOLEAN HostileCiviliansPresent( ); BOOLEAN HostileBloodcatsPresent( ); BOOLEAN HostileZombiesPresent( ); +BOOLEAN HostileCreaturesPresent(); UINT8 NumPCsInSector( ); void SetSoldierNonNeutral( SOLDIERTYPE * pSoldier ); diff --git a/Tactical/ShopKeeper Interface.cpp b/Tactical/ShopKeeper Interface.cpp index c2c23969..2dca4a09 100644 --- a/Tactical/ShopKeeper Interface.cpp +++ b/Tactical/ShopKeeper Interface.cpp @@ -54,6 +54,7 @@ #include "InterfaceItemImages.h" #include "Encyclopedia_new.h" #include "Animation Control.h" // added by Flugente + #include "Town Militia.h" // added by Flugente #endif #ifdef JA2UB @@ -555,7 +556,6 @@ BOOLEAN RemoveRepairItemFromDealersOfferArea( INT16 bSlot ); INT8 GetInvSlotOfUnfullMoneyInMercInventory( SOLDIERTYPE *pSoldier ); void ClearPlayersOfferSlot( INT32 ubSlotToClear ); void ClearArmsDealerOfferSlot( INT32 ubSlotToClear ); -void ConfirmToDeductMoneyFromPlayersAccountMessageBoxCallBack( UINT8 bExitValue ); BOOLEAN DoSkiMessageBox( UINT8 ubStyle, STR16 zString, UINT32 uiExitScreen, UINT8 ubFlags, MSGBOX_CALLBACK ReturnCallback ); @@ -1551,8 +1551,14 @@ BOOLEAN RenderShopKeeperInterface() swprintf( zMoney, L"%d", gArmsDealerStatus[gbSelectedArmsDealerID].uiArmsDealersCash ); InsertCommasForDollarFigure( zMoney ); - InsertDollarSignInToString( zMoney ); - DrawTextToScreen( zMoney, SKI_BUDGET_X, SKI_BUDGET_OFFSET_TO_VALUE, SKI_BUDGET_WIDTH, FONT10ARIAL, SKI_ITEM_PRICE_COLOR, FONT_MCOLOR_BLACK, TRUE, CENTER_JUSTIFIED ); + + CHAR16 zTemp2[64]; + if ( armsDealerInfo[gbSelectedArmsDealerID].uiFlags & ARMS_DEALER_DEALWITHINTEL ) + swprintf( zTemp2, L"%s Intel", zMoney ); + else + swprintf( zTemp2, L"$%s", zMoney ); + + DrawTextToScreen( zTemp2, SKI_BUDGET_X, SKI_BUDGET_OFFSET_TO_VALUE, SKI_BUDGET_WIDTH, FONT10ARIAL, SKI_ITEM_PRICE_COLOR, FONT_MCOLOR_BLACK, TRUE, CENTER_JUSTIFIED ); //if the dealer repairs if( armsDealerInfo[ gbSelectedArmsDealerID ].ubTypeOfArmsDealer == ARMS_DEALER_REPAIRS ) @@ -1570,11 +1576,20 @@ BOOLEAN RenderShopKeeperInterface() DisplayWrappedString( SKI_PLAYERS_CURRENT_BALANCE_X, SKI_PLAYERS_CURRENT_BALANCE_Y, SKI_PLAYERS_CURRENT_BALANCE_WIDTH, 2, SKI_LABEL_FONT, SKI_TITLE_COLOR, SkiMessageBoxText[ SKI_PLAYERS_CURRENT_BALANCE ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED ); //Display the players current balance value - swprintf( zMoney, L"%d", LaptopSaveInfo.iCurrentBalance ); + if ( armsDealerInfo[gbSelectedArmsDealerID].uiFlags & ARMS_DEALER_DEALWITHINTEL ) + { + swprintf( zMoney, L"%d", (int)(GetIntel()) ); + InsertCommasForDollarFigure( zMoney ); + swprintf( zTemp2, L"%s Intel", zMoney ); + } + else + { + swprintf( zMoney, L"%d", LaptopSaveInfo.iCurrentBalance ); + InsertCommasForDollarFigure( zMoney ); + swprintf( zTemp2, L"$%s", zMoney ); + } - InsertCommasForDollarFigure( zMoney ); - InsertDollarSignInToString( zMoney ); - DrawTextToScreen( zMoney, SKI_PLAYERS_CURRENT_BALANCE_X, SKI_PLAYERS_CURRENT_BALANCE_OFFSET_TO_VALUE, SKI_PLAYERS_CURRENT_BALANCE_WIDTH, FONT10ARIAL, SKI_ITEM_PRICE_COLOR, FONT_MCOLOR_BLACK, TRUE, CENTER_JUSTIFIED ); + DrawTextToScreen( zTemp2, SKI_PLAYERS_CURRENT_BALANCE_X, SKI_PLAYERS_CURRENT_BALANCE_OFFSET_TO_VALUE, SKI_PLAYERS_CURRENT_BALANCE_WIDTH, FONT10ARIAL, SKI_ITEM_PRICE_COLOR, FONT_MCOLOR_BLACK, TRUE, CENTER_JUSTIFIED ); //Display the total value text DisplayWrappedString( SKI_TOTAL_VALUE_X, SKI_TOTAL_VALUE_Y, SKI_TOTAL_VALUE_WIDTH, 2, SKI_LABEL_FONT, SKI_TITLE_COLOR, SKI_Text[SKI_TEXT_TOTAL_VALUE], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED ); @@ -1734,10 +1749,11 @@ void DisplayAllDealersCash() { UINT16 usPosY=0; CHAR16 zTemp[512]; + CHAR16 zTemp2[64]; UINT8 ubForeColor; //loop through all the shopkeeper's and display their money - for ( INT8 bArmsDealer = 0; bArmsDealer uiPlayersTotalMoneyValue ) { + INT32 balance = LaptopSaveInfo.iCurrentBalance; + if ( armsDealerInfo[gbSelectedArmsDealerID].uiFlags & ARMS_DEALER_DEALWITHINTEL ) + balance = GetIntel(); + //if the player doesn't have enough money in his account to pay the rest - if( uiArmsDealersItemsCost > uiPlayersTotalMoneyValue + LaptopSaveInfo.iCurrentBalance ) + if( uiArmsDealersItemsCost > uiPlayersTotalMoneyValue + balance ) { // tell player he can't possibly afford this SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_SHOPKEEPER, 6,0, 0, giShopKeeperFaceIndex, DIALOGUE_SHOPKEEPER_UI ); SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_SKIP_A_FRAME, 0,0, 0, giShopKeeperFaceIndex, DIALOGUE_SHOPKEEPER_UI ); - SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_SHOPKEEPER, 0, ( uiArmsDealersItemsCost - ( LaptopSaveInfo.iCurrentBalance + uiPlayersTotalMoneyValue ) ), 0, giShopKeeperFaceIndex, DIALOGUE_SHOPKEEPER_UI ); + SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_SHOPKEEPER, 0, ( uiArmsDealersItemsCost - ( balance + uiPlayersTotalMoneyValue ) ), 0, giShopKeeperFaceIndex, DIALOGUE_SHOPKEEPER_UI ); } else { @@ -3865,10 +3914,20 @@ void PerformTransaction( UINT32 uiMoneyFromPlayersAccount ) SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_SKIP_A_FRAME, 0,0, 0, giShopKeeperFaceIndex, DIALOGUE_SHOPKEEPER_UI ); SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_SHOPKEEPER, 6,0, 0, giShopKeeperFaceIndex, DIALOGUE_SHOPKEEPER_UI ); - if( uiPlayersTotalMoneyValue ) - SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_SHOPKEEPER, 1, ( uiArmsDealersItemsCost - uiPlayersTotalMoneyValue ), 0, giShopKeeperFaceIndex, DIALOGUE_SHOPKEEPER_UI ); + if ( armsDealerInfo[gbSelectedArmsDealerID].uiFlags & ARMS_DEALER_DEALWITHINTEL ) + { + if ( uiPlayersTotalMoneyValue ) + SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_SHOPKEEPER, 8, ( uiArmsDealersItemsCost - uiPlayersTotalMoneyValue ), 0, giShopKeeperFaceIndex, DIALOGUE_SHOPKEEPER_UI ); + else + SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_SHOPKEEPER, 9, ( uiArmsDealersItemsCost - uiPlayersTotalMoneyValue ), 0, giShopKeeperFaceIndex, DIALOGUE_SHOPKEEPER_UI ); + } else - SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_SHOPKEEPER, 2, ( uiArmsDealersItemsCost - uiPlayersTotalMoneyValue ), 0, giShopKeeperFaceIndex, DIALOGUE_SHOPKEEPER_UI ); + { + if ( uiPlayersTotalMoneyValue ) + SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_SHOPKEEPER, 1, ( uiArmsDealersItemsCost - uiPlayersTotalMoneyValue ), 0, giShopKeeperFaceIndex, DIALOGUE_SHOPKEEPER_UI ); + else + SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_SHOPKEEPER, 2, ( uiArmsDealersItemsCost - uiPlayersTotalMoneyValue ), 0, giShopKeeperFaceIndex, DIALOGUE_SHOPKEEPER_UI ); + } } SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_SHOPKEEPER, 7,0, 0, giShopKeeperFaceIndex, DIALOGUE_SHOPKEEPER_UI ); @@ -4649,7 +4708,7 @@ INT16 AddInventoryToSkiLocation( INVENTORY_IN_SLOT *pInv, UINT16 ubSpotLocation, IfMercOwnedCopyItemToMercInv( pInv ); //if the item is money - if( Item[ PlayersOfferArea[ ubSpotLocation ].sItemIndex ].usItemClass == IC_MONEY ) + if( Item[ PlayersOfferArea[ ubSpotLocation ].sItemIndex ].usItemClass == IC_MONEY && !(armsDealerInfo[gbSelectedArmsDealerID].uiFlags & ARMS_DEALER_DEALWITHINTEL) ) { //Since money is always evaluated PlayersOfferArea[ ubSpotLocation ].uiFlags |= ARMS_INV_PLAYERS_ITEM_HAS_VALUE; @@ -5304,7 +5363,9 @@ void EnableDisableEvaluateAndTransactionButtons() fItemEvaluated = TRUE; //else if it is not a repair dealer, and the item is money - else if( armsDealerInfo[ gbSelectedArmsDealerID ].ubTypeOfArmsDealer != ARMS_DEALER_REPAIRS && Item[ PlayersOfferArea[ ubCnt ].sItemIndex ].usItemClass == IC_MONEY ) + else if( armsDealerInfo[ gbSelectedArmsDealerID ].ubTypeOfArmsDealer != ARMS_DEALER_REPAIRS && + Item[ PlayersOfferArea[ ubCnt ].sItemIndex ].usItemClass == IC_MONEY && + !( armsDealerInfo[gbSelectedArmsDealerID].uiFlags & ARMS_DEALER_DEALWITHINTEL ) ) fItemEvaluated = TRUE; } } @@ -5354,8 +5415,12 @@ void EnableDisableEvaluateAndTransactionButtons() { DisableButton( guiSKI_TransactionButton ); } - - if( uiArmsDealerTotalCost > uiPlayersOfferAreaTotalCost + LaptopSaveInfo.iCurrentBalance ) + + INT32 balance = LaptopSaveInfo.iCurrentBalance; + if ( armsDealerInfo[gbSelectedArmsDealerID].uiFlags & ARMS_DEALER_DEALWITHINTEL ) + balance = GetIntel(); + + if( uiArmsDealerTotalCost > uiPlayersOfferAreaTotalCost + balance ) { DisableButton( guiSKI_TransactionButton ); } @@ -5415,6 +5480,10 @@ void AddItemToPlayersOfferAreaAfterShopKeeperOpen( OBJECTTYPE *pItemObject) BOOLEAN IsMoneyTheOnlyItemInThePlayersOfferArea( ) { + // we can't substitute money for intel + if ( armsDealerInfo[gbSelectedArmsDealerID].uiFlags & ARMS_DEALER_DEALWITHINTEL ) + return FALSE; + BOOLEAN fFoundMoney = FALSE; for ( int ubCnt = 0; ubCnt < gPlayersOfferActiveRegions; ++ubCnt ) @@ -5438,6 +5507,10 @@ BOOLEAN IsMoneyTheOnlyItemInThePlayersOfferArea( ) UINT32 CalculateHowMuchMoneyIsInPlayersOfferArea( ) { + // we can't substitute money for intel + if ( armsDealerInfo[gbSelectedArmsDealerID].uiFlags & ARMS_DEALER_DEALWITHINTEL ) + return 0; + UINT32 uiTotalMoneyValue=0; for ( int ubCnt = 0; ubCnt < gPlayersOfferActiveRegions; ++ubCnt ) @@ -5868,6 +5941,27 @@ void ConfirmToDeductMoneyFromPlayersAccountMessageBoxCallBack( UINT8 bExitValue gubSkiDirtyLevel = SKI_DIRTY_LEVEL2; } +void ConfirmToDeductIntelFromPlayersAccountMessageBoxCallBack( UINT8 bExitValue ) +{ + // yes, deduct the money + if ( bExitValue == MSG_BOX_RETURN_YES ) + { + UINT32 uiPlayersOfferAreaValue = CalculateTotalPlayersValue(); + UINT32 uiArmsDealersItemsCost = CalculateTotalArmsDealerCost(); + INT32 iMoneyToDeduct = (INT32)( uiArmsDealersItemsCost - uiPlayersOfferAreaValue ); + + //Perform the transaction with the extra money from the players account + PerformTransaction( iMoneyToDeduct ); + + AddIntel( -iMoneyToDeduct, TRUE ); + } + + // done, re-enable calls to PerformTransaction() + gfPerformTransactionInProgress = FALSE; + + gubSkiDirtyLevel = SKI_DIRTY_LEVEL2; +} + // run through what the player has on the table and see if the shop keep will aceept it or not BOOLEAN WillShopKeeperRejectItemFromPlayer( INT8 bDealerId, UINT16 usItem ) { @@ -5875,13 +5969,16 @@ BOOLEAN WillShopKeeperRejectItemFromPlayer( INT8 bDealerId, UINT16 usItem ) if ( Item[usItem].usItemClass == IC_MONEY ) { - fRejected = FALSE; + // we can't substitute money for intel + if ( armsDealerInfo[gbSelectedArmsDealerID].uiFlags & ARMS_DEALER_DEALWITHINTEL ) + fRejected = TRUE; + else + fRejected = FALSE; } else if ( CanDealerTransactItem( gbSelectedArmsDealerID, usItem, TRUE ) ) { fRejected = FALSE; } - else { fRejected = TRUE; diff --git a/Tactical/ShopKeeper Interface.h b/Tactical/ShopKeeper Interface.h index df214bdb..cdff5274 100644 --- a/Tactical/ShopKeeper Interface.h +++ b/Tactical/ShopKeeper Interface.h @@ -106,6 +106,7 @@ void DrawHatchOnInventory_MilitiaAccess( UINT32 uiSurface, UINT16 usPosX, UINT BOOLEAN ShouldSoldierDisplayHatchOnItem( UINT8 ubProfileID, INT16 sSlotNum ); INT8 AddItemToPlayersOfferArea( UINT8 ubProfileID, INVENTORY_IN_SLOT* pInvSlot, INT16 bSlotIdInOtherLocation ); void ConfirmToDeductMoneyFromPlayersAccountMessageBoxCallBack( UINT8 bExitValue ); +void ConfirmToDeductIntelFromPlayersAccountMessageBoxCallBack( UINT8 bExitValue ); void ConfirmDontHaveEnoughForTheDealerMessageBoxCallBack( UINT8 bExitValue ); void SkiHelpTextDoneCallBack( void ); diff --git a/Tactical/SkillCheck.cpp b/Tactical/SkillCheck.cpp index 650d9dc0..c73fa8e6 100644 --- a/Tactical/SkillCheck.cpp +++ b/Tactical/SkillCheck.cpp @@ -200,12 +200,18 @@ INT8 EffectiveExpLevel( SOLDIERTYPE * pSoldier, BOOLEAN fTactical ) if (pSoldier->ubProfile != NO_PROFILE) { // Flugente: drugs can temporarily cause a merc to be claustrophobic - if ( DoesMercHaveDisability( pSoldier, CLAUSTROPHOBIC ) && pSoldier->bActive && pSoldier->bInSector && gbWorldSectorZ > 0 ) + if ( DoesMercHaveDisability( pSoldier, CLAUSTROPHOBIC ) && pSoldier->bActive && pSoldier->bInSector ) { + INT8 sectorz = pSoldier->bSectorZ; + if ( SPY_LOCATION( pSoldier->bAssignment ) ) + sectorz -= 10; + // claustrophobic! - iEffExpLevel -= 2; + if ( sectorz > 0 ) + iEffExpLevel -= 2; } - else if ( DoesMercHaveDisability( pSoldier, FEAR_OF_INSECTS ) && MercIsInTropicalSector( pSoldier ) ) + + if ( DoesMercHaveDisability( pSoldier, FEAR_OF_INSECTS ) && MercIsInTropicalSector( pSoldier ) ) { // SANDRO - fear of insects, and we are in tropical sector iEffExpLevel -= 1; diff --git a/Tactical/SkillMenu.cpp b/Tactical/SkillMenu.cpp index d1377a38..60ed07da 100644 --- a/Tactical/SkillMenu.cpp +++ b/Tactical/SkillMenu.cpp @@ -139,10 +139,11 @@ TraitSelection::Setup( UINT32 aVal ) CHAR16 pStr[300]; // create entries for the sub-menus for each trait - const UINT8 num = 2; + const UINT8 num = 3; UINT8 traitarray[num]; traitarray[0] = RADIO_OPERATOR_NT; - traitarray[1] = VARIOUSSKILLS; + traitarray[1] = INTEL; + traitarray[2] = VARIOUSSKILLS; for ( int i = 0; i < num; ++i) { swprintf( pStr, gzMercSkillTextNew[traitarray[i]] ); @@ -239,6 +240,26 @@ SkillSelection::Setup( UINT32 aVal ) } break; + case INTEL: + { + for ( UINT32 uiCounter = SKILLS_INTEL_FIRST; uiCounter <= SKILLS_INTEL_LAST; ++uiCounter ) + { + swprintf( pStr, pTraitSkillsMenuStrings[uiCounter] ); + + pOption = new POPUP_OPTION( &std::wstring( pStr ), new popupCallbackFunction( &Wrapper_Function_SkillSelection, uiCounter ) ); + + // if we cannot perform this skill, grey it out + if ( !( pSoldier->CanUseSkill( uiCounter, TRUE ) ) ) + { + // Set this option off. + pOption->setAvail( new popupCallbackFunction( &Popup_OptionOff, NULL ) ); + } + + GetPopup()->addOption( *pOption ); + } + } + break; + case VARIOUSSKILLS: { for(UINT32 uiCounter = SKILLS_VARIOUS_FIRST; uiCounter <= SKILLS_VARIOUS_LAST; ++uiCounter) @@ -293,6 +314,15 @@ SkillSelection::Setup( UINT32 aVal ) } break; + case INTEL: + { + for ( UINT32 uiCounter = SKILLS_INTEL_FIRST; uiCounter <= SKILLS_INTEL_LAST; ++uiCounter ) + { + SetRegionFastHelpText( &( GetPopup()->MenuRegion[cnt++] ), pSoldier->PrintSkillDesc( uiCounter ) ); + } + } + break; + case VARIOUSSKILLS: { for(UINT32 uiCounter = SKILLS_VARIOUS_FIRST; uiCounter <= SKILLS_VARIOUS_LAST; ++uiCounter) diff --git a/Tactical/Soldier Add.cpp b/Tactical/Soldier Add.cpp index 5cf7694e..146fb41b 100644 --- a/Tactical/Soldier Add.cpp +++ b/Tactical/Soldier Add.cpp @@ -1228,7 +1228,7 @@ BOOLEAN InternalAddSoldierToSector( UINT8 ubID, BOOLEAN fCalculateDirection, BOO } else { - if(is_client && (pSoldier->ubStrategicInsertionCode == INSERTION_CODE_GRIDNO)) + if ( ( is_client && (pSoldier->ubStrategicInsertionCode == INSERTION_CODE_GRIDNO) ) || ( pSoldier->usSoldierFlagMask2 & SOLDIER_CONCEALINSERTION ) ) { sGridNo = pSoldier->sInsertionGridNo; ubCalculatedDirection = pSoldier->ubDirection; @@ -1625,14 +1625,15 @@ void AddSoldierToSectorGridNo( SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT8 ubDir { if ( pSoldier->bTeam == gbPlayerNum ) { - RevealRoofsAndItems( pSoldier, TRUE, FALSE, pSoldier->pathing.bLevel, TRUE ); + if ( !( pSoldier->usSoldierFlagMask2 & SOLDIER_CONCEALINSERTION ) ) + RevealRoofsAndItems( pSoldier, TRUE, FALSE, pSoldier->pathing.bLevel, TRUE ); - // ATE: Patch fix: If we are in an non-interruptable animation, stop! - if ( pSoldier->usAnimState == HOPFENCE ) - { - pSoldier->flags.fInNonintAnim = FALSE; - pSoldier->SoldierGotoStationaryStance( ); - } + // ATE: Patch fix: If we are in an non-interruptable animation, stop! + if ( pSoldier->usAnimState == HOPFENCE ) + { + pSoldier->flags.fInNonintAnim = FALSE; + pSoldier->SoldierGotoStationaryStance( ); + } pSoldier->EVENT_StopMerc( sGridNo, ubDirection ); } diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index c4195ed4..85e31c7f 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -15725,15 +15725,11 @@ BOOLEAN SOLDIERTYPE::SeemsLegit( UINT8 ubObserverID ) // 0 - civilians are always ok // 1 - civilians are suspicious at night // 2 - civilians are always suspicious + // if underground, we still use the surface value - UINT8 sectordata = 0; - UINT8 ubSectorId = SECTOR( gWorldSectorX, gWorldSectorY ); - if ( gbWorldSectorZ > 0 ) - // underground we are always suspicious - sectordata = 2; - else if ( ubSectorId >= 0 && ubSectorId < 256 ) - sectordata = SectorExternalData[ubSectorId][gbWorldSectorZ].usCurfewValue; - + UINT8 ubSectorId = SECTOR( this->sSectorX, this->sSectorY ); + UINT8 sectordata = SectorExternalData[ubSectorId][0].usCurfewValue; + if ( sectordata > 1 ) { ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_CURFEW_BROKEN], this->GetName( ) ); @@ -15746,83 +15742,15 @@ BOOLEAN SOLDIERTYPE::SeemsLegit( UINT8 ubObserverID ) return FALSE; } - // check wether we are around a fresh corpse - this will make us much more suspicious - INT32 cnt; - ROTTING_CORPSE * pCorpse; - for ( cnt = 0; cnt < giNumRottingCorpse; ++cnt ) - { - pCorpse = &(gRottingCorpse[cnt]); - - if ( pCorpse && pCorpse->fActivated && pCorpse->def.ubAIWarningValue > 0 && PythSpacesAway( this->sGridNo, pCorpse->def.sGridNo ) <= 5 ) - { - // check: is this corpse that of an ally of the observing soldier? - BOOLEAN fCorpseOFAlly = FALSE; - if ( pSoldier->bTeam == ENEMY_TEAM ) - { - // check wether corpse was one of soldier's allies - for ( UINT8 i = UNIFORM_ENEMY_ADMIN; i <= UNIFORM_ENEMY_ELITE; ++i ) - { - if ( COMPARE_PALETTEREP_ID( pCorpse->def.VestPal, gUniformColors[i].vest ) && COMPARE_PALETTEREP_ID( pCorpse->def.PantsPal, gUniformColors[i].pants ) ) - { - fCorpseOFAlly = TRUE; - break; - } - } - } - else if ( pSoldier->bTeam == OUR_TEAM || pSoldier->bTeam == MILITIA_TEAM ) - { - // check wether corpse was one of soldier's allies - for ( UINT8 i = UNIFORM_MILITIA_ROOKIE; i <= UNIFORM_MILITIA_ELITE; ++i ) - { - if ( COMPARE_PALETTEREP_ID( pCorpse->def.VestPal, gUniformColors[i].vest ) && COMPARE_PALETTEREP_ID( pCorpse->def.PantsPal, gUniformColors[i].pants ) ) - { - fCorpseOFAlly = TRUE; - break; - } - } - } - - // a corpse was found near our position. If the soldier observing us can see it, he will be alarmed - if ( fCorpseOFAlly && SoldierTo3DLocationLineOfSightTest( pSoldier, pCorpse->def.sGridNo, pCorpse->def.bLevel, 3, TRUE, CALC_FROM_WANTED_DIR ) ) - { - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_NEAR_CORPSE], this->GetName( ) ); - return FALSE; - } - } - } - } - - if ( this->usSoldierFlagMask & SOLDIER_COVERT_SOLDIER ) - { - // if our equipment is too good, that is suspicious... not covert! - if ( this->EquipmentTooGood( (distance < discoverrange) ) ) - { - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_SUSPICIOUS_EQUIPMENT], this->GetName( ) ); - return FALSE; - } - - // are we targeting a buddy of our observer? - if ( this->ubTargetID != NOBODY && MercPtrs[this->ubTargetID] && MercPtrs[this->ubTargetID]->bTeam == pSoldier->bTeam ) - { - // if we are aiming at a soldier, others will notice our intent... not covert! - if ( WeaponReady( this ) ) - { - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_TARGETTING_SOLDIER], this->GetName( ), MercPtrs[this->ubTargetID]->GetName( ) ); - return FALSE; - } - } - - // even as a soldier, we will be caught around fresh corpses - // assassins will not be uncovered around corpses, as the AI cannot willingly evade them... one could 'ward' against assassins by surrounding yourself with fresh corpses - if ( distance < gSkillTraitValues.sCOCloseDetectionRangeSoldierCorpse && !this->IsAssassin( ) ) + // do this check only if we are in the currently loaded sector + if ( this->sSectorX == gWorldSectorX && this->sSectorY == gWorldSectorY && this->bSectorZ == gbWorldSectorZ ) { // check wether we are around a fresh corpse - this will make us much more suspicious - // I deem this necessary, to avoid cheap exploits by nefarious players :-) INT32 cnt; ROTTING_CORPSE * pCorpse; for ( cnt = 0; cnt < giNumRottingCorpse; ++cnt ) { - pCorpse = &(gRottingCorpse[cnt]); + pCorpse = &( gRottingCorpse[cnt] ); if ( pCorpse && pCorpse->fActivated && pCorpse->def.ubAIWarningValue > 0 && PythSpacesAway( this->sGridNo, pCorpse->def.sGridNo ) <= 5 ) { @@ -15856,7 +15784,7 @@ BOOLEAN SOLDIERTYPE::SeemsLegit( UINT8 ubObserverID ) // a corpse was found near our position. If the soldier observing us can see it, he will be alarmed if ( fCorpseOFAlly && SoldierTo3DLocationLineOfSightTest( pSoldier, pCorpse->def.sGridNo, pCorpse->def.bLevel, 3, TRUE, CALC_FROM_WANTED_DIR ) ) { - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_NEAR_CORPSE], this->GetName( ) ); + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_NEAR_CORPSE], this->GetName() ); return FALSE; } } @@ -15864,13 +15792,89 @@ BOOLEAN SOLDIERTYPE::SeemsLegit( UINT8 ubObserverID ) } } + if ( this->usSoldierFlagMask & SOLDIER_COVERT_SOLDIER ) + { + // if our equipment is too good, that is suspicious... not covert! + if ( this->EquipmentTooGood( (distance < discoverrange) ) ) + { + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_SUSPICIOUS_EQUIPMENT], this->GetName( ) ); + return FALSE; + } + + // do this check only if we are in the currently loaded sector + if ( this->sSectorX == gWorldSectorX && this->sSectorY == gWorldSectorY && this->bSectorZ == gbWorldSectorZ ) + { + // are we targeting a buddy of our observer? + if ( this->ubTargetID != NOBODY && MercPtrs[this->ubTargetID] && MercPtrs[this->ubTargetID]->bTeam == pSoldier->bTeam ) + { + // if we are aiming at a soldier, others will notice our intent... not covert! + if ( WeaponReady( this ) ) + { + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_TARGETTING_SOLDIER], this->GetName(), MercPtrs[this->ubTargetID]->GetName() ); + return FALSE; + } + } + + // even as a soldier, we will be caught around fresh corpses + // assassins will not be uncovered around corpses, as the AI cannot willingly evade them... one could 'ward' against assassins by surrounding yourself with fresh corpses + if ( distance < gSkillTraitValues.sCOCloseDetectionRangeSoldierCorpse && !this->IsAssassin() ) + { + // check wether we are around a fresh corpse - this will make us much more suspicious + // I deem this necessary, to avoid cheap exploits by nefarious players :-) + INT32 cnt; + ROTTING_CORPSE * pCorpse; + for ( cnt = 0; cnt < giNumRottingCorpse; ++cnt ) + { + pCorpse = &( gRottingCorpse[cnt] ); + + if ( pCorpse && pCorpse->fActivated && pCorpse->def.ubAIWarningValue > 0 && PythSpacesAway( this->sGridNo, pCorpse->def.sGridNo ) <= 5 ) + { + // check: is this corpse that of an ally of the observing soldier? + BOOLEAN fCorpseOFAlly = FALSE; + if ( pSoldier->bTeam == ENEMY_TEAM ) + { + // check wether corpse was one of soldier's allies + for ( UINT8 i = UNIFORM_ENEMY_ADMIN; i <= UNIFORM_ENEMY_ELITE; ++i ) + { + if ( COMPARE_PALETTEREP_ID( pCorpse->def.VestPal, gUniformColors[i].vest ) && COMPARE_PALETTEREP_ID( pCorpse->def.PantsPal, gUniformColors[i].pants ) ) + { + fCorpseOFAlly = TRUE; + break; + } + } + } + else if ( pSoldier->bTeam == OUR_TEAM || pSoldier->bTeam == MILITIA_TEAM ) + { + // check wether corpse was one of soldier's allies + for ( UINT8 i = UNIFORM_MILITIA_ROOKIE; i <= UNIFORM_MILITIA_ELITE; ++i ) + { + if ( COMPARE_PALETTEREP_ID( pCorpse->def.VestPal, gUniformColors[i].vest ) && COMPARE_PALETTEREP_ID( pCorpse->def.PantsPal, gUniformColors[i].pants ) ) + { + fCorpseOFAlly = TRUE; + break; + } + } + } + + // a corpse was found near our position. If the soldier observing us can see it, he will be alarmed + if ( fCorpseOFAlly && SoldierTo3DLocationLineOfSightTest( pSoldier, pCorpse->def.sGridNo, pCorpse->def.bLevel, 3, TRUE, CALC_FROM_WANTED_DIR ) ) + { + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_NEAR_CORPSE], this->GetName() ); + return FALSE; + } + } + } + } + } + } + // uncover if merc is using flashlight and alert is raised if ( pSoldier->bTeam == ENEMY_TEAM && pSoldier->aiData.bAlertStatus >= STATUS_RED && - (NightTime( ) || gbWorldSectorZ > 0) && + (NightTime( ) || this->bSectorZ > 0) && this->GetBestEquippedFlashLightRange( ) > 0 ) { - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s has flashlight!", this->GetName( ) ); + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s has a flashlight!", this->GetName( ) ); return FALSE; } @@ -16045,7 +16049,7 @@ void SOLDIERTYPE::ApplyCovert( BOOLEAN aWithMessage ) ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_DISGUISED_AS_CIVILIAN], this->GetName( ) ); } } - + // reevaluate sight - otherwise we could hide by changing clothes in plain sight! OtherTeamsLookForMan( this ); } @@ -17458,7 +17462,22 @@ void SOLDIERTYPE::SoldierPropertyUpkeep( ) { // these effects last only one turn this->usSoldierFlagMask &= ~(SOLDIER_AIRDROP_TURN | SOLDIER_ASSAULT_BONUS | SOLDIER_RAISED_REDALERT); - + this->usSoldierFlagMask2 &= ~SOLDIER_CONCEALINSERTION; + + // this looks bizarre, but is required + if ( this->usSoldierFlagMask2 & SOLDIER_CONCEALINSERTION_DISCOVERED ) + { + this->usSoldierFlagMask2 &= ~SOLDIER_CONCEALINSERTION_DISCOVERED; + + // we loose our disguise + this->LooseDisguise(); + + if ( gSkillTraitValues.fCOStripIfUncovered ) + this->Strip(); + + HandleInitialRedAlert( ENEMY_TEAM, FALSE ); + } + if ( HasBackgroundFlag( BACKGROUND_EXP_UNDERGROUND ) && this->bSectorZ ) ++bExtraExpLevel; @@ -17550,6 +17569,63 @@ BOOLEAN SOLDIERTYPE::CanUseSkill( INT8 iSkill, BOOLEAN fAPCheck, INT32 sGridNo ) canuse = TRUE; break; + case SKILLS_INTEL_CONCEAL: + case SKILLS_INTEL_GATHERINTEL: + // in order to conceal, we need: + // - enemy team not aware of us (otherwise we could use this skill to instantly escape from combat) + // - an enemy presence (otherwise, why bother) + // - we must be alone (otherwise player could start combat again, at which point we'd need to appear from thin air) + // - no militia present (same reason) + // - no hostile civilians or creatures + // - valid disguise + { + canuse = TRUE; + + // we might already be on assignment, so be careful here + INT8 sectorz = this->bSectorZ; + if ( SPY_LOCATION( this->bAssignment ) ) + sectorz = max( 0, sectorz - 10 ); + + // if we are disguised as a civilian, but there is a curfew here, don't allow that + if ( ( this->usSoldierFlagMask & SOLDIER_COVERT_CIV ) ) + { + // civilians are suspicious if they are found in certain sectors. Especially at night + // sector specific value: + // 0 - civilians are always ok + // 1 - civilians are suspicious at night + // 2 - civilians are always suspicious + // if underground, we still use the surface value + + UINT8 ubSectorId = SECTOR( this->sSectorX, this->sSectorY ); + UINT8 sectordata = SectorExternalData[ubSectorId][sectorz].usCurfewValue; + + if ( sectordata > 1 ) + canuse = FALSE; + // is it night? + else if ( sectordata == 1 && GetTimeOfDayAmbientLightLevel() < NORMAL_LIGHTLEVEL_DAY + 2 ) + canuse = FALSE; + } + + if ( canuse && NumEnemiesInAnySector( this->sSectorX, this->sSectorY, sectorz ) > 0 && + NumPlayerTeamMembersInSector( this->sSectorX, this->sSectorY, this->bSectorZ ) == 1 && + ( sectorz || NumNonPlayerTeamMembersInSector( this->sSectorX, this->sSectorY, MILITIA_TEAM ) == 0 ) && + SeemsLegit( this->ubID ) ) + { + // additional checks if we are in the currently loaded sector + if ( this->sSectorX == gWorldSectorX && this->sSectorY == gWorldSectorY && this->bSectorZ == gbWorldSectorZ ) + { + if ( gTacticalStatus.Team[ENEMY_TEAM].bAwareOfOpposition || + ( gTacticalStatus.uiFlags & INCOMBAT ) || + HostileCiviliansPresent() || + HostileCreaturesPresent() ) + { + canuse = FALSE; + } + } + } + } + break; + case SKILLS_SPOTTER: if ( (!fAPCheck || EnoughPoints( this, APBPConstants[AP_SPOTTER], 0, FALSE )) && CanSpot( ) ) canuse = TRUE; @@ -17623,6 +17699,33 @@ BOOLEAN SOLDIERTYPE::UseSkill( UINT8 iSkill, INT32 usMapPos, UINT32 ID ) return SwitchOffRadio( ); break; + case SKILLS_INTEL_CONCEAL: + case SKILLS_INTEL_GATHERINTEL: + { + // ATE: Patch fix If in a vehicle, remove from vehicle... + TakeSoldierOutOfVehicle( this ); + + // we store our location and later retrieve it, as the gridno will be set to NOWHERE + this->sMTActionGridNo = this->sGridNo; + + // remove from squad + RemoveCharacterFromSquads( this ); + + ChangeSoldiersAssignment( this, CONCEALED + iSkill - SKILLS_INTEL_CONCEAL ); + + // Remove soldier's graphic + this->RemoveSoldierFromGridNo(); + + UpdateMercsInSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ); + + CheckForEndOfBattle( FALSE ); + + CheckAndHandleUnloadingOfCurrentWorld(); + + return TRUE; + } + break; + case SKILLS_SPOTTER: return BecomeSpotter( usMapPos ); break; @@ -17704,6 +17807,26 @@ STR16 SOLDIERTYPE::PrintSkillDesc( INT8 iSkill ) break; + case SKILLS_INTEL_CONCEAL: + case SKILLS_INTEL_GATHERINTEL: + + //swprintf( atStr, pTraitSkillsDenialStrings[TEXT_SKILL_DENIAL_COVERTTRAIT] ); + //wcscat( skilldescarray, atStr ); + + swprintf( atStr, pTraitSkillsDenialStrings[TEXT_SKILL_DENIAL_ENEMYSECTOR] ); + wcscat( skilldescarray, atStr ); + + swprintf( atStr, pTraitSkillsDenialStrings[TEXT_SKILL_DENIAL_SINGLEMERC] ); + wcscat( skilldescarray, atStr ); + + swprintf( atStr, pTraitSkillsDenialStrings[TEXT_SKILL_DENIAL_NOALARM] ); + wcscat( skilldescarray, atStr ); + + swprintf( atStr, pTraitSkillsDenialStrings[TEXT_SKILL_DENIAL_DISGUISE_CIV_OR_MIL] ); + wcscat( skilldescarray, atStr ); + + break; + case SKILLS_SPOTTER: swprintf( atStr, pTraitSkillsDenialStrings[TEXT_SKILL_DENIAL_X_AP], APBPConstants[AP_SPOTTER] ); wcscat( skilldescarray, atStr ); @@ -19734,6 +19857,117 @@ void SOLDIERTYPE::CancelDrag() this->sDragCorpseID = -1; } +// Flugente: spy assignments +extern UINT32 gCoolnessBySector[256]; + +UINT8 SOLDIERTYPE::GetUncoverRisk() +{ + if ( this->stats.bLife < OKLIFE || ( this->usSoldierFlagMask & SOLDIER_POW ) ) + return 0; + + if ( !SPY_LOCATION(this->bAssignment) ) + return 100; + + // base value: + // 15% level + // 15% stealth + // 70% covert trait + UINT32 val = 15 * EffectiveExpLevel ( this, FALSE ) + + 1.5f * GetWornStealth( this ) + + 350 * NUM_SKILL_TRAITS( this, COVERT_NT ); + + ReducePointsForFatigue( this, &val ); + + // personality/disability modifiers + FLOAT modifier = 1.0f; + if ( DoesMercHaveDisability( this, NERVOUS ) ) modifier -= 0.05f; + + if ( DoesMercHavePersonality( this, CHAR_TRAIT_SOCIABLE ) ) modifier += 0.05f; + if ( DoesMercHavePersonality( this, CHAR_TRAIT_COWARD ) ) modifier -= 0.05f; + + // personal value in [0; 100] + int personalvalue = (FLOAT)(val * modifier) / 10.0f; + personalvalue = min( 100, max( 0, personalvalue ) ); + + // if we do this disguised as a soldier, risk will be much higer, as we are under much more scrutiny. This makes up for the increased gain in soldier disguise + // less risk if we are asleep, just hiding or forced to hide + UINT8 typemultiplier = ( this->usSoldierFlagMask & SOLDIER_COVERT_SOLDIER ) ? 5 : 2; + if ( ( this->bAssignment == CONCEALED ) || this->flags.fMercAsleep || this->usSkillCooldown[SOLDIER_COOLDOWN_INTEL_PENALTY] ) + typemultiplier = 1; + + // we now take the sector coolness as a measurement of how important the sector is, and thus how intel we gain + // correct outliers - value in[0; 100] + UINT32 sectorvalue = typemultiplier * min( 20, gCoolnessBySector[SECTOR( this->sSectorX, this->sSectorY )] ); + + UINT8 totalvalue = sectorvalue * ( 110 - personalvalue ) / 100; + totalvalue = min(100, max(0, totalvalue ) ); + + // A most awesome merc in Meduna palace, disguised as a soldier, would have a value of 1.05 * 4. 63 * 4 = 10.649 at this point. + // This would be the place where we modify our intel gain rate. + + return totalvalue; +} + +FLOAT SOLDIERTYPE::GetIntelGain() +{ + if ( this->stats.bLife < OKLIFE || ( this->usSoldierFlagMask & SOLDIER_POW ) ) + return 0.0f; + + // if not on correct assignments, no gain + if ( this->bAssignment != GATHERINTEL ) + return 0.0f; + + // if we're asleep, or on a penalty, we accomplish nothing + if ( this->flags.fMercAsleep || this->usSkillCooldown[SOLDIER_COOLDOWN_INTEL_PENALTY] ) + return 0.0f; + + // the covert trait isn't that important in determining the intel gain. It is much more important in mitigating the risk of exposure, however + // base value: + // 50% wisdom + // 10% level + // 5% scout trait + // 15% covert trait + // 20% snitch trait + UINT32 val = 5 * EffectiveWisdom( this ) + + 10 * EffectiveExpLevel ( this, FALSE ) + + 50 * NUM_SKILL_TRAITS( this, SCOUTING_NT ) + + 75 * NUM_SKILL_TRAITS( this, COVERT_NT ) + + 200 * NUM_SKILL_TRAITS( this, SNITCH_NT ); + + ReducePointsForFatigue( this, &val ); + + // personality/disability modifiers + FLOAT modifier = 1.0f; + if ( DoesMercHaveDisability( this, FORGETFUL ) ) modifier -= 0.15f; + if ( DoesMercHaveDisability( this, PSYCHO ) ) modifier -= 0.05f; + + if ( DoesMercHavePersonality( this, CHAR_TRAIT_SOCIABLE ) ) modifier += 0.10f; + if ( DoesMercHavePersonality( this, CHAR_TRAIT_LONER ) ) modifier -= 0.10f; + if ( DoesMercHavePersonality( this, CHAR_TRAIT_ASSERTIVE ) ) modifier += 0.05f; + if ( DoesMercHavePersonality( this, CHAR_TRAIT_PRIMITIVE ) ) modifier -= 0.10f; + + FLOAT personalvalue = (FLOAT)(val * modifier) / 1000.0f; + + // we now take the sector coolness as a measurement of how important the sector is, and thus how intel we gain + // correct outliers + UINT32 ubLocationModifier = 1 + max(2, min(20, gCoolnessBySector[SECTOR( this->sSectorX, this->sSectorY )] ) ); + + // in order not to make the differences to great, alter these values - will now be in [0.6; 4.63] + FLOAT sectorvalue = log( ubLocationModifier ); + sectorvalue *= sectorvalue / 2.0f; + + FLOAT totalvalue = personalvalue * sectorvalue; + + // if we do this disguised as a soldier, we get more info + if ( this->usSoldierFlagMask & SOLDIER_COVERT_SOLDIER ) + totalvalue *= 2; + + // A most awesome merc in Meduna palace, disguised as a soldier, would have a value of 1.15 * 4.63 * 2 = 10.649 at this point. + // This would be the place where we modify our intel gain rate. + + return totalvalue; +} + INT32 CheckBleeding( SOLDIERTYPE *pSoldier ) { INT8 bBandaged; //,savedOurTurn; @@ -21807,11 +22041,10 @@ void DebugValidateSoldierData( ) // reset frame counter uiFrameCount = 0; - - + // Loop through our team... cnt = gTacticalStatus.Team[gbPlayerNum].bFirstID; - for ( pSoldier = MercPtrs[cnt]; cnt <= gTacticalStatus.Team[gbPlayerNum].bLastID; cnt++, pSoldier++ ) + for ( pSoldier = MercPtrs[cnt]; cnt <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++cnt, pSoldier++ ) { if ( pSoldier->bActive ) { @@ -21820,7 +22053,11 @@ void DebugValidateSoldierData( ) if ( pSoldier->stats.bLife > 0 && !(pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE) ) { // Alive -- now check for proper group IDs - if ( pSoldier->ubGroupID == 0 && pSoldier->bAssignment != IN_TRANSIT && pSoldier->bAssignment != ASSIGNMENT_POW && !(pSoldier->flags.uiStatusFlags & (SOLDIER_DRIVER | SOLDIER_PASSENGER)) ) + if ( pSoldier->ubGroupID == 0 && + !SPY_LOCATION( pSoldier->bAssignment ) && + pSoldier->bAssignment != IN_TRANSIT && + pSoldier->bAssignment != ASSIGNMENT_POW && + !(pSoldier->flags.uiStatusFlags & (SOLDIER_DRIVER | SOLDIER_PASSENGER)) ) { // This is bad! swprintf( sString, L"Soldier Data Error: Soldier %d is alive but has a zero group ID.", cnt ); @@ -21833,9 +22070,9 @@ void DebugValidateSoldierData( ) fProblemDetected = TRUE; } } - else + //else { - if ( pSoldier->ubGroupID != 0 && (pSoldier->flags.uiStatusFlags & SOLDIER_DEAD) ) + //if ( pSoldier->ubGroupID != 0 && (pSoldier->flags.uiStatusFlags & SOLDIER_DEAD) ) { // Dead guys should have 0 group IDs //swprintf( sString, L"GroupID Error: Soldier %d is dead but has a non-zero group ID.", cnt ); @@ -21847,7 +22084,7 @@ void DebugValidateSoldierData( ) if ( (pSoldier->bAssignment != IN_TRANSIT) && ((pSoldier->sSectorX <= 0) || (pSoldier->sSectorX >= 17) || (pSoldier->sSectorY <= 0) || (pSoldier->sSectorY >= 17) || - (pSoldier->bSectorZ < 0) || (pSoldier->bSectorZ > 3)) ) + (pSoldier->bSectorZ < 0) || (pSoldier->bSectorZ > (SPY_LOCATION( pSoldier->bAssignment ) ? 13 : 3) ) ) ) { swprintf( sString, L"Soldier Data Error: Soldier %d is located at %d/%d/%d.", cnt, pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ ); fProblemDetected = TRUE; @@ -22051,7 +22288,7 @@ BOOLEAN HAS_SKILL_TRAIT( SOLDIERTYPE * pSoldier, UINT8 uiSkillTraitNumber ) return FALSE; // Flugente: compatibility with skills - if ( uiSkillTraitNumber == VARIOUSSKILLS ) + if ( uiSkillTraitNumber == INTEL || uiSkillTraitNumber == VARIOUSSKILLS ) return TRUE; INT8 bNumMajorTraitsCounted = 0; diff --git a/Tactical/Soldier Control.h b/Tactical/Soldier Control.h index f0b09118..5ee758c1 100644 --- a/Tactical/Soldier Control.h +++ b/Tactical/Soldier Control.h @@ -414,6 +414,10 @@ enum #define SOLDIER_COVERT_NOREDISGUISE 0x00001000 // this soldier does not want to be redisguised #define SOLDIER_TRAIT_FOCUS 0x00002000 // 'focus' skill is active #define SOLDIER_BAYONET_RUNBONUS 0x00004000 // we are performing a bayonet attack after transitioning from running, giving our attack extra force +#define SOLDIER_CONCEALINSERTION 0x00008000 // we enteri a sector by transition from concealed state (which causes us to spawn at the location we left the sector in) + +#define SOLDIER_CONCEALINSERTION_DISCOVERED 0x00010000 // we enter a sector by transition from concealed state, but as we were 'discovered', set red alert +#define SOLDIER_MERC_POW_LOCATIONKNOWN 0x00020000 // we are a POW, but the player has discovered our location #define SOLDIER_INTERROGATE_ALL 0x000001F8 // all interrogation flags // ---------------------------------------------------------------- @@ -584,6 +588,12 @@ enum{ SKILLS_RADIO_TURNOFF, SKILLS_RADIO_LAST = SKILLS_RADIO_TURNOFF, + // spy + SKILLS_INTEL_FIRST, + SKILLS_INTEL_CONCEAL = SKILLS_INTEL_FIRST, // assignment: spy hides among the population + SKILLS_INTEL_GATHERINTEL, // assignment: spy gathers information while disguised + SKILLS_INTEL_LAST = SKILLS_INTEL_GATHERINTEL, + // various SKILLS_VARIOUS_FIRST, SKILLS_SPOTTER = SKILLS_VARIOUS_FIRST, @@ -608,6 +618,7 @@ enum { SOLDIER_COOLDOWN_COVERTOPS_TEMPORARYOVERT_SECONDS = 0, SOLDIER_COOLDOWN_COVERTOPS_TEMPORARYOVERT_APS, SOLDIER_COOLDOWN_CRYO, // counts how many turns character will be frozen + SOLDIER_COOLDOWN_INTEL_PENALTY, // after being discovered, we can't gain intel from the assignment for this many hours SOLDIER_COOLDOWN_MAX = 20, // enough space for fillers }; @@ -1964,6 +1975,10 @@ public: void SetDragOrderPerson( UINT16 usID ); void SetDragOrderCorpse( UINT32 usID ); void CancelDrag(); + + // Flugente: spy assignments + UINT8 GetUncoverRisk(); + FLOAT GetIntelGain(); ////////////////////////////////////////////////////////////////////////////// }; // SOLDIERTYPE; diff --git a/Tactical/Soldier Create.cpp b/Tactical/Soldier Create.cpp index ccf6da9b..d3251b40 100644 --- a/Tactical/Soldier Create.cpp +++ b/Tactical/Soldier Create.cpp @@ -4170,7 +4170,7 @@ void CopyProfileItems( SOLDIERTYPE *pSoldier, SOLDIERCREATE_STRUCT *pCreateStruc //NOTE: We don't want to add Mike or Iggy if this is being called from autoresolve! void OkayToUpgradeEliteToSpecialProfiledEnemy( SOLDIERCREATE_STRUCT *pp ) { - if( !gfProfiledEnemyAdded && gubEnemyEncounterCode != ENEMY_ENCOUNTER_CODE && gubEnemyEncounterCode != ENEMY_INVASION_CODE ) + if( !gfProfiledEnemyAdded && GetEnemyEncounterCode() != ENEMY_ENCOUNTER_CODE && GetEnemyEncounterCode() != ENEMY_INVASION_CODE ) { if( gubFact[ FACT_MIKE_AVAILABLE_TO_ARMY ] == 1 && !pp->fOnRoof ) { diff --git a/Tactical/Soldier Init List.cpp b/Tactical/Soldier Init List.cpp index 48126811..17637cc1 100644 --- a/Tactical/Soldier Init List.cpp +++ b/Tactical/Soldier Init List.cpp @@ -775,8 +775,8 @@ BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *curr, GROUP *pGroup = NULL ) } // Flugente: if this is an enemy, and we are using ambush code, place us somewhat away from the map center, where the player will be - if ( (tempDetailedPlacement.bTeam == ENEMY_TEAM && (gubEnemyEncounterCode == ENEMY_AMBUSH_CODE || gubEnemyEncounterCode == ENEMY_AMBUSH_DEPLOYMENT_CODE) ) || - (tempDetailedPlacement.bTeam == CREATURE_TEAM && gubEnemyEncounterCode == BLOODCAT_AMBUSH_CODE) ) + if ( (tempDetailedPlacement.bTeam == ENEMY_TEAM && ( GetEnemyEncounterCode() == ENEMY_AMBUSH_CODE || GetEnemyEncounterCode() == ENEMY_AMBUSH_DEPLOYMENT_CODE) ) || + (tempDetailedPlacement.bTeam == CREATURE_TEAM && GetEnemyEncounterCode() == BLOODCAT_AMBUSH_CODE) ) { if ( (gGameExternalOptions.uAmbushEnemyEncircle == 1 && PythSpacesAway( tempDetailedPlacement.sInsertionGridNo, gMapInformation.sCenterGridNo ) <= gAmbushRadiusModifier * gGameExternalOptions.usAmbushEnemyEncircleRadius1) || ( gGameExternalOptions.uAmbushEnemyEncircle == 2) ) diff --git a/Tactical/Squads.cpp b/Tactical/Squads.cpp index 91c63302..9bd98ee2 100644 --- a/Tactical/Squads.cpp +++ b/Tactical/Squads.cpp @@ -397,6 +397,10 @@ BOOLEAN AddCharacterToSquad( SOLDIERTYPE *pCharacter, INT8 bSquadValue ) SetCurrentSquad( bSquadValue, TRUE ); } + if ( SPY_LOCATION( pCharacter->bOldAssignment ) ) + { + pCharacter->usSoldierFlagMask2 |= SOLDIER_CONCEALINSERTION; + } return ( TRUE ); } diff --git a/Tactical/UI Cursors.cpp b/Tactical/UI Cursors.cpp index 24aea239..85476b05 100644 --- a/Tactical/UI Cursors.cpp +++ b/Tactical/UI Cursors.cpp @@ -51,6 +51,7 @@ UINT8 HandleWirecutterCursor( SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT32 uiCur UINT8 HandleRepairCursor( SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT32 uiCursorFlags ); UINT8 HandleRefuelCursor( SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT32 uiCursorFlags ); UINT8 HandleRemoteCursor( SOLDIERTYPE *pSoldier, INT32 sGridNo, BOOLEAN fActivated, UINT32 uiCursorFlags ); +UINT8 HandleCameraCursor( SOLDIERTYPE *pSoldier, INT32 sGridNo, BOOLEAN fActivated, UINT32 uiCursorFlags ); UINT8 HandleBombCursor( SOLDIERTYPE *pSoldier, INT32 sGridNo, BOOLEAN fActivated, UINT32 uiCursorFlags ); UINT8 HandleJarCursor( SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT32 uiCursorFlags ); UINT8 HandleTinCanCursor( SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT32 uiCursorFlags ); @@ -238,14 +239,14 @@ UINT8 GetProperItemCursor( UINT8 ubSoldierID, UINT16 ubItemIndex, INT32 usMapPos if ( fActivated ) { - if ( !gfUIHandlePhysicsTrajectory ) - { - ubCursorID = HandleNonActivatedTossCursor( pSoldier, sTargetGridNo, fRecalc, uiCursorFlags, ubItemCursor ); - } - else - { - ubCursorID = HandleActivatedTossCursor( pSoldier, sTargetGridNo, ubItemCursor ); - } + if ( !gfUIHandlePhysicsTrajectory ) + { + ubCursorID = HandleNonActivatedTossCursor( pSoldier, sTargetGridNo, fRecalc, uiCursorFlags, ubItemCursor ); + } + else + { + ubCursorID = HandleActivatedTossCursor( pSoldier, sTargetGridNo, ubItemCursor ); + } } else { @@ -278,6 +279,10 @@ UINT8 GetProperItemCursor( UINT8 ubSoldierID, UINT16 ubItemIndex, INT32 usMapPos ubCursorID = HandleBombCursor( pSoldier, sTargetGridNo, fActivated, uiCursorFlags ); break; + case CAMERACURS: + ubCursorID = HandleCameraCursor( pSoldier, sTargetGridNo, fActivated, uiCursorFlags ); + break; + case REMOTECURS: ubCursorID = HandleRemoteCursor( pSoldier, sTargetGridNo, fActivated, uiCursorFlags ); @@ -2184,6 +2189,19 @@ UINT8 HandleRemoteCursor( SOLDIERTYPE *pSoldier, INT32 sGridNo, BOOLEAN fActivat } } +UINT8 HandleCameraCursor( SOLDIERTYPE *pSoldier, INT32 sGridNo, BOOLEAN fActivated, UINT32 uiCursorFlags ) +{ + // DRAW PATH TO GUY + HandleUIMovementCursor( pSoldier, uiCursorFlags, sGridNo, MOVEUI_TARGET_HANDCUFF ); + + // do we have handcuffs in our hand? + if ( HasItemFlag( ( &( pSoldier->inv[HANDPOS] ) )->usItem, CAMERA ) && SoldierTo3DLocationLineOfSightTest( pSoldier, sGridNo, gsInterfaceLevel, 0, TRUE, CALC_FROM_WANTED_DIR, TRUE ) ) + { + return CAMERA_GREY_UICURSOR; + } + + return CAMERA_RED_UICURSOR; +} UINT8 HandleBombCursor( SOLDIERTYPE *pSoldier, INT32 sGridNo, BOOLEAN fActivated, UINT32 uiCursorFlags ) { @@ -2847,6 +2865,10 @@ UINT8 GetActionModeCursor( SOLDIERTYPE *pSoldier ) if ( gGameExternalOptions.fAllowPrisonerSystem && HasItemFlag(usInHand, HANDCUFFS) ) ubCursor = HANDCUFFCURS; + // Flugente: camera cursor + if ( HasItemFlag( usInHand, CAMERA ) ) + ubCursor = CAMERACURS; + // Flugente: interactive actions // we only check whether an action is possible in principle, not whether this particular guy can do it. That way we know an action is possible here even if we can't perform it at the moment. // only do this if the item doesn't already allow us to do something else diff --git a/Tactical/soldier profile type.h b/Tactical/soldier profile type.h index 8c2b2307..40d9e96d 100644 --- a/Tactical/soldier profile type.h +++ b/Tactical/soldier profile type.h @@ -179,8 +179,9 @@ typedef enum #define NEWTRAIT_MERCSKILL_EXPERTOFFSET (NUM_MAJOR_TRAITS + NUM_MINOR_TRAITS) #define NEWTRAIT_MERCSKILL_OFFSET_ALL (NEWTRAIT_MERCSKILL_EXPERTOFFSET + NUM_MAJOR_TRAITS) -// Flugente: various skills that do not need a trait still need a number -#define VARIOUSSKILLS (2 * NEWTRAIT_MERCSKILL_EXPERTOFFSET + 2) +// Flugente: these aren't really traits, but it is convenient to pretend so +#define INTEL (2 * NEWTRAIT_MERCSKILL_EXPERTOFFSET + 2) +#define VARIOUSSKILLS (INTEL + 1) // SANDRO - new set of character traits typedef enum diff --git a/TacticalAI/Knowledge.cpp b/TacticalAI/Knowledge.cpp index be30b3b7..be6f1a14 100644 --- a/TacticalAI/Knowledge.cpp +++ b/TacticalAI/Knowledge.cpp @@ -150,11 +150,8 @@ INT32 MostImportantNoiseHeard( SOLDIERTYPE *pSoldier, INT32 *piRetValue, BOOLEAN pbPublOL = gbPublicOpplist[pSoldier->bTeam]; // sevenfm: sector information - UINT8 sectordata = 0; - if ( gbWorldSectorZ > 0 ) // underground we are always suspicious - sectordata = 2; - else - sectordata = SectorExternalData[SECTOR( gWorldSectorX, gWorldSectorY )][gbWorldSectorZ].usCurfewValue; + UINT8 ubSectorId = SECTOR( gWorldSectorX, gWorldSectorY ); + UINT8 sectordata = SectorExternalData[ubSectorId][0].usCurfewValue; // look through this man's personal & public opplists for opponents heard for (uiLoop = 0; uiLoop < guiNumMercSlots; ++uiLoop) diff --git a/TileEngine/Map Edgepoints.cpp b/TileEngine/Map Edgepoints.cpp index 454a1a04..715577fd 100644 --- a/TileEngine/Map Edgepoints.cpp +++ b/TileEngine/Map Edgepoints.cpp @@ -1405,7 +1405,7 @@ INT32 SearchForClosestPrimaryMapEdgepoint(INT32 sGridNo, UINT8 ubInsertionCode, break; } // WANNE - MP: Center - if ( ( (is_networked || gubEnemyEncounterCode == ENEMY_AMBUSH_DEPLOYMENT_CODE ) && ubInsertionCode == INSERTION_CODE_CENTER) || ubInsertionCode == INSERTION_CODE_CHOPPER ) + if ( ( (is_networked || GetEnemyEncounterCode() == ENEMY_AMBUSH_DEPLOYMENT_CODE ) && ubInsertionCode == INSERTION_CODE_CENTER) || ubInsertionCode == INSERTION_CODE_CHOPPER ) { InitCenterEdgepoint( ubInsertionCode == INSERTION_CODE_CENTER ); psArray = gps1stCenterEdgepointArray; diff --git a/TileEngine/Tactical Placement GUI.cpp b/TileEngine/Tactical Placement GUI.cpp index edbbb285..60660724 100644 --- a/TileEngine/Tactical Placement GUI.cpp +++ b/TileEngine/Tactical Placement GUI.cpp @@ -347,6 +347,7 @@ void InitTacticalPlacementGUI() CurrentBattleSectorIs( MercPtrs[i]->sSectorX, MercPtrs[i]->sSectorY, MercPtrs[i]->bSectorZ ) && !( MercPtrs[ i ]->flags.uiStatusFlags & ( SOLDIER_VEHICLE ) ) && // ATE Ignore vehicles MercPtrs[ i ]->bAssignment != ASSIGNMENT_POW && + !( MercPtrs[i]->usSoldierFlagMask2 & SOLDIER_CONCEALINSERTION ) && MercPtrs[ i ]->bAssignment != IN_TRANSIT ) { ++giPlacements; @@ -362,6 +363,7 @@ void InitTacticalPlacementGUI() if( MercPtrs[ i ]->bActive && MercPtrs[ i ]->stats.bLife && !MercPtrs[ i ]->flags.fBetweenSectors && CurrentBattleSectorIs( MercPtrs[i]->sSectorX, MercPtrs[i]->sSectorY, MercPtrs[i]->bSectorZ ) && MercPtrs[ i ]->bAssignment != ASSIGNMENT_POW && + !( MercPtrs[i]->usSoldierFlagMask2 & SOLDIER_CONCEALINSERTION ) && MercPtrs[ i ]->bAssignment != IN_TRANSIT && !( MercPtrs[ i ]->flags.uiStatusFlags & ( SOLDIER_VEHICLE ) ) ) // ATE Ignore vehicles { @@ -375,7 +377,7 @@ void InitTacticalPlacementGUI() gfCenter = TRUE; } - if ( gubEnemyEncounterCode == ENEMY_AMBUSH_DEPLOYMENT_CODE ) + if ( GetEnemyEncounterCode() == ENEMY_AMBUSH_DEPLOYMENT_CODE ) { gMercPlacement[giPlacements].ubStrategicInsertionCode = INSERTION_CODE_CENTER; MercPtrs[i]->ubStrategicInsertionCode = INSERTION_CODE_CENTER; @@ -431,8 +433,9 @@ void InitTacticalPlacementGUI() ++giPlacements; } } + //add all the faces now - for( i = 0; i < giPlacements; i++ ) + for( i = 0; i < giPlacements; ++i ) { VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE; @@ -488,7 +491,8 @@ void InitTacticalPlacementGUI() if( gubDefaultButton == GROUP_BUTTON ) { ButtonList[ iTPButtons[ GROUP_BUTTON ] ]->uiFlags |= BUTTON_CLICKED_ON; - for( i = 0; i < giPlacements; i++ ) + + for( i = 0; i < giPlacements; ++i ) { //go from the currently selected soldier to the end if( !gMercPlacement[ i ].fPlaced ) { //Found an unplaced merc. Select him. @@ -768,7 +772,7 @@ void RenderTacticalPlacementGUI() if( gbCursorMercID == -1 ) { - if ( gubEnemyEncounterCode == ENEMY_AMBUSH_DEPLOYMENT_CODE ) + if ( GetEnemyEncounterCode() == ENEMY_AMBUSH_DEPLOYMENT_CODE ) { INT16 sCellX = 0; INT16 sCellY = 0; @@ -940,7 +944,7 @@ void RenderTacticalPlacementGUI() } } - if ( gubEnemyEncounterCode == ENEMY_AMBUSH_DEPLOYMENT_CODE ) + if ( GetEnemyEncounterCode() == ENEMY_AMBUSH_DEPLOYMENT_CODE ) { INT16 sCellX = 0; INT16 sCellY = 0; @@ -1256,10 +1260,10 @@ void TacticalPlacementHandle() // WANNE - MP: Center if ( gfCenter && (is_networked || - gubEnemyEncounterCode == ENEMY_AMBUSH_DEPLOYMENT_CODE || + GetEnemyEncounterCode() == ENEMY_AMBUSH_DEPLOYMENT_CODE || ( gGameExternalOptions.ubSkyriderHotLZ == 3 && gMercPlacement[gbSelectedMercID].pSoldier->usSoldierFlagMask & SOLDIER_AIRDROP )) ) { - if ( gubEnemyEncounterCode == ENEMY_AMBUSH_DEPLOYMENT_CODE ) + if ( GetEnemyEncounterCode() == ENEMY_AMBUSH_DEPLOYMENT_CODE ) { INT32 testgridno = NOWHERE; @@ -1404,7 +1408,7 @@ void ChooseRandomEdgepoints() { if ( !( gMercPlacement[ i ].pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) ) { - if ( gubEnemyEncounterCode == ENEMY_AMBUSH_DEPLOYMENT_CODE ) + if ( GetEnemyEncounterCode() == ENEMY_AMBUSH_DEPLOYMENT_CODE ) { UINT8 ubDirection; @@ -1804,7 +1808,7 @@ void PutDownMercPiece( INT32 iPlacement ) pSoldier->EVENT_SetSoldierPosition( (FLOAT)sCellX, (FLOAT)sCellY ); } - if ( gubEnemyEncounterCode == ENEMY_AMBUSH_DEPLOYMENT_CODE ) + if ( GetEnemyEncounterCode() == ENEMY_AMBUSH_DEPLOYMENT_CODE ) { ubDirection = (UINT8)GetDirectionToGridNoFromGridNo( gMapInformation.sCenterGridNo, sGridNo ) + 100; } diff --git a/Utils/Cursors.cpp b/Utils/Cursors.cpp index d2870126..560353d7 100644 --- a/Utils/Cursors.cpp +++ b/Utils/Cursors.cpp @@ -142,6 +142,9 @@ CursorFileData CursorFileDatabase[] = {"CURSORS\\minigame.sti" , FALSE, 0, ANIMATED_CURSOR, 3, NULL}, // Flugente: minigames {"CURSORS\\minigame_r.sti" , FALSE, 0, ANIMATED_CURSOR, 3, NULL}, + + { "CURSORS\\camera.sti" , FALSE, 0, ANIMATED_CURSOR, 3, NULL }, // Flugente: camera + { "CURSORS\\camera_r.sti" , FALSE, 0, ANIMATED_CURSOR, 3, NULL }, { "CURSORS\\can_01.sti" , FALSE, 0, 0, 0, NULL }, { "CURSORS\\can_02.sti" , FALSE, 0, 0, 0, NULL }, @@ -1308,7 +1311,7 @@ CursorData CursorDatabase[] = 0, 0, 0, 0, 0, 2, CENTER_CURSOR, CENTER_CURSOR, 0, 0, 0, 0}, - // Flugente: minigames + // Flugente: minigames {C_TRINGS, 6, 0, HIDE_SUBCURSOR, HIDE_SUBCURSOR, C_MINIGAME, 0, 0, CENTER_SUBCURSOR, CENTER_SUBCURSOR, 0, 0, 0, 0, 0, @@ -1322,6 +1325,21 @@ CursorData CursorDatabase[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, CENTER_CURSOR, CENTER_CURSOR, 0, 0, 0, 0}, + + // Flugente: camera + { C_TRINGS, 6, 0, HIDE_SUBCURSOR, HIDE_SUBCURSOR, + C_CAMERA, 0, 0, CENTER_SUBCURSOR, CENTER_SUBCURSOR, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 2, CENTER_CURSOR, CENTER_CURSOR, 0, 0, 0, 0 }, + + { C_TRINGS, 6, 0, HIDE_SUBCURSOR, HIDE_SUBCURSOR, + C_CAMERA_RED, 0, 0, CENTER_SUBCURSOR, CENTER_SUBCURSOR, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 2, CENTER_CURSOR, CENTER_CURSOR, 0, 0, 0, 0 }, { C_TRINGS, 6, 0, HIDE_SUBCURSOR, HIDE_SUBCURSOR, C_FUEL , 0, 0, CENTER_SUBCURSOR, CENTER_SUBCURSOR, diff --git a/Utils/Cursors.h b/Utils/Cursors.h index 5cad24fc..ff50cf31 100644 --- a/Utils/Cursors.h +++ b/Utils/Cursors.h @@ -177,6 +177,9 @@ typedef enum CURSOR_MINIGAME, CURSOR_MINIGAME_RED, + CURSOR_CAMERA, + CURSOR_CAMERA_RED, + CURSOR_FUEL, CURSOR_FUEL_RED, @@ -266,6 +269,8 @@ typedef enum C_SODAMACHINE_RED, C_MINIGAME, C_MINIGAME_RED, + C_CAMERA, + C_CAMERA_RED, C_FUEL, C_FUEL_RED, C_ACTIONMODERED_NCTH, diff --git a/Utils/Text.h b/Utils/Text.h index 01c6d126..a26c33a7 100644 --- a/Utils/Text.h +++ b/Utils/Text.h @@ -1099,7 +1099,8 @@ enum WEAPON_CLEANING_STR, - PRISONER_NO_PRISONS_STR, + PRISONER_FIELDINTERROGATION_STR, + PRISONER_FIELDINTERROGATION_SHORT_STR, PRISONER_DECIDE_STR, PRISONER_LETGO_STR, PRISONER_OFFER_SURRENDER, @@ -1963,6 +1964,10 @@ enum SKI_DONE_BUTTON_HELP_TEXT, SKI_PLAYERS_CURRENT_BALANCE, + + SKI_QUESTION_TO_DEDUCT_INTEL_FROM_PLAYERS_ACCOUNT_TO_COVER_DIFFERENCE, + SKI_QUESTION_TO_DEDUCT_INTEL_FROM_PLAYERS_ACCOUNT_TO_COVER_COST, + TEXT_NUM_SKI_MBOX_TEXT }; @@ -2641,6 +2646,11 @@ enum TEXT_SKILL_DENIAL_PRONEPERSONORCORPSE, TEXT_SKILL_DENIAL_CROUCH, TEXT_SKILL_DENIAL_FREEHANDS, + TEXT_SKILL_DENIAL_COVERTTRAIT, + TEXT_SKILL_DENIAL_ENEMYSECTOR, + TEXT_SKILL_DENIAL_SINGLEMERC, + TEXT_SKILL_DENIAL_NOALARM, + TEXT_SKILL_DENIAL_DISGUISE_CIV_OR_MIL, TEXT_SKILL_DENIAL_MAX, }; @@ -2941,7 +2951,14 @@ enum TEXT_DISEASE_UNDIAGNOSED }; +enum +{ + TEXT_SPY_CONCEAL, + TEXT_SPY_GETINTEL, +}; + extern STR16 szDiseaseText[]; +extern STR16 szSpyText[]; extern STR16 szFoodText[]; extern STR16 szIMPGearWebSiteText[]; @@ -3001,6 +3018,47 @@ extern STR16 szLaptopStatText[]; // Flugente: gear templates extern STR16 szGearTemplateText[]; +// Flugente: intel +enum +{ + // defaults + TEXT_INTEL_TITLE, + TEXT_INTEL_SUBTITLE, + TEXT_INTEL_LINK_1, + TEXT_INTEL_LINK_2, + + TEXT_INTEL_LINK_3, + + // buy info + TEXT_INTEL_BUDGET, + TEXT_INTEL_TEXT_1, + TEXT_INTEL_TEXT_2, + TEXT_INTEL_OFFER_1, + TEXT_INTEL_AIRREGION, + TEXT_INTEL_AIRREGION_BUY1, + TEXT_INTEL_AIRREGION_BUY2, + + TEXT_INTEL_DROPDOWN_HELPTEXT, + TEXT_INTEL_MAPREGION_1, + + // about us + TEXT_INTEL_ABOUTUS_1 = TEXT_INTEL_MAPREGION_1 + 16, + + TEXT_INTEL_ABOUTUS_MAX = TEXT_INTEL_ABOUTUS_1 + 6, + + // sell info + TEXT_INTEL_SELL_1 = TEXT_INTEL_ABOUTUS_MAX, + TEXT_INTEL_SELL_BUTTON_1, + TEXT_INTEL_SELL_BUTTON_2, + TEXT_INTEL_SELL_BUTTON_3, + + TEXT_INTEL_SELL_ALREADYGOT_1, +}; + +extern STR16 szIntelWebsiteText[]; + +extern STR16 szIntelText[]; + #define TACTICAL_INVENTORY_DIALOG_NUM 16 #define TACTICAL_COVER_DIALOG_NUM 16 diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index 039d2578..70c64804 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -2468,6 +2468,8 @@ STR16 pAssignmentStrings[] = L"修理", // repairing L"筑防", //L"Fortify", build structures according to external layout L"培训工人",//L"Train W.", + L"Hide", // TODO.Translate + L"GetIntel", }; @@ -2571,6 +2573,8 @@ STR16 pPersonnelAssignmentStrings[] = L"修理", L"筑防区域", //L"Fortify sector", build structures according to external layout L"培训工人",//L"Train workers", + L"Hide while disguised", // TODO.Translate + L"Get intel while disguised", }; @@ -2633,6 +2637,8 @@ STR16 pLongAssignmentStrings[] = L"修理", L"筑防区域", // L"Fortify sector", build structures according to external layout L"培训工人",//L"Train workers", + L"Hide while disguised", // TODO.Translate + L"Get intel while disguised", }; @@ -2754,6 +2760,7 @@ STR16 pAssignMenuStrings[] = L"训练", L"搬运物品", // get items L"筑防", //L"Fortify", fortify sector + L"Intel", // covert assignments // TODO.Translate L"设施", // the merc is using/staffing a facility //ham3.6 L"取消", }; @@ -2791,6 +2798,10 @@ STR16 pTraitSkillsMenuStrings[] = L"呼叫支援", //L"Call reinforcements", L"关闭接收器", //L"Switch off radio set", + // spy + L"Hide assignment", // TODO.Translate + L"Get Intel assignment", + // various L"侦查员", L"聚焦", //L"Focus", @@ -2808,6 +2819,10 @@ STR16 pTraitSkillsMenuDescStrings[] = L"从邻区呼叫支援。", //L"Call in reinforcements from neighbouring sectors.", L"关闭无线电设备。", //L"Turn off radio set.", + // spy + L"Assignment: hide among the population.", // TODO.Translate + L"Assignment: hide among the population and gather intel.", + // various L"侦查一个区域,友军狙击手在瞄准你所观察到的目标时会增加命中率值。", L"提高中断修正 (malus outside of area)", //L"Increase interrupt modifier (malus outside of area)", @@ -2830,6 +2845,11 @@ STR16 pTraitSkillsDenialStrings[] = L" - 在佣兵旁边放下人或尸体\n", //L" - prone person or corpse next to merc\n", L" - 下蹲姿势\n", //L" - crouched position\n", L" - free main hand\n", // TODO.Translate + L" - covert trait\n", + L" - enemy occupied sector\n", + L" - single merc\n", + L" - no alarm raised\n", + L" - civilian or soldier disguise\n", }; STR16 pSkillMenuStrings[] = @@ -3184,6 +3204,7 @@ STR16 gzMercSkillTextNew[] = L"Placeholder", // for snitch (minor trait) L"生还者", // for survival (minor trait) L"更多...", // 47 + L"Intel", // for INTEL // TODO.Translate L"多种技能", // for VARIOUSSKILLS }; ////////////////////////////////////////////////////////// @@ -3985,7 +4006,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = L"%s 清理了 %s", // added by Flugente: decide what to do with prisoners - L"你现在没有可用的监狱关押这些俘虏,你不得不放他们走。", //L"You have no prison for these prisoners, you have to let them go", + L"As we have no prison, a field interrogation is performed.", // TODO.Translate + L"Field interrogation", L"你打算把 %d 俘虏送到哪里去?",//L"Where do you want to send the %d prisoners?", L"放俘虏离开",//L"Let them go", L"你想要做什么?", @@ -5012,6 +5034,7 @@ STR16 pBookMarkStrings[] = L"世界卫生组织", //L"WHO",  L"Kerberus安保公司", //L"Kerberus", L"民兵总览",//L"Militia Overview", + L"R.I.S.", }; STR16 pBookmarkTitle[] = @@ -5135,6 +5158,9 @@ STR16 pWebPagesTitles[] = L"Kerberus安保公司 - 雇佣队伍", //L"Kerberus - Hire a Team", L"Kerberus安保公司 - 独立协议", //L"Kerberus - Individual Contracts", L"民兵总览", //L"Militia Overview", + L"Recon Intelligence Services - Information Requests", // TODO.Translate + L"Recon Intelligence Services - Information Verification", + L"Recon Intelligence Services - About us", L"Bobby Ray - 最近的运货", L"百科全书", L"百科全书 - 数据", @@ -6067,6 +6093,9 @@ STR16 SkiMessageBoxText[] = L"请求商人修理选定物品", L"结束对话", L"当前余额", + + L"Do you want to transfer %s Intel to cover the difference?", // TODO.Translate + L"Do you want to transfer %s Intel to cover the cost?", }; @@ -6935,6 +6964,7 @@ STR16 gzLaptopHelpText[] = L"世界卫生组织", //L"World Health Organization", L"Kerberus - 安保公司",//L"Kerberus - Experience In Security", L"民兵总览",//L"Militia Overview", + L"Recon Intelligence Services", // TODO.Translate }; @@ -8393,6 +8423,7 @@ STR16 szUDBGenSecondaryStatsTooltipText[]= L"|面|部|防|护", //L"|F|a|c|e |P|r|o|t|e|c|t|i|o|n", L"|感|染|防|护", //L"|I|n|f|e|c|t|i|o|n |P|r|o|t|e|c|t|i|o|n", // 39 L"|护|盾", //L"|S|h|i|e|l|d", + L"|C|a|m|e|r|a", // TODO.Translate }; STR16 szUDBGenSecondaryStatsExplanationsTooltipText[]= @@ -8438,6 +8469,7 @@ STR16 szUDBGenSecondaryStatsExplanationsTooltipText[]= L"\n \n如果你脸上带了这个,这就将降低\n传播给其他人的几率。", //L"\n \nIf worn on your face, this will lower\nthe chance to be infected by other people.", L"\n \n如果保存在物品栏\n降低\n传染给其他人的几率。", //L"\n \nIf kept in your inventory, this will\nlower\nthe chance to be infected by other people.", L"\n \n拿在手里,就可以抵挡前方的伤害。", //L"\n \nIf equipped in a hand, this will block incoming damage.", + L"\n \nYou can take photos with this.", // TODO.Translate }; STR16 szUDBAdvStatsTooltipText[]= @@ -8875,7 +8907,7 @@ STR16 szFoodTextStr[]= STR16 szPrisonerTextStr[]= { L"%d 军官,%d 精英士兵,%d 普通士兵,%d 巡逻官,%d 平民 都被审问。", //L"%d officers, %d elites, %d regulars, %d admins, %d generals and %d civilians were interrogated.", - L"%d 名俘虏已支付赎金", //L"%d prisoners paid ransom money.", + L"Gained $%d as ransom money.", // TODO.Translate L"%d 名俘虏已供出同伙位置", //L"%d prisoners revealed enemy positions.", L"%d 军官,%d 精英士兵,%d 普通士兵,%d 巡逻官 加入了我方。", //L"%d officers, %d elites, %d regulars and %d admins joined our cause.", L"俘虏掀起大规模暴动!在 %s 监狱!", //L"Prisoners start a massive riot in %s!", @@ -10949,6 +10981,12 @@ STR16 szDiseaseText[] = L"\n\n%s (未诊断的) - %d / %d\n", //L"\n\n%s (undiagnosed) - %d / %d\n", }; +STR16 szSpyText[] = +{ + L"Hide", // TODO.Translate + L"Get Intel", +}; + STR16 szFoodText[] = { L"\n\n|水: %d%%\n", //L"\n\n|W|a|t|e|r: %d%%\n", @@ -11255,6 +11293,71 @@ STR16 szGearTemplateText[] = L"所选佣兵不在这个区域。", //L"Selected mercenary is not in this sector.", L"%s 不在这个区域。", //L"%s is not in that sector.", L"%s无法装备%s。", //L"%s could not equip %s.", + L"We cannot attach %s (item %d) as that might damage items.", // TODO.Translate +}; + +STR16 szIntelWebsiteText[] = +{ + L"Recon Intelligence Services", + L"Your need to know base", + L"Information Requests", + L"Information Verification", + + L"About us", + L"You have %d Intel.", + L"We currently have information on the following items, available in exchange for intel as usual:", + L"There is currently no other information available.", + + L"%d Intel - %s", + L"We can provide aerial reconnaissance of a map region. This will last until %02d:00.", + L"Buy data - 50 intel", + L"Buy detailed data - 70 Intel", + + L"Select map region on which you want info on:", + + L"North-west", + L"North-north-west", + L"North-north-east", + L"North-east", + + L"West-north-west", + L"Center-north-west", + L"Center-north-east", + L"East-north-east", + + L"West-south-west", + L"Center-south-west", + L"Center-south-east", + L"East-south-east", + + L"South-west", + L"South-south-west", + L"South-south-east", + L"South-east", + + // about us + L"On the 'Information Requests' page, you can buy information on various enemy targets for intel.", + L"This includes information on enemy patrols & garrisons, noteworthy persons of interests, enemy aircraft etc..", + L"Some of that information may be of temporary nature.", + L"On the 'Information Verification' page, you can upload data you took of significant intelligence.", + + L"We will verify the data (this process usually takes several hours) and compensate you accordingly.", + L"Note that you will reveive less intel if outside conditions have rendered the information less useful (e.g. the person in question having died since the data was acquired).", + + // sell info + L"You can upload the following facts:", + L"Previous", + L"Next", + L"Upload", + + L"You have already received compensation for the following:" +}; + +STR16 szIntelText[] = +{ + L"No more enemies present, %s is no longer in hiding!", + L"%s has been discovered and goes into hiding for %d hours.", + L"%s has been discovered, going to sector!", }; // WANNE: Some Chinese specific strings that needs to be in unicode! diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index ad51d334..5932922f 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -2467,6 +2467,8 @@ STR16 pAssignmentStrings[] = L"Repareer", // repairing L"Fortify", // build structures according to external layout // TODO.Translate L"Train W.", + L"Hide", // TODO.Translate + L"GetIntel", }; @@ -2570,6 +2572,8 @@ STR16 pPersonnelAssignmentStrings[] = L"Repareer", // repairing L"Fortify sector", // build structures according to external layout // TODO.Translate L"Train workers", + L"Hide while disguised", // TODO.Translate + L"Get intel while disguised", }; @@ -2632,6 +2636,8 @@ STR16 pLongAssignmentStrings[] = L"Repareer", // repairing L"Fortify sector", // build structures according to external layout // TODO.Translate L"Train workers", + L"Hide while disguised", // TODO.Translate + L"Get intel while disguised", }; @@ -2753,6 +2759,7 @@ STR16 pAssignMenuStrings[] = L"Train", // the merc is training L"Get Item", // get items // TODO.Translate L"Fortify", // fortify sector // TODO.Translate + L"Intel", // covert assignments // TODO.Translate L"Facility", // the merc is using/staffing a facility // TODO.Translate L"Stop", // cancel this menu }; @@ -2790,6 +2797,10 @@ STR16 pTraitSkillsMenuStrings[] = // TODO.Translate L"Call reinforcements", L"Switch off radio set", + // spy + L"Hide assignment", // TODO.Translate + L"Get Intel assignment", + // various L"Spotter", // TODO.Translate L"Focus", @@ -2807,6 +2818,10 @@ STR16 pTraitSkillsMenuDescStrings[] = L"Call in reinforcements from neighbouring sectors.", L"Turn off radio set.", // TODO.Translate + // spy + L"Assignment: hide among the population.", // TODO.Translate + L"Assignment: hide among the population and gather intel.", + // various L"Observe an area, granting allied snipers a bonus to cth on anything you see.", // TODO.Translate L"Increase interrupt modifier (penalty outside of area).", // TODO.Translate @@ -2829,6 +2844,11 @@ STR16 pTraitSkillsDenialStrings[] = L" - prone person or corpse next to merc\n", // TODO.Translate L" - crouched position\n", L" - free main hand\n", + L" - covert trait\n", + L" - enemy occupied sector\n", + L" - single merc\n", + L" - no alarm raised\n", + L" - civilian or soldier disguise\n", }; STR16 pSkillMenuStrings[] = // TODO.Translate @@ -3183,6 +3203,7 @@ STR16 gzMercSkillTextNew[] = L"Placeholder", // for snitch (minor trait) L"Placeholder", // for survival (minor trait) L"More...", // 47 + L"Intel", // for INTEL // TODO.Translate L"various", // for VARIOUSSKILLS }; ////////////////////////////////////////////////////////// @@ -3986,7 +4007,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = L"%s cleaned %s", // added by Flugente: decide what to do with prisoners - L"You have no prison for these prisoners, you have to let them go", + L"As we have no prison, a field interrogation is performed.", // TODO.Translate + L"Field interrogation", L"Where do you want to send the %d prisoners?", // TODO.Translate L"Let them go", L"What do you want to do?", @@ -5020,6 +5042,7 @@ STR16 pBookMarkStrings[] = L"WHO", L"Kerberus", L"Militia Overview", // TODO.Translate + L"R.I.S.", }; STR16 pBookmarkTitle[] = @@ -5143,6 +5166,9 @@ STR16 pWebPagesTitles[] = L"Kerberus - Hire a Team", L"Kerberus - Individual Contracts", L"Militia Overview", + L"Recon Intelligence Services - Information Requests", // TODO.Translate + L"Recon Intelligence Services - Information Verification", + L"Recon Intelligence Services - About us", L"Bobby Ray's - Recent Shipments", L"Encyclopedia", L"Encyclopedia - Data", @@ -6076,6 +6102,9 @@ STR16 SkiMessageBoxText[] = L"Vraag de dealer om de gesel. items te repareren", L"Einde conversatie", L"Huidige Saldo", + + L"Do you want to transfer %s Intel to cover the difference?", // TODO.Translate + L"Do you want to transfer %s Intel to cover the cost?", }; @@ -6952,6 +6981,7 @@ STR16 gzLaptopHelpText[] = L"World Health Organization", L"Kerberus - Excellence In Security", L"Militia Overview", // TODO.Translate + L"Recon Intelligence Services", // TODO.Translate }; @@ -8410,6 +8440,7 @@ STR16 szUDBGenSecondaryStatsTooltipText[]= L"|F|a|c|e |P|r|o|t|e|c|t|i|o|n", L"|I|n|f|e|c|t|i|o|n |P|r|o|t|e|c|t|i|o|n", // 39 L"|S|h|i|e|l|d", // TODO.Translate + L"|C|a|m|e|r|a", // TODO.Translate }; STR16 szUDBGenSecondaryStatsExplanationsTooltipText[]= @@ -8455,6 +8486,7 @@ STR16 szUDBGenSecondaryStatsExplanationsTooltipText[]= L"\n \nIf worn on your face, this will lower\nthe chance to be infected by other people.", L"\n \nIf kept in your inventory, this will\nlower\nthe chance to be infected by other people.", L"\n \nIf equipped in a hand, this will block incoming damage.", // TODO.Translate + L"\n \nYou can take photos with this.", // TODO.Translate }; STR16 szUDBAdvStatsTooltipText[]= @@ -8893,7 +8925,7 @@ STR16 szFoodTextStr[]= STR16 szPrisonerTextStr[]= { L"%d officers, %d elites, %d regulars, %d admins, %d generals and %d civilians were interrogated.", // TODO.Translate - L"%d prisoners paid ransom money.", + L"Gained $%d as ransom money.", // TODO.Translate L"%d prisoners revealed enemy positions.", L"%d officers, %d elites, %d regulars and %d admins joined our cause.", L"Prisoners start a massive riot in %s!", @@ -10967,6 +10999,12 @@ STR16 szDiseaseText[] = L"\n\n%s (undiagnosed) - %d / %d\n", // TODO.Translate }; +STR16 szSpyText[] = +{ + L"Hide", // TODO.Translate + L"Get Intel", +}; + STR16 szFoodText[] = { L"\n\n|W|a|t|e|r: %d%%\n", @@ -11273,6 +11311,71 @@ STR16 szGearTemplateText[] = // TODO.Translate L"Selected mercenary is not in this sector.", L"%s is not in that sector.", L"%s could not equip %s.", + L"We cannot attach %s (item %d) as that might damage items.", // TODO.Translate +}; + +STR16 szIntelWebsiteText[] = +{ + L"Recon Intelligence Services", + L"Your need to know base", + L"Information Requests", + L"Information Verification", + + L"About us", + L"You have %d Intel.", + L"We currently have information on the following items, available in exchange for intel as usual:", + L"There is currently no other information available.", + + L"%d Intel - %s", + L"We can provide aerial reconnaissance of a map region. This will last until %02d:00.", + L"Buy data - 50 intel", + L"Buy detailed data - 70 Intel", + + L"Select map region on which you want info on:", + + L"North-west", + L"North-north-west", + L"North-north-east", + L"North-east", + + L"West-north-west", + L"Center-north-west", + L"Center-north-east", + L"East-north-east", + + L"West-south-west", + L"Center-south-west", + L"Center-south-east", + L"East-south-east", + + L"South-west", + L"South-south-west", + L"South-south-east", + L"South-east", + + // about us + L"On the 'Information Requests' page, you can buy information on various enemy targets for intel.", + L"This includes information on enemy patrols & garrisons, noteworthy persons of interests, enemy aircraft etc..", + L"Some of that information may be of temporary nature.", + L"On the 'Information Verification' page, you can upload data you took of significant intelligence.", + + L"We will verify the data (this process usually takes several hours) and compensate you accordingly.", + L"Note that you will reveive less intel if outside conditions have rendered the information less useful (e.g. the person in question having died since the data was acquired).", + + // sell info + L"You can upload the following facts:", + L"Previous", + L"Next", + L"Upload", + + L"You have already received compensation for the following:" +}; + +STR16 szIntelText[] = +{ + L"No more enemies present, %s is no longer in hiding!", + L"%s has been discovered and goes into hiding for %d hours.", + L"%s has been discovered, going to sector!", }; #endif //DUTCH diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index ac9f6709..b97348e1 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -2468,6 +2468,8 @@ STR16 pAssignmentStrings[] = L"Repair", // repairing L"Fortify", // build structures according to external layout L"Train W.", + L"Hide", + L"GetIntel", }; @@ -2571,6 +2573,8 @@ STR16 pPersonnelAssignmentStrings[] = L"Repair", L"Fortify sector", // build structures according to external layout L"Train workers", + L"Hide while disguised", + L"Get intel while disguised", }; @@ -2633,6 +2637,8 @@ STR16 pLongAssignmentStrings[] = L"Repair", L"Fortify sector", // build structures according to external layout L"Train workers", + L"Hide while disguised", + L"Get intel while disguised", }; @@ -2754,6 +2760,7 @@ STR16 pAssignMenuStrings[] = L"Train", // the merc is training L"Get Item", // move items L"Fortify", // fortify sector + L"Intel", // covert assignments L"Facility", // the merc is using/staffing a facility L"Cancel", // cancel this menu }; @@ -2791,6 +2798,10 @@ STR16 pTraitSkillsMenuStrings[] = L"Call reinforcements", L"Switch off radio set", + // spy + L"Hide assignment", + L"Get Intel assignment", + // various L"Spotter", L"Focus", @@ -2808,6 +2819,10 @@ STR16 pTraitSkillsMenuDescStrings[] = L"Call in reinforcements from neighbouring sectors.", L"Turn off radio set.", + // spy + L"Assignment: hide among the population.", + L"Assignment: hide among the population and gather intel.", + // various L"Observe an area, granting allied snipers a bonus to cth on anything you see.", L"Increase interrupt modifier (penalty outside of area).", @@ -2830,6 +2845,11 @@ STR16 pTraitSkillsDenialStrings[] = L" - prone person or corpse next to merc\n", L" - crouched position\n", L" - free main hand\n", + L" - covert trait\n", + L" - enemy occupied sector\n", + L" - single merc\n", + L" - no alarm raised\n", + L" - civilian or soldier disguise\n", }; STR16 pSkillMenuStrings[] = @@ -3184,6 +3204,7 @@ STR16 gzMercSkillTextNew[] = L"Placeholder", // for snitch (minor trait) L"Placeholder", // for survival (minor trait) L"More...", // 47 + L"Intel", // for INTEL L"various", // for VARIOUSSKILLS }; ////////////////////////////////////////////////////////// @@ -3985,7 +4006,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = L"%s cleaned %s", // added by Flugente: decide what to do with prisoners - L"You have no prison for these prisoners, you have to let them go", + L"As we have no prison, a field interrogation is performed.", + L"Field interrogation", L"Where do you want to send the %d prisoners?", L"Let them go", L"What do you want to do?", @@ -5013,6 +5035,7 @@ STR16 pBookMarkStrings[] = L"WHO", L"Kerberus", L"Militia Overview", + L"R.I.S.", }; STR16 pBookmarkTitle[] = @@ -5136,6 +5159,9 @@ STR16 pWebPagesTitles[] = L"Kerberus - Hire a Team", L"Kerberus - Individual Contracts", L"Militia Overview", + L"Recon Intelligence Services - Information Requests", + L"Recon Intelligence Services - Information Verification", + L"Recon Intelligence Services - About us", L"Bobby Ray's - Recent Shipments", L"Encyclopedia", L"Encyclopedia - Data", @@ -6068,6 +6094,9 @@ STR16 SkiMessageBoxText[] = L"Ask the dealer to repair the selected items", L"End conversation", L"Current Balance", + + L"Do you want to transfer %s Intel to cover the difference?", + L"Do you want to transfer %s Intel to cover the cost?", }; @@ -6936,6 +6965,7 @@ STR16 gzLaptopHelpText[] = L"World Health Organization", L"Kerberus - Experience In Security", L"Militia Overview", + L"Recon Intelligence Services", }; @@ -8394,6 +8424,7 @@ STR16 szUDBGenSecondaryStatsTooltipText[]= L"|F|a|c|e |P|r|o|t|e|c|t|i|o|n", L"|I|n|f|e|c|t|i|o|n |P|r|o|t|e|c|t|i|o|n", // 39 L"|S|h|i|e|l|d", + L"|C|a|m|e|r|a", }; STR16 szUDBGenSecondaryStatsExplanationsTooltipText[]= @@ -8439,6 +8470,7 @@ STR16 szUDBGenSecondaryStatsExplanationsTooltipText[]= L"\n \nIf worn on your face, this will lower\nthe chance to be infected by other people.", L"\n \nIf kept in your inventory, this will\nlower\nthe chance to be infected by other people.", L"\n \nIf equipped in a hand, this will block incoming damage.", + L"\n \nYou can take photos with this.", }; STR16 szUDBAdvStatsTooltipText[]= @@ -8876,7 +8908,7 @@ STR16 szFoodTextStr[]= STR16 szPrisonerTextStr[]= { L"%d officers, %d elites, %d regulars, %d admins, %d generals and %d civilians were interrogated.", - L"%d prisoners paid ransom money.", + L"Gained $%d as ransom money.", L"%d prisoners revealed enemy positions.", L"%d officers, %d elites, %d regulars and %d admins joined our cause.", L"Prisoners start a massive riot in %s!", @@ -10951,6 +10983,12 @@ STR16 szDiseaseText[] = L"\n\n%s (undiagnosed) - %d / %d\n", }; +STR16 szSpyText[] = +{ + L"Hide", + L"Get Intel", +}; + STR16 szFoodText[] = { L"\n\n|W|a|t|e|r: %d%%\n", @@ -11257,6 +11295,71 @@ STR16 szGearTemplateText[] = L"Selected mercenary is not in this sector.", L"%s is not in that sector.", L"%s could not equip %s.", + L"We cannot attach %s (item %d) as that might damage items.", +}; + +STR16 szIntelWebsiteText[] = +{ + L"Recon Intelligence Services", + L"Your need to know base", + L"Information Requests", + L"Information Verification", + + L"About us", + L"You have %d Intel.", + L"We currently have information on the following items, available in exchange for intel as usual:", + L"There is currently no other information available.", + + L"%d Intel - %s", + L"We can provide aerial reconnaissance of a map region. This will last until %02d:00.", + L"Buy data - 50 intel", + L"Buy detailed data - 70 Intel", + + L"Select map region on which you want info on:", + + L"North-west", + L"North-north-west", + L"North-north-east", + L"North-east", + + L"West-north-west", + L"Center-north-west", + L"Center-north-east", + L"East-north-east", + + L"West-south-west", + L"Center-south-west", + L"Center-south-east", + L"East-south-east", + + L"South-west", + L"South-south-west", + L"South-south-east", + L"South-east", + + // about us + L"On the 'Information Requests' page, you can buy information on various enemy targets for intel.", + L"This includes information on enemy patrols & garrisons, noteworthy persons of interests, enemy aircraft etc..", + L"Some of that information may be of temporary nature.", + L"On the 'Information Verification' page, you can upload data you took of significant intelligence.", + + L"We will verify the data (this process usually takes several hours) and compensate you accordingly.", + L"Note that you will reveive less intel if outside conditions have rendered the information less useful (e.g. the person in question having died since the data was acquired).", + + // sell info + L"You can upload the following facts:", + L"Previous", + L"Next", + L"Upload", + + L"You have already received compensation for the following:" +}; + +STR16 szIntelText[] = +{ + L"No more enemies present, %s is no longer in hiding!", + L"%s has been discovered and goes into hiding for %d hours.", + L"%s has been discovered, going to sector!", }; #endif //ENGLISH diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index d7cd364c..ca926447 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -2476,6 +2476,8 @@ STR16 pAssignmentStrings[] = L"Réparat.", // repairing L"Fortify", // build structures according to external layout // TODO.Translate L"Train W.", + L"Hide", // TODO.Translate + L"GetIntel", }; @@ -2579,6 +2581,8 @@ STR16 pPersonnelAssignmentStrings[] = L"Réparation", L"Fortify sector", // build structures according to external layout // TODO.Translate L"Train workers", + L"Hide while disguised", // TODO.Translate + L"Get intel while disguised", }; @@ -2641,6 +2645,8 @@ STR16 pLongAssignmentStrings[] = L"Réparation", L"Fortify sector", // build structures according to external layout // TODO.Translate L"Train workers", + L"Hide while disguised", // TODO.Translate + L"Get intel while disguised", }; @@ -2762,6 +2768,7 @@ STR16 pAssignMenuStrings[] = L"Formation", // the merc is training L"Dépl obj.", // move items L"Fortify", // fortify sector // TODO.Translate + L"Intel", // covert assignments // TODO.Translate L"Affectat.", // the merc is using/staffing a facility L"Annuler", // cancel this menu }; @@ -2799,6 +2806,10 @@ STR16 pTraitSkillsMenuStrings[] = L"Appeler des renforts", L"Éteindre la radio", + // spy + L"Hide assignment", // TODO.Translate + L"Get Intel assignment", + // various L"Guetteur", L"Focus", // TODO.Translate @@ -2816,6 +2827,10 @@ STR16 pTraitSkillsMenuDescStrings[] = L"Appeler des renforts des secteurs voisins.", L"Éteindre la radio.", + // spy + L"Assignment: hide among the population.", // TODO.Translate + L"Assignment: hide among the population and gather intel.", + // various L"Observer une zone avec un tireur d'élite donne un bonus de CDT sur tout ce que vous voyez.", L"Increase interrupt modifier (penalty outside of area).", // TODO.Translate @@ -2838,6 +2853,11 @@ STR16 pTraitSkillsDenialStrings[] = L" - prone person or corpse next to merc\n", // TODO.Translate L" - crouched position\n", L" - free main hand\n", + L" - covert trait\n", + L" - enemy occupied sector\n", + L" - single merc\n", + L" - no alarm raised\n", + L" - civilian or soldier disguise\n", }; STR16 pSkillMenuStrings[] = @@ -3192,6 +3212,7 @@ STR16 gzMercSkillTextNew[] = L"Placeholder", // for snitch (minor trait) L"Placeholder", // for survival (minor trait) L"Plus...", // 47 + L"Intel", // for INTEL // TODO.Translate L"Divers", // for VARIOUSSKILLS }; ////////////////////////////////////////////////////////// @@ -3991,7 +4012,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = L"%s a nettoyé %s", // added by Flugente: decide what to do with prisoners - L"Vous n'avez pas de prison. Vous les laissez partir.", + L"As we have no prison, a field interrogation is performed.", // TODO.Translate + L"Field interrogation", L"Où voulez-vous envoyer les %d prisonniers ?", L"Les relâcher", L"Voulez-vous proposer ?", @@ -5025,6 +5047,7 @@ STR16 pBookMarkStrings[] = L"WHO", L"Kerberus", L"Militia Overview", // TODO.Translate + L"R.I.S.", }; STR16 pBookmarkTitle[] = @@ -5148,6 +5171,9 @@ STR16 pWebPagesTitles[] = L"Kerberus - Hire a Team", L"Kerberus - Individual Contracts", L"Militia Overview", // TODO.Translate + L"Recon Intelligence Services - Information Requests", // TODO.Translate + L"Recon Intelligence Services - Information Verification", + L"Recon Intelligence Services - About us", L"Bobby Ray : Dernières commandes", L"Encyclopédie", L"Encyclopédie : Données", @@ -6081,6 +6107,9 @@ STR16 SkiMessageBoxText[] = L"Demander au vendeur de réparer les objets sélectionnés", L"Terminer l'entretien", L"Solde actuel", + + L"Do you want to transfer %s Intel to cover the difference?", // TODO.Translate + L"Do you want to transfer %s Intel to cover the cost?", }; @@ -6949,6 +6978,7 @@ STR16 gzLaptopHelpText[] = L"World Health Organization", L"Kerberus - Experience In Security", L"Militia Overview", // TODO.Translate + L"Recon Intelligence Services", // TODO.Translate }; @@ -8397,6 +8427,7 @@ STR16 szUDBGenSecondaryStatsTooltipText[]= L"|F|a|c|e |P|r|o|t|e|c|t|i|o|n", L"|I|n|f|e|c|t|i|o|n |P|r|o|t|e|c|t|i|o|n", // 39 L"|S|h|i|e|l|d", // TODO.Translate + L"|C|a|m|e|r|a", // TODO.Translate }; STR16 szUDBGenSecondaryStatsExplanationsTooltipText[]= @@ -8442,6 +8473,7 @@ STR16 szUDBGenSecondaryStatsExplanationsTooltipText[]= L"\n \nIf worn on your face, this will lower\nthe chance to be infected by other people.", L"\n \nIf kept in your inventory, this will\nlower\nthe chance to be infected by other people.", L"\n \nIf equipped in a hand, this will block incoming damage.", // TODO.Translate + L"\n \nYou can take photos with this.", // TODO.Translate }; STR16 szUDBAdvStatsTooltipText[]= @@ -8875,7 +8907,7 @@ STR16 szFoodTextStr[]= STR16 szPrisonerTextStr[]= { L"%d officers, %d elites, %d regulars, %d admins, %d generals and %d civilians were interrogated.", // TODO.Translate - L"Prisonnier(s) ayant payé une rançon : %d.", + L"Gained $%d as ransom money.", // TODO.Translate L"Prisonnier(s) ayant révélé les positions ennemies : %d.", L"Prisonnier(s) ayant rejoint notre cause : %d officiers, %d élite(s), %d régulier(s) et %d administratif(s).", L"Prisonnier(s) ayant commencé une émeute en %s !", @@ -10949,6 +10981,12 @@ STR16 szDiseaseText[] = L"\n\n%s (undiagnosed) - %d / %d\n", // TODO.Translate }; +STR16 szSpyText[] = +{ + L"Hide", // TODO.Translate + L"Get Intel", +}; + STR16 szFoodText[] = { L"\n\n|W|a|t|e|r: %d%%\n", @@ -11255,6 +11293,71 @@ STR16 szGearTemplateText[] = // TODO.Translate L"Selected mercenary is not in this sector.", L"%s is not in that sector.", L"%s could not equip %s.", + L"We cannot attach %s (item %d) as that might damage items.", // TODO.Translate +}; + +STR16 szIntelWebsiteText[] = +{ + L"Recon Intelligence Services", + L"Your need to know base", + L"Information Requests", + L"Information Verification", + + L"About us", + L"You have %d Intel.", + L"We currently have information on the following items, available in exchange for intel as usual:", + L"There is currently no other information available.", + + L"%d Intel - %s", + L"We can provide aerial reconnaissance of a map region. This will last until %02d:00.", + L"Buy data - 50 intel", + L"Buy detailed data - 70 Intel", + + L"Select map region on which you want info on:", + + L"North-west", + L"North-north-west", + L"North-north-east", + L"North-east", + + L"West-north-west", + L"Center-north-west", + L"Center-north-east", + L"East-north-east", + + L"West-south-west", + L"Center-south-west", + L"Center-south-east", + L"East-south-east", + + L"South-west", + L"South-south-west", + L"South-south-east", + L"South-east", + + // about us + L"On the 'Information Requests' page, you can buy information on various enemy targets for intel.", + L"This includes information on enemy patrols & garrisons, noteworthy persons of interests, enemy aircraft etc..", + L"Some of that information may be of temporary nature.", + L"On the 'Information Verification' page, you can upload data you took of significant intelligence.", + + L"We will verify the data (this process usually takes several hours) and compensate you accordingly.", + L"Note that you will reveive less intel if outside conditions have rendered the information less useful (e.g. the person in question having died since the data was acquired).", + + // sell info + L"You can upload the following facts:", + L"Previous", + L"Next", + L"Upload", + + L"You have already received compensation for the following:" +}; + +STR16 szIntelText[] = +{ + L"No more enemies present, %s is no longer in hiding!", + L"%s has been discovered and goes into hiding for %d hours.", + L"%s has been discovered, going to sector!", }; #endif //FRENCH diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index e889805d..89fcb32d 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -2481,6 +2481,8 @@ STR16 pAssignmentStrings[] = L"Repar.", // repairing L"Fortify", // build structures according to external layout // TODO.Translate L"Train W.", + L"Hide", // TODO.Translate + L"GetIntel", }; STR16 pMilitiaString[] = @@ -2580,6 +2582,8 @@ STR16 pPersonnelAssignmentStrings[] = L"Reparieren", L"Fortify sector", // build structures according to external layout // TODO.Translate L"Train workers", + L"Hide while disguised", // TODO.Translate + L"Get intel while disguised", }; // refer to above for comments @@ -2640,6 +2644,8 @@ STR16 pLongAssignmentStrings[] = L"Reparieren", L"Fortify sector", // build structures according to external layout // TODO.Translate L"Train workers", + L"Hide while disguised", // TODO.Translate + L"Get intel while disguised", }; // the contract options @@ -2757,6 +2763,7 @@ STR16 pAssignMenuStrings[] = L"Training", // the merc is training L"Umzug", // move items L"Fortify", // fortify sector // TODO.Translate + L"Intel", // covert assignments // TODO.Translate L"Betrieb", // the merc is using/staffing a facility L"Abbrechen", // cancel this menu }; @@ -2794,6 +2801,10 @@ STR16 pTraitSkillsMenuStrings[] = L"Verstärkung rufen", L"Radiogerät ausschalten", + // spy + L"Hide assignment", // TODO.Translate + L"Get Intel assignment", + // various L"Spotter", L"Fokus", @@ -2811,6 +2822,10 @@ STR16 pTraitSkillsMenuDescStrings[] = L"Verstärkung aus dem Nachbarsektor anfordern.", L"Radiogerät ausschalten.", + // spy + L"Assignment: hide among the population.", // TODO.Translate + L"Assignment: hide among the population and gather intel.", + // various L"Bestimmtes Gebiet beobachten, damit Scharfschützen einen Bonus auf deren Treffsicherheit erhalten.", L"Increase interrupt modifier (penalty outside of area).", // TODO.Translate @@ -2833,6 +2848,11 @@ STR16 pTraitSkillsDenialStrings[] = L" - prone person or corpse next to merc\n", // TODO.Translate L" - crouched position\n", L" - free main hand\n", + L" - covert trait\n", + L" - enemy occupied sector\n", + L" - single merc\n", + L" - no alarm raised\n", + L" - civilian or soldier disguise\n", }; STR16 pSkillMenuStrings[] = // TODO.Translate @@ -3199,7 +3219,8 @@ STR16 gzMercSkillTextNew[] = L"Placeholder", // for radio operator (minor trait) L"Placeholder", // for snitch(minor trait) L"Placeholder", // for survival (minor trait) - L"Mehr...", //47 + L"Mehr...", // 47 + L"Intel", // for INTEL // TODO.Translate L"diverse", // for VARIOUSSKILLS }; @@ -3993,7 +4014,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = L"%s reinigte %s", // added by Flugente: decide what to do with prisoners - L"Sie haben kein Gefängnis für die Gefangenen und müssen diese nun laufen lassen", + L"As we have no prison, a field interrogation is performed.", // TODO.Translate + L"Field interrogation", L"Wohin mit den %d Gefangenen?", L"Freilassen", L"Was möchten Sie tun?", @@ -4969,6 +4991,7 @@ STR16 pBookMarkStrings[] = L"WHO", L"Kerberus", L"Militia Overview", // TODO.Translate + L"R.I.S.", }; STR16 pBookmarkTitle[] = @@ -5084,6 +5107,9 @@ STR16 pWebPagesTitles[] = L"Kerberus - Hire a Team", L"Kerberus - Individual Contracts", L"Miliz - Übersicht", + L"Recon Intelligence Services - Information Requests", // TODO.Translate + L"Recon Intelligence Services - Information Verification", + L"Recon Intelligence Services - About us", L"Bobby Rays - Letzte Lieferungen", L"Enzyklopädie", L"Enzyklopädie - Daten", @@ -5923,6 +5949,9 @@ STR16 SkiMessageBoxText[] = L"Händler bitten, Gegenstände zu reparieren", L"Unterhaltung beenden", L"Kontostand", + + L"Do you want to transfer %s Intel to cover the difference?", // TODO.Translate + L"Do you want to transfer %s Intel to cover the cost?", }; //OptionScreen.c @@ -6782,6 +6811,7 @@ STR16 gzLaptopHelpText[] = L"World Health Organization", L"Kerberus - Experience In Security", L"Militia Overview", // TODO.Translate + L"Recon Intelligence Services", // TODO.Translate }; STR16 gzHelpScreenText[] = @@ -8226,6 +8256,7 @@ STR16 szUDBGenSecondaryStatsTooltipText[]= L"|F|a|c|e |P|r|o|t|e|c|t|i|o|n", L"|I|n|f|e|c|t|i|o|n |P|r|o|t|e|c|t|i|o|n", // 39 L"|S|h|i|e|l|d", // TODO.Translate + L"|C|a|m|e|r|a", // TODO.Translate }; STR16 szUDBGenSecondaryStatsExplanationsTooltipText[]= @@ -8271,6 +8302,7 @@ STR16 szUDBGenSecondaryStatsExplanationsTooltipText[]= L"\n \nIf worn on your face, this will lower\nthe chance to be infected by other people.", L"\n \nIf kept in your inventory, this will\nlower\nthe chance to be infected by other people.", L"\n \nIf equipped in a hand, this will block incoming damage.", // TODO.Translate + L"\n \nYou can take photos with this.", // TODO.Translate }; STR16 szUDBAdvStatsTooltipText[]= @@ -8705,7 +8737,7 @@ STR16 szFoodTextStr[]= STR16 szPrisonerTextStr[]= { L"%d Offiziere, %d Elite-, %d Reguläre, %d Hilfssoldaten, %d Generäle und %d Zivilisten wurden verhört.", - L"%d Gefangene wurden gegen Lösegeld freigelassen.", + L"Gained $%d as ransom money.", // TODO.Translate L"%d Gefangene haben uns Truppenstandorte verraten.", L"%d Offiziere, %d Elite-, %d Reguläre und %d Hilfssoldaten laufen zu uns über.", L"Gefangenenaufstand in %s!", @@ -10779,6 +10811,12 @@ STR16 szDiseaseText[] = L"\n\n%s (undiagnosed) - %d / %d\n", // TODO.Translate }; +STR16 szSpyText[] = +{ + L"Hide", // TODO.Translate + L"Get Intel", +}; + STR16 szFoodText[] = { L"\n\n|W|a|t|e|r: %d%%\n", @@ -11085,6 +11123,71 @@ STR16 szGearTemplateText[] = // TODO.Translate L"Selected mercenary is not in this sector.", L"%s is not in that sector.", L"%s could not equip %s.", + L"We cannot attach %s (item %d) as that might damage items.", // TODO.Translate +}; + +STR16 szIntelWebsiteText[] = +{ + L"Recon Intelligence Services", + L"Your need to know base", + L"Information Requests", + L"Information Verification", + + L"About us", + L"You have %d Intel.", + L"We currently have information on the following items, available in exchange for intel as usual:", + L"There is currently no other information available.", + + L"%d Intel - %s", + L"We can provide aerial reconnaissance of a map region. This will last until %02d:00.", + L"Buy data - 50 intel", + L"Buy detailed data - 70 Intel", + + L"Select map region on which you want info on:", + + L"North-west", + L"North-north-west", + L"North-north-east", + L"North-east", + + L"West-north-west", + L"Center-north-west", + L"Center-north-east", + L"East-north-east", + + L"West-south-west", + L"Center-south-west", + L"Center-south-east", + L"East-south-east", + + L"South-west", + L"South-south-west", + L"South-south-east", + L"South-east", + + // about us + L"On the 'Information Requests' page, you can buy information on various enemy targets for intel.", + L"This includes information on enemy patrols & garrisons, noteworthy persons of interests, enemy aircraft etc..", + L"Some of that information may be of temporary nature.", + L"On the 'Information Verification' page, you can upload data you took of significant intelligence.", + + L"We will verify the data (this process usually takes several hours) and compensate you accordingly.", + L"Note that you will reveive less intel if outside conditions have rendered the information less useful (e.g. the person in question having died since the data was acquired).", + + // sell info + L"You can upload the following facts:", + L"Previous", + L"Next", + L"Upload", + + L"You have already received compensation for the following:" +}; + +STR16 szIntelText[] = +{ + L"No more enemies present, %s is no longer in hiding!", + L"%s has been discovered and goes into hiding for %d hours.", + L"%s has been discovered, going to sector!", }; #endif //GERMAN diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index a3299c2e..5c16d8de 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -2462,6 +2462,8 @@ STR16 pAssignmentStrings[] = L"Riparare", // repairing L"Fortify", // build structures according to external layout // TODO.Translate L"Train W.", + L"Hide", // TODO.Translate + L"GetIntel", }; @@ -2565,6 +2567,8 @@ STR16 pPersonnelAssignmentStrings[] = L"Riparare", L"Fortify sector", // build structures according to external layout // TODO.Translate L"Train workers", + L"Hide while disguised", // TODO.Translate + L"Get intel while disguised", }; @@ -2627,6 +2631,8 @@ STR16 pLongAssignmentStrings[] = L"Ripara", L"Fortify sector", // build structures according to external layout // TODO.Translate L"Train workers", + L"Hide while disguised", // TODO.Translate + L"Get intel while disguised", }; @@ -2748,6 +2754,7 @@ STR16 pAssignMenuStrings[] = L"Si esercita", // the merc is training L"Get Item", // get items // TODO.Translate L"Fortify", // fortify sector // TODO.Translate + L"Intel", // covert assignments // TODO.Translate L"Facility", // the merc is using/staffing a facility // TODO.Translate L"Annulla", // cancel this menu }; @@ -2785,6 +2792,10 @@ STR16 pTraitSkillsMenuStrings[] = // TODO.Translate L"Call reinforcements", L"Switch off radio set", + // spy + L"Hide assignment", // TODO.Translate + L"Get Intel assignment", + // various L"Spotter", // TODO.Translate L"Focus", // TODO.Translate @@ -2802,6 +2813,10 @@ STR16 pTraitSkillsMenuDescStrings[] = L"Call in reinforcements from neighbouring sectors.", L"Turn off radio set.", // TODO.Translate + // spy + L"Assignment: hide among the population.", // TODO.Translate + L"Assignment: hide among the population and gather intel.", + // various L"Observe an area, granting allied snipers a bonus to cth on anything you see.", // TODO.Translate L"Increase interrupt modifier (penalty outside of area).", // TODO.Translate @@ -2824,6 +2839,11 @@ STR16 pTraitSkillsDenialStrings[] = L" - prone person or corpse next to merc\n", // TODO.Translate L" - crouched position\n", L" - free main hand\n", + L" - covert trait\n", + L" - enemy occupied sector\n", + L" - single merc\n", + L" - no alarm raised\n", + L" - civilian or soldier disguise\n", }; STR16 pSkillMenuStrings[] = // TODO.Translate @@ -3179,6 +3199,7 @@ STR16 gzMercSkillTextNew[] = L"Placeholder", // for snitch (minor trait) L"Placeholder", // for survival (minor trait) L"More...", // 47 + L"Intel", // for INTEL // TODO.Translate L"various", // for VARIOUSSKILLS }; ////////////////////////////////////////////////////////// @@ -3980,7 +4001,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = L"%s cleaned %s", // added by Flugente: decide what to do with prisoners - L"You have no prison for these prisoners, you have to let them go", + L"As we have no prison, a field interrogation is performed.", // TODO.Translate + L"Field interrogation", L"Where do you want to send the %d prisoners?", // TODO.Translate L"Let them go", L"What do you want to do?", @@ -5007,6 +5029,7 @@ STR16 pBookMarkStrings[] = L"WHO", L"Kerberus", L"Militia Overview", // TODO.Translate + L"R.I.S.", }; STR16 pBookmarkTitle[] = @@ -5130,6 +5153,9 @@ STR16 pWebPagesTitles[] = L"Kerberus - Hire a Team", L"Kerberus - Individual Contracts", L"Militia Overview", + L"Recon Intelligence Services - Information Requests", // TODO.Translate + L"Recon Intelligence Services - Information Verification", + L"Recon Intelligence Services - About us", L"Bobby Ray's - Recent Shipments", L"Encyclopedia", L"Encyclopedia - Data", @@ -6062,6 +6088,9 @@ STR16 SkiMessageBoxText[] = L"Rivolgetevi all'operatore per riparare gli oggetti selezionati", L"Fine conversazione", L"Bilancio attuale", + + L"Do you want to transfer %s Intel to cover the difference?", // TODO.Translate + L"Do you want to transfer %s Intel to cover the cost?", }; @@ -6936,6 +6965,7 @@ STR16 gzLaptopHelpText[] = L"World Health Organization", L"Kerberus - Experience In Security", L"Militia Overview", // TODO.Translate + L"Recon Intelligence Services", // TODO.Translate }; @@ -8400,6 +8430,7 @@ STR16 szUDBGenSecondaryStatsTooltipText[]= L"|F|a|c|e |P|r|o|t|e|c|t|i|o|n", L"|I|n|f|e|c|t|i|o|n |P|r|o|t|e|c|t|i|o|n", // 39 L"|S|h|i|e|l|d", // TODO.Translate + L"|C|a|m|e|r|a", // TODO.Translate }; STR16 szUDBGenSecondaryStatsExplanationsTooltipText[]= @@ -8445,6 +8476,7 @@ STR16 szUDBGenSecondaryStatsExplanationsTooltipText[]= L"\n \nIf worn on your face, this will lower\nthe chance to be infected by other people.", L"\n \nIf kept in your inventory, this will\nlower\nthe chance to be infected by other people.", L"\n \nIf equipped in a hand, this will block incoming damage.", // TODO.Translate + L"\n \nYou can take photos with this.", // TODO.Translate }; STR16 szUDBAdvStatsTooltipText[]= @@ -8883,7 +8915,7 @@ STR16 szFoodTextStr[]= STR16 szPrisonerTextStr[]= { L"%d officers, %d elites, %d regulars, %d admins, %d generals and %d civilians were interrogated.", // TODO.Translate - L"%d prisoners paid ransom money.", + L"Gained $%d as ransom money.", // TODO.Translate L"%d prisoners revealed enemy positions.", L"%d officers, %d elites, %d regulars and %d admins joined our cause.", L"Prisoners start a massive riot in %s!", @@ -10958,6 +10990,12 @@ STR16 szDiseaseText[] = L"\n\n%s (undiagnosed) - %d / %d\n", // TODO.Translate }; +STR16 szSpyText[] = +{ + L"Hide", // TODO.Translate + L"Get Intel", +}; + STR16 szFoodText[] = { L"\n\n|W|a|t|e|r: %d%%\n", @@ -11264,6 +11302,71 @@ STR16 szGearTemplateText[] = // TODO.Translate L"Selected mercenary is not in this sector.", L"%s is not in that sector.", L"%s could not equip %s.", + L"We cannot attach %s (item %d) as that might damage items.", // TODO.Translate +}; + +STR16 szIntelWebsiteText[] = +{ + L"Recon Intelligence Services", + L"Your need to know base", + L"Information Requests", + L"Information Verification", + + L"About us", + L"You have %d Intel.", + L"We currently have information on the following items, available in exchange for intel as usual:", + L"There is currently no other information available.", + + L"%d Intel - %s", + L"We can provide aerial reconnaissance of a map region. This will last until %02d:00.", + L"Buy data - 50 intel", + L"Buy detailed data - 70 Intel", + + L"Select map region on which you want info on:", + + L"North-west", + L"North-north-west", + L"North-north-east", + L"North-east", + + L"West-north-west", + L"Center-north-west", + L"Center-north-east", + L"East-north-east", + + L"West-south-west", + L"Center-south-west", + L"Center-south-east", + L"East-south-east", + + L"South-west", + L"South-south-west", + L"South-south-east", + L"South-east", + + // about us + L"On the 'Information Requests' page, you can buy information on various enemy targets for intel.", + L"This includes information on enemy patrols & garrisons, noteworthy persons of interests, enemy aircraft etc..", + L"Some of that information may be of temporary nature.", + L"On the 'Information Verification' page, you can upload data you took of significant intelligence.", + + L"We will verify the data (this process usually takes several hours) and compensate you accordingly.", + L"Note that you will reveive less intel if outside conditions have rendered the information less useful (e.g. the person in question having died since the data was acquired).", + + // sell info + L"You can upload the following facts:", + L"Previous", + L"Next", + L"Upload", + + L"You have already received compensation for the following:" +}; + +STR16 szIntelText[] = +{ + L"No more enemies present, %s is no longer in hiding!", + L"%s has been discovered and goes into hiding for %d hours.", + L"%s has been discovered, going to sector!", }; #endif //ITALIAN diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index d70300b9..c1bb9f3a 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -2474,6 +2474,8 @@ STR16 pAssignmentStrings[] = L"Naprawa", // repairing L"Fortify", // build structures according to external layout // TODO.Translate L"Train W.", + L"Hide", // TODO.Translate + L"GetIntel", }; @@ -2577,6 +2579,8 @@ STR16 pPersonnelAssignmentStrings[] = L"Naprawa", L"Fortify sector", // build structures according to external layout // TODO.Translate L"Train workers", + L"Hide while disguised", // TODO.Translate + L"Get intel while disguised", }; @@ -2639,6 +2643,8 @@ STR16 pLongAssignmentStrings[] = L"Naprawa", L"Fortify sector", // build structures according to external layout // TODO.Translate L"Train workers", + L"Hide while disguised", // TODO.Translate + L"Get intel while disguised", }; @@ -2760,6 +2766,7 @@ STR16 pAssignMenuStrings[] = L"Szkolenie", // the merc is training L"Get Item", // get items // TODO.Translate L"Fortify", // fortify sector // TODO.Translate + L"Intel", // covert assignments // TODO.Translate L"Facility", // the merc is using/staffing a facility // TODO.Translate L"Anuluj", // cancel this menu }; @@ -2797,6 +2804,10 @@ STR16 pTraitSkillsMenuStrings[] = // TODO.Translate L"Call reinforcements", L"Switch off radio set", + // spy + L"Hide assignment", // TODO.Translate + L"Get Intel assignment", + // various L"Spotter", // TODO.Translate L"Focus", // TODO.Translate @@ -2814,6 +2825,10 @@ STR16 pTraitSkillsMenuDescStrings[] = L"Call in reinforcements from neighbouring sectors.", L"Turn off radio set.", // TODO.Translate + // spy + L"Assignment: hide among the population.", // TODO.Translate + L"Assignment: hide among the population and gather intel.", + // various L"Observe an area, granting allied snipers a bonus to cth on anything you see.", // TODO.Translate L"Increase interrupt modifier (penalty outside of area).", // TODO.Translate @@ -2836,6 +2851,11 @@ STR16 pTraitSkillsDenialStrings[] = L" - prone person or corpse next to merc\n", // TODO.Translate L" - crouched position\n", L" - free main hand\n", + L" - covert trait\n", + L" - enemy occupied sector\n", + L" - single merc\n", + L" - no alarm raised\n", + L" - civilian or soldier disguise\n", }; STR16 pSkillMenuStrings[] = // TODO.Translate @@ -3189,6 +3209,7 @@ STR16 gzMercSkillTextNew[] = L"Placeholder", // for snitch(minor trait) L"Placeholder", // for survival (minor trait) L"Więcej...", // 47 + L"Intel", // for INTEL // TODO.Translate L"różne", // for VARIOUSSKILLS }; ////////////////////////////////////////////////////////// @@ -3991,7 +4012,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = L"%s cleaned %s", // added by Flugente: decide what to do with prisoners - L"You have no prison for these prisoners, you have to let them go", + L"As we have no prison, a field interrogation is performed.", // TODO.Translate + L"Field interrogation", L"Where do you want to send the %d prisoners?", // TODO.Translate L"Let them go", L"What do you want to do?", @@ -5022,6 +5044,7 @@ STR16 pBookMarkStrings[] = L"WHO", L"Kerberus", L"Militia Overview", // TODO.Translate + L"R.I.S.", }; STR16 pBookmarkTitle[] = @@ -5145,6 +5168,9 @@ STR16 pWebPagesTitles[] = L"Kerberus - Hire a Team", L"Kerberus - Individual Contracts", L"Militia Overview", // TODO.Translate + L"Recon Intelligence Services - Information Requests", // TODO.Translate + L"Recon Intelligence Services - Information Verification", + L"Recon Intelligence Services - About us", L"Bobby Ray's - Ostatnie dostawy", L"Encyclopedia", L"Encyclopedia - Dane", @@ -6077,6 +6103,9 @@ STR16 SkiMessageBoxText[] = L"Poproś o naprawę wybranych przedmiotów", L"Zakończ rozmowę", L"Saldo dostępne", + + L"Do you want to transfer %s Intel to cover the difference?", // TODO.Translate + L"Do you want to transfer %s Intel to cover the cost?", }; @@ -6950,6 +6979,7 @@ STR16 gzLaptopHelpText[] = L"World Health Organization", L"Kerberus - Experience In Security", L"Militia Overview", // TODO.Translate + L"Recon Intelligence Services", // TODO.Translate }; @@ -8412,6 +8442,7 @@ STR16 szUDBGenSecondaryStatsTooltipText[]= L"|F|a|c|e |P|r|o|t|e|c|t|i|o|n", L"|I|n|f|e|c|t|i|o|n |P|r|o|t|e|c|t|i|o|n", // 39 L"|S|h|i|e|l|d", // TODO.Translate + L"|C|a|m|e|r|a", // TODO.Translate }; STR16 szUDBGenSecondaryStatsExplanationsTooltipText[]= @@ -8457,6 +8488,7 @@ STR16 szUDBGenSecondaryStatsExplanationsTooltipText[]= L"\n \nIf worn on your face, this will lower\nthe chance to be infected by other people.", L"\n \nIf kept in your inventory, this will\nlower\nthe chance to be infected by other people.", L"\n \nIf equipped in a hand, this will block incoming damage.", // TODO.Translate + L"\n \nYou can take photos with this.", // TODO.Translate }; STR16 szUDBAdvStatsTooltipText[]= @@ -8897,7 +8929,7 @@ STR16 szFoodTextStr[]= STR16 szPrisonerTextStr[]= { L"%d officers, %d elites, %d regulars, %d admins, %d generals and %d civilians were interrogated.", // TODO.Translate - L"%d prisoners paid ransom money.", + L"Gained $%d as ransom money.", // TODO.Translate L"%d prisoners revealed enemy positions.", L"%d officers, %d elites, %d regulars and %d admins joined our cause.", L"Prisoners start a massive riot in %s!", @@ -10971,6 +11003,12 @@ STR16 szDiseaseText[] = L"\n\n%s (undiagnosed) - %d / %d\n", // TODO.Translate }; +STR16 szSpyText[] = +{ + L"Hide", // TODO.Translate + L"Get Intel", +}; + STR16 szFoodText[] = { L"\n\n|W|a|t|e|r: %d%%\n", @@ -11277,6 +11315,71 @@ STR16 szGearTemplateText[] = // TODO.Translate L"Selected mercenary is not in this sector.", L"%s is not in that sector.", L"%s could not equip %s.", + L"We cannot attach %s (item %d) as that might damage items.", // TODO.Translate +}; + +STR16 szIntelWebsiteText[] = +{ + L"Recon Intelligence Services", + L"Your need to know base", + L"Information Requests", + L"Information Verification", + + L"About us", + L"You have %d Intel.", + L"We currently have information on the following items, available in exchange for intel as usual:", + L"There is currently no other information available.", + + L"%d Intel - %s", + L"We can provide aerial reconnaissance of a map region. This will last until %02d:00.", + L"Buy data - 50 intel", + L"Buy detailed data - 70 Intel", + + L"Select map region on which you want info on:", + + L"North-west", + L"North-north-west", + L"North-north-east", + L"North-east", + + L"West-north-west", + L"Center-north-west", + L"Center-north-east", + L"East-north-east", + + L"West-south-west", + L"Center-south-west", + L"Center-south-east", + L"East-south-east", + + L"South-west", + L"South-south-west", + L"South-south-east", + L"South-east", + + // about us + L"On the 'Information Requests' page, you can buy information on various enemy targets for intel.", + L"This includes information on enemy patrols & garrisons, noteworthy persons of interests, enemy aircraft etc..", + L"Some of that information may be of temporary nature.", + L"On the 'Information Verification' page, you can upload data you took of significant intelligence.", + + L"We will verify the data (this process usually takes several hours) and compensate you accordingly.", + L"Note that you will reveive less intel if outside conditions have rendered the information less useful (e.g. the person in question having died since the data was acquired).", + + // sell info + L"You can upload the following facts:", + L"Previous", + L"Next", + L"Upload", + + L"You have already received compensation for the following:" +}; + +STR16 szIntelText[] = +{ + L"No more enemies present, %s is no longer in hiding!", + L"%s has been discovered and goes into hiding for %d hours.", + L"%s has been discovered, going to sector!", }; #endif //POLISH diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index cf84a106..bcfe98b3 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -2468,6 +2468,8 @@ STR16 pAssignmentStrings[] = L"Ремонт", // repairing L"Укрепляет", // build structures according to external layout L"Учит рабочих", + L"Hide", // TODO.Translate + L"GetIntel", }; @@ -2571,6 +2573,8 @@ STR16 pPersonnelAssignmentStrings[] = L"Ремонт", L"Укрепляет сектор", // build structures according to external layout L"Учит рабочих", + L"Hide while disguised", // TODO.Translate + L"Get intel while disguised", }; @@ -2633,6 +2637,8 @@ STR16 pLongAssignmentStrings[] = L"Ремонтирует", L"Укрепляет сектор", // build structures according to external layout L"Учит рабочих", + L"Hide while disguised", // TODO.Translate + L"Get intel while disguised", }; @@ -2754,6 +2760,7 @@ STR16 pAssignMenuStrings[] = L"Обучение", // the merc is training L"Носильщик", // move items L"Укреплять", // fortify sector + L"Intel", // covert assignments // TODO.Translate L"Занятия", // the merc is using/staffing a facility L"Отмена", // cancel this menu }; @@ -2791,6 +2798,10 @@ STR16 pTraitSkillsMenuStrings[] = L"Вызвать подкрепления", L"Выключить радиостанцию", + // spy + L"Hide assignment", // TODO.Translate + L"Get Intel assignment", + // various L"Наблюдатель", L"Focus", // TODO.Translate @@ -2808,6 +2819,10 @@ STR16 pTraitSkillsMenuDescStrings[] = L"Вызвать подкрепления из соседних секторов.", L"Turn off radio set.", // TODO.Translate + // spy + L"Assignment: hide among the population.", // TODO.Translate + L"Assignment: hide among the population and gather intel.", + // various L"Наблюдать за местностью, чтобы обеспечить более меткую стрельбу своим снайперам.", L"Increase interrupt modifier (penalty outside of area).", // TODO.Translate @@ -2830,6 +2845,11 @@ STR16 pTraitSkillsDenialStrings[] = L" - prone person or corpse next to merc\n", // TODO.Translate L" - crouched position\n", L" - free main hand\n", + L" - covert trait\n", + L" - enemy occupied sector\n", + L" - single merc\n", + L" - no alarm raised\n", + L" - civilian or soldier disguise\n", }; STR16 pSkillMenuStrings[] = @@ -3184,6 +3204,7 @@ STR16 gzMercSkillTextNew[] = L"Placeholder", // for snitch (minor trait) L"Placeholder", // for survival (minor trait) L"Ещё...", // 47 + L"Intel", // for INTEL // TODO.Translate L"различные", // for VARIOUSSKILLS }; ////////////////////////////////////////////////////////// @@ -3985,7 +4006,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = L"%s чистит %s", // added by Flugente: decide what to do with prisoners - L"У вас нет тюрьмы для содержания заключённых, придётся отпустить их", + L"As we have no prison, a field interrogation is performed.", // TODO.Translate + L"Field interrogation", L"Куда отправить %d пленного(-иков)?", L"Отпустить", L"Что вы хотите сделать?", @@ -5013,6 +5035,7 @@ STR16 pBookMarkStrings[] = L"ВОЗ", L"Цербер", L"Ополчение", + L"R.I.S.", }; STR16 pBookmarkTitle[] = @@ -5136,6 +5159,9 @@ STR16 pWebPagesTitles[] = L"Цербер - Найм команды", L"Цербер - Индивидуальные контракты", L"Militia Overview", // TODO.Translate + L"Recon Intelligence Services - Information Requests", // TODO.Translate + L"Recon Intelligence Services - Information Verification", + L"Recon Intelligence Services - About us", L"Бобби Рэй - последние поступления", L"Энциклопедия", L"Энциклопедия - данные", @@ -6068,6 +6094,9 @@ STR16 SkiMessageBoxText[] = L"Попросить торговца починить выбранные предметы", L"Закончить беседу", L"Текущий баланс", + + L"Do you want to transfer %s Intel to cover the difference?", // TODO.Translate + L"Do you want to transfer %s Intel to cover the cost?", }; @@ -6936,6 +6965,7 @@ STR16 gzLaptopHelpText[] = L"Всемирная организация здравоохранения", L"Цербер - Опыт в безопасности", L"Ополчение", + L"Recon Intelligence Services", // TODO.Translate }; @@ -8394,6 +8424,7 @@ STR16 szUDBGenSecondaryStatsTooltipText[]= L"|З|а|щ|и|т|а |д|л|я |л|и|ц|а", L"|И|н|ф|е|к|ц|и|о|н|н|а|я |з|а|щ|и|т|а", // 39 L"|S|h|i|e|l|d", // TODO.Translate + L"|C|a|m|e|r|a", // TODO.Translate }; STR16 szUDBGenSecondaryStatsExplanationsTooltipText[]= @@ -8439,6 +8470,7 @@ STR16 szUDBGenSecondaryStatsExplanationsTooltipText[]= L"\n \nЕсли одето на лицо, понижает шанс\nзаражения от других людей.", L"\n \nЕсли хранить в своём кармане,\nпонижается шанс заражения\n от других людей.", L"\n \nIf equipped in a hand, this will block incoming damage.", // TODO.Translate + L"\n \nYou can take photos with this.", // TODO.Translate }; STR16 szUDBAdvStatsTooltipText[]= @@ -8876,7 +8908,7 @@ STR16 szFoodTextStr[]= STR16 szPrisonerTextStr[]= { L"%d офицеров, %d спецназа, %d солдат, %d полиции, %d генералов и %d гражданских было допрошено", - L"%d пленных заплатили выкуп.", + L"Gained $%d as ransom money.", // TODO.Translate L"%d пленных выдали расположение отрядов армии.", L"%d офицеров, %d спецназ, %d рядовых и %d полицейских решили присоединиться к нам.", L"Пленные устроили бунт в %s!", @@ -10951,6 +10983,12 @@ STR16 szDiseaseText[] = L"\n\n%s (недиагностирована) - %d / %d\n", }; +STR16 szSpyText[] = +{ + L"Hide", // TODO.Translate + L"Get Intel", +}; + STR16 szFoodText[] = { L"\n\n|В|о|д|а: %d%%\n", @@ -11257,6 +11295,71 @@ STR16 szGearTemplateText[] = // TODO.Translate L"Selected mercenary is not in this sector.", L"%s is not in that sector.", L"%s could not equip %s.", + L"We cannot attach %s (item %d) as that might damage items.", // TODO.Translate +}; + +STR16 szIntelWebsiteText[] = +{ + L"Recon Intelligence Services", + L"Your need to know base", + L"Information Requests", + L"Information Verification", + + L"About us", + L"You have %d Intel.", + L"We currently have information on the following items, available in exchange for intel as usual:", + L"There is currently no other information available.", + + L"%d Intel - %s", + L"We can provide aerial reconnaissance of a map region. This will last until %02d:00.", + L"Buy data - 50 intel", + L"Buy detailed data - 70 Intel", + + L"Select map region on which you want info on:", + + L"North-west", + L"North-north-west", + L"North-north-east", + L"North-east", + + L"West-north-west", + L"Center-north-west", + L"Center-north-east", + L"East-north-east", + + L"West-south-west", + L"Center-south-west", + L"Center-south-east", + L"East-south-east", + + L"South-west", + L"South-south-west", + L"South-south-east", + L"South-east", + + // about us + L"On the 'Information Requests' page, you can buy information on various enemy targets for intel.", + L"This includes information on enemy patrols & garrisons, noteworthy persons of interests, enemy aircraft etc..", + L"Some of that information may be of temporary nature.", + L"On the 'Information Verification' page, you can upload data you took of significant intelligence.", + + L"We will verify the data (this process usually takes several hours) and compensate you accordingly.", + L"Note that you will reveive less intel if outside conditions have rendered the information less useful (e.g. the person in question having died since the data was acquired).", + + // sell info + L"You can upload the following facts:", + L"Previous", + L"Next", + L"Upload", + + L"You have already received compensation for the following:" +}; + +STR16 szIntelText[] = +{ + L"No more enemies present, %s is no longer in hiding!", + L"%s has been discovered and goes into hiding for %d hours.", + L"%s has been discovered, going to sector!", }; #endif //RUSSIAN