mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
New Feature: Added up to 15 game difficulty settings (by Jazz)
- Externalized the difficulty setings to "TableData\DifficultySettings.xml" file - Some INI Settings (ja2_options.ini, CTHConstants.ini and Creature_Settings.ini) moved from INI file to this xml file - see #define DIFFICULTY_SETTING git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7447 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -56,6 +56,10 @@
|
||||
#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
|
||||
#define DIFF_FACTOR_PALACE_DISTANCE 30
|
||||
@@ -2214,6 +2218,12 @@ 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
|
||||
}
|
||||
|
||||
|
||||
@@ -2472,7 +2482,26 @@ void CreateDetailedPlacementGivenBasicPlacementInfo( SOLDIERCREATE_STRUCT *pp, B
|
||||
UINT8 PlacementType = gBloodcatPlacements[ SECTOR(gWorldSectorX, gWorldSectorY) ][0].PlacementType;
|
||||
if( PlacementType == BLOODCAT_PLACEMENT_LAIR )
|
||||
{
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
UINT8 DiffLevel;
|
||||
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
|
||||
DiffLevel = 1;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_MEDIUM )
|
||||
DiffLevel = 2;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_HARD )
|
||||
DiffLevel = 3;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
|
||||
DiffLevel = 4;
|
||||
else
|
||||
{
|
||||
DiffLevel = Random (4);
|
||||
if (DiffLevel == 0) DiffLevel = 1;
|
||||
}
|
||||
pp->bExpLevel += DiffLevel;
|
||||
#else
|
||||
pp->bExpLevel += gGameOptions.ubDifficultyLevel;
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2498,9 +2527,26 @@ void CreateDetailedPlacementGivenBasicPlacementInfo( SOLDIERCREATE_STRUCT *pp, B
|
||||
pp->bExpLevel = min( 10, pp->bExpLevel ); //maximum exp. level of 9 // 10 - Madd
|
||||
|
||||
ubStatsLevel = pp->bExpLevel + bStatsModifier;
|
||||
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
UINT8 DiffLevel;
|
||||
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
|
||||
DiffLevel = 1;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_MEDIUM )
|
||||
DiffLevel = 2;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_HARD )
|
||||
DiffLevel = 3;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
|
||||
DiffLevel = 4;
|
||||
else
|
||||
{
|
||||
DiffLevel = Random (4);
|
||||
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
|
||||
if ( gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
|
||||
ubStatsLevel = max( 6, ubStatsLevel ); //minimum stats level of 6 in insane
|
||||
|
||||
|
||||
Reference in New Issue
Block a user