Document some Quest Log
This commit is contained in:
+2
-2
@@ -1826,7 +1826,7 @@ static void sub_8011BB0(void)
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
SetMainCallback2(gMain.savedCallback);
|
||||
sub_812C224();
|
||||
TrySetQuestLogLinkBattleEvent();
|
||||
FreeMonSpritesGfx();
|
||||
FreeBattleSpritesData();
|
||||
FreeBattleResources();
|
||||
@@ -3782,7 +3782,7 @@ static void HandleEndTurn_FinishBattle(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
sub_812BFDC();
|
||||
TrySetQuestLogBattleEvent();
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER)
|
||||
sub_810CB90();
|
||||
BeginFastPaletteFade(3);
|
||||
|
||||
@@ -2027,7 +2027,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
|
||||
if (gTrainers[gTrainerBattleOpponent_A].trainerClass == CLASS_RIVAL
|
||||
|| gTrainers[gTrainerBattleOpponent_A].trainerClass == CLASS_RIVAL_2
|
||||
|| gTrainers[gTrainerBattleOpponent_A].trainerClass == CLASS_CHAMPION_2)
|
||||
toCpy = GetExpandedPlaceholder(6);
|
||||
toCpy = GetExpandedPlaceholder(PLACEHOLDER_ID_RIVAL);
|
||||
else
|
||||
toCpy = gTrainers[gTrainerBattleOpponent_A].trainerName;
|
||||
}
|
||||
|
||||
+2
-2
@@ -997,8 +997,8 @@ void PlayTrainerEncounterMusic(void)
|
||||
{
|
||||
u16 music;
|
||||
|
||||
if (gUnknown_203ADFA != 2
|
||||
&& gUnknown_203ADFA != 3
|
||||
if (gQuestLogState != 2
|
||||
&& gQuestLogState != 3
|
||||
&& sTrainerBattleMode != TRAINER_BATTLE_CONTINUE_SCRIPT_NO_MUSIC
|
||||
&& sTrainerBattleMode != TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE_NO_MUSIC)
|
||||
{
|
||||
|
||||
@@ -1094,23 +1094,6 @@ enum
|
||||
MENU_FIELD_MOVES,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
FIELD_MOVE_FLASH,
|
||||
FIELD_MOVE_CUT,
|
||||
FIELD_MOVE_FLY,
|
||||
FIELD_MOVE_STRENGTH,
|
||||
FIELD_MOVE_SURF,
|
||||
FIELD_MOVE_ROCK_SMASH,
|
||||
FIELD_MOVE_WATERFALL,
|
||||
FIELD_MOVE_TELEPORT,
|
||||
FIELD_MOVE_DIG,
|
||||
FIELD_MOVE_MILK_DRINK,
|
||||
FIELD_MOVE_SOFT_BOILED,
|
||||
FIELD_MOVE_SWEET_SCENT,
|
||||
FIELD_MOVE_END,
|
||||
};
|
||||
|
||||
static struct
|
||||
{
|
||||
const u8 *text;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// TODO: Use NELEMS/ARRAY_COUNT in .partySize, name trainer parties
|
||||
|
||||
const struct Trainer gTrainers[] = {
|
||||
[TRAINER_NONE] = {
|
||||
.partyFlags = 0,
|
||||
|
||||
@@ -1766,9 +1766,9 @@ u8 Special_GetMartClerkObjectId(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void sub_80CC524(void)
|
||||
void SetUsedPkmnCenterQuestLogEvent(void)
|
||||
{
|
||||
sub_8113550(11, NULL);
|
||||
SetQuestLogEvent(QL_EVENT_USED_PKMN_CENTER, NULL);
|
||||
}
|
||||
|
||||
static const struct {
|
||||
@@ -1868,7 +1868,7 @@ void sub_80CC59C(void)
|
||||
sp0.unk1 = r5;
|
||||
else
|
||||
sp0.unk1 = r5 + 1;
|
||||
sub_8113550(35, (void *)&sp0);
|
||||
SetQuestLogEvent(QL_EVENT_DEPARTED, (void *)&sp0);
|
||||
FlagClear(FLAG_0x808);
|
||||
return;
|
||||
}
|
||||
@@ -1882,7 +1882,7 @@ void sub_80CC59C(void)
|
||||
sp0.unk1 = r5;
|
||||
else
|
||||
sp0.unk1 = r5 + 1;
|
||||
sub_8113550(35, (void *)&sp0);
|
||||
SetQuestLogEvent(QL_EVENT_DEPARTED, (void *)&sp0);
|
||||
FlagClear(FLAG_0x808);
|
||||
return;
|
||||
}
|
||||
@@ -1903,7 +1903,7 @@ void sub_80CC59C(void)
|
||||
if (x != 67 || y != 15)
|
||||
sp0.unk1++;
|
||||
}
|
||||
sub_8113550(35, (void *)&sp0);
|
||||
SetQuestLogEvent(QL_EVENT_DEPARTED, (void *)&sp0);
|
||||
FlagClear(FLAG_0x808);
|
||||
if (r5 == 35)
|
||||
{
|
||||
@@ -2447,7 +2447,7 @@ void Special_BrailleCursorToggle(void)
|
||||
// 8005 = y
|
||||
// 8006 = action (0 = create, 1 = delete)
|
||||
u16 x;
|
||||
if (gUnknown_203ADFA != 2)
|
||||
if (gQuestLogState != 2)
|
||||
{
|
||||
x = gSpecialVar_0x8004 + 27;
|
||||
if (gSpecialVar_0x8006 == 0)
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ static void Task_RunTimeBasedEvents(u8 taskId)
|
||||
|
||||
if (!ScriptContext2_IsEnabled())
|
||||
{
|
||||
if (gUnknown_203ADFA != 2 && gUnknown_203ADFA != 3)
|
||||
if (gQuestLogState != 2 && gQuestLogState != 3)
|
||||
{
|
||||
sub_8056078(&data[1], &data[2]);
|
||||
}
|
||||
|
||||
@@ -1012,7 +1012,7 @@ void HelpSystem_Disable(void)
|
||||
|
||||
void HelpSystem_Enable(void)
|
||||
{
|
||||
if (gUnknown_203ADFA != 2 && gUnknown_203ADFA != 3)
|
||||
if (gQuestLogState != 2 && gQuestLogState != 3)
|
||||
{
|
||||
gHelpSystemEnabled = TRUE;
|
||||
sub_812B4B8();
|
||||
|
||||
+4
-2
@@ -564,13 +564,15 @@ u16 BagGetQuantityByItemId(u16 itemId)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sub_809A824(u16 itemId)
|
||||
void TrySetObtainedItemQuestLogEvent(u16 itemId)
|
||||
{
|
||||
struct QuestLogStruct_809A824
|
||||
{
|
||||
u16 itemId;
|
||||
u8 mapSectionId;
|
||||
} * ptr;
|
||||
|
||||
// Only some key items trigger this event
|
||||
if
|
||||
(
|
||||
itemId == ITEM_OAKS_PARCEL
|
||||
@@ -600,7 +602,7 @@ void sub_809A824(u16 itemId)
|
||||
ptr = malloc(sizeof(*ptr));
|
||||
ptr->itemId = itemId;
|
||||
ptr->mapSectionId = gMapHeader.regionMapSectionId;
|
||||
sub_8113550(40, (void *)ptr);
|
||||
SetQuestLogEvent(QL_EVENT_OBTAINED_ITEM, (void *)ptr);
|
||||
free(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -27,6 +27,7 @@
|
||||
#include "task.h"
|
||||
#include "text_window.h"
|
||||
#include "constants/items.h"
|
||||
#include "constants/quest_log.h"
|
||||
#include "constants/songs.h"
|
||||
|
||||
struct ItemPcResources
|
||||
@@ -901,7 +902,7 @@ static void ItemPc_DoWithdraw(u8 taskId)
|
||||
|
||||
if (AddBagItem(itemId, data[8]) == TRUE)
|
||||
{
|
||||
ItemUse_SetQuestLogEvent(29, NULL, itemId, 0xFFFF);
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_WITHDREW_ITEM_PC, NULL, itemId, 0xFFFF);
|
||||
CopyItemName(itemId, gStringVar1);
|
||||
ConvertIntToDecimalStringN(gStringVar2, data[8], STR_CONV_MODE_LEFT_ALIGN, 3);
|
||||
StringExpandPlaceholders(gStringVar4, gText_WithdrewQuantItem);
|
||||
|
||||
+10
-10
@@ -343,7 +343,7 @@ void FieldUseFunc_CoinCase(u8 taskId)
|
||||
{
|
||||
ConvertIntToDecimalStringN(gStringVar1, GetCoins(), STR_CONV_MODE_LEFT_ALIGN, 4);
|
||||
StringExpandPlaceholders(gStringVar4, gUnknown_8416537);
|
||||
ItemUse_SetQuestLogEvent(4, NULL, gSpecialVar_ItemId, 0xFFFF);
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_USED_ITEM, NULL, gSpecialVar_ItemId, 0xFFFF);
|
||||
if (gTasks[taskId].data[3] == 0)
|
||||
DisplayItemMessageInBag(taskId, 2, gStringVar4, sub_810A1F8);
|
||||
else
|
||||
@@ -354,7 +354,7 @@ void FieldUseFunc_PowderJar(u8 taskId)
|
||||
{
|
||||
ConvertIntToDecimalStringN(gStringVar1, GetBerryPowder(), STR_CONV_MODE_LEFT_ALIGN, 5);
|
||||
StringExpandPlaceholders(gStringVar4, gUnknown_8416644);
|
||||
ItemUse_SetQuestLogEvent(4, NULL, gSpecialVar_ItemId, 0xFFFF);
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_USED_ITEM, NULL, gSpecialVar_ItemId, 0xFFFF);
|
||||
if (gTasks[taskId].data[3] == 0)
|
||||
DisplayItemMessageInBag(taskId, 2, gStringVar4, sub_810A1F8);
|
||||
else
|
||||
@@ -374,7 +374,7 @@ void FieldUseFunc_PokeFlute(u8 taskId)
|
||||
|
||||
if (wokeSomeoneUp)
|
||||
{
|
||||
ItemUse_SetQuestLogEvent(4, NULL, gSpecialVar_ItemId, 0xFFFF);
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_USED_ITEM, NULL, gSpecialVar_ItemId, 0xFFFF);
|
||||
if (gTasks[taskId].data[3] == 0)
|
||||
DisplayItemMessageInBag(taskId, 2, gUnknown_8416690, sub_80A1648);
|
||||
else
|
||||
@@ -523,7 +523,7 @@ static void InitBerryPouchFromBattle(void)
|
||||
|
||||
void FieldUseFunc_TeachyTv(u8 taskId)
|
||||
{
|
||||
ItemUse_SetQuestLogEvent(4, NULL, gSpecialVar_ItemId, 0xFFFF);
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_USED_ITEM, NULL, gSpecialVar_ItemId, 0xFFFF);
|
||||
if (gTasks[taskId].data[3] == 0)
|
||||
{
|
||||
ItemMenu_SetExitCallback(InitTeachyTvFromBag);
|
||||
@@ -569,7 +569,7 @@ static void sub_80A19E8(u8 taskId)
|
||||
{
|
||||
if (!IsSEPlaying())
|
||||
{
|
||||
ItemUse_SetQuestLogEvent(4, NULL, gSpecialVar_ItemId, 0xFFFF);
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_USED_ITEM, NULL, gSpecialVar_ItemId, 0xFFFF);
|
||||
VarSet(VAR_REPEL_STEP_COUNT, ItemId_GetHoldEffectParam(gSpecialVar_ItemId));
|
||||
sub_80A1A44();
|
||||
DisplayItemMessageInBag(taskId, 2, gStringVar4, sub_810A1F8);
|
||||
@@ -587,7 +587,7 @@ static void sub_80A1A44(void)
|
||||
|
||||
void FieldUseFunc_BlackFlute(u8 taskId)
|
||||
{
|
||||
ItemUse_SetQuestLogEvent(4, NULL, gSpecialVar_ItemId, 0xFFFF);
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_USED_ITEM, NULL, gSpecialVar_ItemId, 0xFFFF);
|
||||
if (gSpecialVar_ItemId == ITEM_WHITE_FLUTE)
|
||||
{
|
||||
FlagSet(FLAG_SYS_WHITE_FLUTE_ACTIVE);
|
||||
@@ -629,7 +629,7 @@ void ItemUseOutOfBattle_EscapeRope(u8 taskId)
|
||||
{
|
||||
if (CanUseEscapeRopeOnCurrMap() == TRUE)
|
||||
{
|
||||
ItemUse_SetQuestLogEvent(4, NULL, gSpecialVar_ItemId, gMapHeader.regionMapSectionId);
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_USED_ITEM, NULL, gSpecialVar_ItemId, gMapHeader.regionMapSectionId);
|
||||
sItemUseOnFieldCB = sub_80A1C08;
|
||||
sub_80A103C(taskId);
|
||||
}
|
||||
@@ -685,7 +685,7 @@ static void sub_80A1CC0(u8 taskId)
|
||||
|
||||
void FieldUseFunc_FameChecker(u8 taskId)
|
||||
{
|
||||
ItemUse_SetQuestLogEvent(4, NULL, gSpecialVar_ItemId, 0xFFFF);
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_USED_ITEM, NULL, gSpecialVar_ItemId, 0xFFFF);
|
||||
if (gTasks[taskId].data[3] == 0)
|
||||
{
|
||||
ItemMenu_SetExitCallback(sub_80A1D58);
|
||||
@@ -832,7 +832,7 @@ void BattleUseFunc_PokeDoll(u8 taskId)
|
||||
if (!(gBattleTypeFlags & BATTLE_TYPE_TRAINER))
|
||||
{
|
||||
sub_80A1A44();
|
||||
ItemUse_SetQuestLogEvent(4, 0, gSpecialVar_ItemId, 0xFFFF);
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_USED_ITEM, 0, gSpecialVar_ItemId, 0xFFFF);
|
||||
DisplayItemMessageInBag(taskId, 2, gStringVar4, ItemMenu_StartFadeToExitCallback);
|
||||
}
|
||||
else
|
||||
@@ -935,6 +935,6 @@ void ItemUse_SetQuestLogEvent(u8 eventId, struct Pokemon * pokemon, u16 itemId,
|
||||
questLog->species = GetMonData(pokemon, MON_DATA_SPECIES2);
|
||||
else
|
||||
questLog->species = 0xFFFF;
|
||||
sub_8113550(eventId, (void *)questLog);
|
||||
SetQuestLogEvent(eventId, (void *)questLog);
|
||||
Free(questLog);
|
||||
}
|
||||
|
||||
+1
-1
@@ -229,7 +229,7 @@ static const u8 sLinkErrorTextColor[] = { 0x00, 0x01, 0x02 };
|
||||
|
||||
bool8 IsWirelessAdapterConnected(void)
|
||||
{
|
||||
if (gUnknown_203ADFA == 2 || gUnknown_203ADFA == 3)
|
||||
if (gQuestLogState == 2 || gQuestLogState == 3)
|
||||
return FALSE;
|
||||
|
||||
sub_800B1F4();
|
||||
|
||||
@@ -21,7 +21,7 @@ static u8 *MapNamePopupAppendFloorNum(u8 *dest, s8 flags);
|
||||
void CreateMapNamePopupIfNotAlreadyRunning(bool32 palIntoFadedBuffer)
|
||||
{
|
||||
u8 taskId;
|
||||
if (FlagGet(FLAG_SPECIAL_FLAG_0x4000) != TRUE && !(gUnknown_203ADFA == 2 || gUnknown_203ADFA == 3))
|
||||
if (FlagGet(FLAG_SPECIAL_FLAG_0x4000) != TRUE && !(gQuestLogState == 2 || gQuestLogState == 3))
|
||||
{
|
||||
taskId = FindTaskIdByFunc(Task_MapNamePopup);
|
||||
if (taskId == 0xFF)
|
||||
|
||||
@@ -366,7 +366,7 @@ bool8 sub_80F8110(u8 mapsec, u8 forceFirstTime)
|
||||
|
||||
bool8 sub_80F8154(u8 mapsec, u8 forceFirstTime)
|
||||
{
|
||||
if (gUnknown_203ADFA == 2)
|
||||
if (gQuestLogState == 2)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
+2
-2
@@ -101,7 +101,7 @@ void ResetMenuAndMonGlobals(void)
|
||||
sub_81089BC();
|
||||
ResetTMCaseCursorPos();
|
||||
BerryPouch_CursorResetToTop();
|
||||
sub_811089C();
|
||||
ResetQuestLog();
|
||||
SeedWildEncounterRng(Random());
|
||||
ResetSpecialVars();
|
||||
}
|
||||
@@ -142,7 +142,7 @@ void NewGameInitData(void)
|
||||
NewGameInitPCItems();
|
||||
sub_809C794();
|
||||
InitEasyChatPhrases();
|
||||
sub_8113044();
|
||||
ResetTrainerFanClub();
|
||||
copy_strings_to_sav1();
|
||||
ResetMiniGamesResults();
|
||||
sub_8143D24();
|
||||
|
||||
@@ -459,7 +459,7 @@ void AddTextPrinterWithCustomSpeedForMessage(bool8 allowSkippingDelayWithButtonP
|
||||
|
||||
void LoadStdWindowFrameGfx(void)
|
||||
{
|
||||
if (gUnknown_203ADFA == 2)
|
||||
if (gQuestLogState == 2)
|
||||
{
|
||||
gTextFlags.autoScroll = 1;
|
||||
TextWindow_LoadTilesStdFrame1(0, DLG_WINDOW_BASE_TILE_NUM);
|
||||
@@ -497,7 +497,7 @@ void ClearDialogWindowAndFrame(u8 windowId, bool8 copyToVram)
|
||||
ClearWindowTilemap(windowId);
|
||||
if (copyToVram == TRUE)
|
||||
CopyWindowToVram(windowId, 3);
|
||||
if (gUnknown_203ADFA == 2)
|
||||
if (gQuestLogState == 2)
|
||||
sub_8111134();
|
||||
}
|
||||
|
||||
@@ -529,7 +529,7 @@ static void WindowFunc_DrawStandardFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u
|
||||
|
||||
static void WindowFunc_DrawDialogueFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
|
||||
{
|
||||
if (!IsMsgSignPost() || gUnknown_203ADFA == 2)
|
||||
if (!IsMsgSignPost() || gQuestLogState == 2)
|
||||
{
|
||||
FillBgTilemapBufferRect(bg, DLG_WINDOW_BASE_TILE_NUM + 0, tilemapLeft - 2, tilemapTop - 1, 1, 1, DLG_WINDOW_PALETTE_NUM);
|
||||
FillBgTilemapBufferRect(bg, DLG_WINDOW_BASE_TILE_NUM + 1, tilemapLeft - 1, tilemapTop - 1, 1, 1, DLG_WINDOW_PALETTE_NUM);
|
||||
@@ -613,7 +613,7 @@ void SetStdWindowBorderStyle(u8 windowId, bool8 copyToVram)
|
||||
|
||||
void sub_80F7768(u8 windowId, bool8 copyToVram)
|
||||
{
|
||||
if (gUnknown_203ADFA == 2)
|
||||
if (gQuestLogState == 2)
|
||||
{
|
||||
gTextFlags.autoScroll = 1;
|
||||
TextWindow_LoadTilesStdFrame1(0, DLG_WINDOW_BASE_TILE_NUM);
|
||||
|
||||
+36
-36
@@ -75,6 +75,7 @@
|
||||
#include "constants/maps.h"
|
||||
#include "constants/moves.h"
|
||||
#include "constants/pokemon.h"
|
||||
#include "constants/quest_log.h"
|
||||
#include "constants/songs.h"
|
||||
#include "constants/species.h"
|
||||
#include "constants/vars.h"
|
||||
@@ -248,7 +249,7 @@ static void UpdatePartySelectionDoubleLayout(s8 *slotPtr, s8 movementDir);
|
||||
static s8 GetNewSlotDoubleLayout(s8 slotId, s8 movementDir);
|
||||
static void Task_PrintAndWaitForText(u8 taskId);
|
||||
static void PartyMenuPrintText(const u8 *text);
|
||||
static void sub_8124B60(struct Pokemon *mon, u16 item, u16 item2);
|
||||
static void SetSwappedHeldItemQuestLogEvent(struct Pokemon *mon, u16 item, u16 item2);
|
||||
static bool16 IsMonAllowedInPokemonJump(struct Pokemon *mon);
|
||||
static bool16 IsMonAllowedInDodrioBerryPicking(struct Pokemon *mon);
|
||||
static void Task_CancelParticipationYesNo(u8 taskId);
|
||||
@@ -286,7 +287,6 @@ static void Task_HandleSwitchItemsYesNoInput(u8 taskId);
|
||||
static void Task_SwitchItemsYesNo(u8 taskId);
|
||||
static void Task_WriteMailToGiveMonAfterText(u8 taskId);
|
||||
static void CB2_ReturnToPartyMenuFromWritingMail(void);
|
||||
static void CB2_ReturnToPartyMenuFromWritingMail(void);
|
||||
static void Task_DisplayGaveMailFromPartyMessage(u8 taskId);
|
||||
static void CB2_ReadHeldMail(void);
|
||||
static void CB2_ReturnToPartyMenuFromReadingMail(void);
|
||||
@@ -382,8 +382,8 @@ static void sub_8120FB0(void);
|
||||
static void sub_8122084(u8 windowId, const u8 *str);
|
||||
static u8 sub_81220D4(void);
|
||||
static void sub_8122110(u8 windowId);
|
||||
static void sub_812358C(void);
|
||||
static void sub_8124BB0(struct Pokemon *mon, u8 fieldMove);
|
||||
static void SetSwitchedPartyOrderQuestLogEvent(void);
|
||||
static void SetUsedFieldMoveQuestLogEvent(struct Pokemon *mon, u8 fieldMove);
|
||||
static void sub_8124DE0(void);
|
||||
static void sub_8124E48(void);
|
||||
static void sub_812580C(u8 taskId);
|
||||
@@ -1603,14 +1603,14 @@ static void Task_ReturnToChooseMonAfterText(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
static void DisplayGaveHeldItemMessage(struct Pokemon *mon, u16 item, bool8 keepOpen, u8 a4)
|
||||
static void DisplayGaveHeldItemMessage(struct Pokemon *mon, u16 item, bool8 keepOpen, bool8 fromBagMenu)
|
||||
{
|
||||
if (!a4)
|
||||
ItemUse_SetQuestLogEvent(5, mon, item, 0xFFFF);
|
||||
if (!fromBagMenu) // Used Give option from party menu
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_GAVE_HELD_ITEM, mon, item, 0xFFFF);
|
||||
else if (gPartyMenu.action == PARTY_ACTION_GIVE_PC_ITEM)
|
||||
ItemUse_SetQuestLogEvent(7, mon, item, 0xFFFF);
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_GAVE_HELD_ITEM_PC, mon, item, 0xFFFF);
|
||||
else
|
||||
ItemUse_SetQuestLogEvent(6, mon, item, 0xFFFF);
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_GAVE_HELD_ITEM_BAG, mon, item, 0xFFFF);
|
||||
GetMonNickname(mon, gStringVar1);
|
||||
CopyItemName(item, gStringVar2);
|
||||
StringExpandPlaceholders(gStringVar4, gText_PkmnWasGivenItem);
|
||||
@@ -1620,7 +1620,7 @@ static void DisplayGaveHeldItemMessage(struct Pokemon *mon, u16 item, bool8 keep
|
||||
|
||||
static void DisplayTookHeldItemMessage(struct Pokemon *mon, u16 item, bool8 keepOpen)
|
||||
{
|
||||
ItemUse_SetQuestLogEvent(8, mon, item, 0xFFFF);
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_TOOK_HELD_ITEM, mon, item, 0xFFFF);
|
||||
GetMonNickname(mon, gStringVar1);
|
||||
CopyItemName(item, gStringVar2);
|
||||
StringExpandPlaceholders(gStringVar4, gText_ReceivedItemFromPkmn);
|
||||
@@ -1639,7 +1639,7 @@ static void DisplayAlreadyHoldingItemSwitchMessage(struct Pokemon *mon, u16 item
|
||||
|
||||
static void DisplaySwitchedHeldItemMessage(u16 item, u16 item2, bool8 keepOpen)
|
||||
{
|
||||
sub_8124B60(&gPlayerParty[gPartyMenu.slotId], item2, item);
|
||||
SetSwappedHeldItemQuestLogEvent(&gPlayerParty[gPartyMenu.slotId], item2, item);
|
||||
CopyItemName(item, gStringVar1);
|
||||
CopyItemName(item2, gStringVar2);
|
||||
StringExpandPlaceholders(gStringVar4, gText_SwitchedPkmnItem);
|
||||
@@ -3180,7 +3180,7 @@ static void SwitchSelectedMons(u8 taskId)
|
||||
else
|
||||
{
|
||||
// Initialize switching party mons slide animation
|
||||
sub_812358C();
|
||||
SetSwitchedPartyOrderQuestLogEvent();
|
||||
windowIds[0] = sPartyMenuBoxes[gPartyMenu.slotId].windowId;
|
||||
tSlot1Left = GetWindowAttribute(windowIds[0], WINDOW_TILEMAP_LEFT);
|
||||
tSlot1Top = GetWindowAttribute(windowIds[0], WINDOW_TILEMAP_TOP);
|
||||
@@ -3383,13 +3383,13 @@ static void SwitchPartyMon(void)
|
||||
SwitchMenuBoxSprites(&menuBoxes[0]->statusSpriteId, &menuBoxes[1]->statusSpriteId);
|
||||
}
|
||||
|
||||
static void sub_812358C(void)
|
||||
static void SetSwitchedPartyOrderQuestLogEvent(void)
|
||||
{
|
||||
u16 *buffer = Alloc(2 * sizeof(u16));
|
||||
|
||||
buffer[0] = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES2);
|
||||
buffer[1] = GetMonData(&gPlayerParty[gPartyMenu.slotId2], MON_DATA_SPECIES2);
|
||||
sub_8113550(3, buffer);
|
||||
SetQuestLogEvent(QL_EVENT_SWITCHED_PARTY_ORDER, buffer);
|
||||
Free(buffer);
|
||||
}
|
||||
|
||||
@@ -3490,7 +3490,7 @@ static void Task_GiveHoldItem(u8 taskId)
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
item = gSpecialVar_ItemId;
|
||||
DisplayGaveHeldItemMessage(&gPlayerParty[gPartyMenu.slotId], item, FALSE, 0);
|
||||
DisplayGaveHeldItemMessage(&gPlayerParty[gPartyMenu.slotId], item, FALSE, FALSE);
|
||||
GiveItemToMon(&gPlayerParty[gPartyMenu.slotId], item);
|
||||
RemoveBagItem(item, 1);
|
||||
gTasks[taskId].func = Task_UpdateHeldItemSprite;
|
||||
@@ -3598,7 +3598,7 @@ static void Task_DisplayGaveMailFromPartyMessage(u8 taskId)
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
if (sPartyMenuItemId == ITEM_NONE)
|
||||
DisplayGaveHeldItemMessage(&gPlayerParty[gPartyMenu.slotId], gSpecialVar_ItemId, FALSE, 0);
|
||||
DisplayGaveHeldItemMessage(&gPlayerParty[gPartyMenu.slotId], gSpecialVar_ItemId, FALSE, FALSE);
|
||||
else
|
||||
DisplaySwitchedHeldItemMessage(gSpecialVar_ItemId, sPartyMenuItemId, FALSE);
|
||||
gTasks[taskId].func = Task_UpdateHeldItemSprite;
|
||||
@@ -3986,7 +3986,7 @@ static void CursorCB_FieldMove(u8 taskId)
|
||||
break;
|
||||
default:
|
||||
gPartyMenu.exitCallback = CB2_ReturnToField;
|
||||
sub_8124BB0(&gPlayerParty[GetCursorSelectionMonId()], fieldMove);
|
||||
SetUsedFieldMoveQuestLogEvent(&gPlayerParty[GetCursorSelectionMonId()], fieldMove);
|
||||
Task_ClosePartyMenu(taskId);
|
||||
break;
|
||||
}
|
||||
@@ -4032,7 +4032,7 @@ static void Task_HandleFieldMoveExitAreaYesNoInput(u8 taskId)
|
||||
{
|
||||
case 0:
|
||||
gPartyMenu.exitCallback = CB2_ReturnToField;
|
||||
sub_8124BB0(&gPlayerParty[GetCursorSelectionMonId()], sPartyMenuInternal->data[0]);
|
||||
SetUsedFieldMoveQuestLogEvent(&gPlayerParty[GetCursorSelectionMonId()], sPartyMenuInternal->data[0]);
|
||||
Task_ClosePartyMenu(taskId);
|
||||
break;
|
||||
case MENU_B_PRESSED:
|
||||
@@ -4159,7 +4159,7 @@ static bool8 SetUpFieldMove_Waterfall(void)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void sub_8124B60(struct Pokemon *mon, u16 item, u16 item2)
|
||||
static void SetSwappedHeldItemQuestLogEvent(struct Pokemon *mon, u16 item, u16 item2)
|
||||
{
|
||||
u16 *ptr = Alloc(4 * sizeof(u16));
|
||||
|
||||
@@ -4167,9 +4167,9 @@ static void sub_8124B60(struct Pokemon *mon, u16 item, u16 item2)
|
||||
ptr[0] = item;
|
||||
ptr[1] = item2;
|
||||
if (gPartyMenu.action == PARTY_ACTION_GIVE_PC_ITEM)
|
||||
sub_8113550(10, ptr);
|
||||
SetQuestLogEvent(QL_EVENT_SWAPPED_HELD_ITEM_PC, ptr);
|
||||
else
|
||||
sub_8113550(9, ptr);
|
||||
SetQuestLogEvent(QL_EVENT_SWAPPED_HELD_ITEM, ptr);
|
||||
Free(ptr);
|
||||
}
|
||||
|
||||
@@ -4180,7 +4180,7 @@ struct FieldMoveWarpParams
|
||||
u8 regionMapSectionId;
|
||||
};
|
||||
|
||||
static void sub_8124BB0(struct Pokemon *mon, u8 fieldMove)
|
||||
static void SetUsedFieldMoveQuestLogEvent(struct Pokemon *mon, u8 fieldMove)
|
||||
{
|
||||
struct FieldMoveWarpParams *ptr = Alloc(sizeof(*ptr));
|
||||
|
||||
@@ -4197,11 +4197,11 @@ static void sub_8124BB0(struct Pokemon *mon, u8 fieldMove)
|
||||
default:
|
||||
ptr->regionMapSectionId = 0xFF;
|
||||
}
|
||||
sub_8113550(36, (u16 *)ptr);
|
||||
SetQuestLogEvent(QL_EVENT_USED_FIELD_MOVE, (u16 *)ptr);
|
||||
Free(ptr);
|
||||
}
|
||||
|
||||
void sub_8124C1C(const u8 *healLocCtrlData)
|
||||
void SetUsedFlyQuestLogEvent(const u8 *healLocCtrlData)
|
||||
{
|
||||
const struct MapHeader *mapHeader;
|
||||
struct FieldMoveWarpParams *ptr2;
|
||||
@@ -4220,7 +4220,7 @@ void sub_8124C1C(const u8 *healLocCtrlData)
|
||||
ptr2->species = GetMonData(&gPlayerParty[GetCursorSelectionMonId()], MON_DATA_SPECIES2);
|
||||
ptr2->fieldMove = FIELD_MOVE_FLY;
|
||||
ptr2->regionMapSectionId = mapHeader->regionMapSectionId;
|
||||
sub_8113550(36, (u16 *)ptr2);
|
||||
SetQuestLogEvent(QL_EVENT_USED_FIELD_MOVE, (u16 *)ptr2);
|
||||
Free(ptr2);
|
||||
}
|
||||
|
||||
@@ -4345,7 +4345,7 @@ static void sub_8124EFC(void)
|
||||
RemoveMonPPBonus(mon, moveIdx);
|
||||
SetMonMoveSlot(mon, ItemIdToBattleMoveId(gSpecialVar_ItemId), moveIdx);
|
||||
AdjustFriendship(mon, 4);
|
||||
ItemUse_SetQuestLogEvent(4, mon, gSpecialVar_ItemId, move);
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_USED_ITEM, mon, gSpecialVar_ItemId, move);
|
||||
if (gSpecialVar_ItemId <= ITEM_TM50)
|
||||
RemoveBagItem(gSpecialVar_ItemId, 1);
|
||||
SetMainCallback2(gPartyMenu.exitCallback);
|
||||
@@ -4498,7 +4498,7 @@ void ItemUseCB_Medicine(u8 taskId, TaskFunc func)
|
||||
}
|
||||
else
|
||||
{
|
||||
ItemUse_SetQuestLogEvent(4, mon, item, 0xFFFF);
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_USED_ITEM, mon, item, 0xFFFF);
|
||||
sub_8124DC0(taskId);
|
||||
gItemUseCB = ItemUseCB_MedicineStep;
|
||||
}
|
||||
@@ -4703,7 +4703,7 @@ static void sub_8125898(u8 taskId, UNUSED TaskFunc func)
|
||||
|
||||
ExecuteTableBasedItemEffect_(gPartyMenu.slotId, gSpecialVar_ItemId, (u8)gPartyMenu.data1);
|
||||
gPartyMenuUseExitCallback = TRUE;
|
||||
ItemUse_SetQuestLogEvent(4, mon, gSpecialVar_ItemId, 0xFFFF);
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_USED_ITEM, mon, gSpecialVar_ItemId, 0xFFFF);
|
||||
PlaySE(SE_KAIFUKU);
|
||||
RemoveBagItem(gSpecialVar_ItemId, 1);
|
||||
move = GetMonData(mon, gPartyMenu.data1 + MON_DATA_MOVE1);
|
||||
@@ -4734,7 +4734,7 @@ static void TryUsePPItem(u8 taskId)
|
||||
{
|
||||
gPartyMenuUseExitCallback = TRUE;
|
||||
mon = &gPlayerParty[ptr->slotId];
|
||||
ItemUse_SetQuestLogEvent(4, mon, item, 0xFFFF);
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_USED_ITEM, mon, item, 0xFFFF);
|
||||
PlaySE(SE_KAIFUKU);
|
||||
RemoveBagItem(item, 1);
|
||||
move = GetMonData(mon, MON_DATA_MOVE1 + *moveSlot);
|
||||
@@ -4821,7 +4821,7 @@ void ItemUseCB_TMHM(u8 taskId, UNUSED TaskFunc func)
|
||||
}
|
||||
if (GiveMoveToMon(mon, move[0]) != MON_HAS_MAX_MOVES)
|
||||
{
|
||||
ItemUse_SetQuestLogEvent(4, mon, item, 0xFFFF);
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_USED_ITEM, mon, item, 0xFFFF);
|
||||
sub_8124DC0(taskId);
|
||||
gItemUseCB = ItemUseCB_LearnedMove;
|
||||
}
|
||||
@@ -4962,7 +4962,7 @@ static void sub_8125F5C(u8 taskId)
|
||||
u8 moveIdx = GetMoveSlotToReplace();
|
||||
u16 move = GetMonData(mon, moveIdx + MON_DATA_MOVE1);
|
||||
|
||||
ItemUse_SetQuestLogEvent(4, mon, gSpecialVar_ItemId, move);
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_USED_ITEM, mon, gSpecialVar_ItemId, move);
|
||||
GetMonNickname(mon, gStringVar1);
|
||||
StringCopy(gStringVar2, gMoveNames[move]);
|
||||
RemoveMonPPBonus(mon, moveIdx);
|
||||
@@ -5090,7 +5090,7 @@ static void ItemUseCB_RareCandyStep(u8 taskId, UNUSED TaskFunc func)
|
||||
ExecuteTableBasedItemEffect_(gPartyMenu.slotId, gSpecialVar_ItemId, 0);
|
||||
BufferMonStatsToTaskData(mon, &ptr->data[NUM_STATS]);
|
||||
gPartyMenuUseExitCallback = TRUE;
|
||||
ItemUse_SetQuestLogEvent(4, mon, gSpecialVar_ItemId, 0xFFFF);
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_USED_ITEM, mon, gSpecialVar_ItemId, 0xFFFF);
|
||||
PlayFanfareByFanfareNum(0);
|
||||
UpdateMonDisplayInfoAfterRareCandy(gPartyMenu.slotId, mon);
|
||||
RemoveBagItem(gSpecialVar_ItemId, 1);
|
||||
@@ -5305,7 +5305,7 @@ static void Task_SacredAshLoop(u8 taskId)
|
||||
{
|
||||
gPartyMenuUseExitCallback = TRUE;
|
||||
if (gPartyMenu.menuType != PARTY_MENU_TYPE_IN_BATTLE)
|
||||
ItemUse_SetQuestLogEvent(4, sSacredAshQuestLogMonBackup, gSpecialVar_ItemId, 0xFFFF);
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_USED_ITEM, sSacredAshQuestLogMonBackup, gSpecialVar_ItemId, 0xFFFF);
|
||||
RemoveBagItem(gSpecialVar_ItemId, 1);
|
||||
}
|
||||
gTasks[taskId].func = Task_ClosePartyMenuAfterText;
|
||||
@@ -5354,7 +5354,7 @@ static void sub_8126BD4(void)
|
||||
{
|
||||
gCB2_AfterEvolution = gPartyMenu.exitCallback;
|
||||
ExecuteTableBasedItemEffect_(gPartyMenu.slotId, gSpecialVar_ItemId, 0);
|
||||
ItemUse_SetQuestLogEvent(4, &gPlayerParty[gPartyMenu.slotId], gSpecialVar_ItemId, 0xFFFF);
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_USED_ITEM, &gPlayerParty[gPartyMenu.slotId], gSpecialVar_ItemId, 0xFFFF);
|
||||
RemoveBagItem(gSpecialVar_ItemId, 1);
|
||||
}
|
||||
|
||||
@@ -5531,7 +5531,7 @@ static void GiveItemToSelectedMon(u8 taskId)
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
item = gPartyMenu.bagItem;
|
||||
DisplayGaveHeldItemMessage(&gPlayerParty[gPartyMenu.slotId], item, FALSE, 1);
|
||||
DisplayGaveHeldItemMessage(&gPlayerParty[gPartyMenu.slotId], item, FALSE, TRUE);
|
||||
GiveItemToMon(&gPlayerParty[gPartyMenu.slotId], item);
|
||||
RemoveItemToGiveFromBag(item);
|
||||
gTasks[taskId].func = Task_UpdateHeldItemSpriteAndClosePartyMenu;
|
||||
@@ -5586,7 +5586,7 @@ static void Task_DisplayGaveMailFromBagMessage(u8 taskId)
|
||||
if (sPartyMenuItemId != ITEM_NONE)
|
||||
DisplaySwitchedHeldItemMessage(gPartyMenu.bagItem, sPartyMenuItemId, FALSE);
|
||||
else
|
||||
DisplayGaveHeldItemMessage(&gPlayerParty[gPartyMenu.slotId], gPartyMenu.bagItem, FALSE, 1);
|
||||
DisplayGaveHeldItemMessage(&gPlayerParty[gPartyMenu.slotId], gPartyMenu.bagItem, FALSE, TRUE);
|
||||
gTasks[taskId].func = Task_UpdateHeldItemSpriteAndClosePartyMenu;
|
||||
}
|
||||
}
|
||||
|
||||
+1454
-1354
File diff suppressed because it is too large
Load Diff
+32
-30
@@ -6,6 +6,7 @@
|
||||
#include "link.h"
|
||||
#include "overworld.h"
|
||||
#include "quest_log.h"
|
||||
#include "constants/trainer_classes.h"
|
||||
|
||||
struct QuestLogStruct_TrainerBattleRecord
|
||||
{
|
||||
@@ -18,20 +19,20 @@ struct QuestLogStruct_TrainerBattleRecord
|
||||
|
||||
struct QuestLogStruct_WildBattleRecord
|
||||
{
|
||||
u16 v0;
|
||||
u16 v2;
|
||||
u8 v4;
|
||||
u16 defeatedSpecies;
|
||||
u16 caughtSpecies;
|
||||
u8 mapSec;
|
||||
};
|
||||
|
||||
static void sub_812C334(s32 *, s32 *);
|
||||
|
||||
void sub_812BFDC(void)
|
||||
void TrySetQuestLogBattleEvent(void)
|
||||
{
|
||||
if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_OLD_MAN_TUTORIAL | BATTLE_TYPE_POKEDUDE)) && (gBattleOutcome == B_OUTCOME_WON || gBattleOutcome == B_OUTCOME_CAUGHT))
|
||||
{
|
||||
struct QuestLogStruct_TrainerBattleRecord * questLogTrainerBattleRecord = Alloc(sizeof(struct QuestLogStruct_TrainerBattleRecord));
|
||||
struct QuestLogStruct_WildBattleRecord * questLogWildBattleRecord = Alloc(sizeof(struct QuestLogStruct_WildBattleRecord));
|
||||
u16 questLogMessageType;
|
||||
u16 eventId;
|
||||
u16 playerEndingHP;
|
||||
u16 playerMaxHP;
|
||||
|
||||
@@ -39,17 +40,17 @@ void sub_812BFDC(void)
|
||||
{
|
||||
switch (gTrainers[gTrainerBattleOpponent_A].trainerClass)
|
||||
{
|
||||
case 0x54:
|
||||
questLogMessageType = 30;
|
||||
case CLASS_LEADER_2:
|
||||
eventId = QL_EVENT_DEFEATED_GYM_LEADER;
|
||||
break;
|
||||
case 0x5a:
|
||||
questLogMessageType = 33;
|
||||
case CLASS_CHAMPION_2:
|
||||
eventId = QL_EVENT_DEFEATED_CHAMPION;
|
||||
break;
|
||||
case 0x57:
|
||||
questLogMessageType = 32;
|
||||
case CLASS_ELITE_FOUR_2:
|
||||
eventId = QL_EVENT_DEFEATED_E4_MEMBER;
|
||||
break;
|
||||
default:
|
||||
questLogMessageType = 34;
|
||||
eventId = QL_EVENT_DEFEATED_TRAINER;
|
||||
break;
|
||||
}
|
||||
questLogTrainerBattleRecord->v0 = gTrainerBattleOpponent_A;
|
||||
@@ -78,22 +79,22 @@ void sub_812BFDC(void)
|
||||
questLogTrainerBattleRecord->v6 = 1;
|
||||
if (playerEndingHP < playerMaxHP / 3)
|
||||
questLogTrainerBattleRecord->v6++;
|
||||
sub_8113550(questLogMessageType, (const u16 *)questLogTrainerBattleRecord);
|
||||
SetQuestLogEvent(eventId, (const u16 *)questLogTrainerBattleRecord);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gBattleOutcome == B_OUTCOME_WON)
|
||||
{
|
||||
questLogWildBattleRecord->v0 = GetMonData(gEnemyParty + 0, MON_DATA_SPECIES);
|
||||
questLogWildBattleRecord->v2 = SPECIES_NONE;
|
||||
questLogWildBattleRecord->defeatedSpecies = GetMonData(gEnemyParty, MON_DATA_SPECIES);
|
||||
questLogWildBattleRecord->caughtSpecies = SPECIES_NONE;
|
||||
}
|
||||
else
|
||||
else // gBattleOutcome == B_OUTCOME_CAUGHT
|
||||
{
|
||||
questLogWildBattleRecord->v0 = SPECIES_NONE;
|
||||
questLogWildBattleRecord->v2 = GetMonData(gEnemyParty + 0, MON_DATA_SPECIES);
|
||||
questLogWildBattleRecord->defeatedSpecies = SPECIES_NONE;
|
||||
questLogWildBattleRecord->caughtSpecies = GetMonData(gEnemyParty, MON_DATA_SPECIES);
|
||||
}
|
||||
questLogWildBattleRecord->v4 = GetCurrentRegionMapSectionId();
|
||||
sub_8113550(31, (const u16 *)questLogWildBattleRecord);
|
||||
questLogWildBattleRecord->mapSec = GetCurrentRegionMapSectionId();
|
||||
SetQuestLogEvent(QL_EVENT_DEFEATED_WILD_MON, (const u16 *)questLogWildBattleRecord);
|
||||
}
|
||||
Free(questLogTrainerBattleRecord);
|
||||
Free(questLogWildBattleRecord);
|
||||
@@ -106,13 +107,13 @@ struct QuestLogStruct_LinkBattleRecord
|
||||
u8 v1[3][7];
|
||||
};
|
||||
|
||||
void sub_812C224(void)
|
||||
void TrySetQuestLogLinkBattleEvent(void)
|
||||
{
|
||||
s32 sp0;
|
||||
s32 sp4[2];
|
||||
u16 r8;
|
||||
u16 eventId;
|
||||
s32 r3;
|
||||
u32 r0;
|
||||
bool32 inUnionRoom;
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_LINK)
|
||||
{
|
||||
@@ -120,7 +121,7 @@ void sub_812C224(void)
|
||||
r5->v0 = gBattleOutcome - 1; // 0 = won, 1 = lost, 2 = drew
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
|
||||
{
|
||||
r8 = 15;
|
||||
eventId = QL_EVENT_LINK_BATTLED_MULTI;
|
||||
sub_812C334(&sp0, sp4);
|
||||
for (r3 = 0; r3 < 7; r3++)
|
||||
{
|
||||
@@ -132,20 +133,21 @@ void sub_812C224(void)
|
||||
else
|
||||
{
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
||||
r8 = 14;
|
||||
eventId = QL_EVENT_LINK_BATTLED_DOUBLE;
|
||||
else
|
||||
{
|
||||
r0 = InUnionRoom();
|
||||
r8 = 13;
|
||||
if (r0 == TRUE)
|
||||
r8 = 19;
|
||||
inUnionRoom = InUnionRoom();
|
||||
eventId = QL_EVENT_LINK_BATTLED_SINGLE;
|
||||
|
||||
if (inUnionRoom == TRUE)
|
||||
eventId = QL_EVENT_LINK_BATTLED_UNION;
|
||||
}
|
||||
for (r3 = 0; r3 < 7; r3++)
|
||||
{
|
||||
r5->v1[0][r3] = gLinkPlayers[gBattleStruct->multiplayerId ^ 1].name[r3];
|
||||
}
|
||||
}
|
||||
sub_8113550(r8, (const u16 *)r5);
|
||||
SetQuestLogEvent(eventId, (const u16 *)r5);
|
||||
Free(r5);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "link.h"
|
||||
#include "link_rfu.h"
|
||||
|
||||
void sub_815A008(struct QuestLog * questLog)
|
||||
void SetQuestLogObjectEventsData(struct QuestLog * questLog)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
@@ -134,7 +134,7 @@ void sub_815A1F8(const struct QuestLog * questLog, const struct ObjectEventTempl
|
||||
|
||||
void sub_815A540(void)
|
||||
{
|
||||
if (gUnknown_203ADFA == 2)
|
||||
if (gQuestLogState == 2)
|
||||
{
|
||||
s16 x, y;
|
||||
|
||||
+1
-1
@@ -4389,7 +4389,7 @@ static void sub_80C527C(u16 mapsec)
|
||||
if (sMapsecToSpawn[idx][2])
|
||||
{
|
||||
sub_805546C(sMapsecToSpawn[idx][2]);
|
||||
sub_8124C1C(sMapsecToSpawn[idx]);
|
||||
SetUsedFlyQuestLogEvent(sMapsecToSpawn[idx]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+9
-9
@@ -469,7 +469,7 @@ bool8 ScrCmd_additem(struct ScriptContext *ctx)
|
||||
u32 quantity = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
gSpecialVar_Result = AddBagItem(itemId, (u8)quantity);
|
||||
sub_809A824(itemId);
|
||||
TrySetObtainedItemQuestLogEvent(itemId);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -929,7 +929,7 @@ bool8 ScrCmd_playbgm(struct ScriptContext *ctx)
|
||||
u16 songId = ScriptReadHalfword(ctx);
|
||||
bool8 val = ScriptReadByte(ctx);
|
||||
|
||||
if (gUnknown_203ADFA == 2 || gUnknown_203ADFA == 3)
|
||||
if (gQuestLogState == 2 || gQuestLogState == 3)
|
||||
return FALSE;
|
||||
if (val == TRUE)
|
||||
Overworld_SetSavedMusic(songId);
|
||||
@@ -945,7 +945,7 @@ bool8 ScrCmd_savebgm(struct ScriptContext *ctx)
|
||||
|
||||
bool8 ScrCmd_fadedefaultbgm(struct ScriptContext *ctx)
|
||||
{
|
||||
if (gUnknown_203ADFA == 2 || gUnknown_203ADFA == 3)
|
||||
if (gQuestLogState == 2 || gQuestLogState == 3)
|
||||
return FALSE;
|
||||
Overworld_ChangeMusicToDefault();
|
||||
return FALSE;
|
||||
@@ -954,7 +954,7 @@ bool8 ScrCmd_fadedefaultbgm(struct ScriptContext *ctx)
|
||||
bool8 ScrCmd_fadenewbgm(struct ScriptContext *ctx)
|
||||
{
|
||||
u16 music = ScriptReadHalfword(ctx);
|
||||
if (gUnknown_203ADFA == 2 || gUnknown_203ADFA == 3)
|
||||
if (gQuestLogState == 2 || gQuestLogState == 3)
|
||||
return FALSE;
|
||||
Overworld_ChangeMusicTo(music);
|
||||
return FALSE;
|
||||
@@ -964,7 +964,7 @@ bool8 ScrCmd_fadeoutbgm(struct ScriptContext *ctx)
|
||||
{
|
||||
u8 speed = ScriptReadByte(ctx);
|
||||
|
||||
if (gUnknown_203ADFA == 2 || gUnknown_203ADFA == 3)
|
||||
if (gQuestLogState == 2 || gQuestLogState == 3)
|
||||
return FALSE;
|
||||
if (speed != 0)
|
||||
FadeOutBGMTemporarily(4 * speed);
|
||||
@@ -978,7 +978,7 @@ bool8 ScrCmd_fadeinbgm(struct ScriptContext *ctx)
|
||||
{
|
||||
u8 speed = ScriptReadByte(ctx);
|
||||
|
||||
if (gUnknown_203ADFA == 2 || gUnknown_203ADFA == 3)
|
||||
if (gQuestLogState == 2 || gQuestLogState == 3)
|
||||
return FALSE;
|
||||
if (speed != 0)
|
||||
FadeInBGM(4 * speed);
|
||||
@@ -1328,7 +1328,7 @@ static bool8 WaitForAorBPress(void)
|
||||
sub_8069998(r4);
|
||||
if (r4)
|
||||
{
|
||||
if (gUnknown_203ADFA != 2)
|
||||
if (gQuestLogState != 2)
|
||||
{
|
||||
sub_80699F8();
|
||||
if (r4 < 9 || r4 > 10)
|
||||
@@ -1342,7 +1342,7 @@ static bool8 WaitForAorBPress(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sub_8112CAC() == 1 || gUnknown_203ADFA == 2)
|
||||
if (sub_8112CAC() == 1 || gQuestLogState == 2)
|
||||
{
|
||||
if (gUnknown_20370AC == 120)
|
||||
return TRUE;
|
||||
@@ -1407,7 +1407,7 @@ bool8 ScrCmd_waitbuttonpress(struct ScriptContext *ctx)
|
||||
{
|
||||
gUnknown_3005070 = ctx;
|
||||
|
||||
if (sub_8112CAC() == 1 || gUnknown_203ADFA == 2)
|
||||
if (sub_8112CAC() == 1 || gQuestLogState == 2)
|
||||
gUnknown_20370AC = 0;
|
||||
SetupNativeScript(ctx, WaitForAorBPress);
|
||||
return TRUE;
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
#include "global.h"
|
||||
#include "script.h"
|
||||
#include "event_data.h"
|
||||
#include "quest_log.h"
|
||||
|
||||
#define RAM_SCRIPT_MAGIC 51
|
||||
#define SCRIPT_STACK_SIZE 20
|
||||
|
||||
extern u8 gUnknown_203ADFA;
|
||||
|
||||
extern void sub_80CBDE8(void); // field_specials
|
||||
extern u16 CalcCRC16WithTable(u8 *data, int length); // util
|
||||
@@ -435,7 +435,7 @@ bool8 mapheader_run_first_tag2_script_list_match(void)
|
||||
{
|
||||
u8 *ptr;
|
||||
|
||||
if(gUnknown_203ADFA == 3)
|
||||
if(gQuestLogState == 3)
|
||||
return 0;
|
||||
|
||||
ptr = mapheader_get_first_match_from_tagged_ptr_list(2);
|
||||
|
||||
+1
-1
@@ -1176,7 +1176,7 @@ void QLPlaybackCB_DestroyScriptMenuMonPicSprites(void)
|
||||
{
|
||||
u8 taskId;
|
||||
s16 *data;
|
||||
ScriptContext1_SetupScript(EventScript_1A7AE0);
|
||||
ScriptContext1_SetupScript(EventScript_ReleaseEnd);
|
||||
taskId = FindTaskIdByFunc(Task_ScriptShowMonPic);
|
||||
if (taskId != 0xFF)
|
||||
{
|
||||
|
||||
+2
-2
@@ -1127,11 +1127,11 @@ static void RecordQuestLogItemPurchase(void)
|
||||
|
||||
v = gShopMenuHistory[0].unkA;
|
||||
if (v != 0)
|
||||
sub_8113550(v + 0x24, (const u16 *)&gShopMenuHistory[0]);
|
||||
SetQuestLogEvent(v + QL_EVENT_USED_POKEMART, (const u16 *)&gShopMenuHistory[0]);
|
||||
|
||||
v = gShopMenuHistory[1].unkA;
|
||||
if (v != 0)
|
||||
sub_8113550(v + 0x24, (const u16 *)&gShopMenuHistory[1]);
|
||||
SetQuestLogEvent(v + QL_EVENT_USED_POKEMART, (const u16 *)&gShopMenuHistory[1]);
|
||||
}
|
||||
|
||||
void CreatePokemartMenu(const u16 *itemsForSale)
|
||||
|
||||
+4
-4
@@ -2,6 +2,7 @@
|
||||
#include "gba/m4a_internal.h"
|
||||
#include "sound.h"
|
||||
#include "battle.h"
|
||||
#include "quest_log.h"
|
||||
#include "m4a.h"
|
||||
#include "main.h"
|
||||
#include "pokemon.h"
|
||||
@@ -16,7 +17,6 @@ struct Fanfare
|
||||
|
||||
// TODO: what are these
|
||||
extern u8 gDisableMapMusicChangeOnMapLoad;
|
||||
extern u8 gUnknown_203ADFA;
|
||||
extern u8 gUnknown_203F174;
|
||||
|
||||
// ewram
|
||||
@@ -193,7 +193,7 @@ void PlayFanfareByFanfareNum(u8 fanfareNum)
|
||||
{
|
||||
u16 songNum;
|
||||
|
||||
if(gUnknown_203ADFA == 2)
|
||||
if(gQuestLogState == 2)
|
||||
{
|
||||
sFanfareCounter = 0xFF;
|
||||
}
|
||||
@@ -362,7 +362,7 @@ void PlayCry4(u16 species, s8 pan, u8 mode)
|
||||
|
||||
void PlayCry7(u16 species, u8 mode) // exclusive to FR/LG
|
||||
{
|
||||
if((u8)(gUnknown_203ADFA - 2) >= 2)
|
||||
if((u8)(gQuestLogState - 2) >= 2)
|
||||
{
|
||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 85);
|
||||
PlayCryInternal(species, 0, CRY_VOLUME, 10, mode);
|
||||
@@ -571,7 +571,7 @@ void PlayBGM(u16 songNum)
|
||||
|
||||
void PlaySE(u16 songNum)
|
||||
{
|
||||
if(gDisableMapMusicChangeOnMapLoad == 0 && gUnknown_203ADFA != 2)
|
||||
if(gDisableMapMusicChangeOnMapLoad == 0 && gQuestLogState != 2)
|
||||
m4aSongNumStart(songNum);
|
||||
}
|
||||
|
||||
|
||||
+14
-14
@@ -472,20 +472,20 @@ u8 *GetExpandedPlaceholder(u32 id)
|
||||
|
||||
static const ExpandPlaceholderFunc funcs[] =
|
||||
{
|
||||
ExpandPlaceholder_UnknownStringVar,
|
||||
ExpandPlaceholder_PlayerName,
|
||||
ExpandPlaceholder_StringVar1,
|
||||
ExpandPlaceholder_StringVar2,
|
||||
ExpandPlaceholder_StringVar3,
|
||||
ExpandPlaceholder_KunChan,
|
||||
ExpandPlaceholder_RivalName,
|
||||
ExpandPlaceholder_Version,
|
||||
ExpandPlaceholder_Magma,
|
||||
ExpandPlaceholder_Aqua,
|
||||
ExpandPlaceholder_Maxie,
|
||||
ExpandPlaceholder_Archie,
|
||||
ExpandPlaceholder_Groudon,
|
||||
ExpandPlaceholder_Kyogre,
|
||||
[PLACEHOLDER_ID_UNKNOWN] = ExpandPlaceholder_UnknownStringVar,
|
||||
[PLACEHOLDER_ID_PLAYER] = ExpandPlaceholder_PlayerName,
|
||||
[PLACEHOLDER_ID_STRING_VAR_1] = ExpandPlaceholder_StringVar1,
|
||||
[PLACEHOLDER_ID_STRING_VAR_2] = ExpandPlaceholder_StringVar2,
|
||||
[PLACEHOLDER_ID_STRING_VAR_3] = ExpandPlaceholder_StringVar3,
|
||||
[PLACEHOLDER_ID_KUN] = ExpandPlaceholder_KunChan,
|
||||
[PLACEHOLDER_ID_RIVAL] = ExpandPlaceholder_RivalName,
|
||||
[PLACEHOLDER_ID_VERSION] = ExpandPlaceholder_Version,
|
||||
[PLACEHOLDER_ID_MAGMA] = ExpandPlaceholder_Magma,
|
||||
[PLACEHOLDER_ID_AQUA] = ExpandPlaceholder_Aqua,
|
||||
[PLACEHOLDER_ID_MAXIE] = ExpandPlaceholder_Maxie,
|
||||
[PLACEHOLDER_ID_ARCHIE] = ExpandPlaceholder_Archie,
|
||||
[PLACEHOLDER_ID_GROUDON] = ExpandPlaceholder_Groudon,
|
||||
[PLACEHOLDER_ID_KYOGRE] = ExpandPlaceholder_Kyogre,
|
||||
};
|
||||
|
||||
if (id >= ARRAY_COUNT(funcs))
|
||||
|
||||
+2
-2
@@ -527,7 +527,7 @@ void TextPrinterClearDownArrow(struct TextPrinter *textPrinter)
|
||||
bool8 TextPrinterWaitAutoMode(struct TextPrinter *textPrinter)
|
||||
{
|
||||
struct TextPrinterSubStruct *subStruct = &textPrinter->subUnion.sub;
|
||||
u8 delay = (gUnknown_203ADFA == 2) ? 50 : 120;
|
||||
u8 delay = (gQuestLogState == 2) ? 50 : 120;
|
||||
|
||||
if (subStruct->autoScrollDelay == delay)
|
||||
{
|
||||
@@ -716,7 +716,7 @@ u16 RenderText(struct TextPrinter *textPrinter)
|
||||
textPrinter->printerTemplate.currentChar++;
|
||||
currChar |= *textPrinter->printerTemplate.currentChar << 8;
|
||||
textPrinter->printerTemplate.currentChar++;
|
||||
if ((u8)(gUnknown_203ADFA - 2u) > 1)
|
||||
if ((u8)(gQuestLogState - 2u) > 1)
|
||||
PlayBGM(currChar);
|
||||
return 2;
|
||||
case 16:
|
||||
|
||||
+2
-2
@@ -2585,11 +2585,11 @@ static void sub_8053E8C(void)
|
||||
case 50:
|
||||
if (InUnionRoom())
|
||||
{
|
||||
sub_8113550(18, sTradeData->monSpecies);
|
||||
SetQuestLogEvent(QL_EVENT_LINK_TRADED_UNION, sTradeData->monSpecies);
|
||||
}
|
||||
else
|
||||
{
|
||||
sub_8113550(12, sTradeData->monSpecies);
|
||||
SetQuestLogEvent(QL_EVENT_LINK_TRADED, sTradeData->monSpecies);
|
||||
IncrementGameStat(GAME_STAT_POKEMON_TRADES);
|
||||
}
|
||||
if (gWirelessCommType)
|
||||
|
||||
+2
-1
@@ -29,6 +29,7 @@
|
||||
#include "constants/trainers.h"
|
||||
#include "constants/maps.h"
|
||||
#include "constants/items.h"
|
||||
#include "constants/quest_log.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
@@ -744,7 +745,7 @@ void Task_VsSeeker_0(u8 taskId)
|
||||
}
|
||||
else if (respval == 2)
|
||||
{
|
||||
ItemUse_SetQuestLogEvent(4, 0, gSpecialVar_ItemId, 0xffff);
|
||||
ItemUse_SetQuestLogEvent(QL_EVENT_USED_ITEM, 0, gSpecialVar_ItemId, 0xffff);
|
||||
FieldEffectStart(FLDEFF_UNK_41); // TODO: name this enum
|
||||
gTasks[taskId].func = Task_VsSeeker_1;
|
||||
gTasks[taskId].data[0] = 15;
|
||||
|
||||
@@ -584,7 +584,7 @@ bool8 UpdateRepelCounter(void)
|
||||
if (InUnionRoom() == TRUE)
|
||||
return FALSE;
|
||||
|
||||
if (gUnknown_203ADFA == 2)
|
||||
if (gQuestLogState == 2)
|
||||
return FALSE;
|
||||
|
||||
steps = VarGet(VAR_REPEL_STEP_COUNT);
|
||||
|
||||
Reference in New Issue
Block a user