- Fixed Tixa problem: When playing Realistic you could go down to underground level where crepitus are

o When loading such a buggy savegame, we will fix it automatically

- Simplified (reworked) IF-conditions with crepitus

- new define in luaglobal.h: LUA_GAME_INIT_NEW_GAME, LUA_GAME_INIT_NPCS.
o So we can select if we want to use lua script (GameInit.lua) or the hardcoded JA2 stuff

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4475 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2011-06-06 19:04:56 +00:00
parent bfbe6b0311
commit 75b4d43964
9 changed files with 117 additions and 17 deletions
+13
View File
@@ -965,9 +965,15 @@ void CreatureAttackTown( UINT8 ubSectorID, BOOLEAN fOverrideTest )
//Called by campaign init.
void ChooseCreatureQuestStartDay()
{
if (gGameOptions.ubGameStyle == STYLE_REALISTIC || !gGameExternalOptions.fEnableCrepitus)
return;
/*
// INT32 iRandom, iDay;
if( !(gGameOptions.ubGameStyle == STYLE_SCIFI) || !gGameExternalOptions.fEnableCrepitus)
return; //only available in science fiction mode.
*/
//Post the event. Once it becomes due, it will setup the queen monster's location, and
//begin spreading and attacking towns from there.
switch( gGameOptions.ubDifficultyLevel )
@@ -1435,8 +1441,15 @@ void CheckConditionsForTriggeringCreatureQuest( INT16 sSectorX, INT16 sSectorY,
// move to Scripts/StrategicTownLoyalty.lua
UINT8 ubValidMines = 0;
if (gGameOptions.ubGameStyle == STYLE_REALISTIC || !gGameExternalOptions.fEnableCrepitus)
return;
/*
if( !(gGameOptions.ubGameStyle == STYLE_SCIFI) || !gGameExternalOptions.fEnableCrepitus)
return; //No scifi, no creatures...
*/
if( giLairID )
return; //Creature quest already begun
+60 -8
View File
@@ -76,6 +76,7 @@
#include "aim.h"
#include "LuaInitNPCs.h"
#include "Luaglobal.h"
class OBJECTTYPE;
class SOLDIERTYPE;
@@ -94,9 +95,10 @@ UINT8 gubScreenCount=0;
void InitNPCs( void )
{
#ifdef LUA_GAME_INIT_NPCS
LetLuaGameInit(1);
#if 0
#else
MERCPROFILESTRUCT * pProfile;
@@ -139,7 +141,6 @@ void InitNPCs( void )
pProfile->bSectorZ = 0;
}
#ifdef JA2TESTVERSION
ScreenMsg( MSG_FONT_RED, MSG_DEBUG, L"Skyrider in %c %d", 'A' + pProfile->sSectorY - 1, pProfile->sSectorX );
#endif
@@ -147,7 +148,6 @@ void InitNPCs( void )
// use alternate map, with Skyrider's shack, in this sector
SectorInfo[ SECTOR( pProfile->sSectorX, pProfile->sSectorY ) ].uiFlags |= SF_USE_ALTERNATE_MAP;
// set up Madlab's secret lab (he'll be added when the meanwhile scene occurs)
if (!is_networked)
@@ -228,7 +228,7 @@ void InitNPCs( void )
gfPlayerTeamSawJoey = FALSE;
if ( gGameOptions.ubGameStyle == STYLE_SCIFI && gGameExternalOptions.fEnableCrepitus )
if ( gGameOptions.ubGameStyle == STYLE_SCIFI && gGameExternalOptions.fEnableCrepitus )
{
// add Bob
pProfile = &(gMercProfiles[BOB]);
@@ -623,9 +623,61 @@ BOOLEAN InitNewGame( BOOLEAN fReset )
// this is for the "mercs climbing down from a rope" animation, NOT Skyrider!!
ResetHeliSeats( );
LetLuaGameInit(0);
#ifdef LUA_GAME_INIT_NEW_GAME
LetLuaGameInit(0);
#else
INT32 iStartingCash;
// Setup two new messages!
AddPreReadEmail(OLD_ENRICO_1,OLD_ENRICO_1_LENGTH,MAIL_ENRICO, GetWorldTotalMin() );
AddPreReadEmail(OLD_ENRICO_2,OLD_ENRICO_2_LENGTH,MAIL_ENRICO, GetWorldTotalMin() );
AddPreReadEmail(RIS_REPORT,RIS_REPORT_LENGTH,RIS_EMAIL, GetWorldTotalMin() );
AddPreReadEmail(OLD_ENRICO_3,OLD_ENRICO_3_LENGTH,MAIL_ENRICO, GetWorldTotalMin() );
AddEmail(IMP_EMAIL_INTRO,IMP_EMAIL_INTRO_LENGTH,CHAR_PROFILE_SITE, GetWorldTotalMin(), -1, -1);
//AddEmail(ENRICO_CONGRATS,ENRICO_CONGRATS_LENGTH,MAIL_ENRICO, GetWorldTotalMin() );
if(gGameExternalOptions.fMercDayOne)
{
AddEmail(MERC_INTRO, MERC_INTRO_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin( ), -1, 1 );
}
// ATE: Set starting cash....
switch( gGameOptions.ubDifficultyLevel )
{
case DIF_LEVEL_EASY:
iStartingCash = gGameExternalOptions.iStartingCashNovice;
//iStartingCash = 45000;
break;
case DIF_LEVEL_MEDIUM:
iStartingCash = gGameExternalOptions.iStartingCashExperienced;
//iStartingCash = 35000;
break;
case DIF_LEVEL_HARD:
iStartingCash = gGameExternalOptions.iStartingCashExpert;
//iStartingCash = 30000;
break;
case DIF_LEVEL_INSANE:
iStartingCash = gGameExternalOptions.iStartingCashInsane;
// iStartingCash = 15000;
break;
default:
Assert(0);
return( FALSE );
}
// Setup initial money
AddTransactionToPlayersBook( ANONYMOUS_DEPOSIT, 0, GetWorldTotalMin(), iStartingCash );
#endif
UINT32 uiDaysTimeMercSiteAvailable = Random( 2 ) + 1;
// schedule email for message from spec at 7am 3 days in the future
+2
View File
@@ -11,6 +11,8 @@ extern "C" {
// --------------------------
// WANNE: Should we enable lua scripting for different actions, or should we use "hardcoded" stuff instead?
#define LUA_GAME_INIT_NEW_GAME // GameInit.lua (Function: InitNewGame)
#define LUA_GAME_INIT_NPCS // GameInit.lua (Function: InitNPCs)
#define LUA_INTRO // Intro.lua
#define LUA_HOURLY_QUEST_UPDATE // HourlyUpdate.lua
#define LUA_STRATEGY_EVENT_HANDLER // StrategicEventHandler.lua
+5
View File
@@ -1782,11 +1782,16 @@ void HandleRPCDescriptionOfSector( INT16 sSectorX, INT16 sSectorY, INT16 sSector
{
if ( sSectorX == ubSectorDescription[ cnt ][ 1 ] && sSectorY == ubSectorDescription[ cnt ][ 0 ] )
{
if ((gGameOptions.ubGameStyle == STYLE_REALISTIC || !gGameExternalOptions.fEnableCrepitus) && cnt == 3)
continue;
/*
// If we're not scifi, skip some
if ( !(gGameOptions.ubGameStyle == STYLE_SCIFI && gGameExternalOptions.fEnableCrepitus) && cnt == 3 )
{
continue;
}
*/
SetSectorFlag( sSectorX, sSectorY, ( UINT8 )sSectorZ, SF_HAVE_USED_GUIDE_QUOTE );