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