From f135291973cb97b26281e9d6eb1c51d4de3199f5 Mon Sep 17 00:00:00 2001 From: MaddMugsy Date: Sat, 12 Aug 2006 00:56:26 +0000 Subject: [PATCH] -added ENABLE_ALL_WEAPON_CACHES and ENABLE_ALL_TERRORIST flags (requires new game to use) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@428 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- GameSettings.cpp | 2 ++ GameVersion.cpp | 2 +- Strategic/Strategic AI.cpp | 41 +++++++++++++++++++++++++++++------- Tactical/Soldier Profile.cpp | 6 +++++- 4 files changed, 41 insertions(+), 10 deletions(-) diff --git a/GameSettings.cpp b/GameSettings.cpp index 578e1d982..3653469c9 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -485,6 +485,8 @@ void LoadGameExternalOptions() gGameExternalOptions.fAmmoDynamicWeight = iniReader.ReadBoolean("JA2 Gameplay Settings", "DYNAMIC_AMMO_WEIGHT", TRUE); //Pulmu gGameExternalOptions.fEnableCrepitus = iniReader.ReadBoolean("JA2 Gameplay Settings", "ENABLE_CREPITUS", TRUE); + gGameExternalOptions.fEnableAllTerrorists = iniReader.ReadBoolean("JA2 Gameplay Settings", "ENABLE_ALL_TERRORISTS", FALSE); + gGameExternalOptions.fEnableAllWeaponCaches = iniReader.ReadBoolean("JA2 Gameplay Settings", "ENABLE_ALL_WEAPON_CACHES", FALSE); } diff --git a/GameVersion.cpp b/GameVersion.cpp index 0d1bea3cb..98458a916 100644 --- a/GameVersion.cpp +++ b/GameVersion.cpp @@ -23,7 +23,7 @@ INT16 zVersionLabel[256] = { L"Beta v. 0.98" }; #else //RELEASE BUILD VERSION - INT16 zVersionLabel[256] = { L"Release v1.13.427" }; + INT16 zVersionLabel[256] = { L"Release v1.13.428" }; #endif diff --git a/Strategic/Strategic AI.cpp b/Strategic/Strategic AI.cpp index 61a7779b8..7eadb740f 100644 --- a/Strategic/Strategic AI.cpp +++ b/Strategic/Strategic AI.cpp @@ -1388,16 +1388,41 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Strategic3"); //final thing to do is choose 1 cache map out of 5 possible maps. Simply select the sector randomly, //set up the flags to use the alternate map, then place 8-12 regular troops there (no ai though). //changing MAX_STRATEGIC_TEAM_SIZE may require changes to to the defending force here. - switch( Random( 5 ) ) + if ( !gGameExternalOptions.fEnableAllWeaponCaches ) { - case 0: pSector = &SectorInfo[ SEC_E11 ]; break; - case 1: pSector = &SectorInfo[ SEC_H5 ]; break; - case 2: pSector = &SectorInfo[ SEC_H10 ]; break; - case 3: pSector = &SectorInfo[ SEC_J12 ]; break; - case 4: pSector = &SectorInfo[ SEC_M9 ]; break; + switch( Random( 5 ) ) + { + case 0: pSector = &SectorInfo[ SEC_E11 ]; break; + case 1: pSector = &SectorInfo[ SEC_H5 ]; break; + case 2: pSector = &SectorInfo[ SEC_H10 ]; break; + case 3: pSector = &SectorInfo[ SEC_J12 ]; break; + case 4: pSector = &SectorInfo[ SEC_M9 ]; break; + } + pSector->uiFlags |= SF_USE_ALTERNATE_MAP; + pSector->ubNumTroops = (UINT8)(6 + gGameOptions.ubDifficultyLevel * 2); + } + else + { + pSector = &SectorInfo[ SEC_E11 ]; + pSector->uiFlags |= SF_USE_ALTERNATE_MAP; + pSector->ubNumTroops = (UINT8)(6 + gGameOptions.ubDifficultyLevel * 2); + + pSector = &SectorInfo[ SEC_H5 ]; + pSector->uiFlags |= SF_USE_ALTERNATE_MAP; + pSector->ubNumTroops = (UINT8)(6 + gGameOptions.ubDifficultyLevel * 2); + + pSector = &SectorInfo[ SEC_H10 ]; + pSector->uiFlags |= SF_USE_ALTERNATE_MAP; + pSector->ubNumTroops = (UINT8)(6 + gGameOptions.ubDifficultyLevel * 2); + + pSector = &SectorInfo[ SEC_J12 ]; + pSector->uiFlags |= SF_USE_ALTERNATE_MAP; + pSector->ubNumTroops = (UINT8)(6 + gGameOptions.ubDifficultyLevel * 2); + + pSector = &SectorInfo[ SEC_M9 ]; + pSector->uiFlags |= SF_USE_ALTERNATE_MAP; + pSector->ubNumTroops = (UINT8)(6 + gGameOptions.ubDifficultyLevel * 2); } - pSector->uiFlags |= SF_USE_ALTERNATE_MAP; - pSector->ubNumTroops = (UINT8)(6 + gGameOptions.ubDifficultyLevel * 2); ValidateWeights( 1 ); } diff --git a/Tactical/Soldier Profile.cpp b/Tactical/Soldier Profile.cpp index 2d727c233..5aec06e51 100644 --- a/Tactical/Soldier Profile.cpp +++ b/Tactical/Soldier Profile.cpp @@ -441,13 +441,17 @@ void DecideActiveTerrorists( void ) case DIF_LEVEL_EASY: uiChance = 70; break; - case DIF_LEVEL_HARD: + case DIF_LEVEL_INSANE: uiChance = 30; break; default: uiChance = 50; break; } + + if ( gGameExternalOptions.fEnableAllTerrorists ) + uiChance = 100; + // add at least 2 more ubNumAdditionalTerrorists = 2; for (ubLoop = 0; ubLoop < (MAX_ADDITIONAL_TERRORISTS - 2); ubLoop++)