Externalized Difficulty Settings

- Removed #ifdef DIFFICULTY_SETTING. Now the new difficulty settings code is always active (by Jazz)
- Removed unused INI reading settings

These parameters were moved to the file DifficultySettings.xml.
** Ja2_Options.INI **
ENEMY_AP_BONUS_NOVICE , _EXPERIENCED, _EXPERT, _INSANE
NUM_KILLS_PER_PROGRESS_POINT_NOVICE , _EXPERIENCED, _EXPERT, _INSANE
INITIAL_GARRISON_PERCENTAGES_NOVICE  , _EXPERIENCED, _EXPERT, _INSANE
MIN_ENEMY_GROUP_SIZE_NOVICE , _EXPERIENCED, _EXPERT, _INSANE
UNLIMITED_POOL_OF_TROOPS_NOVICE , _EXPERIENCED, _EXPERT, _INSANE
QUEENS_INITIAL_POOL_OF_TROOPS_NOVICE , _EXPERIENCED, _EXPERT, _INSANE
ENEMY_STARTING_ALERT_LEVEL_NOVICE , _EXPERIENCED, _EXPERT, _INSANE
ENEMY_ALERT_DECAY_NOVICE , _EXPERIENCED, _EXPERT, _INSANE
NUM_AWARE_BATTLES_NOVICE , _EXPERIENCED, _EXPERT, _INSANE
BASE_DELAY_IN_MINUTES_BETWEEN_EVALUATIONS_NOVICE , _EXPERIENCED, _EXPERT, _INSANE
EVALUATION_DELAY_VARIANCE_NOVICE , _EXPERIENCED, _EXPERT, _INSANE
GRACE_PERIOD_IN_HOURS_AFTER_SECTOR_LIBERATION_NOVICE , _EXPERIENCED, _EXPERT, _INSANE
GRACE_PERIOD_IN_DAYS_AFTER_PATROL_DESTROYED_NOVICE , _EXPERIENCED, _EXPERT, _INSANE
AGGRESSIVE_QUEEN_AI_NOVICE , _EXPERIENCED, _EXPERT, _INSANE
QUEEN_POOL_INCREMENT_PER_DIFFICULTY_LEVEL
PERCENT_EXTRA_ELITES_EXPERIENCED , _EXPERT, _INSANE
MAX_MERC_DEATHS_EASY , _EXPERIENCED, _EXPERT, _INSANE
		
** Creatures_Settings.INI **
CREATURE_SPREAD_TIME_NOVICE , _EXPERIENCED, _EXPERT, _INSANE
QUEEN_REPRODUCTION_BASE_NOVICE , _EXPERIENCED, _EXPERT, _INSANE
QUEEN_REPRODUCTION_BONUS_NOVICE , _EXPERIENCED, _EXPERT, _INSANE
QUEEN_INIT_BONUS_SPREAD_NOVICE , _EXPERIENCED, _EXPERT, _INSANE
CREATURE_POPULATION_MODIFIER_NOVICE , _EXPERIENCED, _EXPERT, _INSANE
CREATURE_TOWN_AGGRESSIVENESS_NOVICE , _EXPERIENCED, _EXPERT, _INSANE
QUEEN_POOL_INCREMENT_PER_DIFFICULTY_LEVEL
		
