Removed option AI_DECISION_INFO.

Added quest debug logging to Logs\QuestInfo.txt

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9177 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2021-10-14 08:35:32 +00:00
parent 9f787dd73d
commit 0a717c2697
13 changed files with 107 additions and 12 deletions
+2 -2
View File
@@ -538,6 +538,8 @@ void ShutdownStrategicLayer()
ClearTacticalMessageQueue();
}
extern void DebugQuestInfo(STR szOutput);
BOOLEAN InitNewGame( BOOLEAN fReset )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"InitNewGame");
@@ -833,8 +835,6 @@ fFirstTimeInMapScreen = TRUE;
return( TRUE );
}
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"InitNewGame done");
return( TRUE );
}
+12 -1
View File
@@ -3584,8 +3584,11 @@ static int l_gubBoxerID(lua_State *L)
UINT8 val = lua_tointeger( L, 1 );
UINT8 val2 = lua_tointeger( L, 2 );
if ( val <= 2 )
if (val <= 2)
{
gubBoxerID[val] = val2;
DebugQuestInfo(String("Lua: set gubBoxerID[%d] %d", val, gubBoxerID[val]));
}
}
return 0;
@@ -8195,6 +8198,7 @@ static int l_SetgfBoxerFought (lua_State *L)
BOOLEAN Bool = lua_toboolean( L, 2 );
gfBoxerFought[id] = Bool;
DebugQuestInfo(String("lua: set gfBoxerFought[%d] %d ", id, Bool));
}
return 0;
@@ -8203,7 +8207,10 @@ static int l_SetgfBoxerFought (lua_State *L)
static int l_SetgfBoxersResting(lua_State *L)
{
if (lua_gettop(L))
{
gfBoxersResting = lua_toboolean(L, 1);
DebugQuestInfo(String("lua: set gfBoxersResting %d", gfBoxersResting));
}
return 0;
}
@@ -8211,7 +8218,10 @@ static int l_SetgfBoxersResting(lua_State *L)
static int l_SetgubBoxersRests(lua_State *L)
{
if (lua_gettop(L))
{
gubBoxersRests = lua_tointeger(L, 1);
DebugQuestInfo(String("lua: set gubBoxersRests %d ", gubBoxersRests));
}
return 0;
}
@@ -10605,6 +10615,7 @@ static int l_ResetBoxers( lua_State *L )
gubBoxerID[i] = NOBODY;
// sevenfm: keep gfBoxerFought[] unchanged as it will be reset every day at 16:00 by HourlyQuestUpdate(), HourlyUpdate.lua
//gfBoxerFought[i] = FALSE;
DebugQuestInfo(String("Lua: reset boxer gubBoxerID[%d] %d", i, gubBoxerID[i]));
}
return 0;
+10 -1
View File
@@ -70,17 +70,19 @@ extern void GuaranteeAtLeastXItemsOfIndex( UINT8 ubArmsDealer, UINT16 usItemInde
extern void GiveQuestRewardPoint( INT16 sQuestSectorX, INT16 sQuestsSectorY, INT8 bExpReward, UINT8 bException );
extern void DebugQuestInfo(STR szOutput);
void SetFactTrue( UINT16 usFact )
{
// This function is here just for control flow purposes (debug breakpoints)
// and code is more readable that way
// must intercept when Jake is first trigered to start selling fuel
// must intercept when Jake is first triggered to start selling fuel
if ( ( usFact == FACT_ESTONI_REFUELLING_POSSIBLE ) && ( CheckFact( usFact, 0 ) == FALSE ) )
{
// give him some gas...
GuaranteeAtLeastXItemsOfIndex( ARMS_DEALER_JAKE, GAS_CAN, ( UINT8 ) ( 4 + Random( 3 ) ) );
DebugQuestInfo(String("guarantee X items of %d (GAS_CAN) for dealer %d (ARMS_DEALER_JAKE)", GAS_CAN, ARMS_DEALER_JAKE));
}
gubFact[usFact] = TRUE;
@@ -89,6 +91,7 @@ void SetFactTrue( UINT16 usFact )
void SetFactFalse( UINT16 usFact )
{
gubFact[usFact] = FALSE;
DebugQuestInfo(String("fact %d false", usFact));
}
BOOLEAN CheckForNewShipment( void )
@@ -1381,6 +1384,7 @@ UINT8 GetFact( UINT16 usFact )
void StartQuest( UINT8 ubQuest, INT16 sSectorX, INT16 sSectorY )
{
DebugQuestInfo(String("start quest %d sector %d %d", ubQuest, sSectorX, sSectorY));
InternalStartQuest( ubQuest, sSectorX, sSectorY, TRUE );
}
@@ -1409,6 +1413,7 @@ void InternalStartQuest( UINT8 ubQuest, INT16 sSectorX, INT16 sSectorY, BOOLEAN
void EndQuest( UINT8 ubQuest, INT16 sSectorX, INT16 sSectorY )
{
DebugQuestInfo(String("end quest %d sector %d %d", ubQuest, sSectorX, sSectorY));
InternalEndQuest( ubQuest, sSectorX, sSectorY, TRUE );
}
@@ -1565,6 +1570,8 @@ void InitQuestEngine()
memset(gubQuest, 0, sizeof(gubQuest));
memset(gubFact, 0, sizeof(gubFact));
DebugQuestInfo(String("\nInit Quest Engine"));
// semi-hack to make the letter quest start right away
CheckForQuests( 1 );
@@ -1583,6 +1590,8 @@ void InitQuestEngine()
gfBoxersResting = FALSE;
InitLUAModderData( );
DebugQuestInfo(String("reset gubBoxersRests 0, gubBoxingMatchesWon 0, gfBoxersResting FALSE gubCambriaMedicalObjects %d", gubCambriaMedicalObjects));
}
+3 -1
View File
@@ -3162,7 +3162,7 @@ BOOLEAN EnterSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ )
//Moa: removed this function and replaced by the handling function.
//SectorInventoryCooldownFunctions(sSectorX, sSectorY, bSectorZ);
//moved from SectorInventoryCooldownFunctions. Invisible items are handled as well.
//Since we have allready loaded the items previously we can use the globals here.
//Since we have already loaded the items previously we can use the globals here.
HandleSectorCooldownFunctions( sSectorX, sSectorY, (INT8)bSectorZ, gWorldItems, guiNumWorldItems, TRUE );
//Update LastTimePlayerWasInSector
SetLastTimePlayerWasInSector( );
@@ -3170,6 +3170,8 @@ BOOLEAN EnterSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ )
//Save to tempfile
SaveWorldItemsToTempItemFile( sSectorX, sSectorY, (INT8)bSectorZ, guiNumWorldItems, gWorldItems );
DebugQuestInfo(String("--- Enter Sector %s%s Level %d ---", pVertStrings[sSectorY], pHortStrings[sSectorX], bSectorZ));
return TRUE; //because the map was loaded.
}