diff --git a/GameSettings.cpp b/GameSettings.cpp index f20807aa..49683fe6 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -849,6 +849,14 @@ void LoadGameExternalOptions() // CHRISL: New setting to allow Slay to remain as a hired PC gGameExternalOptions.fEnableSlayForever = iniReader.ReadBoolean("Recruitment Settings", "SLAY_STAYS_FOREVER", FALSE); + // anv: playable Speck + gGameExternalOptions.fEnableRecruitableSpeck = iniReader.ReadBoolean("Recruitment Settings", "RECRUITABLE_SPECK", TRUE); + // anv: John Kulba becomes recruitable as a merc after finishing escort quest + gGameExternalOptions.fEnableRecruitableJohnKulba = iniReader.ReadBoolean("Recruitment Settings", "RECRUITABLE_JOHN_KULBA", TRUE); + gGameExternalOptions.ubRecruitableJohnKulbaDelay = iniReader.ReadInteger("Recruitment Settings", "RECRUITABLE_JOHN_KULBA_DELAY", 14, 0, 255); + // anv: enable JA1 natives as MERC mercs + gGameExternalOptions.fEnableRecruitableJA1Natives = iniReader.ReadBoolean("Recruitment Settings", "RECRUITABLE_JA1_NATIVES", TRUE); + // Buggler: setting to show/hide skills/traits in AIM & MERC hiring page gGameExternalOptions.fShowSkillsInHirePage = iniReader.ReadBoolean("Recruitment Settings", "SHOW_SKILLS_IN_HIRING_PAGE", FALSE); diff --git a/GameSettings.h b/GameSettings.h index 73c0bf95..50f16e88 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -726,6 +726,14 @@ typedef struct // CHRISL: option to allow Slay to remain as a hired PC BOOLEAN fEnableSlayForever; + // anv: playable Speck + BOOLEAN fEnableRecruitableSpeck; + // anv: John Kulba becomes recruitable as a merc after finishing escort quest + BOOLEAN fEnableRecruitableJohnKulba; + UINT16 ubRecruitableJohnKulbaDelay; + // anv: enable JA1 natives as MERC mercs + BOOLEAN fEnableRecruitableJA1Natives; + // CHRISL: Setting to turn off the description and stack popup options from the sector inventory panel BOOLEAN fSectorDesc; diff --git a/Laptop/AimLinks.cpp b/Laptop/AimLinks.cpp index 8b513865..79f98b09 100644 --- a/Laptop/AimLinks.cpp +++ b/Laptop/AimLinks.cpp @@ -189,7 +189,7 @@ void ExitAimLinks() DeleteVideoObjectFromIndex(guiFuneralLink); DeleteVideoObjectFromIndex(guiInsuranceLink); - for(i=0; i 0 && gConditionsForMercAvailability[ gConditionsForMercAvailability[i - 1].uiIndex ].uiAlternateIndex != 255) { // Previous merc has alternate (drunk) merc, skip his one! - LaptopSaveInfo.gubLastMercIndex = LaptopSaveInfo.gubLastMercIndex + 2; + //LaptopSaveInfo.gubLastMercIndex = LaptopSaveInfo.gubLastMercIndex + 2; + LaptopSaveInfo.gubLastMercIndex = LaptopSaveInfo.gubLastMercIndex++; } else { LaptopSaveInfo.gubLastMercIndex++; } } - - gConditionsForMercAvailability[gConditionsForMercAvailability[i].uiIndex].NewMercsAvailable = TRUE; - LaptopSaveInfo.ubLastMercAvailableId = gConditionsForMercAvailability[i].uiIndex; + //gConditionsForMercAvailability[gConditionsForMercAvailability[i].uiIndex].NewMercsAvailable = TRUE; LaptopSaveInfo.ubLastMercAvailableId = gConditionsForMercAvailability[i].uiIndex; gConditionsForMercAvailability[i].StartMercsAvailable = TRUE; - + #ifdef JA2UB AddEmail( NEW_MERCS_AT_MERC, NEW_MERCS_AT_MERC_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT); //new mercs are available LaptopSaveInfo.fNewMercsAvailableAtMercSite = TRUE; #else - if( IsSpeckComAvailable() ) { AddEmail( NEW_MERCS_AT_MERC, NEW_MERCS_AT_MERC_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT); diff --git a/Laptop/mercs.h b/Laptop/mercs.h index 08fb5281..f18dc26a 100644 --- a/Laptop/mercs.h +++ b/Laptop/mercs.h @@ -109,7 +109,7 @@ enum }; - +BOOLEAN CanMercBeAvailableDuringInit( UINT8 ubMercToCheck );// anv: for all mercs available void GameInitMercs(); BOOLEAN EnterMercs(); void ExitMercs(); @@ -123,6 +123,9 @@ BOOLEAN RemoveMercBackGround(); void DailyUpdateOfMercSite( UINT16 usDate); UINT8 GetMercIDFromMERCArray(UINT8 ubMercID); +UINT8 GetAvailableMercIndex(UINT8 gubCurMercIndex); +UINT8 GetAvailableMercIDFromMERCArray(UINT8 ubMercID); + void DisplayTextForSpeckVideoPopUp(STR16 pString); BOOLEAN IsMercMercAvailable( UINT8 ubMercID ); @@ -157,6 +160,9 @@ void MakeBiffAwayForCoupleOfDays(); #else BOOLEAN IsSpeckComAvailable(); void HandleSpeckWitnessingEmployeeDeath( SOLDIERTYPE* pSoldier ); + + // anv: for Kulba hireable after escort quest + void AddJohnAsMerc( ); #endif void InitializeNumDaysMercArrive(); diff --git a/Tactical/Interface Dialogue.cpp b/Tactical/Interface Dialogue.cpp index 0aeb07e1..ba0d6155 100644 --- a/Tactical/Interface Dialogue.cpp +++ b/Tactical/Interface Dialogue.cpp @@ -2731,6 +2731,7 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum if( pSoldier->ubProfile == FLO ) { SetFactTrue( FACT_PC_MARRYING_DARYL_IS_FLO ); + #ifdef JA2UB #else // anv: make Speck whine about it immediately if on team @@ -4013,6 +4014,13 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum case NPC_ACTION_ADD_JOHNS_GUN_SHIPMENT: AddJohnsGunShipment(); + +#ifdef JA2UB +#else + // anv: recruitable Kulba + if( gGameExternalOptions.fEnableRecruitableJohnKulba == TRUE ) + AddJohnAsMerc(); +#endif // also close panel DeleteTalkingMenu(); break; diff --git a/Tactical/Merc Hiring.cpp b/Tactical/Merc Hiring.cpp index 17907f30..3391721d 100644 --- a/Tactical/Merc Hiring.cpp +++ b/Tactical/Merc Hiring.cpp @@ -65,6 +65,12 @@ #include "ub_config.h" #endif +#ifdef JA2UB +#else + // anv: for Kulba's odyssey + #include "email.h" +#endif + //forward declarations of common classes to eliminate includes class OBJECTTYPE; class SOLDIERTYPE; @@ -452,6 +458,38 @@ void MercArrivesCallback( UINT8 ubSoldierID ) pMerc = &gMercProfiles[ pSoldier->ubProfile ]; +// anv: handle Kulba's odyssey +#ifdef JA2UB + // too many Kulbas +#else + if(pSoldier->ubProfile == JOHN_MERC) + { + // just in case + if( LaptopSaveInfo.ubJohnPossibleMissedFlights > 3 ) + LaptopSaveInfo.ubJohnPossibleMissedFlights = 3; + // every time Kulba delays his arrival, chances of next delay decrease + if( Random( 100 ) < LaptopSaveInfo.ubJohnPossibleMissedFlights * 25 ) + { + pSoldier->uiTimeSoldierWillArrive = pSoldier->uiTimeSoldierWillArrive + 720 + Random ( 720 ); + AddStrategicEvent( EVENT_DELAYED_HIRING_OF_MERC, pSoldier->uiTimeSoldierWillArrive, pSoldier->ubID ); + if(LaptopSaveInfo.ubJohnPossibleMissedFlights == 3 ) + AddEmail( JOHN_KULBA_MISSED_FLIGHT_1, JOHN_KULBA_MISSED_FLIGHT_1_LENGTH, JOHN_KULBA, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT ); + else if(LaptopSaveInfo.ubJohnPossibleMissedFlights == 2 ) + AddEmail( JOHN_KULBA_MISSED_FLIGHT_2, JOHN_KULBA_MISSED_FLIGHT_2_LENGTH, JOHN_KULBA, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT ); + else if(LaptopSaveInfo.ubJohnPossibleMissedFlights == 1 ) + AddEmail( JOHN_KULBA_MISSED_FLIGHT_3, JOHN_KULBA_MISSED_FLIGHT_3_LENGTH, JOHN_KULBA, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT ); + + LaptopSaveInfo.ubJohnPossibleMissedFlights--; + return; + } + else + { + // reset possible missed flights, for the future Kulba's adventures + LaptopSaveInfo.ubJohnPossibleMissedFlights = 3; + } + } +#endif + // add the guy to a squad AddCharacterToAnySquad( pSoldier ); diff --git a/Tactical/Soldier Profile.h b/Tactical/Soldier Profile.h index 0fb3639a..7a373c20 100644 --- a/Tactical/Soldier Profile.h +++ b/Tactical/Soldier Profile.h @@ -242,6 +242,12 @@ enum NPCIDs #endif NPC170 = NPC169 + 84, SPECK_PLAYABLE = 191,// anv + + // Those 4 only available in JA2 113 and not in JA2 UB! + JOHN_MERC = 195, + ELIO = 196, + JUAN = 197, + WAHAN = 198, } ; BOOLEAN LoadMercProfiles(void); diff --git a/builddefines.h b/builddefines.h index b05bd24d..8e9f45bb 100644 --- a/builddefines.h +++ b/builddefines.h @@ -22,7 +22,7 @@ // ----------------------------- // ***************************** -// WANNE: With these define we can build JA2 DEMO version that runs with 1.13 +// WANNE: With this defin we can build JA2 DEMO version that runs with 1.13 // The 2 UB defines (JA2UB and JA2UBMAPS) should be disabled, because we only want to build the demo version from the JA2 code! //#define JA113DEMO