- New Feature: Now it is possible to compile a JA2 1.13 Demo executable with the actual 1.13 source code (by Jazz)

o This JA2 demo executable is as close as possible to the original JA2 demo, but with the 1.13 features!
--> No laptop, disabled strategy actions, auto merc hired, only P1 maps, ...
o To build the 1.13 executable, just enable the "JA113DEMO" define in builddefines.h
o The 1.13 demo executable will read from ja2_Demo.ini instead of ja2.ini
o You also need the "Data-JA2Demo" folder from the official 1.13 SVN GameDir: https://ja2svn.dyndns.org/source/ja2_v1.13_data/GameDir
o Once you start the game with the demo executable, you will notice the "START DEMO" instead of "START NEW GAME" in the main menu
o Multiplayer is disabled in the demo executable

- There is another new define called "JA113NODEMO" (by Jazz)
o See builddefines.h
o If this define is enabled, a special version of 1.13 is build
-> Disable all meanwhiles, emails, blocked quest with queen, alien queen


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5287 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2012-05-18 11:20:11 +00:00
parent 9a2896d72c
commit d23a94eefc
47 changed files with 385 additions and 97 deletions
+1 -1
View File
@@ -1991,7 +1991,7 @@ void RenderAutoResolve()
SetFactTrue( FACT_FIRST_BATTLE_WON );
}
SetTheFirstBattleSector( ( INT16 ) (gpAR->ubSectorX + gpAR->ubSectorY * MAP_WORLD_X ) );
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
//Ja25: no loyalty
#else
HandleFirstBattleEndingWhileInTown( gpAR->ubSectorX, gpAR->ubSectorY, 0, TRUE );
+1 -1
View File
@@ -642,7 +642,7 @@ void InitNewCampaign()
//InitKnowFacilitiesFlags( );
BuildUndergroundSectorInfoList();
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
// no UB
#else
if (!is_networked)
+2 -2
View File
@@ -298,7 +298,7 @@ void InitCreatureQuest()
fPlayMeanwhile = TRUE;
#endif
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
//Ja25 No meanwhiles && no creatures
#else
if( fPlayMeanwhile && !gfCreatureMeanwhileScenePlayed )
@@ -1561,7 +1561,7 @@ BOOLEAN LoadCreatureDirectives( HWFILE hFile, UINT32 uiSavedGameVersion )
if( gfClearCreatureQuest && giLairID != -1 )
{
giLairID = 0;
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
// no UB
#else
gfCreatureMeanwhileScenePlayed = FALSE;
+2 -2
View File
@@ -221,7 +221,7 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
// WANNE: This fixes the bug, that Speck did not sent the email on Day 3, when MERC_WEBSITE_ALL_MERCS_AVAILABLE = TRUE!
if ( gGameExternalOptions.fMercDayOne == FALSE /* && gGameExternalOptions.fAllMercsAvailable == FALSE */ )
{
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
//No JA25 UB
#else
AddEmail(MERC_INTRO, MERC_INTRO_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin( ), -1, -1 ,TYPE_EMAIL_EMAIL_EDT );
@@ -361,7 +361,7 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
// BeginAirRaid( );
// break;
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
// Ja25 No meanwhiles
#else
case EVENT_MEANWHILE:
+50 -2
View File
@@ -85,6 +85,12 @@
#include "Luaglobal.h"
#include "SaveLoadScreen.h"
#ifdef JA113DEMO
#include "Merc Contract.h"
#include "Soldier Add.h"
#include "Map Screen Interface Bottom.h"
#endif
#include "PostalService.h"
extern CPostalService gPostalService;
@@ -553,7 +559,7 @@ BOOLEAN InitNewGame( BOOLEAN fReset )
AutoSaveToSlot[4] = FALSE;
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
//Ja25 no meanwhiles
#else
// reset meanwhile flags
@@ -709,7 +715,7 @@ fFirstTimeInMapScreen = TRUE;
InitCustomStrategicLayer ( );
#endif
#else
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
#else
INT32 iStartingCash;
@@ -779,8 +785,30 @@ fFirstTimeInMapScreen = TRUE;
}
else
{
#ifdef JA113DEMO
//QuickSetupOfMercProfileItems( 0,4 ); //Vicki
//QuickGameMemberHireMerc( 4 );
//QuickSetupOfMercProfileItems( 0,7 ); // Ivan
//QuickGameMemberHireMerc( 7 );
//QuickSetupOfMercProfileItems( 0,10 ); // Shadow
//QuickGameMemberHireMerc( 10 );
//QuickSetupOfMercProfileItems( 0,33 ); //
//QuickGameMemberHireMerc( 33 );
//QuickSetupOfMercProfileItems( 0,42 ); //
//QuickGameMemberHireMerc( 42 );
SetLaptopExitScreen( MAP_SCREEN );
SetPendingNewScreen( MAP_SCREEN );
#else
SetLaptopExitScreen( INIT_SCREEN );
SetPendingNewScreen(LAPTOP_SCREEN);
#endif
}
gubScreenCount = 1;
@@ -803,6 +831,10 @@ fFirstTimeInMapScreen = TRUE;
//Set the fact the game is in progress
gTacticalStatus.fHasAGameBeenStarted = TRUE;
#ifdef JA113DEMO
RequestTriggerExitFromMapscreen( MAP_EXIT_TO_TACTICAL );
#endif
return( TRUE );
}
@@ -1012,6 +1044,10 @@ void QuickSetupOfMercProfileItems( UINT32 uiCount, UINT8 ubProfileIndex )
BOOLEAN QuickGameMemberHireMerc( UINT8 ubCurrentSoldier )
{
MERC_HIRE_STRUCT HireMercStruct;
#ifdef JA113DEMO
INT16 sSoldierID=0;
#endif
memset(&HireMercStruct, 0, sizeof(MERC_HIRE_STRUCT));
@@ -1024,7 +1060,11 @@ BOOLEAN QuickGameMemberHireMerc( UINT8 ubCurrentSoldier )
HireMercStruct.fCopyProfileItemsOver = TRUE;
HireMercStruct.ubInsertionCode = INSERTION_CODE_CHOPPER;
#ifdef JA113DEMO
HireMercStruct.iTotalContractLength = 61;
#else
HireMercStruct.iTotalContractLength = 7;
#endif
//specify when the merc should arrive
HireMercStruct.uiTimeTillMercArrives = 0;
@@ -1034,6 +1074,14 @@ BOOLEAN QuickGameMemberHireMerc( UINT8 ubCurrentSoldier )
{
return(FALSE);
}
#ifdef JA113DEMO
sSoldierID = GetSoldierIDFromMercID( ubCurrentSoldier );
if( sSoldierID == -1 )
return( FALSE );
Menptr[ sSoldierID ].bTypeOfLastContract = CONTRACT_EXTEND_1_WEEK;
#endif
//add an entry in the finacial page for the hiring of the merc
AddTransactionToPlayersBook(HIRED_MERC, ubCurrentSoldier, GetWorldTotalMin(), -(INT32) gMercProfiles[ubCurrentSoldier].uiWeeklySalary );
+3 -3
View File
@@ -37,7 +37,7 @@ void HourlyLarryUpdate( void );
extern INT32 GetCurrentBalance( void );
extern void PayOffSkyriderDebtIfAny( );
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
//no UB
#else
void HourlyCheckIfSlayAloneSoHeCanLeave();
@@ -95,7 +95,7 @@ CHAR16 zString[128];
HourlyQuestUpdate();
HourlyLarryUpdate();
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
// no UB
#else
HourlyCheckIfSlayAloneSoHeCanLeave();
@@ -440,7 +440,7 @@ void HourlyLarryUpdate( void )
}
}
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
// no JA25 UB
#else
void HourlyCheckIfSlayAloneSoHeCanLeave()
+71
View File
@@ -75,6 +75,8 @@ extern BOOLEAN gfDoneWithSplashScreen;
extern UINT32 iStringToUseLua;
extern INT8 Test;
static int l_HireMerc (lua_State *L);
//Briefing room
static int l_SetEndMission(lua_State *L);
static int l_SetStartMission(lua_State *L);
@@ -804,6 +806,8 @@ void IniGlobal_1(lua_State *L)
void IniFunction(lua_State *L)
{
lua_register(L, "HireMerc", l_HireMerc);
//Briefing room
lua_register(L, "SetEndMission", l_SetEndMission);
lua_register(L, "SetStartMission", l_SetStartMission);
@@ -11785,6 +11789,73 @@ static int l_VisibleTown (lua_State *L)
//---------------
static int l_HireMerc (lua_State *L)
{
MERC_HIRE_STRUCT HireMercStruct;
INT16 sSoldierID=0;
INT16 iTotalContract = 7;
UINT32 iTimeTillMercArrives = 0;
UINT8 n = lua_gettop(L);
int i = 0;
UINT8 ubCurrentSoldier = 0;
for (i= 1; i<=n; i++ )
{
if (i == 1 ) ubCurrentSoldier = lua_tointeger(L,i);
if (i == 2 ) iTotalContract = lua_tointeger(L,i);
if (i == 3 ) iTimeTillMercArrives = lua_tointeger(L,i);
}
if ( ubCurrentSoldier <= NUM_PROFILES && ubCurrentSoldier != -1 )
{
memset(&HireMercStruct, 0, sizeof(MERC_HIRE_STRUCT));
//HireMercStruct.bMercStatus = MERC_OK;
HireMercStruct.ubProfileID = ubCurrentSoldier;
HireMercStruct.sSectorX = gsMercArriveSectorX;
HireMercStruct.sSectorY = gsMercArriveSectorY;
HireMercStruct.fUseLandingZoneForArrival = TRUE;
HireMercStruct.fCopyProfileItemsOver = TRUE;
HireMercStruct.ubInsertionCode = INSERTION_CODE_CHOPPER;
HireMercStruct.iTotalContractLength = iTotalContract;
//specify when the merc should arrive
HireMercStruct.uiTimeTillMercArrives = iTimeTillMercArrives;
//if we succesfully hired the merc
if( !HireMerc( &HireMercStruct ) )
{
sSoldierID = GetSoldierIDFromMercID( ubCurrentSoldier );
if( sSoldierID > -1 )
Menptr[ sSoldierID ].bTypeOfLastContract = CONTRACT_EXTEND_1_WEEK;
gMercProfiles[ubCurrentSoldier].bMercStatus = MERC_OK;
//add an entry in the finacial page for the hiring of the merc
AddTransactionToPlayersBook(HIRED_MERC, ubCurrentSoldier, GetWorldTotalMin(), -(INT32) gMercProfiles[ubCurrentSoldier].uiWeeklySalary );
if( gMercProfiles[ ubCurrentSoldier ].bMedicalDeposit )
{
//add an entry in the finacial page for the medical deposit
AddTransactionToPlayersBook(MEDICAL_DEPOSIT, ubCurrentSoldier, GetWorldTotalMin(), -(gMercProfiles[ubCurrentSoldier].sMedicalDepositAmount) );
}
//add an entry in the history page for the hiring of the merc
AddHistoryToPlayersLog( HISTORY_HIRED_MERC_FROM_AIM, ubCurrentSoldier, GetWorldTotalMin(), -1, -1 );
}
}
return 0;
}
static int lh_getBooleanFromTable(lua_State *L, const char * fieldname)
{
lua_getfield(L, -1, fieldname);
+1 -1
View File
@@ -678,7 +678,7 @@ void LandHelicopter( void )
}
else
{
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
Assert( 0 );
//No meanwhiles
#else
+12
View File
@@ -545,6 +545,18 @@ BOOLEAN CreateButtonsForMapBorder( void )
}
#endif
#ifdef JA113DEMO
DisableButton( giMapBorderButtons[ MAP_BORDER_TOWN_BTN ]);
DisableButton( giMapBorderButtons[ MAP_BORDER_MINE_BTN ]);
DisableButton( giMapBorderButtons[ MAP_BORDER_TEAMS_BTN ]);
DisableButton( giMapBorderButtons[ MAP_BORDER_MILITIA_BTN ]);
DisableButton( giMapBorderButtons[ MAP_BORDER_AIRSPACE_BTN ]);
DisableButton( giMapBorderButtons[ MAP_BORDER_ITEM_BTN ]);
DisableButton( giMapBorderButtons[ MAP_BORDER_MOBILE_BTN ]);
fShowTownFlag = FALSE;
#endif
InitializeMapBorderButtonStates( );
return( TRUE );
+7 -2
View File
@@ -380,6 +380,11 @@ void RenderMapScreenInterfaceBottom( BOOLEAN fForceMapscreenFullRender )
EnableDisableBottomButtonsAndRegions( );
fMapBottomDirtied = FALSE;
#ifdef JA113DEMO
DisableButton (guiMapBottomExitButtons[MAP_EXIT_TO_LAPTOP]);
#endif
return;
}
@@ -1321,7 +1326,7 @@ BOOLEAN AllowedToTimeCompress( void )
return( FALSE );
}
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
//Ja25 no meanwhiles
#else
// meanwhile coming up
@@ -1800,7 +1805,7 @@ BOOLEAN AllowedToExitFromMapscreenTo( INT8 bExitToWhere )
return( FALSE );
}
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
//Ja25 No meanwhiles
#else
// meanwhile coming up
+1 -2
View File
@@ -5614,12 +5614,11 @@ BOOLEAN HandleTimeCompressWithTeamJackedInAndGearedToGo( void )
FadeInGameScreen( );
SetUpShutDownMapScreenHelpTextScreenMask( );
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
//no ja25 UB
#else
// Add e-mail message
AddEmail(ENRICO_CONGRATS,ENRICO_CONGRATS_LENGTH,MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
#endif
return( TRUE );
+5 -5
View File
@@ -180,7 +180,7 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B
INT8 bTownId = 0;
UINT8 ubSectorID;
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
//Ja25: No meanwhiles
#else
if( AreInMeanwhile( ) )
@@ -267,7 +267,7 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B
{
HandleMoraleEvent( NULL, MORALE_TOWN_LIBERATED, sMapX, sMapY, bMapZ );
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
//Ja25: no loyalty
#else
HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_GAIN_TOWN_SECTOR, sMapX, sMapY, bMapZ );
@@ -284,7 +284,7 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B
if ( GetTotalLeftInMine( GetMineIndexForSector( sMapX, sMapY ) ) > 0)
{
HandleMoraleEvent( NULL, MORALE_MINE_LIBERATED, sMapX, sMapY, bMapZ );
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
// Ja25: no loyalty
#else
HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_GAIN_MINE, sMapX, sMapY, bMapZ );
@@ -306,7 +306,7 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B
}
HandleMoraleEvent( NULL, MORALE_SAM_SITE_LIBERATED, sMapX, sMapY, bMapZ );
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
// Ja25: no loyalty
#else
HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_GAIN_SAM, sMapX, sMapY, bMapZ );
@@ -343,7 +343,7 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B
if ( bMapZ == 0 && ( ( sMapY == MAP_ROW_M && (sMapX >= 2 && sMapX <= 6) ) || sMapY == MAP_ROW_N && sMapX == 6) )
{
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
//Ja25 No meanwhiles
#else
HandleOutskirtsOfMedunaMeanwhileScene();
+1 -1
View File
@@ -1982,7 +1982,7 @@ void BeginCaptureSquence( )
void EndCaptureSequence( )
{
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
// no UB
#else
+1 -1
View File
@@ -816,7 +816,7 @@ void HandleNPCSystemEvent( UINT32 uiEvent )
break;
case NPC_ACTION_SEND_ENRICO_MIGUEL_EMAIL:
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
// no UB
#else
AddEmail( ENRICO_MIGUEL, ENRICO_MIGUEL_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1 , TYPE_EMAIL_EMAIL_EDT);
+2 -2
View File
@@ -1715,7 +1715,7 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
if( fExceptionQueue || fCheckForBattle && gTacticalStatus.fEnemyInSector &&
FindMovementGroupInSector( (UINT8)gWorldSectorX, (UINT8)gWorldSectorY, TRUE ) &&
(pGroup->ubNextX != gWorldSectorX || pGroup->ubNextY != gWorldSectorY || gbWorldSectorZ > 0 ) ||
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
//Ja25: NO meanwhiles
#else
AreInMeanwhile() ||
@@ -1729,7 +1729,7 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
//QUEUE BATTLE!
//Delay arrival by a random value ranging from 3-5 minutes, so it doesn't get the player
//too suspicious after it happens to him a few times, which, by the way, is a rare occurrence.
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
/*Ja25: No meanwhiles*/
#else
if( AreInMeanwhile() )
+1 -1
View File
@@ -208,7 +208,7 @@ void HandleEnricoEmail(void)
UINT8 ubCurrentProgress = CurrentPlayerProgressPercentage();
UINT8 ubHighestProgress = HighestPlayerProgressPercentage();
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
//JA25 UB
#else
// if creatures have attacked a mine (doesn't care if they're still there or not at the moment)
+2 -2
View File
@@ -1840,7 +1840,7 @@ void CheckIfEntireTownHasBeenLiberated( INT8 bTownId, INT16 sSectorX, INT16 sSec
// set fact is has been lib'ed and set history event
AddHistoryToPlayersLog( HISTORY_LIBERATED_TOWN, bTownId, GetWorldTotalMin(), sSectorX, sSectorY );
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
//Ja25: No meanhwiles
#else
HandleMeanWhileEventPostingForTownLiberation( bTownId );
@@ -1875,7 +1875,7 @@ void CheckIfEntireTownHasBeenLost( INT8 bTownId, INT16 sSectorX, INT16 sSectorY
if ( MilitiaTrainingAllowedInSector( sSectorX, sSectorY, 0 ) && IsTownUnderCompleteControlByEnemy(bTownId) )
{
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
//Ja25 No meanwhile
#else
// the whole town is under enemy control, check if we libed this town before
+1 -1
View File
@@ -5790,7 +5790,7 @@ UINT32 MapScreenHandle(void)
RenderKeyRingPopup( FALSE );
}
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
/* UB */
#else
CheckForMeanwhileOKStart( );
+6 -6
View File
@@ -1483,7 +1483,7 @@ void BeginLoadScreen( void )
SetCurrentCursorFromDatabase( VIDEO_NO_CURSOR );
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
if( guiCurrentScreen == MAP_SCREEN && !(gTacticalStatus.uiFlags & LOADING_SAVED_GAME) )
#else
//Ja25: No meanwhiles
@@ -1903,7 +1903,7 @@ void GetMapFileName(INT16 sMapX,INT16 sMapY, INT8 bSectorZ, STR8 bString, BOOLEA
}
}
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
/* Ja25: No meanwhiles */
#else
// If we are in a meanwhile...
@@ -2386,7 +2386,7 @@ void PrepareLoadedSector()
BOOLEAN fEnemyPresenceInThisSector = FALSE;
BOOLEAN fAddCivs = TRUE;
INT8 bMineIndex = -1;
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
//Ja25 No meanwhiles
#else
if( AreInMeanwhile( ) == FALSE )
@@ -2415,7 +2415,7 @@ void PrepareLoadedSector()
if( !(gTacticalStatus.uiFlags & LOADING_SAVED_GAME ))
{
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
//Ja25 No meanwhiles
#else
if ( !AreReloadingFromMeanwhile( ) )
@@ -2540,7 +2540,7 @@ void PrepareLoadedSector()
{
AddProfilesNotUsingProfileInsertionData();
}
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
//Ja25 No meanwhiles
#else
if( !AreInMeanwhile() || GetMeanwhileID() == INTERROGATION )
@@ -2918,7 +2918,7 @@ BOOLEAN EnterSector( INT16 sSectorX, INT16 sSectorY , INT8 bSectorZ )
memset( &(gTacticalStatus.bNumFoughtInBattle), 0, MAXTEAMS );
}
#ifdef JA2UB
#if (defined JA2UB || defined JA113NODEMO)
//Ja25 No meanwhiles
#else
if( AreInMeanwhile() == FALSE )