Name all specials
This commit is contained in:
+5
-5
@@ -235,7 +235,7 @@ static void DoStandardWildBattle(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
FreezeObjectEvents();
|
||||
sub_805C780();
|
||||
StopPlayerAvatar();
|
||||
gMain.savedCallback = CB2_EndWildBattle;
|
||||
gBattleTypeFlags = 0;
|
||||
CreateBattleStartTask(GetWildBattleTransition(), 0);
|
||||
@@ -247,7 +247,7 @@ void StartRoamerBattle(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
FreezeObjectEvents();
|
||||
sub_805C780();
|
||||
StopPlayerAvatar();
|
||||
gMain.savedCallback = CB2_EndWildBattle;
|
||||
gBattleTypeFlags = BATTLE_TYPE_ROAMER;
|
||||
CreateBattleStartTask(GetWildBattleTransition(), MUS_VS_DEN);
|
||||
@@ -259,7 +259,7 @@ static void DoSafariBattle(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
FreezeObjectEvents();
|
||||
sub_805C780();
|
||||
StopPlayerAvatar();
|
||||
gMain.savedCallback = CB2_EndSafariBattle;
|
||||
gBattleTypeFlags = BATTLE_TYPE_SAFARI;
|
||||
CreateBattleStartTask(GetWildBattleTransition(), 0);
|
||||
@@ -269,7 +269,7 @@ static void DoGhostBattle(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
FreezeObjectEvents();
|
||||
sub_805C780();
|
||||
StopPlayerAvatar();
|
||||
gMain.savedCallback = CB2_EndWildBattle;
|
||||
gBattleTypeFlags = BATTLE_TYPE_GHOST;
|
||||
CreateBattleStartTask(GetWildBattleTransition(), 0);
|
||||
@@ -399,7 +399,7 @@ static void sub_807FB08(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
FreezeObjectEvents();
|
||||
sub_805C780();
|
||||
StopPlayerAvatar();
|
||||
gMain.savedCallback = sub_807FAF8;
|
||||
SavePlayerParty();
|
||||
InitPokedudePartyAndOpponent();
|
||||
|
||||
+3
-3
@@ -402,7 +402,7 @@ static void Task_Linkup_6a(u8 taskId)
|
||||
if (gSpecialVar_Result == 1)
|
||||
{
|
||||
// Dumb trick required to match
|
||||
if (gLinkType == LINKTYPE_0x4411)
|
||||
if (gLinkType == LINKTYPE_BERRY_BLENDER_SETUP)
|
||||
*UnusedVarNeededToMatch += 0;
|
||||
DestroyLinkPlayerCountDisplayWindow(gTasks[taskId].data[5]);
|
||||
EnableBothScriptContexts();
|
||||
@@ -493,9 +493,9 @@ void TryRecordMixLinkup(void)
|
||||
CreateLinkupTask(2, 4);
|
||||
}
|
||||
|
||||
void sub_8081128(void)
|
||||
void TryContestLinkup(void)
|
||||
{
|
||||
gLinkType = LINKTYPE_0x6601;
|
||||
gLinkType = LINKTYPE_CONTEST_GMODE;
|
||||
gBattleTypeFlags = 0;
|
||||
CreateLinkupTask(4, 4);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ bool8 sub_8069590(void)
|
||||
return FALSE;
|
||||
else
|
||||
{
|
||||
sub_805C780();
|
||||
StopPlayerAvatar();
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -65,7 +65,7 @@ bool8 sub_8069648(void)
|
||||
return FALSE;
|
||||
else
|
||||
{
|
||||
sub_805C780();
|
||||
StopPlayerAvatar();
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ void FieldInput_HandleCancelSignpost(struct FieldInput * input)
|
||||
{
|
||||
if (input->dpadDirection != 0 && GetPlayerFacingDirection() != input->dpadDirection)
|
||||
{
|
||||
if (sub_80699D4() == TRUE)
|
||||
if (IsMsgBoxWalkawayDisabled() == TRUE)
|
||||
return;
|
||||
if (input->dpadDirection == DIR_NORTH)
|
||||
RegisterQuestLogInput(QL_INPUT_UP);
|
||||
@@ -657,9 +657,9 @@ static bool8 TryStartStepCountScript(u16 metatileBehavior)
|
||||
|
||||
if (!(gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_FISHING) && !MetatileBehavior_IsForcedMovementTile(metatileBehavior))
|
||||
{
|
||||
if (sub_810C4EC() == TRUE)
|
||||
if (UpdateVsSeekerStepCounter() == TRUE)
|
||||
{
|
||||
ScriptContext1_SetupScript(gUnknown_81A8CED);
|
||||
ScriptContext1_SetupScript(EventScript_VsSeekerChargingDone);
|
||||
return TRUE;
|
||||
}
|
||||
else if (UpdatePoisonStepCounter() == TRUE)
|
||||
@@ -1086,7 +1086,7 @@ void sub_806DE70(u16 x, u16 y)
|
||||
{
|
||||
if (events[i].x + 7 == x && events[i].y + 7 == y)
|
||||
{
|
||||
sub_8112364();
|
||||
QuestLog_OnInteractionWithSpecialNpc();
|
||||
ScriptContext1_SetupScript(events[i].script);
|
||||
ScriptContext2_Enable();
|
||||
}
|
||||
|
||||
@@ -1114,7 +1114,7 @@ void sub_805C774(void)
|
||||
ForcedMovement_None();
|
||||
}
|
||||
|
||||
void sub_805C780(void)
|
||||
void StopPlayerAvatar(void)
|
||||
{
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
|
||||
@@ -1596,7 +1596,7 @@ void CreateStopSurfingTask_NoMusicChange(u8 direction)
|
||||
Task_StopSurfingInit(taskId);
|
||||
}
|
||||
|
||||
void sub_805D1A8(void)
|
||||
void SeafoamIslandsB4F_CurrentDumpsPlayerOnLand(void)
|
||||
{
|
||||
if (gUnknown_3005E88 != 1 && gUnknown_3005E88 != 3)
|
||||
{
|
||||
|
||||
@@ -95,7 +95,7 @@ static u8 *const sStringVarPtrs[] = {
|
||||
|
||||
void ShowDiploma(void)
|
||||
{
|
||||
sub_8112364();
|
||||
QuestLog_OnInteractionWithSpecialNpc();
|
||||
SetMainCallback2(CB2_ShowDiploma);
|
||||
ScriptContext2_Enable();
|
||||
}
|
||||
@@ -187,7 +187,7 @@ u8 GetLeadMonFriendship(void)
|
||||
|
||||
void ShowTownMap(void)
|
||||
{
|
||||
sub_8112364();
|
||||
QuestLog_OnInteractionWithSpecialNpc();
|
||||
sub_80BFF50(1, CB2_ReturnToFieldContinueScriptPlayMapMusic);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2036,7 +2036,7 @@ bool8 UseRegisteredKeyItemOnField(void)
|
||||
ScriptContext2_Enable();
|
||||
FreezeObjectEvents();
|
||||
sub_805C270();
|
||||
sub_805C780();
|
||||
StopPlayerAvatar();
|
||||
gSpecialVar_ItemId = gSaveBlock1Ptr->registeredItem;
|
||||
taskId = CreateTask(ItemId_GetFieldFunc(gSaveBlock1Ptr->registeredItem), 8);
|
||||
gTasks[taskId].data[3] = 1;
|
||||
|
||||
+1
-1
@@ -1555,7 +1555,7 @@ void CB2_WhiteOut(void)
|
||||
gFieldCallback = FieldCB_RushInjuredPokemonToCenter;
|
||||
val = 0;
|
||||
do_load_map_stuff_loop(&val);
|
||||
sub_8112364();
|
||||
QuestLog_OnInteractionWithSpecialNpc();
|
||||
SetFieldVBlankCallback();
|
||||
SetMainCallback1(CB1_Overworld);
|
||||
SetMainCallback2(CB2_Overworld);
|
||||
|
||||
+55
-55
@@ -106,7 +106,7 @@ EWRAM_DATA u8 gQuestLogState = 0;
|
||||
static EWRAM_DATA u16 gUnknown_203ADFC = 0;
|
||||
static EWRAM_DATA u8 sQuestLogHeaderWindowIds[3] = {0};
|
||||
static EWRAM_DATA u16 *gUnknown_203AE04 = NULL;
|
||||
static EWRAM_DATA u16 *gUnknown_203AE08 = NULL;
|
||||
static EWRAM_DATA u16 *sEventRecordingPointer = NULL;
|
||||
static EWRAM_DATA u16 *gUnknown_203AE0C[32] = {NULL};
|
||||
static EWRAM_DATA void (* sQuestLogCB)(void) = NULL;
|
||||
static EWRAM_DATA u16 *gUnknown_203AE90 = NULL;
|
||||
@@ -129,7 +129,7 @@ static void sub_8110A00(void);
|
||||
static void sub_8110A3C(void);
|
||||
static void SetPlayerInitialCoordsAtScene(u8);
|
||||
static void SetNPCInitialCoordsAtScene(u8);
|
||||
static void sub_8110E3C(void);
|
||||
static void TryRecordEvent39_GoToNextScene(void);
|
||||
static void BackUpTrainerRematchesToVars(void);
|
||||
static void BackUpMapLayoutToVar(void);
|
||||
static void SetGameStateAtScene(u8);
|
||||
@@ -182,7 +182,7 @@ static bool8 sub_81137E4(u16, const u16 *);
|
||||
static u16 *sub_8113828(u16, const u16 *);
|
||||
static bool8 TrySetLinkQuestLogEvent(u16, const u16 *);
|
||||
static bool8 TrySetTrainerBattleQuestLogEvent(u16, const u16 *);
|
||||
static void sub_8113A1C(u16);
|
||||
static void TryRecordEvent41_IncCursor(u16);
|
||||
static void sub_811381C(void);
|
||||
static bool8 IsQuestLogEventWithSpecialEncounterSpecies(u16, const u16 *);
|
||||
static u16 *QuestLog_SkipCommand(u16 *, u16 **);
|
||||
@@ -192,9 +192,9 @@ static bool8 sub_8113B44(const u16 *);
|
||||
static void sub_8113B88(void);
|
||||
static void sub_8113B94(u16);
|
||||
static void sub_8113BD8(void);
|
||||
static u16 *sub_8113BF4(u16 *);
|
||||
static u16 *TryRecordEvent39_NoParams(u16 *);
|
||||
static u16 *sub_8113C20(u16 *, struct QuestLogEntry *);
|
||||
static u16 *sub_8113C5C(u16 *, u16);
|
||||
static u16 *TryRecordEvent41(u16 *, u16);
|
||||
static u16 *sub_8113C8C(u16 *, struct QuestLogEntry *);
|
||||
static u16 *sub_8113CC8(u16 *, struct QuestLogEntry *);
|
||||
static u16 *sub_8113D08(u16 *, struct QuestLogEntry *);
|
||||
@@ -300,8 +300,8 @@ void sub_8110840(void * oldPointer)
|
||||
gUnknown_203AE04 = (void *)gUnknown_203AE04 + offset;
|
||||
if (gQuestLogState != 0)
|
||||
{
|
||||
if (gUnknown_203AE08)
|
||||
gUnknown_203AE08 = (void *)gUnknown_203AE08 + offset;
|
||||
if (sEventRecordingPointer)
|
||||
sEventRecordingPointer = (void *)sEventRecordingPointer + offset;
|
||||
if (gQuestLogState == QL_STATE_2)
|
||||
{
|
||||
int r3;
|
||||
@@ -318,7 +318,7 @@ void ResetQuestLog(void)
|
||||
sCurrentSceneNum = 0;
|
||||
gQuestLogState = 0;
|
||||
sQuestLogCB = NULL;
|
||||
gUnknown_203AE08 = NULL;
|
||||
sEventRecordingPointer = NULL;
|
||||
gUnknown_203AE04 = NULL;
|
||||
sub_8113BD8();
|
||||
sub_81138F8();
|
||||
@@ -351,12 +351,12 @@ bool8 sub_8110944(const void * a0, size_t cmdSize)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 sub_8110988(u16 *a0, size_t a1)
|
||||
static bool8 WillCommandOfSizeFitInSav1Record(u16 *cursor, size_t size)
|
||||
{
|
||||
void * r2 = gSaveBlock1Ptr->questLog[sCurrentSceneNum].unk_568;
|
||||
void * r0 = gSaveBlock1Ptr->questLog[sCurrentSceneNum].end;
|
||||
r0 -= a1;
|
||||
if ((void *)a0 < r2 || (void *)a0 > r0)
|
||||
void * start = gSaveBlock1Ptr->questLog[sCurrentSceneNum].unk_568;
|
||||
void * end = gSaveBlock1Ptr->questLog[sCurrentSceneNum].end;
|
||||
end -= size;
|
||||
if ((void *)cursor < start || (void *)cursor > end)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
@@ -375,7 +375,7 @@ static void sub_8110A00(void)
|
||||
if (TryRecordQuestLogEntrySequence(sQuestLogSceneRecordBuffer) != 1)
|
||||
{
|
||||
gUnknown_3005E88 = 0;
|
||||
sub_8110E3C();
|
||||
TryRecordEvent39_GoToNextScene();
|
||||
gQuestLogState = 0;
|
||||
sQuestLogCB = NULL;
|
||||
}
|
||||
@@ -416,7 +416,7 @@ static void StartRecordingQuestLogEntry(u16 eventId)
|
||||
|
||||
DestroySav1QuestLogEntry(sCurrentSceneNum);
|
||||
sub_8113B88();
|
||||
gUnknown_203AE08 = gSaveBlock1Ptr->questLog[sCurrentSceneNum].unk_568;
|
||||
sEventRecordingPointer = gSaveBlock1Ptr->questLog[sCurrentSceneNum].unk_568;
|
||||
if (IS_LINK_QL_EVENT(eventId) || eventId == QL_EVENT_DEPARTED)
|
||||
gSaveBlock1Ptr->questLog[sCurrentSceneNum].unk_000 = 2;
|
||||
else
|
||||
@@ -509,9 +509,9 @@ static void BackUpMapLayoutToVar(void)
|
||||
VarSet(VAR_QLBAK_MAP_LAYOUT, gSaveBlock1Ptr->mapLayoutId);
|
||||
}
|
||||
|
||||
static void sub_8110E3C(void)
|
||||
static void TryRecordEvent39_GoToNextScene(void)
|
||||
{
|
||||
sub_8113BF4(gUnknown_203AE08);
|
||||
TryRecordEvent39_NoParams(sEventRecordingPointer);
|
||||
if (++sCurrentSceneNum >= QUEST_LOG_SCENE_COUNT)
|
||||
sCurrentSceneNum = 0;
|
||||
}
|
||||
@@ -522,19 +522,19 @@ static bool8 TryRecordQuestLogEntrySequence(struct QuestLogEntry * entry)
|
||||
|
||||
for (i = gUnknown_203ADFC; i < sQuestLogCursor; i++)
|
||||
{
|
||||
if (gUnknown_203AE08 == NULL)
|
||||
if (sEventRecordingPointer == NULL)
|
||||
return FALSE;
|
||||
switch (entry[i].unk_6)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
gUnknown_203AE08 = sub_8113D48(gUnknown_203AE08, &entry[i]);
|
||||
sEventRecordingPointer = sub_8113D48(sEventRecordingPointer, &entry[i]);
|
||||
break;
|
||||
default:
|
||||
gUnknown_203AE08 = sub_8113CC8(gUnknown_203AE08, &entry[i]);
|
||||
sEventRecordingPointer = sub_8113CC8(sEventRecordingPointer, &entry[i]);
|
||||
break;
|
||||
}
|
||||
if (gUnknown_203AE08 == NULL)
|
||||
if (sEventRecordingPointer == NULL)
|
||||
{
|
||||
gUnknown_3005E88 = 0;
|
||||
return FALSE;
|
||||
@@ -543,7 +543,7 @@ static bool8 TryRecordQuestLogEntrySequence(struct QuestLogEntry * entry)
|
||||
|
||||
if (gUnknown_3005E88 == 0)
|
||||
{
|
||||
gUnknown_203AE08 = sub_8113BF4(gUnknown_203AE08);
|
||||
sEventRecordingPointer = TryRecordEvent39_NoParams(sEventRecordingPointer);
|
||||
return FALSE;
|
||||
}
|
||||
gUnknown_203ADFC = sQuestLogCursor;
|
||||
@@ -966,7 +966,7 @@ bool8 QuestLog_SchedulePlaybackCB(void (*callback)(void))
|
||||
switch (gQuestLogState)
|
||||
{
|
||||
case 1:
|
||||
sub_8112364();
|
||||
QuestLog_OnInteractionWithSpecialNpc();
|
||||
break;
|
||||
case 2:
|
||||
gUnknown_3005E88 = 3;
|
||||
@@ -1228,7 +1228,7 @@ static void sub_8111F8C(u8 taskId)
|
||||
{
|
||||
FreezeObjectEvents();
|
||||
sub_805C270();
|
||||
sub_805C780();
|
||||
StopPlayerAvatar();
|
||||
ScriptContext2_Enable();
|
||||
task->func = Task_QuestLogScene_SavedGame;
|
||||
}
|
||||
@@ -1364,28 +1364,28 @@ void sub_811231C(void)
|
||||
if (gQuestLogState == QL_STATE_1)
|
||||
{
|
||||
TryRecordQuestLogEntrySequence(sQuestLogSceneRecordBuffer);
|
||||
sub_8110E3C();
|
||||
TryRecordEvent39_GoToNextScene();
|
||||
gQuestLogState = 0;
|
||||
sQuestLogCB = NULL;
|
||||
gUnknown_203AE04 = NULL;
|
||||
gUnknown_203AE08 = NULL;
|
||||
sEventRecordingPointer = NULL;
|
||||
gUnknown_3005E88 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8112364(void)
|
||||
void QuestLog_OnInteractionWithSpecialNpc(void)
|
||||
{
|
||||
if (gUnknown_3005E88 && gQuestLogState == QL_STATE_1)
|
||||
{
|
||||
TryRecordQuestLogEntrySequence(sQuestLogSceneRecordBuffer);
|
||||
sub_8113A1C(1);
|
||||
sub_8110E3C();
|
||||
TryRecordEvent41_IncCursor(1);
|
||||
TryRecordEvent39_GoToNextScene();
|
||||
gUnknown_3005E88 = 0;
|
||||
gQuestLogState = 0;
|
||||
sQuestLogCB = NULL;
|
||||
}
|
||||
gUnknown_203AE04 = NULL;
|
||||
gUnknown_203AE08 = NULL;
|
||||
sEventRecordingPointer = NULL;
|
||||
}
|
||||
|
||||
void sub_81123BC(void)
|
||||
@@ -1414,7 +1414,7 @@ void sub_8112450(void)
|
||||
{
|
||||
if (MenuHelpers_LinkSomething() != TRUE)
|
||||
{
|
||||
sub_8112364();
|
||||
QuestLog_OnInteractionWithSpecialNpc();
|
||||
sub_81123BC();
|
||||
}
|
||||
}
|
||||
@@ -2442,7 +2442,7 @@ void SetQuestLogEvent(u16 eventId, const u16 *eventData)
|
||||
{
|
||||
if (gUnknown_203AE04 == NULL)
|
||||
{
|
||||
gUnknown_203AE04 = gUnknown_203AE08;
|
||||
gUnknown_203AE04 = sEventRecordingPointer;
|
||||
r1 = sQuestLogStorageCBs[eventId](gUnknown_203AE04, eventData);
|
||||
}
|
||||
else
|
||||
@@ -2454,7 +2454,7 @@ void SetQuestLogEvent(u16 eventId, const u16 *eventData)
|
||||
else
|
||||
{
|
||||
gUnknown_203AE04 = NULL;
|
||||
r1 = sQuestLogStorageCBs[eventId](gUnknown_203AE08, eventData);
|
||||
r1 = sQuestLogStorageCBs[eventId](sEventRecordingPointer, eventData);
|
||||
}
|
||||
|
||||
if (r1 == NULL)
|
||||
@@ -2465,7 +2465,7 @@ void SetQuestLogEvent(u16 eventId, const u16 *eventData)
|
||||
return;
|
||||
}
|
||||
|
||||
gUnknown_203AE08 = r1;
|
||||
sEventRecordingPointer = r1;
|
||||
if (gUnknown_203B048 == 0)
|
||||
return;
|
||||
sub_811231C();
|
||||
@@ -2517,7 +2517,7 @@ bool8 sub_8113748(void)
|
||||
return TRUE;
|
||||
|
||||
if (gQuestLogState == QL_STATE_1)
|
||||
sub_8112364();
|
||||
QuestLog_OnInteractionWithSpecialNpc();
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -2583,11 +2583,11 @@ static u16 *sub_8113828(u16 eventId, const u16 *eventData)
|
||||
sub_8113B94(eventId);
|
||||
|
||||
if (eventId == QL_EVENT_DEFEATED_WILD_MON)
|
||||
gUnknown_203AE04 = gUnknown_203AE08;
|
||||
gUnknown_203AE04 = sEventRecordingPointer;
|
||||
else
|
||||
gUnknown_203AE04 = NULL;
|
||||
|
||||
return sQuestLogStorageCBs[eventId](gUnknown_203AE08, eventData);
|
||||
return sQuestLogStorageCBs[eventId](sEventRecordingPointer, eventData);
|
||||
}
|
||||
|
||||
static bool8 TrySetLinkQuestLogEvent(u16 eventId, const u16 *eventData)
|
||||
@@ -2613,15 +2613,15 @@ void sub_81138F8(void)
|
||||
gUnknown_203B024 = (struct UnkStruct_203B024){};
|
||||
}
|
||||
|
||||
void sub_811390C(void)
|
||||
void QuestLog_StartRecordingInputsAfterDeferredEvent(void)
|
||||
{
|
||||
if (gUnknown_203B024.unk_00 != QL_EVENT_0)
|
||||
{
|
||||
u16 *resp;
|
||||
gUnknown_203B04A = 0;
|
||||
StartRecordingQuestLogEntry(gUnknown_203B024.unk_00);
|
||||
resp = sQuestLogStorageCBs[gUnknown_203B024.unk_00](gUnknown_203AE08, gUnknown_203B024.unk_04);
|
||||
gUnknown_203AE08 = resp;
|
||||
resp = sQuestLogStorageCBs[gUnknown_203B024.unk_00](sEventRecordingPointer, gUnknown_203B024.unk_04);
|
||||
sEventRecordingPointer = resp;
|
||||
sub_81138F8();
|
||||
}
|
||||
}
|
||||
@@ -2654,17 +2654,17 @@ void sub_81139BC(void)
|
||||
StartRecordingQuestLogEntry(gUnknown_203B024.unk_00);
|
||||
}
|
||||
sub_8113B94(gUnknown_203B024.unk_00);
|
||||
resp = sQuestLogStorageCBs[gUnknown_203B024.unk_00](gUnknown_203AE08, gUnknown_203B024.unk_04);
|
||||
gUnknown_203AE08 = resp;
|
||||
sub_8113A1C(1);
|
||||
resp = sQuestLogStorageCBs[gUnknown_203B024.unk_00](sEventRecordingPointer, gUnknown_203B024.unk_04);
|
||||
sEventRecordingPointer = resp;
|
||||
TryRecordEvent41_IncCursor(1);
|
||||
sub_81138F8();
|
||||
sub_811231C();
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8113A1C(u16 a0)
|
||||
static void TryRecordEvent41_IncCursor(u16 a0)
|
||||
{
|
||||
gUnknown_203AE08 = sub_8113C5C(gUnknown_203AE08, a0);
|
||||
sEventRecordingPointer = TryRecordEvent41(sEventRecordingPointer, a0);
|
||||
sQuestLogCursor++;
|
||||
}
|
||||
|
||||
@@ -2853,9 +2853,9 @@ static void sub_8113BD8(void)
|
||||
gUnknown_203B04B = FALSE;
|
||||
}
|
||||
|
||||
static u16 *sub_8113BF4(u16 *a0)
|
||||
static u16 *TryRecordEvent39_NoParams(u16 *a0)
|
||||
{
|
||||
if (!sub_8110988(a0, sQuestLogEventCmdSizes[QL_EVENT_39]))
|
||||
if (!WillCommandOfSizeFitInSav1Record(a0, sQuestLogEventCmdSizes[QL_EVENT_39]))
|
||||
return NULL;
|
||||
a0[0] = QL_EVENT_39;
|
||||
return a0 + 1;
|
||||
@@ -2863,7 +2863,7 @@ static u16 *sub_8113BF4(u16 *a0)
|
||||
|
||||
static u16 *sub_8113C20(u16 *a0, struct QuestLogEntry * a1)
|
||||
{
|
||||
if (!sub_8110988(a0, sQuestLogEventCmdSizes[QL_EVENT_39]))
|
||||
if (!WillCommandOfSizeFitInSav1Record(a0, sQuestLogEventCmdSizes[QL_EVENT_39]))
|
||||
return NULL;
|
||||
a1->unk_6 = 0xFF;
|
||||
a1->unk_4 = 0;
|
||||
@@ -2874,9 +2874,9 @@ static u16 *sub_8113C20(u16 *a0, struct QuestLogEntry * a1)
|
||||
return a0 + 1;
|
||||
}
|
||||
|
||||
static u16 *sub_8113C5C(u16 *a0, u16 a1)
|
||||
static u16 *TryRecordEvent41(u16 *a0, u16 a1)
|
||||
{
|
||||
if (!sub_8110988(a0, sQuestLogEventCmdSizes[QL_EVENT_41]))
|
||||
if (!WillCommandOfSizeFitInSav1Record(a0, sQuestLogEventCmdSizes[QL_EVENT_41]))
|
||||
return NULL;
|
||||
a0[0] = QL_EVENT_41;
|
||||
a0[1] = a1;
|
||||
@@ -2885,7 +2885,7 @@ static u16 *sub_8113C5C(u16 *a0, u16 a1)
|
||||
|
||||
static u16 *sub_8113C8C(u16 *a0, struct QuestLogEntry * a1)
|
||||
{
|
||||
if (!sub_8110988(a0, sQuestLogEventCmdSizes[QL_EVENT_41]))
|
||||
if (!WillCommandOfSizeFitInSav1Record(a0, sQuestLogEventCmdSizes[QL_EVENT_41]))
|
||||
return NULL;
|
||||
a1->unk_6 = 0xFE;
|
||||
a1->unk_4 = a0[1];
|
||||
@@ -2900,7 +2900,7 @@ static u16 *sub_8113CC8(u16 *a0, struct QuestLogEntry * a1)
|
||||
{
|
||||
u8 *r6 = (u8 *)a0 + 4;
|
||||
|
||||
if (!sub_8110988(a0, sQuestLogEventCmdSizes[QL_EVENT_0]))
|
||||
if (!WillCommandOfSizeFitInSav1Record(a0, sQuestLogEventCmdSizes[QL_EVENT_0]))
|
||||
return NULL;
|
||||
a0[0] = 0;
|
||||
a0[1] = a1->unk_4;
|
||||
@@ -2915,7 +2915,7 @@ static u16 *sub_8113D08(u16 *a0, struct QuestLogEntry * a1)
|
||||
{
|
||||
u8 *r6 = (u8 *)a0 + 4;
|
||||
|
||||
if (!sub_8110988(a0, sQuestLogEventCmdSizes[QL_EVENT_0]))
|
||||
if (!WillCommandOfSizeFitInSav1Record(a0, sQuestLogEventCmdSizes[QL_EVENT_0]))
|
||||
return NULL;
|
||||
a1->unk_6 = 2;
|
||||
a1->unk_4 = a0[1];
|
||||
@@ -2931,7 +2931,7 @@ static u16 *sub_8113D48(u16 *a0, struct QuestLogEntry * a1)
|
||||
u16 *r4 = a0;
|
||||
u8 *r6 = (u8 *)a0 + 4;
|
||||
|
||||
if (!sub_8110988(r4, sQuestLogEventCmdSizes[QL_EVENT_2]))
|
||||
if (!WillCommandOfSizeFitInSav1Record(r4, sQuestLogEventCmdSizes[QL_EVENT_2]))
|
||||
return NULL;
|
||||
if (a1->unk_6 == 0)
|
||||
r4[0] = 2;
|
||||
@@ -2950,7 +2950,7 @@ static u16 *sub_8113D94(u16 *a0, struct QuestLogEntry * a1)
|
||||
u16 *r5 = a0;
|
||||
u8 *r6 = (u8 *)a0 + 4;
|
||||
|
||||
if (!sub_8110988(r5, sQuestLogEventCmdSizes[QL_EVENT_2]))
|
||||
if (!WillCommandOfSizeFitInSav1Record(r5, sQuestLogEventCmdSizes[QL_EVENT_2]))
|
||||
return NULL;
|
||||
if (r5[0] == 2)
|
||||
a1->unk_6 = 0;
|
||||
|
||||
+3
-3
@@ -93,16 +93,16 @@ void TrySetMapSaveWarpStatus(void)
|
||||
sub_810B7CC();
|
||||
}
|
||||
|
||||
void sub_810B810(void)
|
||||
void SetUnlockedPokedexFlags(void)
|
||||
{
|
||||
gSaveBlock2Ptr->field_A8 |= 0x1;
|
||||
gSaveBlock2Ptr->field_A8 |= 0x10;
|
||||
gSaveBlock2Ptr->field_A8 |= 0x20;
|
||||
}
|
||||
|
||||
void sub_810B82C(void)
|
||||
void SetPostgameFlags(void)
|
||||
{
|
||||
gSaveBlock2Ptr->specialSaveWarpFlags |= 0x80;
|
||||
gSaveBlock2Ptr->specialSaveWarpFlags |= CHAMPION_SAVEWARP;
|
||||
gSaveBlock2Ptr->field_A8 |= 0x2;
|
||||
gSaveBlock2Ptr->field_A8 |= 0x4;
|
||||
gSaveBlock2Ptr->field_A8 |= 0x8;
|
||||
|
||||
+8
-8
@@ -28,7 +28,7 @@ static struct ScriptContext sScriptContext1;
|
||||
static u32 sUnusedVariable2;
|
||||
static struct ScriptContext sScriptContext2;
|
||||
static bool8 sScriptContext2Enabled;
|
||||
static u8 gUnknown_3000F9D;
|
||||
static u8 sMsgBoxWalkawayDisabled;
|
||||
static u8 sMsgBoxIsCancelable;
|
||||
static u8 sQuestLogInput;
|
||||
static u8 sQuestLogInputIsDpad;
|
||||
@@ -235,19 +235,19 @@ u8 GetRegisteredQuestLogInput(void)
|
||||
return sQuestLogInput;
|
||||
}
|
||||
|
||||
void sub_80699BC(void)
|
||||
void DisableMsgBoxWalkaway(void)
|
||||
{
|
||||
gUnknown_3000F9D = TRUE;
|
||||
sMsgBoxWalkawayDisabled = TRUE;
|
||||
}
|
||||
|
||||
void sub_80699C8(void)
|
||||
void EnableMsgBoxWalkaway(void)
|
||||
{
|
||||
gUnknown_3000F9D = FALSE;
|
||||
sMsgBoxWalkawayDisabled = FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_80699D4(void)
|
||||
bool8 IsMsgBoxWalkawayDisabled(void)
|
||||
{
|
||||
return gUnknown_3000F9D;
|
||||
return sMsgBoxWalkawayDisabled;
|
||||
}
|
||||
|
||||
void SetWalkingIntoSignVars(void)
|
||||
@@ -330,7 +330,7 @@ bool8 ScriptContext2_RunScript(void)
|
||||
void ScriptContext1_SetupScript(const u8 *ptr)
|
||||
{
|
||||
ClearMsgBoxCancelableState();
|
||||
sub_80699C8();
|
||||
EnableMsgBoxWalkaway();
|
||||
ClearQuestLogInputIsDpadFlag();
|
||||
InitScriptContext(&sScriptContext1, gScriptCmdTable, gScriptCmdTableEnd);
|
||||
SetupBytecodeScript(&sScriptContext1, ptr);
|
||||
|
||||
+1
-1
@@ -395,7 +395,7 @@ void ShowStartMenu(void)
|
||||
{
|
||||
FreezeObjectEvents();
|
||||
sub_805C270();
|
||||
sub_805C780();
|
||||
StopPlayerAvatar();
|
||||
}
|
||||
OpenStartMenuWithFollowupFunc(Task_StartMenuHandleInput);
|
||||
ScriptContext2_Enable();
|
||||
|
||||
+39
-38
@@ -80,7 +80,9 @@ extern u8 gSelectedObjectEvent;
|
||||
// static declarations
|
||||
static EWRAM_DATA struct VsSeekerStruct *sVsSeeker = NULL;
|
||||
|
||||
static void sub_810C3B8(u8 taskId);
|
||||
static void VsSeekerResetInBagStepCounter(void);
|
||||
static void VsSeekerResetChargingStepCounter(void);
|
||||
static void Task_ResetObjectsRematchWantedState(u8 taskId);
|
||||
static void sub_810C594(void);
|
||||
static void Task_VsSeeker_1(u8 taskId);
|
||||
static void Task_VsSeeker_2(u8 taskId);
|
||||
@@ -103,6 +105,7 @@ static u8 GetRematchableTrainerLocalId(void);
|
||||
static void StartTrainerObjectMovementScript(struct VsSeekerTrainerInfo *, const u8 *);
|
||||
static u8 GetCurVsSeekerResponse(s32, u16);
|
||||
static void StartAllRespondantIdleMovements(void);
|
||||
static u8 GetRandomFaceDirectionMovementType();
|
||||
|
||||
// rodata
|
||||
static const VsSeekerData sVsSeekerData[] = {
|
||||
@@ -581,16 +584,14 @@ static const u8 gUnknown_8453F67[] = {
|
||||
MOVEMENT_TYPE_FACE_RIGHT
|
||||
};
|
||||
|
||||
|
||||
// text
|
||||
|
||||
|
||||
void sub_810C3A4(void)
|
||||
void VsSeekerFreezeObjectsAfterChargeComplete(void)
|
||||
{
|
||||
CreateTask(sub_810C3B8, 80);
|
||||
CreateTask(Task_ResetObjectsRematchWantedState, 80);
|
||||
}
|
||||
|
||||
static void sub_810C3B8(u8 taskId)
|
||||
static void Task_ResetObjectsRematchWantedState(u8 taskId)
|
||||
{
|
||||
struct Task * task = &gTasks[taskId];
|
||||
u8 i;
|
||||
@@ -618,36 +619,36 @@ static void sub_810C3B8(u8 taskId)
|
||||
if (task->data[0] != 0)
|
||||
{
|
||||
DestroyTask(taskId);
|
||||
sub_805C780();
|
||||
StopPlayerAvatar();
|
||||
EnableBothScriptContexts();
|
||||
}
|
||||
}
|
||||
|
||||
void sub_810C444(void)
|
||||
void VsSeekerResetObjectMovementAfterChargeComplete(void)
|
||||
{
|
||||
struct ObjectEventTemplate * templates = gSaveBlock1Ptr->objectEventTemplates;
|
||||
u8 i;
|
||||
u8 r6;
|
||||
u8 sp0;
|
||||
u8 movementType;
|
||||
u8 objEventId;
|
||||
struct ObjectEvent * objectEvent;
|
||||
|
||||
for (i = 0; i < gMapHeader.events->objectEventCount; i++)
|
||||
{
|
||||
if ((templates[i].trainerType == 1 || templates[i].trainerType == 3) && (templates[i].movementType == MOVEMENT_TYPE_WALK_SLOWLY_IN_PLACE_DOWN || templates[i].movementType == MOVEMENT_TYPE_WALK_SLOWLY_IN_PLACE_UP || templates[i].movementType == MOVEMENT_TYPE_WALK_SLOWLY_IN_PLACE_LEFT))
|
||||
{
|
||||
r6 = sub_810CF54();
|
||||
TryGetObjectEventIdByLocalIdAndMap(templates[i].localId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &sp0);
|
||||
objectEvent = &gObjectEvents[sp0];
|
||||
if (sub_810CF04(sp0) == TRUE)
|
||||
movementType = GetRandomFaceDirectionMovementType();
|
||||
TryGetObjectEventIdByLocalIdAndMap(templates[i].localId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &objEventId);
|
||||
objectEvent = &gObjectEvents[objEventId];
|
||||
if (sub_810CF04(objEventId) == TRUE)
|
||||
{
|
||||
SetTrainerMovementType(objectEvent, r6);
|
||||
SetTrainerMovementType(objectEvent, movementType);
|
||||
}
|
||||
templates[i].movementType = r6;
|
||||
templates[i].movementType = movementType;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool8 sub_810C4EC(void)
|
||||
bool8 UpdateVsSeekerStepCounter(void)
|
||||
{
|
||||
if (CheckBagHasItem(ITEM_VS_SEEKER, 1) == TRUE)
|
||||
{
|
||||
@@ -672,7 +673,7 @@ bool8 sub_810C4EC(void)
|
||||
if (x == 100)
|
||||
{
|
||||
FlagClear(FLAG_SYS_VS_SEEKER_CHARGING);
|
||||
sub_810C640();
|
||||
VsSeekerResetChargingStepCounter();
|
||||
sub_810D0D0();
|
||||
return TRUE;
|
||||
}
|
||||
@@ -684,7 +685,7 @@ bool8 sub_810C4EC(void)
|
||||
void TryUpdateRandomTrainerRematches(u16 mapGroup, u16 mapNum)
|
||||
{
|
||||
FlagClear(FLAG_SYS_VS_SEEKER_CHARGING);
|
||||
sub_810C640();
|
||||
VsSeekerResetChargingStepCounter();
|
||||
sub_810D0D0();
|
||||
sub_810C594();
|
||||
}
|
||||
@@ -698,34 +699,34 @@ static void sub_810C594(void)
|
||||
struct ObjectEvent * objectEvent = &gObjectEvents[i];
|
||||
if (objectEvent->movementType == MOVEMENT_TYPE_WALK_SLOWLY_IN_PLACE_DOWN || objectEvent->movementType == MOVEMENT_TYPE_WALK_SLOWLY_IN_PLACE_UP || objectEvent->movementType == MOVEMENT_TYPE_WALK_SLOWLY_IN_PLACE_LEFT)
|
||||
{
|
||||
u8 r3 = sub_810CF54();
|
||||
u8 movementType = GetRandomFaceDirectionMovementType();
|
||||
if (objectEvent->active && gSprites[objectEvent->spriteId].data[0] == i)
|
||||
{
|
||||
gSprites[objectEvent->spriteId].pos2.x = 0;
|
||||
gSprites[objectEvent->spriteId].pos2.y = 0;
|
||||
SetTrainerMovementType(objectEvent, r3);
|
||||
SetTrainerMovementType(objectEvent, movementType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_810C604(void)
|
||||
static void VsSeekerResetInBagStepCounter(void)
|
||||
{
|
||||
gSaveBlock1Ptr->trainerRematchStepCounter &= 0xFF00;
|
||||
}
|
||||
|
||||
void sub_810C620(void)
|
||||
static void VsSeekerSetStepCounterInBagFull(void)
|
||||
{
|
||||
gSaveBlock1Ptr->trainerRematchStepCounter &= 0xFF00;
|
||||
gSaveBlock1Ptr->trainerRematchStepCounter |= 100;
|
||||
}
|
||||
|
||||
void sub_810C640(void)
|
||||
static void VsSeekerResetChargingStepCounter(void)
|
||||
{
|
||||
gSaveBlock1Ptr->trainerRematchStepCounter &= 0x00FF;
|
||||
}
|
||||
|
||||
void sub_810C654(void)
|
||||
static void VsSeekerSetStepCounterFullyCharged(void)
|
||||
{
|
||||
gSaveBlock1Ptr->trainerRematchStepCounter &= 0x00FF;
|
||||
gSaveBlock1Ptr->trainerRematchStepCounter |= (100 << 8);
|
||||
@@ -785,7 +786,7 @@ static void Task_VsSeeker_2(u8 taskId)
|
||||
{
|
||||
data[1] = 0;
|
||||
data[2] = 0;
|
||||
sub_810C604();
|
||||
VsSeekerResetInBagStepCounter();
|
||||
sVsSeeker->responseCode = GetVsSeekerResponseInArea(sVsSeekerData);
|
||||
ScriptMovement_StartObjectMovementScript(0xFF, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, gUnknown_8453F5C);
|
||||
gTasks[taskId].func = Task_VsSeeker_3;
|
||||
@@ -934,7 +935,7 @@ static u8 GetVsSeekerResponseInArea(const VsSeekerData * a0)
|
||||
{
|
||||
PlaySE(SE_PIN);
|
||||
FlagSet(FLAG_SYS_VS_SEEKER_CHARGING);
|
||||
sub_810C640();
|
||||
VsSeekerResetChargingStepCounter();
|
||||
return VSSEEKER_RESPONSE_FOUND_REMATCHES;
|
||||
}
|
||||
if (sVsSeeker->trainerHasNotYetBeenFought)
|
||||
@@ -944,7 +945,7 @@ static u8 GetVsSeekerResponseInArea(const VsSeekerData * a0)
|
||||
|
||||
void sub_810CB90(void)
|
||||
{
|
||||
u8 sp0 = 0;
|
||||
u8 objEventId = 0;
|
||||
struct ObjectEventTemplate *r4 = gSaveBlock1Ptr->objectEventTemplates;
|
||||
s32 r9 = sub_810CE10(sVsSeekerData, gTrainerBattleOpponent_A);
|
||||
|
||||
@@ -958,12 +959,12 @@ void sub_810CB90(void)
|
||||
{
|
||||
struct ObjectEvent *r4_2;
|
||||
|
||||
TryGetObjectEventIdByLocalIdAndMap(r4[r8].localId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &sp0);
|
||||
r4_2 = &gObjectEvents[sp0];
|
||||
sub_810CF54(&r4[r8]); // You are using this function incorrectly. Please consult the manual.
|
||||
TryGetObjectEventIdByLocalIdAndMap(r4[r8].localId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &objEventId);
|
||||
r4_2 = &gObjectEvents[objEventId];
|
||||
GetRandomFaceDirectionMovementType(&r4[r8]); // You are using this function incorrectly. Please consult the manual.
|
||||
OverrideMovementTypeForObjectEvent(r4_2, gUnknown_8453F67[r4_2->facingDirection]);
|
||||
gSaveBlock1Ptr->trainerRematches[r4[r8].localId] = 0;
|
||||
if (gSelectedObjectEvent == sp0)
|
||||
if (gSelectedObjectEvent == objEventId)
|
||||
r4_2->movementType = gUnknown_8453F67[r4_2->facingDirection];
|
||||
else
|
||||
r4_2->movementType = MOVEMENT_TYPE_FACE_DOWN;
|
||||
@@ -1113,22 +1114,22 @@ bool8 sub_810CF04(u8 a0)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
u8 sub_810CF54()
|
||||
static u8 GetRandomFaceDirectionMovementType()
|
||||
{
|
||||
u16 r1 = Random() % 4;
|
||||
|
||||
switch (r1)
|
||||
{
|
||||
case 0:
|
||||
return 7;
|
||||
return MOVEMENT_TYPE_FACE_UP;
|
||||
case 1:
|
||||
return 8;
|
||||
return MOVEMENT_TYPE_FACE_DOWN;
|
||||
case 2:
|
||||
return 9;
|
||||
return MOVEMENT_TYPE_FACE_LEFT;
|
||||
case 3:
|
||||
return 10;
|
||||
return MOVEMENT_TYPE_FACE_RIGHT;
|
||||
default:
|
||||
return 8;
|
||||
return MOVEMENT_TYPE_FACE_DOWN;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user