** CTHConstants.ini **
BASE_DIFFICULTY_NOVICE , _EXPERIENCED, _EXPERT, _INSANE
AIM_DIFFICULTY_NOVICE , _EXPERIENCED, _EXPERT, _INSANE


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7461 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2014-08-31 13:39:23 +00:00
parent a2bbeebc54
commit 684e1d6148
42 changed files with 187 additions and 688 deletions
+15 -54
View File
@@ -288,11 +288,9 @@
#define JA2SP_UB_RPC_TEX_AND_JOHN "RPC_TEX_AND_JOHN"
#define JA2SP_UB_RANDOM_MANUEL_TEXT "RANDOM_MANUEL_TEXT"
#ifdef DIFFICULTY_SETTING
//#define NUM_DIFF_SETTINGS 4
DIFFICULTY_SETTINGS_VALUES zDeffSetting[15];
UINT8 MaxDifficultySettingsValues;
#endif
//Difficulty settings
enum
@@ -301,12 +299,8 @@ enum
GIO_DIFF_MED,
GIO_DIFF_HARD,
GIO_DIFF_INSANE,
#ifdef DIFFICULTY_SETTING
GIO_DIFF_NEW = GIO_DIFF_INSANE + 245,
#else
NUM_DIFF_SETTINGS,
#endif
// NUM_DIFF_SETTINGS,
};
@@ -1433,11 +1427,8 @@ void BtnGIODifficultySelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
{
#ifdef DIFFICULTY_SETTING
if ( iCurrentDifficulty < MaxDifficultySettingsValues /*NUM_DIFF_SETTINGS*/ - 2 ) //2
#else
if ( iCurrentDifficulty < MaxDifficultySettingsValues /*2*/ )
#endif
if ( iCurrentDifficulty < MaxDifficultySettingsValues /*NUM_DIFF_SETTINGS*/ - 2 )
// if ( iCurrentDifficulty < MaxDifficultySettingsValues /*2*/ )
{
PlayButtonSound( giGIODifficultyButton[1], BUTTON_SOUND_CLICKED_ON );
@@ -1453,11 +1444,8 @@ void BtnGIODifficultySelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
{
btn->uiFlags|=(BUTTON_CLICKED_ON);
#ifdef DIFFICULTY_SETTING
if ( iCurrentDifficulty < MaxDifficultySettingsValues /*NUM_DIFF_SETTINGS*/ - 2 ) //2
#else
if ( iCurrentDifficulty < MaxDifficultySettingsValues /*2*/ )
#endif
//if ( iCurrentDifficulty < MaxDifficultySettingsValues /*2*/ )
{
PlayButtonSound( giGIODifficultyButton[1], BUTTON_SOUND_CLICKED_ON );
@@ -2699,11 +2687,8 @@ BOOLEAN RenderGIOScreen()
RenderGIOSmallSelectionFrame( (GIO_DIF_SETTING_X + 36), (GIO_DIF_SETTING_Y - 3) );
DisplayWrappedString( (UINT16)(GIO_DIF_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (UINT16)(GIO_DIF_SETTING_Y-GIO_GAP_BN_SETTINGS + GIO_TITLE_DISTANCE - 12), GIO_DIF_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ GIO_DIF_LEVEL_TEXT ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
#ifdef DIFFICULTY_SETTING
DisplayWrappedString( (UINT16)(GIO_DIF_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (GIO_DIF_SETTING_Y+6), GIO_DIF_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, zDeffSetting[ iCurrentDifficulty + 1].szDeffName, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
#else
DisplayWrappedString( (UINT16)(GIO_DIF_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (GIO_DIF_SETTING_Y+6), GIO_DIF_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ iCurrentDifficulty + 9 ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
#endif
// DisplayWrappedString( (UINT16)(GIO_DIF_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (GIO_DIF_SETTING_Y+6), GIO_DIF_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ iCurrentDifficulty + 9 ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
//Display the IMP number Title Text
RenderGIOSmallSelectionFrame( (GIO_IMP_SETTING_X + 36), (GIO_IMP_SETTING_Y - 3) );
@@ -3074,11 +3059,8 @@ void DoneFadeOutForExitGameInitOptionScreen( void )
gGameOptions.ubGameStyle = FALSE;
gGameUBOptions.fRandomManuelText = GetCurrentTextStyleButtonSetting();
#ifdef DIFFICULTY_SETTING
gGameOptions.ubDifficultyLevel = min( MaxDifficultySettingsValues-1, ( max( 1, (iCurrentDifficulty + 1)) ));
#else
gGameOptions.ubDifficultyLevel = min( NUM_DIFF_SETTINGS-1, ( max( 1, (iCurrentDifficulty + 1)) ));
#endif
//gGameOptions.ubDifficultyLevel = min( NUM_DIFF_SETTINGS-1, ( max( 1, (iCurrentDifficulty + 1)) ));
gGameOptions.fTurnTimeLimit = FALSE;
@@ -3188,9 +3170,8 @@ void DisplayMessageToUserAboutGameDifficulty()
{
UINT8 ubDiffLevel = iCurrentDifficulty;
#ifdef DIFFICULTY_SETTING
DoGioMessageBox( MSG_BOX_BASIC_STYLE, zDeffSetting[ubDiffLevel + 1].szConfirmText, GAME_INIT_OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmGioDifSettingMessageBoxCallBack );
#else
/*
switch( ubDiffLevel )
{
case 0:
@@ -3206,7 +3187,7 @@ void DisplayMessageToUserAboutGameDifficulty()
DoGioMessageBox( MSG_BOX_BASIC_STYLE, zGioDifConfirmText[GIO_CFS_INSANE], GAME_INIT_OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmGioDifSettingMessageBoxCallBack );
break;
}
#endif
*/
}
@@ -3445,12 +3426,9 @@ void RenderGIOSmallSelectionFrame(INT16 sX, INT16 sY)
#define JA2SP_BACKGROUNDS "BACKGROUNDS"
#define JA2SP_FOODSYSTEM "FOOD_SYSTEM"
#ifdef DIFFICULTY_SETTING
//#define NUM_DIFF_SETTINGS 3
DIFFICULTY_SETTINGS_VALUES zDeffSetting[15];
UINT8 MaxDifficultySettingsValues;
#endif
//Difficulty settings
enum
@@ -3459,12 +3437,8 @@ enum
GIO_DIFF_MED,
GIO_DIFF_HARD,
GIO_DIFF_INSANE,
#ifdef DIFFICULTY_SETTING
GIO_DIFF_NEW = GIO_DIFF_INSANE + 245,
#else
NUM_DIFF_SETTINGS,
#endif
// NUM_DIFF_SETTINGS,
};
@@ -4555,11 +4529,8 @@ void BtnGIODifficultySelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
{
#ifdef DIFFICULTY_SETTING
if ( iCurrentDifficulty < MaxDifficultySettingsValues /*NUM_DIFF_SETTINGS*/ - 1 ) //3
#else
if ( iCurrentDifficulty < 3 )
#endif
//if ( iCurrentDifficulty < 3 )
{
PlayButtonSound( giGIODifficultyButton[1], BUTTON_SOUND_CLICKED_ON );
@@ -4575,11 +4546,8 @@ void BtnGIODifficultySelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
{
btn->uiFlags|=(BUTTON_CLICKED_ON);
#ifdef DIFFICULTY_SETTING
if ( iCurrentDifficulty < MaxDifficultySettingsValues /*NUM_DIFF_SETTINGS*/ - 1 ) //2
#else
if ( iCurrentDifficulty < 3 )
#endif
//if ( iCurrentDifficulty < 3 )
{
PlayButtonSound( giGIODifficultyButton[1], BUTTON_SOUND_CLICKED_ON );
@@ -5788,11 +5756,8 @@ BOOLEAN RenderGIOScreen()
RenderGIOSmallSelectionFrame( (GIO_DIF_SETTING_X + 36), (GIO_DIF_SETTING_Y - 3) );
DisplayWrappedString( (UINT16)(GIO_DIF_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (UINT16)(GIO_DIF_SETTING_Y-GIO_GAP_BN_SETTINGS + GIO_TITLE_DISTANCE - 12), GIO_DIF_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ GIO_DIF_LEVEL_TEXT ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
#ifdef DIFFICULTY_SETTING
DisplayWrappedString( (UINT16)(GIO_DIF_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (GIO_DIF_SETTING_Y+6), GIO_DIF_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, zDeffSetting[ iCurrentDifficulty + 1].szDeffName, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
#else
DisplayWrappedString( (UINT16)(GIO_DIF_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (GIO_DIF_SETTING_Y+6), GIO_DIF_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ iCurrentDifficulty + 9 ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
#endif
//DisplayWrappedString( (UINT16)(GIO_DIF_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (GIO_DIF_SETTING_Y+6), GIO_DIF_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ iCurrentDifficulty + 9 ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
//Display the IMP number Title Text
RenderGIOSmallSelectionFrame( (GIO_IMP_SETTING_X + 36), (GIO_IMP_SETTING_Y - 3) );
@@ -6148,11 +6113,8 @@ void DoneFadeOutForExitGameInitOptionScreen( void )
gGameOptions.fGunNut = GetCurrentGunButtonSetting();
gGameOptions.ubGameStyle = GetCurrentGameStyleButtonSetting();
#ifdef DIFFICULTY_SETTING
gGameOptions.ubDifficultyLevel = min( MaxDifficultySettingsValues, ( max( 1, (iCurrentDifficulty + 1)) ));
#else
gGameOptions.ubDifficultyLevel = min( NUM_DIFF_SETTINGS, ( max( 1, (iCurrentDifficulty + 1)) ));
#endif
//gGameOptions.ubDifficultyLevel = min( NUM_DIFF_SETTINGS, ( max( 1, (iCurrentDifficulty + 1)) ));
gGameOptions.fTurnTimeLimit = FALSE;
@@ -6253,9 +6215,8 @@ void DisplayMessageToUserAboutGameDifficulty()
{
UINT8 ubDiffLevel = iCurrentDifficulty;
#ifdef DIFFICULTY_SETTING
DoGioMessageBox( MSG_BOX_BASIC_STYLE, zDeffSetting[ubDiffLevel + 1].szConfirmText, GAME_INIT_OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmGioDifSettingMessageBoxCallBack );
#else
/*
switch( ubDiffLevel )
{
case 0:
@@ -6271,7 +6232,7 @@ void DisplayMessageToUserAboutGameDifficulty()
DoGioMessageBox( MSG_BOX_BASIC_STYLE, zGioDifConfirmText[GIO_CFS_INSANE], GAME_INIT_OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmGioDifSettingMessageBoxCallBack );
break;
}
#endif
*/
}
-2
View File
@@ -8,7 +8,6 @@ UINT32 GameInitOptionsScreenShutdown( void );
BOOLEAN SpIniExists();
#ifdef DIFFICULTY_SETTING
typedef struct
{
UINT16 uiIndex;
@@ -81,6 +80,5 @@ typedef struct
} DIFFICULTY_SETTINGS_VALUES;
extern UINT8 MaxDifficultySettingsValues;
extern DIFFICULTY_SETTINGS_VALUES zDeffSetting[15];
#endif
#endif
+1 -132
View File
@@ -47,9 +47,7 @@
#include "Map Information.h"
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
#include <vfs/Core/vfs.h>
#include <vfs/Core/vfs_file_raii.h>
@@ -868,14 +866,8 @@ void LoadGameExternalOptions()
//tais: mercs can go on assignment; 0 = default behaviour, 1 = all mercs available at start, 2 = no mercs go on other assignments... period!
gGameExternalOptions.fMercsOnAssignment = iniReader.ReadInteger("Recruitment Settings","MERCS_CAN_BE_ON_ASSIGNMENT",0,0,2);
//Merc Death Settings:
gGameExternalOptions.gfMercsDieOnAssignment = iniReader.ReadBoolean("Recruitment Settings","MERCS_CAN_DIE_ON_ASSIGNMENT",TRUE);
gGameExternalOptions.giEasyMercDeaths = iniReader.ReadInteger("Recruitment Settings","MAX_MERC_DEATHS_EASY",1, 0, 10);
gGameExternalOptions.giExperiencedMercDeaths = iniReader.ReadInteger("Recruitment Settings","MAX_MERC_DEATHS_EXPERIENCED",2, 0, 10);
gGameExternalOptions.giExpertMercDeaths = iniReader.ReadInteger("Recruitment Settings","MAX_MERC_DEATHS_EXPERT",3, 0, 10);
gGameExternalOptions.giInsaneMercDeaths = iniReader.ReadInteger("Recruitment Settings","MAX_MERC_DEATHS_INSANE",4, 0, 10);
// CHRISL: New setting to allow Slay to remain as a hired PC
gGameExternalOptions.fEnableSlayForever = iniReader.ReadBoolean("Recruitment Settings", "SLAY_STAYS_FOREVER", FALSE);
@@ -1084,12 +1076,6 @@ void LoadGameExternalOptions()
//################# Tactical Difficulty Settings #################
// Enemy AP settings
gGameExternalOptions.iEasyAPBonus = (INT8) iniReader.ReadInteger("Tactical Difficulty Settings","ENEMY_AP_BONUS_NOVICE",0,__max(-APBPConstants[AP_MINIMUM],-128),127);
gGameExternalOptions.iExperiencedAPBonus = (INT8) iniReader.ReadInteger("Tactical Difficulty Settings","ENEMY_AP_BONUS_EXPERIENCED",0,__max(-APBPConstants[AP_MINIMUM],-128),127);
gGameExternalOptions.iExpertAPBonus = (INT8) iniReader.ReadInteger("Tactical Difficulty Settings","ENEMY_AP_BONUS_EXPERT",0,__max(-APBPConstants[AP_MINIMUM],-128),127);
gGameExternalOptions.iInsaneAPBonus = (INT8) iniReader.ReadInteger("Tactical Difficulty Settings","ENEMY_AP_BONUS_INSANE",0,__max(-APBPConstants[AP_MINIMUM],-128),127);
gGameExternalOptions.iPlayerAPBonus = (INT8) iniReader.ReadInteger("Tactical Difficulty Settings","PLAYER_AP_BONUS",0,__max(-APBPConstants[AP_MINIMUM],-128),127);
// Percentage bonus to total enemy CtH on every hit - applies during tactical combat only
@@ -1763,12 +1749,6 @@ void LoadGameExternalOptions()
// Flat modifier to Current Progress.
gGameExternalOptions.bGameProgressModifier = iniReader.ReadInteger("Strategic Progress Settings","GAME_PROGRESS_MODIFIER", 0, -100, 100);
// HEADROCK HAM 3: Four INI settings to control the number of kills you must accumulate to win one progress point, one setting per difficulty level
gGameExternalOptions.usNumKillsPerProgressPointNovice = iniReader.ReadInteger("Strategic Progress Settings","NUM_KILLS_PER_PROGRESS_POINT_NOVICE", 7, 1, 1000);
gGameExternalOptions.usNumKillsPerProgressPointExperienced = iniReader.ReadInteger("Strategic Progress Settings","NUM_KILLS_PER_PROGRESS_POINT_EXPERIENCED", 10, 1, 1000);
gGameExternalOptions.usNumKillsPerProgressPointExpert = iniReader.ReadInteger("Strategic Progress Settings","NUM_KILLS_PER_PROGRESS_POINT_EXPERT", 15, 1, 1000);
gGameExternalOptions.usNumKillsPerProgressPointInsane = iniReader.ReadInteger("Strategic Progress Settings","NUM_KILLS_PER_PROGRESS_POINT_INSANE", 60, 1, 1000);
//Global game events
gGameExternalOptions.ubGameProgressStartMadlabQuest = iniReader.ReadInteger("Strategic Progress Settings","GAME_PROGRESS_START_MADLAB_QUEST",35, 0, 100);
gGameExternalOptions.ubGameProgressMikeAvailable = iniReader.ReadInteger("Strategic Progress Settings","GAME_PROGRESS_MIKE_AVAILABLE",50, 0, 100);
@@ -1981,75 +1961,8 @@ void LoadGameExternalOptions()
// WDS - New AI
gGameExternalOptions.useNewAI = iniReader.ReadBoolean("Strategic Enemy AI Settings","NEW_AGGRESSIVE_AI",FALSE);
gGameExternalOptions.iForcePercentageNovice = iniReader.ReadInteger("Strategic Enemy AI Settings","INITIAL_GARRISON_PERCENTAGES_NOVICE",70, 1, 200);
gGameExternalOptions.iForcePercentageExperienced = iniReader.ReadInteger("Strategic Enemy AI Settings","INITIAL_GARRISON_PERCENTAGES_EXPERIENCED",100, 1, 300);
gGameExternalOptions.iForcePercentageExpert = iniReader.ReadInteger("Strategic Enemy AI Settings","INITIAL_GARRISON_PERCENTAGES_EXPERT",150, 1, 400);
gGameExternalOptions.iForcePercentageInsane = iniReader.ReadInteger("Strategic Enemy AI Settings","INITIAL_GARRISON_PERCENTAGES_INSANE",200, 1, 600);
gGameExternalOptions.ubMinEnemyGroupSizeNovice = (UINT8) iniReader.ReadInteger("Strategic Enemy AI Settings","MIN_ENEMY_GROUP_SIZE_NOVICE",3, 1, CODE_MAXIMUM_NUMBER_OF_ENEMIES);
gGameExternalOptions.ubMinEnemyGroupSizeExperienced = (UINT8) iniReader.ReadInteger("Strategic Enemy AI Settings","MIN_ENEMY_GROUP_SIZE_EXPERIENCED",4, 1, CODE_MAXIMUM_NUMBER_OF_ENEMIES);
gGameExternalOptions.ubMinEnemyGroupSizeExpert = (UINT8) iniReader.ReadInteger("Strategic Enemy AI Settings","MIN_ENEMY_GROUP_SIZE_EXPERT",6, 1, CODE_MAXIMUM_NUMBER_OF_ENEMIES);
gGameExternalOptions.ubMinEnemyGroupSizeInsane = (UINT8) iniReader.ReadInteger("Strategic Enemy AI Settings","MIN_ENEMY_GROUP_SIZE_INSANE",12, 1, CODE_MAXIMUM_NUMBER_OF_ENEMIES);
gGameExternalOptions.iPercentElitesBonusExperienced = iniReader.ReadInteger("Strategic Enemy AI Settings","PERCENT_EXTRA_ELITES_EXPERIENCED",0, 0, 100);
gGameExternalOptions.iPercentElitesBonusExpert = iniReader.ReadInteger("Strategic Enemy AI Settings","PERCENT_EXTRA_ELITES_EXPERT",25, 0, 100);
gGameExternalOptions.iPercentElitesBonusInsane = iniReader.ReadInteger("Strategic Enemy AI Settings","PERCENT_EXTRA_ELITES_INSANE",50, 0, 100);
gGameExternalOptions.gfEasyUnlimitedTroops = iniReader.ReadBoolean("Strategic Enemy AI Settings","UNLIMITED_POOL_OF_TROOPS_NOVICE",FALSE);
gGameExternalOptions.gfNormalUnlimitedTroops = iniReader.ReadBoolean("Strategic Enemy AI Settings","UNLIMITED_POOL_OF_TROOPS_EXPERIENCED",FALSE);
gGameExternalOptions.gfHardUnlimitedTroops = iniReader.ReadBoolean("Strategic Enemy AI Settings","UNLIMITED_POOL_OF_TROOPS_EXPERT",FALSE);
gGameExternalOptions.gfInsaneUnlimitedTroops = iniReader.ReadBoolean("Strategic Enemy AI Settings","UNLIMITED_POOL_OF_TROOPS_INSANE",TRUE);
gGameExternalOptions.iReinforcementPoolNovice = iniReader.ReadInteger("Strategic Enemy AI Settings","QUEENS_INITIAL_POOL_OF_TROOPS_NOVICE",150, 25, 1000000);
gGameExternalOptions.iReinforcementPoolExperienced = iniReader.ReadInteger("Strategic Enemy AI Settings","QUEENS_INITIAL_POOL_OF_TROOPS_EXPERIENCED",200, 25, 1000000);
gGameExternalOptions.iReinforcementPoolExpert = iniReader.ReadInteger("Strategic Enemy AI Settings","QUEENS_INITIAL_POOL_OF_TROOPS_EXPERT",400, 25, 1000000);
gGameExternalOptions.iReinforcementPoolInsane = iniReader.ReadInteger("Strategic Enemy AI Settings","QUEENS_INITIAL_POOL_OF_TROOPS_INSANE",8000, 25, 1000000);
gGameExternalOptions.guiBaseQueenPoolIncrement = iniReader.ReadInteger("Strategic Enemy AI Settings","QUEEN_POOL_INCREMENT_PER_DIFFICULTY_LEVEL",60, 1, 100);
gGameExternalOptions.ubEasyEnemyStartingAlertLevel = iniReader.ReadInteger("Strategic Enemy AI Settings","ENEMY_STARTING_ALERT_LEVEL_NOVICE", 5, 1, 100);
gGameExternalOptions.ubNormalEnemyStartingAlertLevel = iniReader.ReadInteger("Strategic Enemy AI Settings","ENEMY_STARTING_ALERT_LEVEL_EXPERIENCED", 20, 1, 100);
gGameExternalOptions.ubHardEnemyStartingAlertLevel = iniReader.ReadInteger("Strategic Enemy AI Settings","ENEMY_STARTING_ALERT_LEVEL_EXPERT", 60, 1, 100);
gGameExternalOptions.ubInsaneEnemyStartingAlertLevel = iniReader.ReadInteger("Strategic Enemy AI Settings","ENEMY_STARTING_ALERT_LEVEL_INSANE", 80, 1, 100);
gGameExternalOptions.ubEasyEnemyStartingAlertDecay = iniReader.ReadInteger("Strategic Enemy AI Settings","ENEMY_ALERT_DECAY_NOVICE", 75, 1, 100);
gGameExternalOptions.ubNormalEnemyStartingAlertDecay = iniReader.ReadInteger("Strategic Enemy AI Settings","ENEMY_ALERT_DECAY_EXPERIENCED", 50, 1, 100);
gGameExternalOptions.ubHardEnemyStartingAlertDecay = iniReader.ReadInteger("Strategic Enemy AI Settings","ENEMY_ALERT_DECAY_EXPERT", 25, 1, 100);
gGameExternalOptions.ubInsaneEnemyStartingAlertDecay = iniReader.ReadInteger("Strategic Enemy AI Settings","ENEMY_ALERT_DECAY_INSANE", 10, 1, 100);
gGameExternalOptions.ubEasyNumAwareBattles = iniReader.ReadInteger("Strategic Enemy AI Settings","NUM_AWARE_BATTLES_NOVICE", 1, 1, 10);
gGameExternalOptions.ubNormalNumAwareBattles = iniReader.ReadInteger("Strategic Enemy AI Settings","NUM_AWARE_BATTLES_EXPERIENCED", 2, 1, 10);
gGameExternalOptions.ubHardNumAwareBattles = iniReader.ReadInteger("Strategic Enemy AI Settings","NUM_AWARE_BATTLES_EXPERT", 3, 1, 10);
gGameExternalOptions.ubInsaneNumAwareBattles = iniReader.ReadInteger("Strategic Enemy AI Settings","NUM_AWARE_BATTLES_INSANE", 4, 1, 10);
gGameExternalOptions.ubEasyTimeEvaluateInMinutes = iniReader.ReadInteger("Strategic Enemy AI Settings","BASE_DELAY_IN_MINUTES_BETWEEN_EVALUATIONS_NOVICE", 480, 10, NUM_MIN_IN_DAY);
gGameExternalOptions.ubNormalTimeEvaluateInMinutes = iniReader.ReadInteger("Strategic Enemy AI Settings","BASE_DELAY_IN_MINUTES_BETWEEN_EVALUATIONS_EXPERIENCED", 360, 10, NUM_MIN_IN_DAY);
gGameExternalOptions.ubHardTimeEvaluateInMinutes = iniReader.ReadInteger("Strategic Enemy AI Settings","BASE_DELAY_IN_MINUTES_BETWEEN_EVALUATIONS_EXPERT", 180, 10, NUM_MIN_IN_DAY);
gGameExternalOptions.ubInsaneTimeEvaluateInMinutes = iniReader.ReadInteger("Strategic Enemy AI Settings","BASE_DELAY_IN_MINUTES_BETWEEN_EVALUATIONS_INSANE", 90, 10, NUM_MIN_IN_DAY);
gGameExternalOptions.ubEasyTimeEvaluateVariance = iniReader.ReadInteger("Strategic Enemy AI Settings","EVALUATION_DELAY_VARIANCE_NOVICE", 240, 10, NUM_MIN_IN_DAY);
gGameExternalOptions.ubNormalTimeEvaluateVariance = iniReader.ReadInteger("Strategic Enemy AI Settings","EVALUATION_DELAY_VARIANCE_EXPERIENCED", 180, 10, NUM_MIN_IN_DAY);
gGameExternalOptions.ubHardTimeEvaluateVariance = iniReader.ReadInteger("Strategic Enemy AI Settings","EVALUATION_DELAY_VARIANCE_EXPERT", 120, 10, NUM_MIN_IN_DAY);
gGameExternalOptions.ubInsaneTimeEvaluateVariance = iniReader.ReadInteger("Strategic Enemy AI Settings","EVALUATION_DELAY_VARIANCE_INSANE", 60, 10, NUM_MIN_IN_DAY);
gGameExternalOptions.ubEasyGracePeriodInHours = iniReader.ReadInteger("Strategic Enemy AI Settings","GRACE_PERIOD_IN_HOURS_AFTER_SECTOR_LIBERATION_NOVICE", 144, 1, 288);
gGameExternalOptions.ubNormalGracePeriodInHours = iniReader.ReadInteger("Strategic Enemy AI Settings","GRACE_PERIOD_IN_HOURS_AFTER_SECTOR_LIBERATION_EXPERIENCED", 96, 1, 288);
gGameExternalOptions.ubHardGracePeriodInHours = iniReader.ReadInteger("Strategic Enemy AI Settings","GRACE_PERIOD_IN_HOURS_AFTER_SECTOR_LIBERATION_EXPERT", 48, 1, 288);
gGameExternalOptions.ubInsaneGracePeriodInHours = iniReader.ReadInteger("Strategic Enemy AI Settings","GRACE_PERIOD_IN_HOURS_AFTER_SECTOR_LIBERATION_INSANE", 6, 1, 288);
gGameExternalOptions.ubEasyPatrolGracePeriodInDays = iniReader.ReadInteger("Strategic Enemy AI Settings","GRACE_PERIOD_IN_DAYS_AFTER_PATROL_DESTROYED_NOVICE", 16, 1, 100);
gGameExternalOptions.ubNormalPatrolGracePeriodInDays = iniReader.ReadInteger("Strategic Enemy AI Settings","GRACE_PERIOD_IN_DAYS_AFTER_PATROL_DESTROYED_EXPERIENCED", 12, 1, 100);
gGameExternalOptions.ubHardPatrolGracePeriodInDays = iniReader.ReadInteger("Strategic Enemy AI Settings","GRACE_PERIOD_IN_DAYS_AFTER_PATROL_DESTROYED_EXPERT", 8, 1, 100);
gGameExternalOptions.ubInsanePatrolGracePeriodInDays = iniReader.ReadInteger("Strategic Enemy AI Settings","GRACE_PERIOD_IN_DAYS_AFTER_PATROL_DESTROYED_INSANE", 2, 1, 100);
gGameExternalOptions.gfEasyAggressiveQueen = iniReader.ReadBoolean("Strategic Enemy AI Settings","AGGRESSIVE_QUEEN_AI_NOVICE",FALSE);
gGameExternalOptions.gfNormalAggressiveQueen = iniReader.ReadBoolean("Strategic Enemy AI Settings","AGGRESSIVE_QUEEN_AI_EXPERIENCED",FALSE);
gGameExternalOptions.gfHardAggressiveQueen = iniReader.ReadBoolean("Strategic Enemy AI Settings","AGGRESSIVE_QUEEN_AI_EXPERT",FALSE);
gGameExternalOptions.gfInsaneAggressiveQueen = iniReader.ReadBoolean("Strategic Enemy AI Settings","AGGRESSIVE_QUEEN_AI_INSANE",TRUE);
gGameExternalOptions.gfInvestigateSector = iniReader.ReadBoolean("Strategic Enemy AI Settings","ENEMY_INVESTIGATE_SECTOR",FALSE);
gGameExternalOptions.gfReassignPendingReinforcements = iniReader.ReadBoolean("Strategic Enemy AI Settings","REASSIGN_PENDING_REINFORCEMENTS",TRUE);
//################# Militia Training Settings ##################
@@ -3366,10 +3279,6 @@ void LoadCTHConstants()
gGameCTHConstants.BASE_HEAVY_WEAPON = iniReader.ReadFloat("Base CTH","BASE_HEAVY_WEAPON",2.0, -1000.0, 1000.0);
gGameCTHConstants.BASE_DIFFICULTY[0] = -100.0;
gGameCTHConstants.BASE_DIFFICULTY[1] = iniReader.ReadFloat("Base CTH","BASE_DIFFICULTY_NOVICE",-30.0, -1000.0, 1000.0);
gGameCTHConstants.BASE_DIFFICULTY[2] = iniReader.ReadFloat("Base CTH","BASE_DIFFICULTY_EXPERIENCED",0.0, -1000.0, 1000.0);
gGameCTHConstants.BASE_DIFFICULTY[3] = iniReader.ReadFloat("Base CTH","BASE_DIFFICULTY_EXPERT",20.0, -1000.0, 1000.0);
gGameCTHConstants.BASE_DIFFICULTY[4] = iniReader.ReadFloat("Base CTH","BASE_DIFFICULTY_INSANE",50.0, -1000.0, 1000.0);
gGameCTHConstants.BASE_DIFFICULTY[5] = 100.0;
////////////////////////////////////////////////////////////
@@ -3410,10 +3319,6 @@ void LoadCTHConstants()
gGameCTHConstants.AIM_HEAVY_WEAPON = iniReader.ReadFloat("Aiming CTH","AIM_HEAVY_WEAPON",2.0, -1000.0, 1000.0);
gGameCTHConstants.AIM_DIFFICULTY[0] = -100.0;
gGameCTHConstants.AIM_DIFFICULTY[1] = iniReader.ReadFloat("Aiming CTH","AIM_DIFFICULTY_NOVICE",-30.0, -1000.0, 1000.0);
gGameCTHConstants.AIM_DIFFICULTY[2] = iniReader.ReadFloat("Aiming CTH","AIM_DIFFICULTY_EXPERIENCED",0.0, -1000.0, 1000.0);
gGameCTHConstants.AIM_DIFFICULTY[3] = iniReader.ReadFloat("Aiming CTH","AIM_DIFFICULTY_EXPERT",20.0, -1000.0, 1000.0);
gGameCTHConstants.AIM_DIFFICULTY[4] = iniReader.ReadFloat("Aiming CTH","AIM_DIFFICULTY_INSANE",50.0, -1000.0, 1000.0);
gGameCTHConstants.AIM_DIFFICULTY[5] = 100.0;
////////////////////////////////////////////////////////////
@@ -3708,37 +3613,6 @@ void LoadCreaturesSettings()
gCreaturesSettings.ubCrepitusFeedingSectorX = iniReader.ReadInteger("Creatures Settings", "CREPITUS_FEEDING_SECTOR_X", 9);
gCreaturesSettings.ubCrepitusFeedingSectorY = iniReader.ReadInteger("Creatures Settings", "CREPITUS_FEEDING_SECTOR_Y", 10);
gCreaturesSettings.ubCrepitusFeedingSectorZ = iniReader.ReadInteger("Creatures Settings", "CREPITUS_FEEDING_SECTOR_Z", 2);
gCreaturesSettings.usCreatureSpreadTimeNovice = iniReader.ReadInteger("Creatures Settings","CREATURE_SPREAD_TIME_NOVICE", 510, 5, 14400);
gCreaturesSettings.usCreatureSpreadTimeExperienced = iniReader.ReadInteger("Creatures Settings","CREATURE_SPREAD_TIME_EXPERIENCED", 450, 5, 14400);
gCreaturesSettings.usCreatureSpreadTimeExpert = iniReader.ReadInteger("Creatures Settings","CREATURE_SPREAD_TIME_EXPERT", 390, 5, 14400);
gCreaturesSettings.usCreatureSpreadTimeInsane = iniReader.ReadInteger("Creatures Settings","CREATURE_SPREAD_TIME_INSANE", 150, 5, 14400);
gCreaturesSettings.ubQueenReproductionBaseNovice = iniReader.ReadInteger("Creatures Settings","QUEEN_REPRODUCTION_BASE_NOVICE", 6, 1, 30);
gCreaturesSettings.ubQueenReproductionBaseExperienced = iniReader.ReadInteger("Creatures Settings","QUEEN_REPRODUCTION_BASE_EXPERIENCED", 7, 1, 30);
gCreaturesSettings.ubQueenReproductionBaseExpert = iniReader.ReadInteger("Creatures Settings","QUEEN_REPRODUCTION_BASE_EXPERT", 9, 1, 30);
gCreaturesSettings.ubQueenReproductionBaseInsane = iniReader.ReadInteger("Creatures Settings","QUEEN_REPRODUCTION_BASE_INSANE", 15, 1, 30);
gCreaturesSettings.ubQueenReproductionBonusNovice = iniReader.ReadInteger("Creatures Settings","QUEEN_REPRODUCTION_BONUS_NOVICE", 1, 0, 10);
gCreaturesSettings.ubQueenReproductionBonusExperienced = iniReader.ReadInteger("Creatures Settings","QUEEN_REPRODUCTION_BONUS_EXPERIENCED", 2, 0, 10);
gCreaturesSettings.ubQueenReproductionBonusExpert = iniReader.ReadInteger("Creatures Settings","QUEEN_REPRODUCTION_BONUS_EXPERT", 3, 0, 10);
gCreaturesSettings.ubQueenReproductionBonusInsane = iniReader.ReadInteger("Creatures Settings","QUEEN_REPRODUCTION_BONUS_INSANE", 5, 0, 10);
gCreaturesSettings.ubQueenInitBonusSpreadsNovice = iniReader.ReadInteger("Creatures Settings","QUEEN_INIT_BONUS_SPREAD_NOVICE", 1, 0, 10);
gCreaturesSettings.ubQueenInitBonusSpreadsExperienced = iniReader.ReadInteger("Creatures Settings","QUEEN_INIT_BONUS_SPREAD_EXPERIENCED", 2, 0, 10);
gCreaturesSettings.ubQueenInitBonusSpreadsExpert = iniReader.ReadInteger("Creatures Settings","QUEEN_INIT_BONUS_SPREAD_EXPERT", 3, 0, 10);
gCreaturesSettings.ubQueenInitBonusSpreadsInsane = iniReader.ReadInteger("Creatures Settings","QUEEN_INIT_BONUS_SPREAD_INSANE", 5, 0, 10);
gCreaturesSettings.bCreaturePopulationModifierNovice = iniReader.ReadInteger("Creatures Settings","CREATURE_POPULATION_MODIFIER_NOVICE", 0, -5, 5);
gCreaturesSettings.bCreaturePopulationModifierExperienced = iniReader.ReadInteger("Creatures Settings","CREATURE_POPULATION_MODIFIER_EXPERIENCED", 0, -5, 5);
gCreaturesSettings.bCreaturePopulationModifierExpert = iniReader.ReadInteger("Creatures Settings","CREATURE_POPULATION_MODIFIER_EXPERT", 0, -5, 5);
gCreaturesSettings.bCreaturePopulationModifierInsane = iniReader.ReadInteger("Creatures Settings","CREATURE_POPULATION_MODIFIER_INSANE", 0, -5, 5);
gCreaturesSettings.bCreatureTownAggressivenessNovice = iniReader.ReadInteger("Creatures Settings","CREATURE_TOWN_AGGRESSIVENESS_NOVICE", -10, -100, 100);
gCreaturesSettings.bCreatureTownAggressivenessExperienced = iniReader.ReadInteger("Creatures Settings","CREATURE_TOWN_AGGRESSIVENESS_EXPERIENCED", 0, -100, 100);
gCreaturesSettings.bCreatureTownAggressivenessExpert = iniReader.ReadInteger("Creatures Settings","CREATURE_TOWN_AGGRESSIVENESS_EXPERT", 10, -100, 100);
gCreaturesSettings.bCreatureTownAggressivenessInsane = iniReader.ReadInteger("Creatures Settings","CREATURE_TOWN_AGGRESSIVENESS_INSANE", 50, -100, 100);
}
void FreeGameExternalOptions()
@@ -4049,19 +3923,14 @@ void DisplayGameSettings( )
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s: %s (%S)", pMessageStrings[ MSG_VERSION ], zVersionLabel, czVersionNumber );
//Display the difficulty level
#ifdef DIFFICULTY_SETTING
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s: %s", gzGIOScreenText[ GIO_DIF_LEVEL_TEXT ], zDeffSetting[gGameOptions.ubDifficultyLevel].szDeffName );
#else
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s: %s", gzGIOScreenText[ GIO_DIF_LEVEL_TEXT ], gzGIOScreenText[ gGameOptions.ubDifficultyLevel + GIO_EASY_TEXT - 1 ] );
#endif
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s: %s", gzGIOScreenText[ GIO_DIF_LEVEL_TEXT ], gzGIOScreenText[ gGameOptions.ubDifficultyLevel + GIO_EASY_TEXT - 1 ] );
#ifdef DIFFICULTY_SETTING
//Test Settings
if ( gGameExternalOptions.gfAllowReinforcements == TRUE )
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s: %s", L"AllowReinforcements", L"YES");
else
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s: %s", L"AllowReinforcements", L"NO");
#endif
//Bobby Ray option 1
if ( gGameOptions.ubBobbyRayQuality >= BR_GOOD && gGameOptions.ubBobbyRayQuality < BR_GREAT )
-6
View File
@@ -4,11 +4,7 @@
#include "Types.h"
#include "Strategic Status.h"
#include "Morale.h"
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
#define GAME_INI_FILE "Ja2.ini"
@@ -189,7 +185,6 @@ enum
DIF_LEVEL_HARD,
DIF_LEVEL_INSANE,
DIF_LEVEL_FIVE,
#ifdef DIFFICULTY_SETTING
DIF_LEVEL_6,
DIF_LEVEL_7,
DIF_LEVEL_8,
@@ -200,7 +195,6 @@ enum
DIF_LEVEL_13,
DIF_LEVEL_14,
DIF_LEVEL_15,
#endif
};
//Enums for the difficulty levels
+1 -5
View File
@@ -1460,8 +1460,6 @@ BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
}
#endif
#ifdef DIFFICULTY_SETTING
strcpy(fileName, directoryName);
strcat(fileName, DIFFICULTYFILENAME);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
@@ -1474,9 +1472,7 @@ BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,TRUE), fileName);
}
#endif
#endif
#endif
LuaState::INIT(lua::LUA_STATE_STRATEGIC_MINES_AND_UNDERGROUND, true);
g_luaUnderground.LoadScript(GetLanguagePrefix());
+2 -10
View File
@@ -29,9 +29,7 @@
#include "network.h"
#include "saveloadscreen.h"
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
#include <vfs/Core/vfs.h>
#include <vfs/Core/vfs_init.h>
@@ -848,11 +846,8 @@ void BtnMPHDifficultySelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT || reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
{
#ifdef DIFFICULTY_SETTING
if ( iMPHDifficulty < MaxDifficultySettingsValues - 1)
#else
if ( iMPHDifficulty < 3 )
#endif
//if ( iMPHDifficulty < 3 )
{
PlayButtonSound( giMPHDifficultyButton[1], BUTTON_SOUND_CLICKED_ON );
@@ -2674,11 +2669,8 @@ BOOLEAN RenderMPHScreen()
RenderMPHSmallSelectionFrame( (MPH_DIFFICULTY_SETTING_X + 36), (MPH_DIFFICULTY_SETTING_Y - 3) );
DisplayWrappedString( (UINT16)(MPH_DIFFICULTY_SETTING_X+MPH_OFFSET_TO_TEXT + 1), (UINT16)(MPH_DIFFICULTY_SETTING_Y-MPH_GAP_BN_SETTINGS + MPH_TITLE_DISTANCE - 12), MPH_DIFFICULTY_SETTING_WIDTH, 2, MPH_TOGGLE_TEXT_FONT, MPH_TOGGLE_TEXT_COLOR, gzGIOScreenText[ GIO_DIF_LEVEL_TEXT ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
#ifdef DIFFICULTY_SETTING
DisplayWrappedString( (UINT16)(MPH_DIFFICULTY_SETTING_X+MPH_OFFSET_TO_TEXT + 1), (MPH_DIFFICULTY_SETTING_Y+6), MPH_DIFFICULTY_SETTING_WIDTH, 2, MPH_TOGGLE_TEXT_FONT, MPH_TOGGLE_TEXT_COLOR, zDeffSetting[ iMPHDifficulty + 1].szDeffName, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
#else
DisplayWrappedString( (UINT16)(MPH_DIFFICULTY_SETTING_X+MPH_OFFSET_TO_TEXT + 1), (MPH_DIFFICULTY_SETTING_Y+6), MPH_DIFFICULTY_SETTING_WIDTH, 2, MPH_TOGGLE_TEXT_FONT, MPH_TOGGLE_TEXT_COLOR, gzGIOScreenText[ iMPHDifficulty + 9 ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
#endif
//DisplayWrappedString( (UINT16)(MPH_DIFFICULTY_SETTING_X+MPH_OFFSET_TO_TEXT + 1), (MPH_DIFFICULTY_SETTING_Y+6), MPH_DIFFICULTY_SETTING_WIDTH, 2, MPH_TOGGLE_TEXT_FONT, MPH_TOGGLE_TEXT_COLOR, gzGIOScreenText[ iMPHDifficulty + 9 ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
// ---------------
// ---------------
+4 -8
View File
@@ -76,9 +76,7 @@
#include "Vehicles.h"
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
//forward declarations of common classes to eliminate includes
class OBJECTTYPE;
@@ -5660,9 +5658,8 @@ void HandleRadioScanInSector( INT16 sMapX, INT16 sMapY, INT8 bZ )
UINT8 normalgroupsize = 0;
#ifdef DIFFICULTY_SETTING
normalgroupsize = zDeffSetting[gGameOptions.ubDifficultyLevel].iMinEnemyGroupSize;
#else
/*
switch( gGameOptions.ubDifficultyLevel )
{
case DIF_LEVEL_EASY:
@@ -5679,7 +5676,7 @@ void HandleRadioScanInSector( INT16 sMapX, INT16 sMapY, INT8 bZ )
normalgroupsize = gGameExternalOptions.ubMinEnemyGroupSizeInsane;
break;
}
#endif
*/
normalgroupsize *= 2;
@@ -6011,9 +6008,8 @@ void HandleGatheringInformationBySoldier( SOLDIERTYPE* pSoldier )
UINT16 usNormalGroupSize = 0;
#ifdef DIFFICULTY_SETTING
usNormalGroupSize = zDeffSetting[gGameOptions.ubDifficultyLevel].iMinEnemyGroupSize;
#else
/*
switch( gGameOptions.ubDifficultyLevel )
{
case DIF_LEVEL_EASY:
@@ -6030,7 +6026,7 @@ void HandleGatheringInformationBySoldier( SOLDIERTYPE* pSoldier )
usNormalGroupSize = gGameExternalOptions.ubMinEnemyGroupSizeInsane;
break;
}
#endif
*/
usNormalGroupSize *= 2;
FLOAT fBaseChance = ( EffectiveLeadership(pSoldier) + EffectiveWisdom(pSoldier) + EffectiveExpLevel(pSoldier) * 10 ) / 3000.0f;
+11 -22
View File
@@ -24,9 +24,7 @@
#include "UndergroundInit.h"
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
extern BOOLEAN InitStrategicMovementCosts();
void InitKnowFacilitiesFlags( );
@@ -432,9 +430,8 @@ void BuildUndergroundSectorInfoList()
//J9
curr = NewUndergroundNode( 9, 10, 1 );
#ifdef DIFFICULTY_SETTING
curr->ubNumTroops = zDeffSetting[gGameOptions.ubDifficultyLevel].iJ9B1NumTroops;
#else
/*
switch( gGameOptions.ubDifficultyLevel )
{
case DIF_LEVEL_EASY:
@@ -450,38 +447,30 @@ void BuildUndergroundSectorInfoList()
curr->ubNumTroops = 20;
break;
}
#endif
*/
//J9 feeding zone
curr = NewUndergroundNode( 9, 10, 2 );
#ifdef DIFFICULTY_SETTING
curr->ubNumCreatures = (UINT8)(2 + zDeffSetting[gGameOptions.ubDifficultyLevel].iJ9B2NumCreatures*2 + Random( 2 ));
#else
curr->ubNumCreatures = (UINT8)(2 + gGameOptions.ubDifficultyLevel*2 + Random( 2 ));
#endif
//curr->ubNumCreatures = (UINT8)(2 + gGameOptions.ubDifficultyLevel*2 + Random( 2 ));
//K4
curr = NewUndergroundNode( 4, 11, 1 );
#ifdef DIFFICULTY_SETTING
curr->ubNumTroops = (UINT8)(6 + zDeffSetting[gGameOptions.ubDifficultyLevel].iK4B1NumTroops*2 + Random( 3 ));
curr->ubNumElites = (UINT8)(4 + zDeffSetting[gGameOptions.ubDifficultyLevel].iK4B1NumElites + Random( 2 ));
#else
curr->ubNumTroops = (UINT8)(6 + gGameOptions.ubDifficultyLevel*2 + Random( 3 ));
curr->ubNumElites = (UINT8)(4 + gGameOptions.ubDifficultyLevel + Random( 2 ));
#endif
//curr->ubNumTroops = (UINT8)(6 + gGameOptions.ubDifficultyLevel*2 + Random( 3 ));
//curr->ubNumElites = (UINT8)(4 + gGameOptions.ubDifficultyLevel + Random( 2 ));
//O3
curr = NewUndergroundNode( 3, 15, 1 );
#ifdef DIFFICULTY_SETTING
curr->ubNumTroops = (UINT8)(6 + zDeffSetting[gGameOptions.ubDifficultyLevel].iO3B1NumTroops*2 + Random( 3 ));
curr->ubNumElites = (UINT8)(4 + zDeffSetting[gGameOptions.ubDifficultyLevel].iO3B1NumElites + Random( 2 ));
#else
curr->ubNumTroops = (UINT8)(6 + gGameOptions.ubDifficultyLevel*2 + Random( 3 ));
curr->ubNumElites = (UINT8)(4 + gGameOptions.ubDifficultyLevel + Random( 2 ));
#endif
//curr->ubNumTroops = (UINT8)(6 + gGameOptions.ubDifficultyLevel*2 + Random( 3 ));
//curr->ubNumElites = (UINT8)(4 + gGameOptions.ubDifficultyLevel + Random( 2 ));
//P3
curr = NewUndergroundNode( 3, 16, 1 );
#ifdef DIFFICULTY_SETTING
if (gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
curr->ubNumElites = (UINT8)(zDeffSetting[gGameOptions.ubDifficultyLevel].iP3B1NumElites + Random( 3 ));
else if (gGameOptions.ubDifficultyLevel == DIF_LEVEL_MEDIUM )
@@ -490,7 +479,7 @@ void BuildUndergroundSectorInfoList()
curr->ubNumElites = (UINT8)(zDeffSetting[gGameOptions.ubDifficultyLevel].iP3B1NumElites + Random( 6 ));
else
curr->ubNumElites = zDeffSetting[gGameOptions.ubDifficultyLevel].iP3B1NumElites;
#else
/*
switch( gGameOptions.ubDifficultyLevel )
{
case DIF_LEVEL_EASY:
@@ -506,7 +495,7 @@ void BuildUndergroundSectorInfoList()
curr->ubNumElites = 20;
break;
}
#endif
*/
//Do all of the mandatory underground mine sectors
//Drassen's mine
+14 -22
View File
@@ -36,9 +36,7 @@
#include "Strategic Mines.h"
#include "connect.h"
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
#ifdef JA2BETAVERSION
BOOLEAN gfClearCreatureQuest = FALSE;
@@ -349,9 +347,8 @@ void InitCreatureQuest()
#endif
giHabitatedDistance = 0;
#ifdef DIFFICULTY_SETTING
giPopulationModifier = zDeffSetting[gGameOptions.ubDifficultyLevel].iCreaturePopulationModifier;
#else
/*
switch( gGameOptions.ubDifficultyLevel )
{
case DIF_LEVEL_EASY:
@@ -367,7 +364,7 @@ void InitCreatureQuest()
giPopulationModifier = INSANE_POPULATION_MODIFIER;
break;
}
#endif
*/
//Determine which of the maps are infectible by creatures. Infectible mines
//are those that are player controlled and unlimited. We don't want the creatures to
@@ -517,10 +514,9 @@ void InitCreatureQuest()
//Now determine how often we will spread the creatures.
#ifdef DIFFICULTY_SETTING
i = zDeffSetting[gGameOptions.ubDifficultyLevel].iQueenInitBonusSpread;
AddPeriodStrategicEvent( EVENT_CREATURE_SPREAD, zDeffSetting[gGameOptions.ubDifficultyLevel].iCreatureSpreadTime, 0 );
#else
/*
switch( gGameOptions.ubDifficultyLevel )
{
case DIF_LEVEL_EASY:
@@ -540,7 +536,7 @@ void InitCreatureQuest()
AddPeriodStrategicEvent( EVENT_CREATURE_SPREAD, INSANE_SPREAD_TIME_IN_MINUTES, 0 );
break;
}
#endif
*/
//Set things up so that the creatures can plan attacks on helpless miners and civilians while
//they are sleeping. They do their planning at 10PM every day, and decide to attack sometime
@@ -651,11 +647,9 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"CreatureSpreading1");
case DIF_LEVEL_INSANE: //200%
iAbsoluteMaxPopulation *= 2;
break;
#ifdef DIFFICULTY_SETTING
default:
default:
iAbsoluteMaxPopulation /= 2; //Half
break;
#endif
}
//Calculate the desired max population percentage based purely on current distant to creature range.
@@ -701,9 +695,8 @@ void SpreadCreatures()
}
//queen just produced a litter of creature larvae. Let's do some spreading now.
#ifdef DIFFICULTY_SETTING
usNewCreatures = (UINT16)( zDeffSetting[gGameOptions.ubDifficultyLevel].iQueenReproductionBase + Random( 1 + zDeffSetting[gGameOptions.ubDifficultyLevel].iQueenReproductionBonus ));
#else
/*
switch( gGameOptions.ubDifficultyLevel )
{
case DIF_LEVEL_EASY:
@@ -719,7 +712,7 @@ void SpreadCreatures()
usNewCreatures = (UINT16)(INSANE_QUEEN_REPRODUCTION_BASE + Random( 1 + INSANE_QUEEN_REPRODUCTION_BONUS ));
break;
}
#endif
*/
while( usNewCreatures-- )
{
@@ -1761,13 +1754,12 @@ void CreatureNightPlanning()
//10% chance for each creature with difficulty modifier to decide it's time to attack.
#ifdef DIFFICULTY_SETTING
i = zDeffSetting[gGameOptions.ubDifficultyLevel].iCreatureTownAggressiveness;
if( ubNumCreatures > 1 && ubNumCreatures * 10 + i > (INT32)PreRandom( 100 ) )
{
AddStrategicEvent( EVENT_CREATURE_ATTACK, GetWorldTotalMin() + 1 + PreRandom( 429 ), ubSectorID );
}
#else
i = zDeffSetting[gGameOptions.ubDifficultyLevel].iCreatureTownAggressiveness;
if( ubNumCreatures > 1 && ubNumCreatures * 10 + i > (INT32)PreRandom( 100 ) )
{
AddStrategicEvent( EVENT_CREATURE_ATTACK, GetWorldTotalMin() + 1 + PreRandom( 429 ), ubSectorID );
}
/*
switch( gGameOptions.ubDifficultyLevel )
{
case DIF_LEVEL_EASY:
@@ -1799,7 +1791,7 @@ void CreatureNightPlanning()
}
break;
}
#endif
*/
//if( ubNumCreatures > 1 && ubNumCreatures * 10 > (INT32)PreRandom( 100 ) )
//{ //10% chance for each creature to decide it's time to attack.
// AddStrategicEvent( EVENT_CREATURE_ATTACK, GetWorldTotalMin() + 1 + PreRandom( 429 ), ubSectorID );
+4
View File
@@ -511,11 +511,15 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
MilitiaMovementOrder( (UINT8) pEvent->uiParam );
break;
#ifdef JA2UB
// 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 );
break;
#endif
case EVENT_PMC_REINFORCEMENT_ARRIVAL:
HandlePMCArrival( (UINT8)pEvent->uiParam );
+3 -9
View File
@@ -85,9 +85,7 @@
#include "Map Screen Interface Bottom.h"
#endif
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
#include "PostalService.h"
extern CPostalService gPostalService;
@@ -563,11 +561,8 @@ BOOLEAN InitNewGame( BOOLEAN fReset )
AutoSaveToSlot[3] = FALSE;
AutoSaveToSlot[4] = FALSE;
#ifdef DIFFICULTY_SETTING
gGameExternalOptions.gfAllowReinforcements = zDeffSetting[gGameOptions.ubDifficultyLevel].bAllowReinforcements;
#endif
gGameExternalOptions.gfAllowReinforcements = zDeffSetting[gGameOptions.ubDifficultyLevel].bAllowReinforcements;
#ifdef JA2UB
//Ja25 no meanwhiles
#else
@@ -752,9 +747,8 @@ fFirstTimeInMapScreen = TRUE;
}
// ATE: Set starting cash....
#ifdef DIFFICULTY_SETTING
iStartingCash = zDeffSetting[gGameOptions.ubDifficultyLevel].iStartingCash;
#else
/*
switch( gGameOptions.ubDifficultyLevel )
{
case DIF_LEVEL_EASY:
@@ -785,7 +779,7 @@ fFirstTimeInMapScreen = TRUE;
Assert(0);
return( FALSE );
}
#endif
*/
// Setup initial money
AddTransactionToPlayersBook( ANONYMOUS_DEPOSIT, 0, GetWorldTotalMin(), iStartingCash );
+2 -5
View File
@@ -45,9 +45,7 @@
#include "Music Control.h"
#include "NPC.h"
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
#ifdef JA2UB
#include "Ja25 Strategic Ai.h"
@@ -12968,9 +12966,8 @@ static int l_SetStartingCashDifLevel (lua_State *L)
INT32 DifficultyLevel = lua_tointeger(L,1);
INT32 iStartingCash = 0;
#ifdef DIFFICULTY_SETTING
AddTransactionToPlayersBook( ANONYMOUS_DEPOSIT, 0, GetWorldTotalMin(), zDeffSetting[DifficultyLevel].iStartingCash );
#else
/*
switch( DifficultyLevel )
{
case DIF_LEVEL_EASY:
@@ -12993,7 +12990,7 @@ static int l_SetStartingCashDifLevel (lua_State *L)
iStartingCash = 4500;
}
AddTransactionToPlayersBook( ANONYMOUS_DEPOSIT, 0, GetWorldTotalMin(), iStartingCash );
#endif
*/
}
return 0;
}
+1 -6
View File
@@ -38,9 +38,7 @@
#include "Random.h"
#endif
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
#define MAX_MEANWHILE_PROFILES 10
@@ -702,11 +700,8 @@ void ProcessImplicationsOfMeanwhile( void )
{
case END_OF_PLAYERS_FIRST_BATTLE:
#ifdef DIFFICULTY_SETTING
if( zDeffSetting[gGameOptions.ubDifficultyLevel].bStrategicAiActionWakeQueen == TRUE )
#else
if( gGameOptions.ubDifficultyLevel >= DIF_LEVEL_HARD )
#endif
//if( gGameOptions.ubDifficultyLevel >= DIF_LEVEL_HARD )
{ //Wake up the queen earlier to punish the good players!
ExecuteStrategicAIAction( STRATEGIC_AI_ACTION_WAKE_QUEEN, 0, 0 );
}
+2 -5
View File
@@ -32,9 +32,7 @@
#include "postalservice.h"
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
extern BOOLEAN fMapScreenBottomDirty;
extern CPostalService gPostalService;
@@ -330,9 +328,8 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B
if ( !SectorInfo[ SECTOR( sMapX, sMapY ) ].fSurfaceWasEverPlayerControlled )
{
// grant grace period
#ifdef DIFFICULTY_SETTING
UpdateLastDayOfPlayerActivity( ( UINT16 ) ( GetWorldDay() + zDeffSetting[gGameOptions.ubDifficultyLevel].iUpdateLastDayOfPlayerActivity ) );
#else
/*
if ( gGameOptions.ubDifficultyLevel >= DIF_LEVEL_HARD )
{
@@ -342,7 +339,7 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B
{
UpdateLastDayOfPlayerActivity( ( UINT16 ) ( GetWorldDay() + 1 ) );
}
#endif
*/
}
}
+2 -6
View File
@@ -54,9 +54,7 @@
#include "ub_config.h"
#endif
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
extern void InitializeTacticalStatusAtBattleStart();
extern BOOLEAN gfDelayAutoResolveStart;
@@ -656,10 +654,8 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
iChance -= (2 * ((ubNumMobileEnemies + ubNumStationaryEnemies) - 6)); // -2% adjustment per enemy beyond 6
// adjust the chance for difficulty setting
#ifdef DIFFICULTY_SETTING
iChance = iChance + (zDeffSetting[gGameOptions.ubDifficultyLevel].iChanceOfEnemyAmbushes);
#else
/*
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
iChance -= 15;
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_MEDIUM )
@@ -668,7 +664,7 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
iChance += 12;
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
iChance += 25;
#endif
*/
// adjust the chance for what we know about the sector
if( WhatPlayerKnowsAboutEnemiesInSector( gubPBSectorX, gubPBSectorY ) == KNOWS_NOTHING )
+3 -7
View File
@@ -64,9 +64,7 @@
#include "Arms Dealer Init.h"
#endif
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
#include <vector>
@@ -573,11 +571,9 @@ BOOLEAN PrepareEnemyForSectorBattle()
// Reinforcement groups? Bring it on!
if( gGameExternalOptions.gfAllowReinforcements &&
#ifdef DIFFICULTY_SETTING
!( (GetTownIdForSector( gWorldSectorX, gWorldSectorY ) == OMERTA ) ) )
#else
!( (GetTownIdForSector( gWorldSectorX, gWorldSectorY ) == OMERTA )&&( gGameOptions.ubDifficultyLevel != DIF_LEVEL_INSANE ) ) )
#endif
!( (GetTownIdForSector( gWorldSectorX, gWorldSectorY ) == OMERTA ) ) )
//!( (GetTownIdForSector( gWorldSectorX, gWorldSectorY ) == OMERTA )&&( gGameOptions.ubDifficultyLevel != DIF_LEVEL_INSANE ) ) )
{
UINT16 pusMoveDir[4][3];
UINT8 ubDirNumber = 0;
+2 -7
View File
@@ -24,9 +24,7 @@
#include "Inventory Choosing.h"
#endif
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
#include "connect.h"
#include "Reinforcement.h"
@@ -53,13 +51,10 @@ void GetNumberOfEnemiesInFiveSectors( INT16 sSectorX, INT16 sSectorY, UINT8 *pub
if( !gGameExternalOptions.gfAllowReinforcements )
return;
#ifdef DIFFICULTY_SETTING
if ( ( GetTownIdForSector( sSectorX, sSectorY ) == OMERTA )&&( zDeffSetting[gGameOptions.ubDifficultyLevel].bAllowReinforcementsOmerta == FALSE ) ) //Madd: skip Omerta //Lal: but not on insane ;-)
return;
#else
if ( ( GetTownIdForSector( sSectorX, sSectorY ) == OMERTA )&&( gGameOptions.ubDifficultyLevel != DIF_LEVEL_INSANE ) ) //Madd: skip Omerta //Lal: but not on insane ;-)
return;
#endif
//if ( ( GetTownIdForSector( sSectorX, sSectorY ) == OMERTA )&&( gGameOptions.ubDifficultyLevel != DIF_LEVEL_INSANE ) ) //Madd: skip Omerta //Lal: but not on insane ;-)
// return;
GenerateDirectionInfos( sSectorX, sSectorY, &ubDirNumber, pusMoveDir, FALSE, TRUE );
+59 -154
View File
@@ -37,9 +37,7 @@
#include "interface dialogue.h"
#endif
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
#define SAI_VERSION 29
@@ -551,9 +549,7 @@ void Ensure_RepairedGarrisonGroup( GARRISON_GROUP **ppGarrison, INT32 *pGarraySi
//returns the number of reinforcements permitted to be sent. Will increased if the denied counter is non-zero.
INT32 GarrisonReinforcementsRequested( INT32 iGarrisonID, UINT8 *pubExtraReinforcements )
{
#ifdef DIFFICULTY_SETTING
INT32 iExtraReinforcements;
#endif
INT32 iReinforcementsRequested;
INT32 iExistingForces;
@@ -569,7 +565,7 @@ INT32 GarrisonReinforcementsRequested( INT32 iGarrisonID, UINT8 *pubExtraReinfor
//Record how many of the reinforcements are additionally provided due to being denied in the past. This will grow
//until it is finally excepted or an absolute max is made.
#ifdef DIFFICULTY_SETTING
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
iExtraReinforcements = 1;
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_MEDIUM )
@@ -585,9 +581,8 @@ INT32 GarrisonReinforcementsRequested( INT32 iGarrisonID, UINT8 *pubExtraReinfor
}
*pubExtraReinforcements = (UINT8)(gubGarrisonReinforcementsDenied[ iGarrisonID ] / (6 - iExtraReinforcements));
#else
*pubExtraReinforcements = (UINT8)(gubGarrisonReinforcementsDenied[ iGarrisonID ] / (6 - gGameOptions.ubDifficultyLevel));
#endif
//*pubExtraReinforcements = (UINT8)(gubGarrisonReinforcementsDenied[ iGarrisonID ] / (6 - gGameOptions.ubDifficultyLevel));
//Make sure the number of extra reinforcements don't bump the force size past the max of MAX_STRATEGIC_TEAM_SIZE.
*pubExtraReinforcements = (UINT16)min( (INT32)*pubExtraReinforcements, min( (INT32)(*pubExtraReinforcements), iMaxEnemyGroupSize - iReinforcementsRequested ) );
@@ -1190,8 +1185,6 @@ void InitStrategicAI()
dEnemyGeneralsSpeedupFactor = max( 0.5f, dEnemyGeneralsSpeedupFactor - gStrategicStatus.usVIPsLeft * gGameExternalOptions.fEnemyGeneralStrategicDecisionSpeedBonus );
}
#ifdef DIFFICULTY_SETTING
giReinforcementPool = zDeffSetting[gGameOptions.ubDifficultyLevel].iQueensInitialPoolOfTroops;
giForcePercentage = zDeffSetting[gGameOptions.ubDifficultyLevel].iInitialGarrisonPercentages;
giArmyAlertness = zDeffSetting[gGameOptions.ubDifficultyLevel].iEnemyStartingAlertLevel;
@@ -1202,7 +1195,7 @@ void InitStrategicAI()
gfAggressiveQueen = zDeffSetting[gGameOptions.ubDifficultyLevel].bAggressiveQueenAi;
// 475 is 7:55am in minutes since midnight, the time the game starts on day 1
AddStrategicEvent( EVENT_EVALUATE_QUEEN_SITUATION, 475 + dEnemyGeneralsSpeedupFactor * (zDeffSetting[gGameOptions.ubDifficultyLevel].iBaseDelayInMinutesBetweenEvaluations + Random( zDeffSetting[gGameOptions.ubDifficultyLevel].iEvaluationDelayVariance )), 0 );
#else
/*
switch( gGameOptions.ubDifficultyLevel )
{
case DIF_LEVEL_EASY:
@@ -1251,8 +1244,7 @@ void InitStrategicAI()
AddStrategicEvent( EVENT_EVALUATE_QUEEN_SITUATION, 475 + dEnemyGeneralsSpeedupFactor * (gGameExternalOptions.ubInsaneTimeEvaluateInMinutes + Random( gGameExternalOptions.ubInsaneTimeEvaluateVariance )), 0);
break;
}
#endif
*/
//Initialize the sectorinfo structure so all sectors don't point to a garrisonID.
for( i = 0; i <= 255; i++ )
{
@@ -1264,7 +1256,6 @@ void InitStrategicAI()
memcpy( gArmyComp, gOrigArmyComp, sizeof( gArmyComp ) );
//Eliminate more perimeter defenses on the easier levels.
#ifdef DIFFICULTY_SETTING
if (zDeffSetting[gGameOptions.ubDifficultyLevel].iDesiredPopulationL2 == FALSE)
{
@@ -1291,7 +1282,7 @@ void InitStrategicAI()
}
}
}
#else
/*
switch( gGameOptions.ubDifficultyLevel )
{
case DIF_LEVEL_EASY:
@@ -1354,7 +1345,8 @@ void InitStrategicAI()
}
break;
}
#endif
*/
//initialize the patrol group definitions
giPatrolArraySize = iOrigPatrolArraySize;
if( gPatrolGroup )
@@ -1529,7 +1521,6 @@ void InitStrategicAI()
//Now post an event which allows them to check adjacent sectors periodically.
//Spread them out so that they process at different times.
#ifdef DIFFICULTY_SETTING
UINT32 val;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
val = 1;
@@ -1546,9 +1537,8 @@ void InitStrategicAI()
}
AddPeriodStrategicEventWithOffset( EVENT_CHECK_ENEMY_CONTROLLED_SECTOR, 140 - 20 * val + Random( 4 ), 475 + i, gGarrisonGroup[ i ].ubSectorID );
#else
AddPeriodStrategicEventWithOffset( EVENT_CHECK_ENEMY_CONTROLLED_SECTOR, 140 - 20 * gGameOptions.ubDifficultyLevel + Random( 4 ), 475 + i, gGarrisonGroup[ i ].ubSectorID );
#endif
//AddPeriodStrategicEventWithOffset( EVENT_CHECK_ENEMY_CONTROLLED_SECTOR, 140 - 20 * gGameOptions.ubDifficultyLevel + Random( 4 ), 475 + i, gGarrisonGroup[ i ].ubSectorID );
}
//Now, initialize each of the patrol groups
@@ -1565,7 +1555,6 @@ void InitStrategicAI()
if( ubNumTroops && gGameExternalOptions.fArmyUsesTanksInPatrols )
{
#ifdef DIFFICULTY_SETTING
UINT32 val2;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
val2 = 1;
@@ -1582,9 +1571,9 @@ void InitStrategicAI()
}
if( Random( 10 ) < val2 && i != 3 && i != 4)
#else
if( Random( 10 ) < gGameOptions.ubDifficultyLevel && i != 3 && i != 4)
#endif
//if( Random( 10 ) < gGameOptions.ubDifficultyLevel && i != 3 && i != 4)
{
ubNumTroops--;
ubNumTanks++;
@@ -1660,12 +1649,9 @@ void InitStrategicAI()
if( ubPicked[0] != ubSector && ubPicked[1] != ubSector )
{
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache1X, gModSettings.ubWeaponCache1Y ) ]; //SEC_E11
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
#ifdef DIFFICULTY_SETTING
pSector->ubNumTroops = (UINT8)(6 + zDeffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops1 * 2);
#else
pSector->ubNumTroops = (UINT8)(6 + gGameOptions.ubDifficultyLevel * 2);
#endif
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + zDeffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops1 * 2);
//pSector->ubNumTroops = (UINT8)(6 + gGameOptions.ubDifficultyLevel * 2);
if (ubPicked[0] == 0)
ubPicked[0] = ubSector;
else if (ubPicked[1] == 0)
@@ -1683,11 +1669,8 @@ void InitStrategicAI()
{
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache2X, gModSettings.ubWeaponCache2Y ) ]; //SEC_H5
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
#ifdef DIFFICULTY_SETTING
pSector->ubNumTroops = (UINT8)(6 + zDeffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops2 * 2);
#else
pSector->ubNumTroops = (UINT8)(6 + gGameOptions.ubDifficultyLevel * 2);
#endif
//pSector->ubNumTroops = (UINT8)(6 + gGameOptions.ubDifficultyLevel * 2);
if (ubPicked[0] == 0)
ubPicked[0] = ubSector;
else if (ubPicked[1] == 0)
@@ -1705,11 +1688,8 @@ void InitStrategicAI()
{
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache3X, gModSettings.ubWeaponCache3Y ) ]; //SEC_H10
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
#ifdef DIFFICULTY_SETTING
pSector->ubNumTroops = (UINT8)(6 + zDeffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops3 * 2);
#else
pSector->ubNumTroops = (UINT8)(6 + gGameOptions.ubDifficultyLevel * 2);
#endif
//pSector->ubNumTroops = (UINT8)(6 + gGameOptions.ubDifficultyLevel * 2);
if (ubPicked[0] == 0)
ubPicked[0] = ubSector;
else if (ubPicked[1] == 0)
@@ -1727,11 +1707,8 @@ void InitStrategicAI()
{
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache4X, gModSettings.ubWeaponCache4Y ) ]; //SEC_J12
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
#ifdef DIFFICULTY_SETTING
pSector->ubNumTroops = (UINT8)(6 + zDeffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops4 * 2);
#else
pSector->ubNumTroops = (UINT8)(6 + gGameOptions.ubDifficultyLevel * 2);
#endif
//pSector->ubNumTroops = (UINT8)(6 + gGameOptions.ubDifficultyLevel * 2);
if (ubPicked[0] == 0)
ubPicked[0] = ubSector;
else if (ubPicked[1] == 0)
@@ -1749,11 +1726,8 @@ void InitStrategicAI()
{
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache5X, gModSettings.ubWeaponCache5Y ) ]; //SEC_M9
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
#ifdef DIFFICULTY_SETTING
pSector->ubNumTroops = (UINT8)(6 + zDeffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops5 * 2);
#else
pSector->ubNumTroops = (UINT8)(6 + gGameOptions.ubDifficultyLevel * 2);
#endif
//pSector->ubNumTroops = (UINT8)(6 + gGameOptions.ubDifficultyLevel * 2);
if (ubPicked[0] == 0)
ubPicked[0] = ubSector;
else if (ubPicked[1] == 0)
@@ -1775,7 +1749,6 @@ void InitStrategicAI()
}
else
{
#ifdef DIFFICULTY_SETTING
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache1X, gModSettings.ubWeaponCache1Y ) ]; //SEC_E11
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + zDeffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops1 * 2);
@@ -1796,7 +1769,7 @@ void InitStrategicAI()
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + zDeffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops5 * 2);
#else
/*
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache1X, gModSettings.ubWeaponCache1Y ) ]; //SEC_E11
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + gGameOptions.ubDifficultyLevel * 2);
@@ -1816,7 +1789,7 @@ void InitStrategicAI()
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache5X, gModSettings.ubWeaponCache5Y ) ]; //SEC_M9
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
pSector->ubNumTroops = (UINT8)(6 + gGameOptions.ubDifficultyLevel * 2);
#endif
*/
}
ValidateWeights( 1 );
@@ -3452,9 +3425,8 @@ void EvaluateQueenSituation()
{
dEnemyGeneralsSpeedupFactor = max( 0.5f, dEnemyGeneralsSpeedupFactor - gStrategicStatus.usVIPsLeft * gGameExternalOptions.fEnemyGeneralStrategicDecisionSpeedBonus );
}
#ifdef DIFFICULTY_SETTING
uiOffset += dEnemyGeneralsSpeedupFactor * (zDeffSetting[gGameOptions.ubDifficultyLevel].iBaseDelayInMinutesBetweenEvaluations + Random( zDeffSetting[gGameOptions.ubDifficultyLevel].iEvaluationDelayVariance ));
#else
/*
switch( gGameOptions.ubDifficultyLevel )
{
case DIF_LEVEL_EASY:
@@ -3470,18 +3442,15 @@ void EvaluateQueenSituation()
uiOffset += dEnemyGeneralsSpeedupFactor * (gGameExternalOptions.ubInsaneTimeEvaluateInMinutes + Random( gGameExternalOptions.ubInsaneTimeEvaluateVariance ));
break;
}
#endif
*/
if( !giReinforcementPool )
{ //Queen has run out of reinforcements. Simulate recruiting and training new troops
uiOffset *= 10;
//Madd: don't need an unlimited troops check here, since they can never run out like this
#ifdef DIFFICULTY_SETTING
giReinforcementPool += ( zDeffSetting[gGameOptions.ubDifficultyLevel].iQueenPoolIncrementPerDifficultyLevel * gGameOptions.ubDifficultyLevel ) * ( 100 + CurrentPlayerProgressPercentage() ) / 100 ;
#else
giReinforcementPool += ( gGameExternalOptions.guiBaseQueenPoolIncrement * gGameOptions.ubDifficultyLevel ) * ( 100 + CurrentPlayerProgressPercentage() ) / 100 ;
#endif
//giReinforcementPool += ( gGameExternalOptions.guiBaseQueenPoolIncrement * gGameOptions.ubDifficultyLevel ) * ( 100 + CurrentPlayerProgressPercentage() ) / 100 ;
AddStrategicEvent( EVENT_EVALUATE_QUEEN_SITUATION, GetWorldTotalMin() + uiOffset, 0 );
return;
@@ -3740,10 +3709,9 @@ BOOLEAN LoadStrategicAI( HWFILE hFile )
UINT8 ubSAIVersion;
INT32 iMaxEnemyGroupSize = gGameExternalOptions.iMaxEnemyGroupSize;
#ifdef DIFFICULTY_SETTING
gfUnlimitedTroops = zDeffSetting[gGameOptions.ubDifficultyLevel].bUnlimitedPoolOfTroops;
gfAggressiveQueen = zDeffSetting[gGameOptions.ubDifficultyLevel].bAggressiveQueenAi;
#else
gfUnlimitedTroops = zDeffSetting[gGameOptions.ubDifficultyLevel].bUnlimitedPoolOfTroops;
gfAggressiveQueen = zDeffSetting[gGameOptions.ubDifficultyLevel].bAggressiveQueenAi;
/*
switch( gGameOptions.ubDifficultyLevel )
{
case DIF_LEVEL_EASY:
@@ -3763,7 +3731,7 @@ BOOLEAN LoadStrategicAI( HWFILE hFile )
gfAggressiveQueen = gGameExternalOptions.gfInsaneAggressiveQueen;
break;
}
#endif
*/
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Strategic6");
FileRead( hFile, gbPadding2, 3, &uiNumBytesRead );
@@ -4098,12 +4066,10 @@ BOOLEAN LoadStrategicAI( HWFILE hFile )
SectorInfo[ SEC_N5 ].bBloodCatPlacements = 12;
SectorInfo[ SEC_N5 ].bBloodCats = 15;
break;
#ifdef DIFFICULTY_SETTING
default:
SectorInfo[ SEC_N5 ].bBloodCatPlacements = 8;
SectorInfo[ SEC_N5 ].bBloodCats = 10;
break;
#endif
}
}
if( ubSAIVersion < 23 )
@@ -4408,7 +4374,6 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Strategic7");
if( gfExtraElites && iFactor >= 15 && gArmyComp[ i ].bElitePercentage )
{
#ifdef DIFFICULTY_SETTING
INT32 val;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
val = 1;
@@ -4424,9 +4389,8 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Strategic7");
if (val == 0) val = 1;
}
iChange = val * 5;
#else
iChange = gGameOptions.ubDifficultyLevel * 5;
#endif
//iChange = gGameOptions.ubDifficultyLevel * 5;
//increase elite % (max 100)
iNew = gArmyComp[ i ].bElitePercentage + iChange;
@@ -4607,7 +4571,6 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
ubSourceSectorID = SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY );
}
#ifdef DIFFICULTY_SETTING
UINT8 val;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
val = 1;
@@ -4623,10 +4586,8 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
if (val == 0) val = 1;
}
ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + val * 3);
#else
ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + gGameOptions.ubDifficultyLevel * 3);
#endif
ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + val * 3);
//ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + gGameOptions.ubDifficultyLevel * 3);
// anv: replace one of soldiers with tank
for( UINT8 ubCounter = 0; ubCounter < 4; ubCounter++ )
{
@@ -4634,28 +4595,24 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
grouptanks[ubCounter] = 0;
if( ubNumSoldiers && gGameExternalOptions.fArmyUsesTanksInAttacks )
{
#ifdef DIFFICULTY_SETTING
if( Random(10) < val )
#else
if( Random(10) < gGameOptions.ubDifficultyLevel )
#endif
//if( Random(10) < gGameOptions.ubDifficultyLevel )
{
grouptroops[ubCounter]--;
grouptanks[ubCounter]++;
}
}
}
#ifdef DIFFICULTY_SETTING
pGroup0 = CreateNewEnemyGroupDepartingFromSector( ubSourceSectorID, 0, grouptroops[0], grouptroops[0] - grouptroops[0] / val, grouptanks[0] );
pGroup1 = CreateNewEnemyGroupDepartingFromSector( ubSourceSectorID, 0, grouptroops[1], grouptroops[1] - grouptroops[1] / val, grouptanks[1] );
pGroup2 = CreateNewEnemyGroupDepartingFromSector( ubSourceSectorID, 0, grouptroops[2], grouptroops[2] - grouptroops[2] / val, grouptanks[2] );
pGroup3 = CreateNewEnemyGroupDepartingFromSector( ubSourceSectorID, 0, grouptroops[3], grouptroops[3] - grouptroops[3] / val, grouptanks[3] );
#else
/*
pGroup0 = CreateNewEnemyGroupDepartingFromSector( ubSourceSectorID, 0, grouptroops[0], grouptroops[0] - grouptroops[0] / gGameOptions.ubDifficultyLevel, grouptanks[0] );
pGroup1 = CreateNewEnemyGroupDepartingFromSector( ubSourceSectorID, 0, grouptroops[1], grouptroops[1] - grouptroops[1] / gGameOptions.ubDifficultyLevel, grouptanks[1] );
pGroup2 = CreateNewEnemyGroupDepartingFromSector( ubSourceSectorID, 0, grouptroops[2], grouptroops[2] - grouptroops[2] / gGameOptions.ubDifficultyLevel, grouptanks[2] );
pGroup3 = CreateNewEnemyGroupDepartingFromSector( ubSourceSectorID, 0, grouptroops[3], grouptroops[3] - grouptroops[3] / gGameOptions.ubDifficultyLevel, grouptanks[3] );
#endif
*/
if( !gGarrisonGroup[ SectorInfo[ ubTargetSectorID ].ubGarrisonID ].ubPendingGroupID )
{
pGroup0->pEnemyGroup->ubIntention = STAGE;
@@ -4699,7 +4656,6 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
break;
}
#ifdef DIFFICULTY_SETTING
UINT8 value;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
value = 1;
@@ -4716,10 +4672,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
}
ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + value * 3);
#else
ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + gGameOptions.ubDifficultyLevel * 3);
#endif
//ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + gGameOptions.ubDifficultyLevel * 3);
// anv: replace one of soldiers with tank
for( UINT8 ubCounter = 0; ubCounter < 4; ubCounter++ )
{
@@ -4727,24 +4680,18 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
grouptanks[ubCounter] = 0;
if( ubNumSoldiers && gGameExternalOptions.fArmyUsesTanksInAttacks )
{
#ifdef DIFFICULTY_SETTING
if( Random(10) < gGameOptions.ubDifficultyLevel )
#else
if( Random(10) < value )
#endif
// if( Random(10) < value )
{
grouptroops[ubCounter]--;
grouptanks[ubCounter]++;
}
}
groupelites[ubCounter] = 0;
#ifdef DIFFICULTY_SETTING
if ( value > 0 )
groupelites[ubCounter] = grouptroops[ubCounter] - grouptroops[ubCounter] / value;
#else
if ( gGameOptions.ubDifficultyLevel > 0 )
groupelites[ubCounter] = grouptroops[ubCounter] - grouptroops[ubCounter] / gGameOptions.ubDifficultyLevel;
#endif
//if ( gGameOptions.ubDifficultyLevel > 0 )
// groupelites[ubCounter] = grouptroops[ubCounter] - grouptroops[ubCounter] / gGameOptions.ubDifficultyLevel;
}
//UINT32 totalusedsoldiers = 4 * min(grouptroops + groupelites + ubNumTanks, (UINT32)gGameExternalOptions.iMaxEnemyGroupSize);
@@ -4923,7 +4870,6 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
BOOLEAN fAttack_Balime = !(SectorInfo[ SEC_L11 ].ubNumTroops > 0);
BOOLEAN fAttack_Chitzena = !(SectorInfo[ SEC_L11 ].ubNumTroops > 0);
#ifdef DIFFICULTY_SETTING
UINT8 value2;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
value2 = 1;
@@ -4939,9 +4885,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
if (value2 == 0) value2 = 1;
}
ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + value2 * 3);
#else
ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + gGameOptions.ubDifficultyLevel * 3);
#endif
//ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + gGameOptions.ubDifficultyLevel * 3);
// anv: replace one of soldiers with tank
if( ubNumSoldiers && gGameExternalOptions.fArmyUsesTanksInAttacks )
{
@@ -4951,16 +4895,10 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
UINT32 grouptroops = ubNumSoldiers;
UINT32 groupelites = 0;
#ifdef DIFFICULTY_SETTING
if ( value2 > 0 )
#else
if ( gGameOptions.ubDifficultyLevel > 0 )
#endif
#ifdef DIFFICULTY_SETTING
//if ( gGameOptions.ubDifficultyLevel > 0 )
groupelites = ubNumSoldiers - ubNumSoldiers / value2;
#else
groupelites = ubNumSoldiers - ubNumSoldiers / gGameOptions.ubDifficultyLevel;
#endif
//groupelites = ubNumSoldiers - ubNumSoldiers / gGameOptions.ubDifficultyLevel;
UINT32 totalusedsoldiers = 0;
if ( fAttack_Grumm )
@@ -5196,7 +5134,6 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
ubSectorID = (UINT8)STRATEGIC_INDEX_TO_SECTOR_INFO( sWorldSectorLocationOfFirstBattle );
pSector = &SectorInfo[ ubSectorID ];
#ifdef DIFFICULTY_SETTING
UINT8 value4;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
value4 = 1;
@@ -5212,17 +5149,12 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
if (value4 == 0) value4 = 1;
}
ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + value4 * 4);
#else
ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + gGameOptions.ubDifficultyLevel * 4);
#endif
//ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + gGameOptions.ubDifficultyLevel * 4);
// anv: replace one of soldiers with tank
if( ubNumSoldiers && gGameExternalOptions.fArmyUsesTanksInAttacks )
{
#ifdef DIFFICULTY_SETTING
if( Random( 10 ) < value4 )
#else
if( Random( 10 ) < gGameOptions.ubDifficultyLevel )
#endif
//if( Random( 10 ) < gGameOptions.ubDifficultyLevel )
{
ubNumSoldiers--;
ubNumTanks++;
@@ -5275,7 +5207,6 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
unsigned intention = (unsigned) option2;
Assert(intention < NUM_ENEMY_INTENTIONS);
#ifdef DIFFICULTY_SETTING
UINT8 value5;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
value5 = 1;
@@ -5296,13 +5227,13 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
Random(HighestPlayerProgressPercentage() / 5) +
Random(option1 / 5)
);
#else
/*
ubNumSoldiers = ( gubMinEnemyGroupSize +
gGameOptions.ubDifficultyLevel * 3 +
Random(HighestPlayerProgressPercentage() / 5) +
Random(option1 / 5)
);
#endif
*/
if ( !gfUnlimitedTroops )
giReinforcementPool -= ubNumSoldiers;
@@ -5350,11 +5281,8 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
if( ubNumSoldiers && gGameExternalOptions.fArmyUsesTanksInAttacks )
{
#ifdef DIFFICULTY_SETTING
if( Random( 10 * 100 ) < value5 * direness )
#else
if( Random( 10 * 100 ) < gGameOptions.ubDifficultyLevel * direness )
#endif
//if( Random( 10 * 100 ) < gGameOptions.ubDifficultyLevel * direness )
{
elitesThisSquad--;
tanksThisSquad++;
@@ -5446,7 +5374,6 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
case NPC_ACTION_SEND_SOLDIERS_TO_OMERTA:
#ifdef DIFFICULTY_SETTING
UINT8 value6;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
value6 = 1;
@@ -5462,9 +5389,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
if (value6 == 0) value6 = 1;
}
ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + value6 * 6); //6, 12, or 18 based on difficulty.
#else
ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + gGameOptions.ubDifficultyLevel * 6); //6, 12, or 18 based on difficulty.
#endif
// ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + gGameOptions.ubDifficultyLevel * 6); //6, 12, or 18 based on difficulty.
pGroup = CreateNewEnemyGroupDepartingFromSector( SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY ), 0, ubNumSoldiers, (UINT8)(ubNumSoldiers/7), 0 ); //add 1 elite to normal, and 2 for hard
ubNumSoldiers = (UINT8)(ubNumSoldiers + ubNumSoldiers / 7);
@@ -5489,7 +5414,6 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
case NPC_ACTION_SEND_TROOPS_TO_SAM:
ubSectorID = (UINT8)SECTOR( sSectorX, sSectorY );
#ifdef DIFFICULTY_SETTING
UINT8 value7;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
value7 = 1;
@@ -5505,9 +5429,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
if (value7 == 0) value7 = 1;
}
ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + value7 + HighestPlayerProgressPercentage() / 15 );
#else
ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + gGameOptions.ubDifficultyLevel + HighestPlayerProgressPercentage() / 15 );
#endif
// ubNumSoldiers = (UINT8)( gubMinEnemyGroupSize + gGameOptions.ubDifficultyLevel + HighestPlayerProgressPercentage() / 15 );
//Madd: unlimited reinforcements?
if ( !gfUnlimitedTroops )
giReinforcementPool -= ubNumSoldiers;
@@ -5515,11 +5437,8 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
// anv: replace one of soldiers with tank
if( ubNumSoldiers && gGameExternalOptions.fArmyUsesTanksInAttacks )
{
#ifdef DIFFICULTY_SETTING
if( Random( 10 * 100 ) < value7 * HighestPlayerProgressPercentage() )
#else
if( Random( 10 * 100 ) < gGameOptions.ubDifficultyLevel * HighestPlayerProgressPercentage() )
#endif
//if( Random( 10 * 100 ) < gGameOptions.ubDifficultyLevel * HighestPlayerProgressPercentage() )
{
ubNumSoldiers--;
ubNumTanks++;
@@ -5557,9 +5476,8 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
case NPC_ACTION_GIVE_KNOWLEDGE_OF_ALL_MERCS:
//temporarily make the queen's forces more aware (high alert)
#ifdef DIFFICULTY_SETTING
gubNumAwareBattles = zDeffSetting[gGameOptions.ubDifficultyLevel].iNumAwareBattles;
#else
/*
switch( gGameOptions.ubDifficultyLevel )
{
case DIF_LEVEL_EASY:
@@ -5575,7 +5493,7 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
gubNumAwareBattles = gGameExternalOptions.ubInsaneNumAwareBattles;
break;
}
#endif
*/
break;
default:
@@ -5841,7 +5759,6 @@ void StrategicHandleQueenLosingControlOfSector( INT16 sSectorX, INT16 sSectorY,
//Keep track of victories and wake up the queen after x number of battles.
gusPlayerBattleVictories++;
#ifdef DIFFICULTY_SETTING
UINT8 value8;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
value8 = 1;
@@ -5857,9 +5774,7 @@ void StrategicHandleQueenLosingControlOfSector( INT16 sSectorX, INT16 sSectorY,
if (value8 == 0) value8 = 1;
}
if( gusPlayerBattleVictories == 5 - value8 )
#else
if( gusPlayerBattleVictories == 5 - gGameOptions.ubDifficultyLevel )
#endif
//if( gusPlayerBattleVictories == 5 - gGameOptions.ubDifficultyLevel )
{ //4 victories for easy, 3 for normal, 2 for hard
WakeUpQueen();
}
@@ -5981,7 +5896,6 @@ void StrategicHandleQueenLosingControlOfSector( INT16 sSectorX, INT16 sSectorY,
}
//Madd: tweaked to increase attacks for experienced and expert to 8 and 12, and unlimited for insane
#ifdef DIFFICULTY_SETTING
UINT8 value9;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
value9 = 1;
@@ -5998,9 +5912,7 @@ void StrategicHandleQueenLosingControlOfSector( INT16 sSectorX, INT16 sSectorY,
}
if( pSector->ubInvestigativeState >= ( 4 * value9 ) && zDeffSetting[gGameOptions.ubDifficultyLevel].bQueenLosingControlOfSector == FALSE )
#else
if( pSector->ubInvestigativeState >= ( 4 * gGameOptions.ubDifficultyLevel ) && gGameOptions.ubDifficultyLevel < DIF_LEVEL_INSANE )
#endif
//if( pSector->ubInvestigativeState >= ( 4 * gGameOptions.ubDifficultyLevel ) && gGameOptions.ubDifficultyLevel < DIF_LEVEL_INSANE )
{
//This is the 4th time the player has conquered this sector. We won't pester the player with probing attacks here anymore.
return;
@@ -6558,11 +6470,8 @@ void UpgradeAdminsToTroops()
while ( ubAdminsToCheck > 0)
{
// chance to upgrade at each check is random, and also dependant on the garrison's priority
#ifdef DIFFICULTY_SETTING
if ( Chance ( bPriority ) || zDeffSetting[gGameOptions.ubDifficultyLevel].bUpgradeAdminsToTroops == TRUE )
#else
if ( Chance ( bPriority ) || gGameOptions.ubDifficultyLevel > DIF_LEVEL_HARD ) // Madd: Always happens on Insane
#endif
//if ( Chance ( bPriority ) || gGameOptions.ubDifficultyLevel > DIF_LEVEL_HARD ) // Madd: Always happens on Insane
{
pSector->ubNumAdmins--;
pSector->ubNumTroops++;
@@ -6617,11 +6526,8 @@ void UpgradeAdminsToTroops()
while ( ubAdminsToCheck > 0)
{
// chance to upgrade at each check is random, and also dependant on the group's priority
#ifdef DIFFICULTY_SETTING
if ( Chance ( bPriority ) || zDeffSetting[gGameOptions.ubDifficultyLevel].bUpgradeAdminsToTroops2 == TRUE )
#else
if ( Chance ( bPriority ) || gGameOptions.ubDifficultyLevel >= DIF_LEVEL_HARD )// Madd: Always happens on Expert and Insane
#endif
//if ( Chance ( bPriority ) || gGameOptions.ubDifficultyLevel >= DIF_LEVEL_HARD )// Madd: Always happens on Expert and Insane
{
pGroup->pEnemyGroup->ubNumAdmins--;
pGroup->pEnemyGroup->ubNumTroops++;
@@ -6861,9 +6767,8 @@ void TagSAIGroupWithGracePeriod( GROUP *pGroup )
if( iPatrolID != -1 )
{
#ifdef DIFFICULTY_SETTING
gPatrolGroup[ iPatrolID ].bFillPermittedAfterDayMod100 = (UINT8)((GetWorldDay() + zDeffSetting[gGameOptions.ubDifficultyLevel].iGracePeriodInDaysAfterPatrolDestroyed) % 100);
#else
/*
switch( gGameOptions.ubDifficultyLevel ) {
case DIF_LEVEL_EASY:
gPatrolGroup[ iPatrolID ].bFillPermittedAfterDayMod100 = (UINT8)((GetWorldDay() + gGameExternalOptions.ubEasyPatrolGracePeriodInDays) % 100);
@@ -6878,7 +6783,7 @@ void TagSAIGroupWithGracePeriod( GROUP *pGroup )
gPatrolGroup[ iPatrolID ].bFillPermittedAfterDayMod100 = (UINT8)((GetWorldDay() + gGameExternalOptions.ubInsanePatrolGracePeriodInDays) % 100);
break;
}
#endif
*/
}
}
}
+1 -6
View File
@@ -24,9 +24,7 @@
#include "Facilities.h"
#endif
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
#include "Strategic Mines LUA.h"
#include <vector>
@@ -198,11 +196,8 @@ void InitializeMines( void )
ubMineProductionIncreases = 15;
break;
default:
#ifdef DIFFICULTY_SETTING
ubMineProductionIncreases = 25;
#else
Assert( 0 );
#endif
//Assert( 0 );
return;
}
+1 -5
View File
@@ -61,9 +61,7 @@
//extern JA25_SECTOR_AI *gJa25AiSectorStruct;
#endif
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
#include "connect.h"
//forward declarations of common classes to eliminate includes
@@ -4881,8 +4879,7 @@ BOOLEAN TestForBloodcatAmbush( GROUP *pGroup )
{ //no ambushes underground (no bloodcats either)
return FALSE;
}
#ifdef DIFFICULTY_SETTING
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
ubDifficulty = 0;
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_MEDIUM )
@@ -4893,7 +4890,6 @@ BOOLEAN TestForBloodcatAmbush( GROUP *pGroup )
ubDifficulty = 3;
else
ubDifficulty = 0;
#endif
ubSectorID = (UINT8)SECTOR( pGroup->ubSectorX, pGroup->ubSectorY );
pSector = &SectorInfo[ ubSectorID ];
+4 -13
View File
@@ -18,9 +18,7 @@
#include "SaveLoadGame.h" // added by Flugente
#endif
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
STRATEGIC_STATUS gStrategicStatus;
@@ -220,21 +218,15 @@ void UpdateLastDayOfPlayerActivity( UINT16 usDay )
UINT8 LackOfProgressTolerance( void )
{
#ifdef DIFFICULTY_SETTING
UINT8 iTolerance;
#endif
#ifdef DIFFICULTY_SETTING
if ( gGameOptions.ubDifficultyLevel == DIF_LEVEL_HARD || gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
#else
if ( gGameOptions.ubDifficultyLevel >= DIF_LEVEL_HARD )
#endif
//if ( gGameOptions.ubDifficultyLevel >= DIF_LEVEL_HARD )
{
// give an EXTRA day over normal
return( 7 - DIF_LEVEL_MEDIUM + gStrategicStatus.ubHighestProgress / 42 );
}
#ifdef DIFFICULTY_SETTING
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
iTolerance = 1;
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_MEDIUM )
@@ -247,10 +239,9 @@ UINT8 iTolerance;
iTolerance = 1;
return( 6 - iTolerance + gStrategicStatus.ubHighestProgress / 42 );
#else
return( 6 - gGameOptions.ubDifficultyLevel + gStrategicStatus.ubHighestProgress / 42 );
#endif
//return( 6 - gGameOptions.ubDifficultyLevel + gStrategicStatus.ubHighestProgress / 42 );
}
+2 -11
View File
@@ -44,9 +44,7 @@
#include "LuaInitNPCs.h"
#include "Interface.h"
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
// the max loyalty rating for any given town
#define MAX_LOYALTY_VALUE 100
@@ -1879,11 +1877,8 @@ void CheckIfEntireTownHasBeenLiberated( INT8 bTownId, INT16 sSectorX, INT16 sSec
// even taking over non-trainable "towns" like Orta/Tixa for the first time should count as "player activity"
#ifdef DIFFICULTY_SETTING
if ( gGameOptions.ubDifficultyLevel == DIF_LEVEL_HARD || gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE)
#else
if ( gGameOptions.ubDifficultyLevel >= DIF_LEVEL_HARD )
#endif
//if ( gGameOptions.ubDifficultyLevel >= DIF_LEVEL_HARD )
{
UpdateLastDayOfPlayerActivity( ( UINT16 ) ( GetWorldDay() + 4 ) );
}
@@ -2063,8 +2058,6 @@ void HandleLoyaltyImplicationsOfMercRetreat( INT8 bRetreatCode, INT16 sSectorX,
// if not worse than 2:1 odds, then penalize morale
// SANDRO - Set the odds based on difficulty level
#ifdef DIFFICULTY_SETTING
UINT8 DiffLevel;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
DiffLevel = 1;
@@ -2078,9 +2071,7 @@ void HandleLoyaltyImplicationsOfMercRetreat( INT8 bRetreatCode, INT16 sSectorX,
DiffLevel = 1;
if ( gTacticalStatus.fEnemyInSector && ( (PlayerStrength() * (2 + DiffLevel)) >= EnemyStrength() ) )
#else
if ( gTacticalStatus.fEnemyInSector && ( (PlayerStrength() * (2 + gGameOptions.ubDifficultyLevel)) >= EnemyStrength() ) )
#endif
//if ( gTacticalStatus.fEnemyInSector && ( (PlayerStrength() * (2 + gGameOptions.ubDifficultyLevel)) >= EnemyStrength() ) )
{
HandleMoraleEvent( NULL, MORALE_RAN_AWAY, sSectorX, sSectorY, (INT8)sSectorZ );
}
+2 -6
View File
@@ -9,10 +9,7 @@
#include "MemMan.h"
#include "Debug Control.h"
#include "GameSettings.h"
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
typedef enum
{
@@ -190,7 +187,6 @@ void AddExtraItems(UINT8 x, UINT8 y, UINT8 z, bool sectorIsLoaded)
int baseFNLength = strlen(fileName);
// Append a suffix based on the difficulty
#ifdef DIFFICULTY_SETTING
switch (gGameOptions.ubDifficultyLevel) {
case DIF_LEVEL_ZERO:
break;
@@ -242,7 +238,7 @@ void AddExtraItems(UINT8 x, UINT8 y, UINT8 z, bool sectorIsLoaded)
default:
break;
}
#else
/*
switch (gGameOptions.ubDifficultyLevel) {
case DIF_LEVEL_ZERO:
break;
@@ -263,7 +259,7 @@ void AddExtraItems(UINT8 x, UINT8 y, UINT8 z, bool sectorIsLoaded)
default:
break;
}
#endif
*/
strcat(fileName, ".xml");
if(!FileExists(fileName))//dnl ch75 261013 just to avoid sdd::exception under debug from VFS when file not exist
+2 -6
View File
@@ -161,9 +161,7 @@
#define MINS_TO_FLASH_CONTRACT_TIME (4 * 60)
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
#ifdef JA2UB
void MakeBadSectorListFromMapsOnHardDrive( BOOLEAN fDisplayMessages ); // ja25 UB
@@ -15405,11 +15403,9 @@ void DumpSectorDifficultyInfo( void )
// NOTE: This operates on the selected map sector!
CHAR16 wSectorName[ 128 ];
#ifdef DIFFICULTY_SETTING
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Playing Difficulty: %s", zDeffSetting[gGameOptions.ubDifficultyLevel].szDeffName );
#else
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Playing Difficulty: %s", gzGIOScreenText[ GIO_DIF_LEVEL_TEXT + gGameOptions.ubDifficultyLevel ] );
#endif
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Playing Difficulty: %s", gzGIOScreenText[ GIO_DIF_LEVEL_TEXT + gGameOptions.ubDifficultyLevel ] );
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Highest Progress (0-100) = %d%%", HighestPlayerProgressPercentage() );
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Player Kills = %d", gStrategicStatus.usPlayerKills );
+2 -11
View File
@@ -109,9 +109,7 @@
#include "LuaInitNPCs.h"
#include "Luaglobal.h"
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
#ifdef JA2UB
#include "SaveLoadGame.h"
@@ -7322,12 +7320,9 @@ void CreateAndAddMoneyObjectToGround( UINT32 sGridNo, INT32 iEasyAmount, INT32 i
break;
default:
#ifdef DIFFICULTY_SETTING
iCash = iNormalAmount;
break;
#else
Assert(0);
#endif
//Assert(0);
break;
}
CreateMoney( iCash, &Object );
@@ -7524,12 +7519,10 @@ void HandleMovingEnemiesOntoRoofs()
MoveEnemyFromGridNoToRoofGridNo( 15446, 13993 );
MoveEnemyFromGridNoToRoofGridNo( 15436, 14006 );
break;
#ifdef DIFFICULTY_SETTING
default:
MoveEnemyFromGridNoToRoofGridNo( 15446, 13993 );
MoveEnemyFromGridNoToRoofGridNo( 15436, 14006 );
break;
#endif
}
}
@@ -7544,11 +7537,9 @@ void HandleMovingEnemiesOntoRoofs()
case DIF_LEVEL_HARD:
MoveEnemyFromGridNoToRoofGridNo( 8711, 5521 );
break;
#ifdef DIFFICULTY_SETTING
default:
MoveEnemyFromGridNoToRoofGridNo( 8711, 5521 );
break;
#endif
}
}
}
+1 -6
View File
@@ -33,9 +33,7 @@
#include "meanwhile.h"
#endif
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
#define SCRIPT_DELAY 10
#define AIR_RAID_SAY_QUOTE_TIME 3000
@@ -514,11 +512,8 @@ void AirRaidLookForDive( )
{
// If we are are beginning game, only do gun dives..
#ifdef DIFFICULTY_SETTING
if ( gAirRaidDef.uiFlags & AIR_RAID_BEGINNING_GAME && zDeffSetting[gGameOptions.ubDifficultyLevel].bAirRaidLookForDive == FALSE)
#else
if ( gAirRaidDef.uiFlags & AIR_RAID_BEGINNING_GAME && gGameOptions.ubDifficultyLevel < DIF_LEVEL_HARD )
#endif
//if ( gAirRaidDef.uiFlags & AIR_RAID_BEGINNING_GAME && gGameOptions.ubDifficultyLevel < DIF_LEVEL_HARD )
{
if ( gbNumDives == 0 )
{
+5 -8
View File
@@ -49,9 +49,7 @@
#include "ub_config.h"
#endif
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
#include "email.h"
#include "mercs.h"
@@ -1297,9 +1295,9 @@ void HandleUnhiredMercDeaths( INT32 iProfileID )
// then we're not allowed to kill him (to avoid really pissing off player by killing his very favorite merc)
return;
}
#ifdef DIFFICULTY_SETTING
ubMaxDeaths = zDeffSetting[gGameOptions.ubDifficultyLevel].iMaxMercDeaths;
#else
/*
// how many in total can be killed like this depends on player's difficulty setting
switch( gGameOptions.ubDifficultyLevel )
{
@@ -1320,7 +1318,7 @@ void HandleUnhiredMercDeaths( INT32 iProfileID )
ubMaxDeaths = 0;
break;
}
#endif
*/
// if we've already hit the limit in this game, skip these checks
if (gStrategicStatus.ubUnhiredMercDeaths >= ubMaxDeaths)
{
@@ -1619,9 +1617,8 @@ UINT8 CurrentPlayerProgressPercentage(void)
// kills per point depends on difficulty, and should match the ratios of starting enemy populations (730/1050/1500)
// HEADROCK HAM 3: Externalized all four Kills-per-point ratios.
#ifdef DIFFICULTY_SETTING
ubKillsPerPoint = zDeffSetting[gGameOptions.ubDifficultyLevel].iNumKillsPerProgressPoint;
#else
/*
switch( gGameOptions.ubDifficultyLevel )
{
case DIF_LEVEL_EASY:
@@ -1641,7 +1638,7 @@ UINT8 CurrentPlayerProgressPercentage(void)
ubKillsPerPoint = 10;
break;
}
#endif
*/
usKillsProgress = gStrategicStatus.usPlayerKills / ubKillsPerPoint;
if (usKillsProgress > usMaxKillsProgress)
{
+3 -22
View File
@@ -57,10 +57,7 @@
#include "structure.h"
#include "Explosion Control.h"
#include "ub_config.h"
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
//*******************************************************************
//
@@ -1551,8 +1548,8 @@ void HandleJa25EnemyExpLevelModifier( )
}
}
break;
#ifdef DIFFICULTY_SETTING
default:
default:
//Get the 2nd highest player exp level
bPlayerExpLevel = JA25SecondHighestExpLevelOnPlayersTeam( );
@@ -1575,7 +1572,6 @@ void HandleJa25EnemyExpLevelModifier( )
Ja25ScaleAllEnemiesByValue( bDifference );
}
break;
#endif
}
}
@@ -1827,23 +1823,8 @@ void HandleInitialEventsInHeliCrash()
UINT32 GetNumberOfTurnsPowerGenFanWillBeStoppedFor()
{
UINT32 uiNumTurns = PGF__NUM_TURNS_TILL_START_FAN_BACK_UP_EASY;
uiNumTurns = zDeffSetting[gGameOptions.ubDifficultyLevel].iGetNumberOfTurnsPowerGenFanWillBeStoppedFor;
#ifdef DIFFICULTY_SETTING
uiNumTurns = zDeffSetting[gGameOptions.ubDifficultyLevel].iGetNumberOfTurnsPowerGenFanWillBeStoppedFor;
#else
switch( gGameOptions.ubDifficultyLevel )
{
case DIF_LEVEL_EASY:
uiNumTurns = PGF__NUM_TURNS_TILL_START_FAN_BACK_UP_EASY;
break;
case DIF_LEVEL_MEDIUM:
uiNumTurns = PGF__NUM_TURNS_TILL_START_FAN_BACK_UP_NORMAL;
break;
case DIF_LEVEL_HARD:
uiNumTurns = PGF__NUM_TURNS_TILL_START_FAN_BACK_UP_HARD;
break;
}
#endif
return( uiNumTurns );
}
+3 -11
View File
@@ -55,9 +55,7 @@
#include "CampaignStats.h" // added by Flugente
#include "AIInternals.h"//dnl ch61 180813
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
//forward declarations of common classes to eliminate includes
class OBJECTTYPE;
@@ -2221,7 +2219,6 @@ INT32 SoldierToSoldierLineOfSightTest( SOLDIERTYPE * pStartSoldier, SOLDIERTYPE
if (PlacementType == BLOODCAT_PLACEMENT_STATIC)
{
// Are bloodcats set to forgo attacking enemies?
#ifdef DIFFICULTY_SETTING
UINT8 DiffLev;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
DiffLev = 1;
@@ -2234,10 +2231,8 @@ INT32 SoldierToSoldierLineOfSightTest( SOLDIERTYPE * pStartSoldier, SOLDIERTYPE
else
DiffLev = 1;
if (gBloodcatPlacements[ ubSectorID ][ DiffLev-1 ].ubFactionAffiliation == QUEENS_CIV_GROUP)
#else
if (gBloodcatPlacements[ ubSectorID ][ gGameOptions.ubDifficultyLevel-1 ].ubFactionAffiliation == QUEENS_CIV_GROUP)
#endif
if (gBloodcatPlacements[ ubSectorID ][ DiffLev-1 ].ubFactionAffiliation == QUEENS_CIV_GROUP)
//if (gBloodcatPlacements[ ubSectorID ][ gGameOptions.ubDifficultyLevel-1 ].ubFactionAffiliation == QUEENS_CIV_GROUP)
{
// skip sight between army & bloodcats
if ( pStartSoldier->bTeam == ENEMY_TEAM && pEndSoldier->bTeam == CREATURE_TEAM && pEndSoldier->ubBodyType == BLOODCAT )
@@ -2249,11 +2244,8 @@ INT32 SoldierToSoldierLineOfSightTest( SOLDIERTYPE * pStartSoldier, SOLDIERTYPE
return( 0 );
}
}
#ifdef DIFFICULTY_SETTING
else if (gBloodcatPlacements[ ubSectorID ][ DiffLev-1 ].ubFactionAffiliation > NON_CIV_GROUP)
#else
else if (gBloodcatPlacements[ ubSectorID ][ gGameOptions.ubDifficultyLevel-1 ].ubFactionAffiliation > NON_CIV_GROUP)
#endif
//else if (gBloodcatPlacements[ ubSectorID ][ gGameOptions.ubDifficultyLevel-1 ].ubFactionAffiliation > NON_CIV_GROUP)
{
// Bloodcats in this sector belong to a faction. They adhere to certain rules as a result.
if ( pEndSoldier->bTeam == CREATURE_TEAM && pEndSoldier->ubBodyType == BLOODCAT && pStartSoldier->bSide != gbPlayerNum)
+8 -16
View File
@@ -134,9 +134,7 @@
#endif
#include "XML.h"
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
// OJW - 20090419
UINT8 giMAXIMUM_NUMBER_OF_PLAYER_MERCS = CODE_MAXIMUM_NUMBER_OF_PLAYER_MERCS;
@@ -4355,7 +4353,6 @@ SOLDIERTYPE * CivilianGroupMemberChangesSides( SOLDIERTYPE * pAttacked )
}
// HEADROCK HAM 3.6: If this sector has affiliated bloodcats, make them all hostile.
#ifdef DIFFICULTY_SETTING
UINT8 DiffLevel;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
DiffLevel = 1;
@@ -4369,10 +4366,10 @@ SOLDIERTYPE * CivilianGroupMemberChangesSides( SOLDIERTYPE * pAttacked )
DiffLevel = 1;
if ( gBloodcatPlacements[SECTOR(pNewAttacked->sSectorX,pNewAttacked->sSectorY)][0].PlacementType == BLOODCAT_PLACEMENT_STATIC &&
gBloodcatPlacements[SECTOR(pNewAttacked->sSectorX,pNewAttacked->sSectorY)][ DiffLevel-1 ].ubFactionAffiliation == pNewAttacked->ubCivilianGroup )
#else
/*
if ( gBloodcatPlacements[SECTOR(pNewAttacked->sSectorX,pNewAttacked->sSectorY)][0].PlacementType == BLOODCAT_PLACEMENT_STATIC &&
gBloodcatPlacements[SECTOR(pNewAttacked->sSectorX,pNewAttacked->sSectorY)][ gGameOptions.ubDifficultyLevel-1 ].ubFactionAffiliation == pNewAttacked->ubCivilianGroup )
#endif
*/
{
MakeBloodcatsHostile();
}
@@ -8872,7 +8869,6 @@ BOOLEAN ProcessImplicationsOfPCAttack( SOLDIERTYPE * pSoldier, SOLDIERTYPE ** pp
// Attacked a bloodcat.
MakeBloodcatsHostile();
// Are bloodcats in this sector affiliated with a faction?
#ifdef DIFFICULTY_SETTING
UINT8 DiffLevel;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
DiffLevel = 1;
@@ -8887,15 +8883,14 @@ BOOLEAN ProcessImplicationsOfPCAttack( SOLDIERTYPE * pSoldier, SOLDIERTYPE ** pp
if ( gBloodcatPlacements[SECTOR(pTarget->sSectorX,pTarget->sSectorY)][0].PlacementType == BLOODCAT_PLACEMENT_STATIC &&
gBloodcatPlacements[SECTOR(pTarget->sSectorX,pTarget->sSectorY)][ DiffLevel-1 ].ubFactionAffiliation > NON_CIV_GROUP )
#else
/*
if ( gBloodcatPlacements[SECTOR(pTarget->sSectorX,pTarget->sSectorY)][0].PlacementType == BLOODCAT_PLACEMENT_STATIC &&
gBloodcatPlacements[SECTOR(pTarget->sSectorX,pTarget->sSectorY)][ gGameOptions.ubDifficultyLevel-1 ].ubFactionAffiliation > NON_CIV_GROUP )
#endif
*/
{
// Temporarily change bloodcat's civilian group
UINT8 ubFaction = pTarget->ubCivilianGroup;
#ifdef DIFFICULTY_SETTING
UINT8 DiffLevel2;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
DiffLevel2 = 1;
@@ -8909,9 +8904,7 @@ BOOLEAN ProcessImplicationsOfPCAttack( SOLDIERTYPE * pSoldier, SOLDIERTYPE ** pp
DiffLevel2 = 1;
pTarget->ubCivilianGroup = gBloodcatPlacements[SECTOR(pTarget->sSectorX,pTarget->sSectorY)][ DiffLevel2-1 ].ubFactionAffiliation;
#else
pTarget->ubCivilianGroup = gBloodcatPlacements[SECTOR(pTarget->sSectorX,pTarget->sSectorY)][ gGameOptions.ubDifficultyLevel-1 ].ubFactionAffiliation;
#endif
// pTarget->ubCivilianGroup = gBloodcatPlacements[SECTOR(pTarget->sSectorX,pTarget->sSectorY)][ gGameOptions.ubDifficultyLevel-1 ].ubFactionAffiliation;
// Make entire faction hostile
CivilianGroupMembersChangeSidesWithinProximity( pTarget );
// Change back
@@ -8962,7 +8955,6 @@ BOOLEAN ProcessImplicationsOfPCAttack( SOLDIERTYPE * pSoldier, SOLDIERTYPE ** pp
CivilianGroupMembersChangeSidesWithinProximity( pTarget );
// HEADROCK HAM 3.6: If there are bloodcats affiliated with his group...
#ifdef DIFFICULTY_SETTING
UINT8 DiffLevel;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
DiffLevel = 1;
@@ -8977,10 +8969,10 @@ BOOLEAN ProcessImplicationsOfPCAttack( SOLDIERTYPE * pSoldier, SOLDIERTYPE ** pp
if ( gBloodcatPlacements[SECTOR(pTarget->sSectorX,pTarget->sSectorY)][0].PlacementType == BLOODCAT_PLACEMENT_STATIC &&
gBloodcatPlacements[SECTOR(pTarget->sSectorX,pTarget->sSectorY)][ DiffLevel-1 ].ubFactionAffiliation == pTarget->ubCivilianGroup )
#else
if ( gBloodcatPlacements[SECTOR(pTarget->sSectorX,pTarget->sSectorY)][0].PlacementType == BLOODCAT_PLACEMENT_STATIC &&
/*
if ( gBloodcatPlacements[SECTOR(pTarget->sSectorX,pTarget->sSectorY)][0].PlacementType == BLOODCAT_PLACEMENT_STATIC &&
gBloodcatPlacements[SECTOR(pTarget->sSectorX,pTarget->sSectorY)][ gGameOptions.ubDifficultyLevel-1 ].ubFactionAffiliation == pTarget->ubCivilianGroup )
#endif
*/
{
// Make them hostile.
MakeBloodcatsHostile();
+1 -9
View File
@@ -42,9 +42,7 @@
#endif
#include "connect.h"
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
//rain
//#define BREATH_GAIN_REDUCTION_PER_RAIN_INTENSITY 25
@@ -1392,11 +1390,9 @@ void UnusedAPsToBreath( SOLDIERTYPE * pSoldier )
case DIF_LEVEL_INSANE:
sBreathPerAP *= 6/5; // +20%
break;
#ifdef DIFFICULTY_SETTING
default:
sBreathPerAP *= 9/10; // -10%
break;
#endif
}
}
// SANDRO: this simple thing is the correct calculation
@@ -4322,11 +4318,9 @@ INT32 GetBPCostPer10APsForGunHolding( SOLDIERTYPE * pSoldier, BOOLEAN fEstimate
case DIF_LEVEL_INSANE:
iBPcost /= 2; // -50%
break;
#ifdef DIFFICULTY_SETTING
default:
iBPcost = (iBPcost * 9)/10; // -10%
break;
#endif
}
}
@@ -4491,11 +4485,9 @@ INT32 GetBPCostForRecoilkick( SOLDIERTYPE * pSoldier )
case DIF_LEVEL_INSANE:
iKickPower /= 2; // -50%
break;
#ifdef DIFFICULTY_SETTING
default:
default:
iKickPower = (iKickPower * 9)/10; // -10%
break;
#endif
}
}
+1 -6
View File
@@ -51,9 +51,7 @@
#include "Animation Control.h"
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
//forward declarations of common classes to eliminate includes
class OBJECTTYPE;
@@ -980,7 +978,6 @@ BOOLEAN TurnSoldierIntoCorpse( SOLDIERTYPE *pSoldier, BOOLEAN fRemoveMerc, BOOLE
{
gTacticalStatus.fLockItemLocators = FALSE;
#ifdef DIFFICULTY_SETTING
UINT8 DiffLevel;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
DiffLevel = 1;
@@ -993,9 +990,7 @@ BOOLEAN TurnSoldierIntoCorpse( SOLDIERTYPE *pSoldier, BOOLEAN fRemoveMerc, BOOLE
else
DiffLevel = 1;
ubNumGoo = 6 - ( DiffLevel - DIF_LEVEL_EASY );
#else
ubNumGoo = 6 - ( gGameOptions.ubDifficultyLevel - DIF_LEVEL_EASY );
#endif
//ubNumGoo = 6 - ( gGameOptions.ubDifficultyLevel - DIF_LEVEL_EASY );
sNewGridNo = pSoldier->sGridNo + ( WORLD_COLS * 2 );
+4 -8
View File
@@ -103,9 +103,7 @@
#include "Ja25 Strategic Ai.h"
#endif
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
#include "fresh_header.h"
@@ -2065,9 +2063,8 @@ INT16 SOLDIERTYPE::CalcActionPoints( void )
//if ( this->bTeam != CIV_TEAM && this->bTeam != gbPlayerNum)
if ( this->bTeam == ENEMY_TEAM )
{
#ifdef DIFFICULTY_SETTING
ubPoints += zDeffSetting[gGameOptions.ubDifficultyLevel].iEnemyAPBonus;
#else
/*
switch( gGameOptions.ubDifficultyLevel )
{
case DIF_LEVEL_EASY:
@@ -2093,7 +2090,7 @@ INT16 SOLDIERTYPE::CalcActionPoints( void )
default:
ubPoints += 0;
}
#endif
*/
}
// Bonus to Militia APs
else if ( this->bTeam == MILITIA_TEAM )
@@ -2202,9 +2199,8 @@ void SOLDIERTYPE::CalcNewActionPoints( void )
}
if ( this->bTeam == ENEMY_TEAM )
{
#ifdef DIFFICULTY_SETTING
usMaxActionPnts += zDeffSetting[gGameOptions.ubDifficultyLevel].iEnemyAPBonus;
#else
/*
switch( gGameOptions.ubDifficultyLevel )
{
case DIF_LEVEL_EASY:
@@ -2220,7 +2216,7 @@ void SOLDIERTYPE::CalcNewActionPoints( void )
usMaxActionPnts += gGameExternalOptions.iInsaneAPBonus;
break;
}
#endif
*/
}
// Bonus to Militia APs
else if ( this->bTeam == MILITIA_TEAM )
+3 -12
View File
@@ -56,9 +56,7 @@
#include "Ja25 Strategic Ai.h"
#endif
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
// THESE 3 DIFFICULTY FACTORS MUST ALWAYS ADD UP TO 100% EXACTLY!!!
#define DIFF_FACTOR_PLAYER_PROGRESS 50
@@ -2218,12 +2216,10 @@ INT8 CalcDifficultyModifier( UINT8 ubSoldierClass )
bDiffModifier += (INT8)(DIFF_FACTOR_GAME_DIFFICULTY * 1.5);
}
break;
#ifdef DIFFICULTY_SETTING
default:
// equally strong militia, enemies, creatures, bloodcats (+10)
bDiffModifier += ( DIFF_FACTOR_GAME_DIFFICULTY / 2 );
break;
#endif
}
@@ -2483,7 +2479,6 @@ void CreateDetailedPlacementGivenBasicPlacementInfo( SOLDIERCREATE_STRUCT *pp, B
if( PlacementType == BLOODCAT_PLACEMENT_LAIR )
{
#ifdef DIFFICULTY_SETTING
UINT8 DiffLevel;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
DiffLevel = 1;
@@ -2499,9 +2494,7 @@ void CreateDetailedPlacementGivenBasicPlacementInfo( SOLDIERCREATE_STRUCT *pp, B
if (DiffLevel == 0) DiffLevel = 1;
}
pp->bExpLevel += DiffLevel;
#else
pp->bExpLevel += gGameOptions.ubDifficultyLevel;
#endif
//pp->bExpLevel += gGameOptions.ubDifficultyLevel;
}
break;
}
@@ -2528,7 +2521,6 @@ void CreateDetailedPlacementGivenBasicPlacementInfo( SOLDIERCREATE_STRUCT *pp, B
ubStatsLevel = pp->bExpLevel + bStatsModifier;
#ifdef DIFFICULTY_SETTING
UINT8 DiffLevel;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
DiffLevel = 1;
@@ -2544,9 +2536,8 @@ void CreateDetailedPlacementGivenBasicPlacementInfo( SOLDIERCREATE_STRUCT *pp, B
if (DiffLevel == 0) DiffLevel = 1;
}
ubStatsLevel = max( DiffLevel, ubStatsLevel ); //minimum stats level of 0 -- madd->= dif level
#else
ubStatsLevel = max( gGameOptions.ubDifficultyLevel, ubStatsLevel ); //minimum stats level of 0 -- madd->= dif level
#endif
//ubStatsLevel = max( gGameOptions.ubDifficultyLevel, ubStatsLevel ); //minimum stats level of 0 -- madd->= dif level
if ( gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
ubStatsLevel = max( 6, ubStatsLevel ); //minimum stats level of 6 in insane
+4 -18
View File
@@ -61,9 +61,7 @@ class SOLDIERTYPE;
// anv: for taunts on miss
#include "Civ Quotes.h"
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
//rain
//#define WEAPON_RELIABILITY_REDUCTION_PER_RAIN_INTENSITY 0
@@ -5935,11 +5933,8 @@ else
// GAME DIFFICULTY
if ( !(pSoldier->flags.uiStatusFlags & SOLDIER_PC ) && (pSoldier->bSide != gbPlayerNum) )
{
#ifdef DIFFICULTY_SETTING
iBaseModifier += zDeffSetting[gGameOptions.ubDifficultyLevel].NewDifficualtySetingsBASE_DIFFICULTY;
#else
iBaseModifier += gGameCTHConstants.BASE_DIFFICULTY[gGameOptions.ubDifficultyLevel];
#endif
//iBaseModifier += gGameCTHConstants.BASE_DIFFICULTY[gGameOptions.ubDifficultyLevel];
}
// Percentage based-modifier from the weapon and its attachments
@@ -6272,11 +6267,8 @@ else
// GAME DIFFICULTY
if ( !(pSoldier->flags.uiStatusFlags & SOLDIER_PC ) && (pSoldier->bSide != gbPlayerNum) )
{
#ifdef DIFFICULTY_SETTING
iAimModifier += zDeffSetting[gGameOptions.ubDifficultyLevel].NewDifficualtySetingsAIM_DIFFICULTY;
#else
iAimModifier += gGameCTHConstants.AIM_DIFFICULTY[gGameOptions.ubDifficultyLevel];
#endif
//iAimModifier += gGameCTHConstants.AIM_DIFFICULTY[gGameOptions.ubDifficultyLevel];
}
// Percent modifier from the weapon and its attachments
@@ -12876,11 +12868,8 @@ FLOAT CalcNewChanceToHitBaseSpecialBonus(SOLDIERTYPE *pSoldier)
// GAME DIFFICULTY
if ( !(pSoldier->flags.uiStatusFlags & SOLDIER_PC ) && (pSoldier->bSide != gbPlayerNum) )
{
#ifdef DIFFICULTY_SETTING
fBaseModifier += zDeffSetting[gGameOptions.ubDifficultyLevel].NewDifficualtySetingsBASE_DIFFICULTY;
#else
fBaseModifier += gGameCTHConstants.BASE_DIFFICULTY[gGameOptions.ubDifficultyLevel];
#endif
//fBaseModifier += gGameCTHConstants.BASE_DIFFICULTY[gGameOptions.ubDifficultyLevel];
}
return fBaseModifier;
@@ -13179,11 +13168,8 @@ FLOAT CalcNewChanceToHitAimSpecialBonus(SOLDIERTYPE *pSoldier)
// GAME DIFFICULTY
if ( !(pSoldier->flags.uiStatusFlags & SOLDIER_PC ) && (pSoldier->bSide != gbPlayerNum) )
{
#ifdef DIFFICULTY_SETTING
fAimModifier += zDeffSetting[gGameOptions.ubDifficultyLevel].NewDifficualtySetingsAIM_DIFFICULTY;
#else
fAimModifier += gGameCTHConstants.AIM_DIFFICULTY[gGameOptions.ubDifficultyLevel];
#endif
//fAimModifier += gGameCTHConstants.AIM_DIFFICULTY[gGameOptions.ubDifficultyLevel];
}
return fAimModifier;
+1 -4
View File
@@ -258,9 +258,7 @@ typedef PARSE_STAGE;
#define HISTORYNAMEFILENAME "History.xml"
#ifdef DIFFICULTY_SETTING
#define DIFFICULTYFILENAME "DifficultySettings.xml"
#endif
extern BOOLEAN ReadInItemStats(STR fileName, BOOLEAN localizedVersion);
extern BOOLEAN WriteItemStats();
@@ -562,7 +560,6 @@ extern BOOLEAN ReadInLanguageLocation(STR fileName, BOOLEAN localizedVersion, LA
extern BOOLEAN ReadInAimOldArchive(STR fileName, BOOLEAN localizedVersion);
extern BOOLEAN ReadInHistorys(STR fileName, BOOLEAN localizedVersion );
#ifdef DIFFICULTY_SETTING
extern BOOLEAN ReadInDifficultySettings(STR fileName, BOOLEAN localizedVersion);
#endif
#endif
+10 -27
View File
@@ -55,9 +55,7 @@
#include "Ja25_Tactical.h"
#endif
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
#include "Music Control.h"
@@ -934,12 +932,9 @@ void HandleSight(SOLDIERTYPE *pSoldier, UINT8 ubSightFlags)
// revealing roofs and looking for items handled here, too
RevealRoofsAndItems(pSoldier,TRUE, TRUE, pSoldier->pathing.bLevel, FALSE );
}
// unless in easy mode allow alerted enemies to radio
#ifdef DIFFICULTY_SETTING
// unless in easy mode allow alerted enemies to radio
else if ( zDeffSetting[gGameOptions.ubDifficultyLevel].bRadioSightings == TRUE )
#else
else if ( gGameOptions.ubDifficultyLevel >= DIF_LEVEL_MEDIUM )
#endif
//else if ( gGameOptions.ubDifficultyLevel >= DIF_LEVEL_MEDIUM )
{
// don't allow admins to radio
//Madd: Huh? why not admins? removed.
@@ -985,12 +980,9 @@ void HandleSight(SOLDIERTYPE *pSoldier, UINT8 ubSightFlags)
#endif
RadioSightings(pThem,pSoldier->ubID, pThem->bTeam);
}
// unless in easy mode allow alerted enemies to radio
#ifdef DIFFICULTY_SETTING
// unless in easy mode allow alerted enemies to radio
else if ( zDeffSetting[gGameOptions.ubDifficultyLevel].bRadioSightings2 == TRUE )
#else
else if ( gGameOptions.ubDifficultyLevel >= DIF_LEVEL_MEDIUM )
#endif
//else if ( gGameOptions.ubDifficultyLevel >= DIF_LEVEL_MEDIUM )
{
// don't allow admins to radio
if ( pThem->bTeam == ENEMY_TEAM && gTacticalStatus.Team[ ENEMY_TEAM ].bAwareOfOpposition && pThem->ubSoldierClass != SOLDIER_CLASS_ADMINISTRATOR )
@@ -2515,7 +2507,6 @@ void ManSeesMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, INT32 sOppGridNo,
else if ( pOpponent->ubBodyType == BLOODCAT && pOpponent->aiData.bNeutral)
{
// HEADROCK HAM 3.6: If bloodcats are set as affiliated with civilians, do not trigger hostilities.
#ifdef DIFFICULTY_SETTING
UINT8 DiffLevel;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
DiffLevel = 1;
@@ -2531,11 +2522,11 @@ void ManSeesMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, INT32 sOppGridNo,
if ( gBloodcatPlacements[SECTOR(pSoldier->sSectorX, pSoldier->sSectorY)][ 0 ].PlacementType != BLOODCAT_PLACEMENT_STATIC ||
gBloodcatPlacements[SECTOR(pSoldier->sSectorX, pSoldier->sSectorY)][ DiffLevel - 1 ].ubFactionAffiliation == NON_CIV_GROUP ||
gBloodcatPlacements[SECTOR(pSoldier->sSectorX, pSoldier->sSectorY)][ DiffLevel - 1 ].ubFactionAffiliation == QUEENS_CIV_GROUP )
#else
/*
if ( gBloodcatPlacements[SECTOR(pSoldier->sSectorX, pSoldier->sSectorY)][ 0 ].PlacementType != BLOODCAT_PLACEMENT_STATIC ||
gBloodcatPlacements[SECTOR(pSoldier->sSectorX, pSoldier->sSectorY)][ gGameOptions.ubDifficultyLevel - 1 ].ubFactionAffiliation == NON_CIV_GROUP ||
gBloodcatPlacements[SECTOR(pSoldier->sSectorX, pSoldier->sSectorY)][ gGameOptions.ubDifficultyLevel - 1 ].ubFactionAffiliation == QUEENS_CIV_GROUP )
#endif
*/
{
MakeBloodcatsHostile();
}
@@ -6049,8 +6040,7 @@ void ProcessNoise(UINT8 ubNoiseMaker, INT32 sGridNo, INT8 bLevel, UINT8 ubTerrTy
// Also, there's a toggle that determines whether or not bloodcats can sense enemies in this sector.
UINT8 ubSectorID = SECTOR(gWorldSectorX, gWorldSectorY);
UINT8 PlacementType = gBloodcatPlacements[ ubSectorID ][0].PlacementType;
#ifdef DIFFICULTY_SETTING
UINT8 DiffLevel;
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
DiffLevel = 1;
@@ -6062,15 +6052,11 @@ void ProcessNoise(UINT8 ubNoiseMaker, INT32 sGridNo, INT8 bLevel, UINT8 ubTerrTy
DiffLevel = 4;
else
DiffLevel = 1;
#endif
if (PlacementType == BLOODCAT_PLACEMENT_STATIC)
{
#ifdef DIFFICULTY_SETTING
if (gBloodcatPlacements[ ubSectorID ][ DiffLevel-1 ].ubFactionAffiliation == QUEENS_CIV_GROUP)
#else
if (gBloodcatPlacements[ ubSectorID ][ gGameOptions.ubDifficultyLevel-1 ].ubFactionAffiliation == QUEENS_CIV_GROUP)
#endif
//if (gBloodcatPlacements[ ubSectorID ][ gGameOptions.ubDifficultyLevel-1 ].ubFactionAffiliation == QUEENS_CIV_GROUP)
{
// skip noises between army & bloodcats
if ( pSoldier->bTeam == ENEMY_TEAM && MercPtrs[ ubNoiseMaker ]->ubBodyType == BLOODCAT && MercPtrs[ ubNoiseMaker ]->bTeam == CREATURE_TEAM )
@@ -6081,12 +6067,9 @@ void ProcessNoise(UINT8 ubNoiseMaker, INT32 sGridNo, INT8 bLevel, UINT8 ubTerrTy
{
continue;
}
}
#ifdef DIFFICULTY_SETTING
}
else if (gBloodcatPlacements[ ubSectorID ][ DiffLevel-1 ].ubFactionAffiliation > NON_CIV_GROUP)
#else
else if (gBloodcatPlacements[ ubSectorID ][ gGameOptions.ubDifficultyLevel-1 ].ubFactionAffiliation > NON_CIV_GROUP)
#endif
//else if (gBloodcatPlacements[ ubSectorID ][ gGameOptions.ubDifficultyLevel-1 ].ubFactionAffiliation > NON_CIV_GROUP)
{
if ( MercPtrs[ ubNoiseMaker ]->ubBodyType == BLOODCAT && MercPtrs[ ubNoiseMaker ]->bTeam == CREATURE_TEAM && pSoldier->bSide != gbPlayerNum)
{
+1 -6
View File
@@ -26,9 +26,7 @@
#include "Vehicles.h" // added by silversurfer
#endif
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
//////////////////////////////////////////////////////////////////////////////
// SANDRO - In this file, all APBPConstants[AP_CROUCH] and APBPConstants[AP_PRONE] were changed to GetAPsCrouch() and GetAPsProne()
@@ -2294,11 +2292,8 @@ INT8 CalcMorale(SOLDIERTYPE *pSoldier)
bMoraleCategory = MORALE_WORRIED;
// SANDRO - on Insane difficulty enemy morale cannot go below worried
#ifdef DIFFICULTY_SETTING
if (bMoraleCategory == MORALE_HOPELESS && zDeffSetting[gGameOptions.ubDifficultyLevel].bEnemyMoraleWorried == TRUE )
#else
if (bMoraleCategory == MORALE_HOPELESS && gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
#endif
//if (bMoraleCategory == MORALE_HOPELESS && gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
bMoraleCategory = MORALE_WORRIED;
#ifdef DEBUGDECISIONS
+1 -6
View File
@@ -39,9 +39,7 @@
#include "connect.h"
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
//forward declarations of common classes to eliminate includes
class OBJECTTYPE;
@@ -1954,11 +1952,8 @@ void CalculateLaunchItemBasicParams( SOLDIERTYPE *pSoldier, OBJECTTYPE *pItem, I
}
fGLauncher = TRUE;
sMinRange = MIN_MORTAR_RANGE/2;
#ifdef DIFFICULTY_SETTING
if ( (gGameSettings.fOptions[TOPTION_GL_HIGH_ANGLE] && pSoldier->bTeam == OUR_TEAM) || ( pSoldier->bTeam == ENEMY_TEAM && ( gGameOptions.ubDifficultyLevel == DIF_LEVEL_HARD || gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE ) ) )
#else
if ( (gGameSettings.fOptions[TOPTION_GL_HIGH_ANGLE] && pSoldier->bTeam == OUR_TEAM) || ( pSoldier->bTeam == ENEMY_TEAM && gGameOptions.ubDifficultyLevel >= DIF_LEVEL_HARD ) )
#endif
// if ( (gGameSettings.fOptions[TOPTION_GL_HIGH_ANGLE] && pSoldier->bTeam == OUR_TEAM) || ( pSoldier->bTeam == ENEMY_TEAM && gGameOptions.ubDifficultyLevel >= DIF_LEVEL_HARD ) )
dDegrees *= 2;
//fLauncher = TRUE;
}
-3
View File
@@ -10,8 +10,6 @@
#include "GameInitOptionsScreen.h"
#endif
#ifdef DIFFICULTY_SETTING
struct
{
PARSE_STAGE curElement;
@@ -593,4 +591,3 @@ BOOLEAN ReadInDifficultySettings( STR fileName, BOOLEAN localizedVersion)
return( TRUE );
}
#endif
-5
View File
@@ -11,11 +11,6 @@
// https://ja2svn.dyndns.org/source/ja2/trunk/Documents/1.13%20Modding/Modding%20Examples
#define ENABLE_BRIEFINGROOM
//----- Externalized difficulty settings to "TableData\DifficultySettings.xml" - by Jazz -----
// Once enabled here, the game reads up to 15 difficulty settings from the xml file
// INFO: Some INI Settings (ja2_options.ini, CTHConstants.ini and Creature_Settings.ini moved to the xml file)
#define DIFFICULTY_SETTING
// -----------------------------
// *****************************
// WANNE: Enable those 2 defines, if you want to build UB-Version!!
+1 -3
View File
@@ -73,9 +73,7 @@
#include "Ja25Update.h"
#endif
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
#include "ub_config.h" //legion2
#include "Campaign Types.h"
@@ -147,7 +145,7 @@ UINT8 ubNumTanks = 0;
ubNumTroops = 10 + Random( 5 );
ubNumElites = Random( 4 );
SetNumberJa25EnemiesInSector( SectorX, SectorY, Level, ubNumAdmins, ubNumTroops, ubNumElites, ubNumTanks );
break
break;
}
}
}