mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +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:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user