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:
Wanne
2014-08-28 10:30:40 +00:00
parent 6b728e56ac
commit 344797f6af
47 changed files with 1976 additions and 49 deletions
+46
View File
@@ -45,6 +45,10 @@
#include "Music Control.h"
#include "NPC.h"
#ifdef DIFFICULTY_SETTING
#include "GameInitOptionsScreen.h"
#endif
#ifdef JA2UB
#include "Ja25 Strategic Ai.h"
#include "Ja25_Tactical.h"
@@ -81,6 +85,8 @@ extern INT8 Test;
static int l_HireMerc (lua_State *L);
static int l_SetStartingCashDifLevel (lua_State *L);
//Briefing room
static int l_SetEndMission(lua_State *L);
static int l_SetStartMission(lua_State *L);
@@ -932,6 +938,8 @@ void IniFunction(lua_State *L, BOOLEAN bQuests )
{
lua_register(L, "HireMerc", l_HireMerc);
lua_register(L, "SetStartingCashDifLevel", l_SetStartingCashDifLevel);
lua_register(L, "SetLaptopBroken", l_SetLaptopBroken);
//------Briefing Room------
@@ -12951,3 +12959,41 @@ BOOLEAN LoadLuaGlobalFromLoadGameFile( HWFILE hFile )
return( TRUE );
}
//--------------------------------------------------------------
static int l_SetStartingCashDifLevel (lua_State *L)
{
if ( lua_gettop(L) >= 1 )
{
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:
iStartingCash = gGameExternalOptions.iStartingCashNovice;
break;
case DIF_LEVEL_MEDIUM:
iStartingCash = gGameExternalOptions.iStartingCashExperienced;
break;
case DIF_LEVEL_HARD:
iStartingCash = gGameExternalOptions.iStartingCashExpert;
break;
case DIF_LEVEL_INSANE:
iStartingCash = gGameExternalOptions.iStartingCashInsane;
break;
default:
iStartingCash = 4500;
}
AddTransactionToPlayersBook( ANONYMOUS_DEPOSIT, 0, GetWorldTotalMin(), iStartingCash );
#endif
}
return 0;
}