From f641ba3e3238c841914cdd610a4f4f20c953efa9 Mon Sep 17 00:00:00 2001 From: Wanne Date: Sun, 24 Feb 2008 19:06:52 +0000 Subject: [PATCH] - new property (ENABLE_CHANCE_OF_ENEMY_AMBUSHES_ON_INSANE_DIFFICULT) for the enemy ambushes which are in the game since the beginning of 1.13 development git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1836 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- GameSettings.cpp | 3 +++ GameSettings.h | 2 ++ Strategic/PreBattle Interface.cpp | 6 ++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/GameSettings.cpp b/GameSettings.cpp index f3270ae5f..b6d1a7c52 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -705,6 +705,9 @@ void LoadGameExternalOptions() // Kaiden: Vehicle Inventory change - Added INI file Option VEHICLE_INVENTORY gGameExternalOptions.fVehicleInventory = iniReader.ReadBoolean("JA2 Gameplay Settings", "VEHICLE_INVENTORY", TRUE); + // WANNE: Added INI file Option for enemy ambushes, so we also have the option to play vanilla ja2 ambush settings + gGameExternalOptions.fEnableChanceOfEnemyAmbushesOnInsaneDifficult = iniReader.ReadBoolean("JA2 Gameplay Settings", "ENABLE_CHANCE_OF_ENEMY_AMBUSHES_ON_INSANE_DIFFICULT", TRUE); + } diff --git a/GameSettings.h b/GameSettings.h index 8d73475f6..0aca4c4cf 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -209,6 +209,8 @@ typedef struct // Kaiden: Vehicle Inventory change - Added for INI Option BOOLEAN fVehicleInventory; + BOOLEAN fEnableChanceOfEnemyAmbushesOnInsaneDifficult; + // System settings UINT8 gubDeadLockDelay; BOOLEAN gfEnableEmergencyButton_SkipStrategicEvents; diff --git a/Strategic/PreBattle Interface.cpp b/Strategic/PreBattle Interface.cpp index 9bb7c5720..d2b796dc2 100644 --- a/Strategic/PreBattle Interface.cpp +++ b/Strategic/PreBattle Interface.cpp @@ -543,8 +543,10 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI ) { gubEnemyEncounterCode = ENEMY_AMBUSH_CODE; } - // Madd - else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE && + // Madd: + // WANNE: Added an ja2_options.ini Property "ENABLE_CHANCE_OF_ENEMY_AMBUSHES_ON_INSANE_DIFFICULT" + else if( gGameExternalOptions.fEnableChanceOfEnemyAmbushesOnInsaneDifficult && + gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE && CurrentPlayerProgressPercentage() >= 25 ) { //if the enemy outnumbers the players, then there is a chance of the enemies ambushing the group if( ubNumMobileEnemies > ubNumMercs )