Merge pull request #316 from PikalaxALT/various_documentation
Various documentation
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "librfu.h"
|
||||
#include "link_rfu.h"
|
||||
#include "AgbRfu_LinkManager.h"
|
||||
|
||||
#define RN_ACCEPT 0x01
|
||||
#define RN_NAME_TIMER_CLEAR 0x02
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "palette.h"
|
||||
#include "gflib.h"
|
||||
#include "item_menu.h"
|
||||
#include "text.h"
|
||||
#include "window.h"
|
||||
#include "text_window.h"
|
||||
#include "menu_helpers.h"
|
||||
#include "new_menu_helpers.h"
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include "util.h"
|
||||
#include "item.h"
|
||||
#include "random.h"
|
||||
#include "pokemon.h"
|
||||
#include "battle_ai_script_commands.h"
|
||||
#include "constants/species.h"
|
||||
#include "constants/abilities.h"
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_controllers.h"
|
||||
#include "pokemon.h"
|
||||
#include "random.h"
|
||||
#include "util.h"
|
||||
#include "constants/abilities.h"
|
||||
|
||||
+6
-8
@@ -1,20 +1,13 @@
|
||||
#include "global.h"
|
||||
#include "gflib.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_controllers.h"
|
||||
#include "battle_interface.h"
|
||||
#include "battle_bg.h"
|
||||
#include "bg.h"
|
||||
#include "decompress.h"
|
||||
#include "dma3.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "graphics.h"
|
||||
#include "main.h"
|
||||
#include "m4a.h"
|
||||
#include "palette.h"
|
||||
#include "pokemon.h"
|
||||
#include "sound.h"
|
||||
#include "sprite.h"
|
||||
#include "task.h"
|
||||
#include "constants/battle_anim.h"
|
||||
|
||||
@@ -1970,6 +1963,11 @@ static void ScriptCmd_unloadspritegfx(void)
|
||||
ClearSpriteIndex(GET_TRUE_SPRITE_INDEX(index));
|
||||
}
|
||||
|
||||
// Create sprite from template and init data array with varargs
|
||||
// args: template, flags, va_args
|
||||
// flags:
|
||||
// - bits 0-6: subpriority mod (signed)
|
||||
// - bit 7: target if set else attacker
|
||||
static void ScriptCmd_createsprite(void)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
#include "global.h"
|
||||
#include "gflib.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_interface.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "palette.h"
|
||||
#include "random.h"
|
||||
#include "sound.h"
|
||||
#include "trig.h"
|
||||
#include "util.h"
|
||||
#include "constants/songs.h"
|
||||
@@ -4321,7 +4319,7 @@ static void AnimLockOnTargetStep4(struct Sprite* sprite)
|
||||
sprite->data[1] = 0;
|
||||
}
|
||||
|
||||
BlendPalettes(sub_8075BE8(1, 1, 1, 1, 1, 0, 0), sprite->data[1], RGB_WHITE);
|
||||
BlendPalettes(SelectBattleAnimSpriteAndBgPalettes(1, 1, 1, 1, 1, 0, 0), sprite->data[1], RGB_WHITE);
|
||||
if (sprite->data[1] == 16)
|
||||
{
|
||||
int pal;
|
||||
@@ -4981,7 +4979,7 @@ void AnimTask_FadeScreenBlueStep(u8);
|
||||
|
||||
void AnimTask_FadeScreenBlue(u8 taskId)
|
||||
{
|
||||
int a = sub_8075BE8(1, 0, 0, 0, 0, 0, 0) & 0xFFFF;
|
||||
int a = SelectBattleAnimSpriteAndBgPalettes(1, 0, 0, 0, 0, 0, 0) & 0xFFFF;
|
||||
int b;
|
||||
int c;
|
||||
int d;
|
||||
@@ -4996,7 +4994,7 @@ void AnimTask_FadeScreenBlue(u8 taskId)
|
||||
gTasks[taskId].data[7] = 13;
|
||||
gTasks[taskId].data[8] = 14;
|
||||
gTasks[taskId].data[9] = 15;
|
||||
b = sub_8075CB8(1, 1, 1, 1);
|
||||
b = SelectBattlerSpritePalettes(1, 1, 1, 1);
|
||||
c = a | b;
|
||||
StorePointerInVars(&gTasks[taskId].data[14], &gTasks[taskId].data[15], (void*)c);
|
||||
b = b | (0x10000 << IndexOfSpritePaletteTag(ANIM_TAG_MOON));
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
#include "global.h"
|
||||
#include "malloc.h"
|
||||
#include "gflib.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_interface.h"
|
||||
#include "decompress.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "graphics.h"
|
||||
#include "math_util.h"
|
||||
#include "palette.h"
|
||||
#include "random.h"
|
||||
#include "scanline_effect.h"
|
||||
#include "sound.h"
|
||||
#include "trig.h"
|
||||
#include "util.h"
|
||||
#include "constants/songs.h"
|
||||
@@ -3090,7 +3087,7 @@ static void FakeOutStep2(u8 taskId)
|
||||
{
|
||||
gTasks[taskId].data[11] = 0x88;
|
||||
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG3 | BLDCNT_EFFECT_LIGHTEN);
|
||||
BlendPalettes(sub_8075BE8(1, 0, 0, 0, 0, 0, 0), 16, RGB_WHITE);
|
||||
BlendPalettes(SelectBattleAnimSpriteAndBgPalettes(1, 0, 0, 0, 0, 0, 0), 16, RGB_WHITE);
|
||||
}
|
||||
else if (gTasks[taskId].data[10] > 4)
|
||||
{
|
||||
|
||||
@@ -1,19 +1,13 @@
|
||||
#include "global.h"
|
||||
#include "malloc.h"
|
||||
#include "gflib.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "bg.h"
|
||||
#include "data.h"
|
||||
#include "decompress.h"
|
||||
#include "dma3.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "graphics.h"
|
||||
#include "palette.h"
|
||||
#include "pokemon_icon.h"
|
||||
#include "random.h"
|
||||
#include "scanline_effect.h"
|
||||
#include "sound.h"
|
||||
#include "sprite.h"
|
||||
#include "task.h"
|
||||
#include "trig.h"
|
||||
#include "util.h"
|
||||
|
||||
+9
-14
@@ -1,14 +1,9 @@
|
||||
#include "global.h"
|
||||
#include "gflib.h"
|
||||
#include "battle_anim.h"
|
||||
#include "bg.h"
|
||||
#include "data.h"
|
||||
#include "decompress.h"
|
||||
#include "dma3.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "malloc.h"
|
||||
#include "palette.h"
|
||||
#include "pokemon_icon.h"
|
||||
#include "sprite.h"
|
||||
#include "task.h"
|
||||
#include "trig.h"
|
||||
#include "util.h"
|
||||
@@ -1240,7 +1235,7 @@ void SetGreyscaleOrOriginalPalette(u16 paletteNum, bool8 restoreOriginalColor)
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_8075BE8(u8 battleBackground, u8 attacker, u8 target, u8 attackerPartner, u8 targetPartner, u8 a6, u8 a7)
|
||||
u32 SelectBattleAnimSpriteAndBgPalettes(bool8 battleBackground, bool8 attacker, bool8 target, bool8 attackerPartner, bool8 targetPartner, bool8 a6, bool8 a7)
|
||||
{
|
||||
u32 selectedPalettes = 0;
|
||||
u32 shift;
|
||||
@@ -1286,19 +1281,19 @@ u32 sub_8075BE8(u8 battleBackground, u8 attacker, u8 target, u8 attackerPartner,
|
||||
return selectedPalettes;
|
||||
}
|
||||
|
||||
u32 sub_8075CB8(u8 a1, u8 a2, u8 a3, u8 a4)
|
||||
u32 SelectBattlerSpritePalettes(bool8 playerLeft, bool8 playerRight, bool8 foeLeft, bool8 foeRight)
|
||||
{
|
||||
u32 var = 0;
|
||||
u32 shift;
|
||||
|
||||
if (a1)
|
||||
if (playerLeft)
|
||||
{
|
||||
if (IsBattlerSpriteVisible(GetBattlerAtPosition(B_POSITION_PLAYER_LEFT)))
|
||||
{
|
||||
var |= 1 << (GetBattlerAtPosition(B_POSITION_PLAYER_LEFT) + 16);
|
||||
}
|
||||
}
|
||||
if (a2)
|
||||
if (playerRight)
|
||||
{
|
||||
if (IsBattlerSpriteVisible(GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT)))
|
||||
{
|
||||
@@ -1306,7 +1301,7 @@ u32 sub_8075CB8(u8 a1, u8 a2, u8 a3, u8 a4)
|
||||
var |= 1 << shift;
|
||||
}
|
||||
}
|
||||
if (a3)
|
||||
if (foeLeft)
|
||||
{
|
||||
if (IsBattlerSpriteVisible(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT)))
|
||||
{
|
||||
@@ -1314,7 +1309,7 @@ u32 sub_8075CB8(u8 a1, u8 a2, u8 a3, u8 a4)
|
||||
var |= 1 << shift;
|
||||
}
|
||||
}
|
||||
if (a4)
|
||||
if (foeRight)
|
||||
{
|
||||
if (IsBattlerSpriteVisible(GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT)))
|
||||
{
|
||||
@@ -1325,13 +1320,13 @@ u32 sub_8075CB8(u8 a1, u8 a2, u8 a3, u8 a4)
|
||||
return var;
|
||||
}
|
||||
|
||||
u8 sub_8075D80(u8 a1)
|
||||
u8 GetSpritePalIdxByBattler(u8 a1)
|
||||
{
|
||||
return a1;
|
||||
}
|
||||
|
||||
// not used
|
||||
static u8 GetBattlerAtPosition_(u8 position)
|
||||
static u8 GetSpritePalIdxByPosition(u8 position)
|
||||
{
|
||||
return GetBattlerAtPosition(position);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "gflib.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "sound.h"
|
||||
#include "task.h"
|
||||
#include "constants/battle_anim.h"
|
||||
#include "constants/species.h"
|
||||
|
||||
@@ -1,19 +1,14 @@
|
||||
#include "global.h"
|
||||
#include "gflib.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_main.h"
|
||||
#include "battle_controllers.h"
|
||||
#include "battle_interface.h"
|
||||
#include "decompress.h"
|
||||
#include "dma3.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "graphics.h"
|
||||
#include "m4a.h"
|
||||
#include "main.h"
|
||||
#include "palette.h"
|
||||
#include "pokeball.h"
|
||||
#include "sound.h"
|
||||
#include "sprite.h"
|
||||
#include "task.h"
|
||||
#include "trig.h"
|
||||
#include "util.h"
|
||||
@@ -666,7 +661,7 @@ void sub_80EF344(u8 taskId)
|
||||
priority = gSprites[spriteId].oam.priority;
|
||||
subpriority = gSprites[spriteId].subpriority;
|
||||
gTasks[taskId].data[10] = LaunchBallStarsTask(x, y + 32, priority, subpriority, ballId);
|
||||
selectedPalettes = sub_8075BE8(1, 0, 0, 0, 0, 0, 0);
|
||||
selectedPalettes = SelectBattleAnimSpriteAndBgPalettes(1, 0, 0, 0, 0, 0, 0);
|
||||
gTasks[taskId].data[11] = LaunchBallFadeMonTask(0, gBattleAnimAttacker, selectedPalettes, ballId);
|
||||
gTasks[taskId].data[0]++;
|
||||
break;
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
#include "global.h"
|
||||
#include "gflib.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "decompress.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "palette.h"
|
||||
#include "sprite.h"
|
||||
#include "task.h"
|
||||
#include "trig.h"
|
||||
#include "util.h"
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
#include "global.h"
|
||||
#include "gflib.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "graphics.h"
|
||||
#include "malloc.h"
|
||||
#include "palette.h"
|
||||
#include "sound.h"
|
||||
#include "sprite.h"
|
||||
#include "task.h"
|
||||
#include "util.h"
|
||||
#include "constants/songs.h"
|
||||
@@ -22,9 +18,9 @@ struct AnimStatsChangeData
|
||||
|
||||
static void StartBlendAnimSpriteColor(u8 taskId, u32 selectedPalettes);
|
||||
static void AnimTask_BlendSpriteColor_Step2(u8 taskId);
|
||||
static void sub_80BAB78(u8 taskId);
|
||||
static void sub_80BABD0(u8 taskId);
|
||||
static void sub_80BACA8(struct Sprite *sprite);
|
||||
static void Task_WaitHardwarePaletteFade(u8 taskId);
|
||||
static void Task_DoCloneBattlerSpriteWithBlend(u8 taskId);
|
||||
static void Task_FinishCloneBattlerSpriteWithBlend(struct Sprite *sprite);
|
||||
static void sub_80BAF38(u8 taskId);
|
||||
static void sub_80BB0D8(u8 taskId);
|
||||
static void sub_80BB2A0(u8 taskId);
|
||||
@@ -41,18 +37,42 @@ static const u16 gUnknown_83E7CC8[] = { RGB(31, 31, 31) };
|
||||
const u8 gUnknown_83E7CCA[] = { REG_OFFSET_BG0CNT, REG_OFFSET_BG1CNT, REG_OFFSET_BG2CNT, REG_OFFSET_BG3CNT };
|
||||
const u8 gUnknown_83E7CCE[] = { REG_OFFSET_BG0CNT, REG_OFFSET_BG1CNT, REG_OFFSET_BG2CNT, REG_OFFSET_BG3CNT };
|
||||
|
||||
void sub_80BA7F8(u8 taskId)
|
||||
// gBattleAnimArgs[0] is a bitfield.
|
||||
// Bits 0-10 result in the following palettes being selected:
|
||||
// 0: battle background palettes (BG palettes 1, 2, and 3)
|
||||
// 1: gBattleAnimAttacker OBJ palette
|
||||
// 2: gBattleAnimTarget OBJ palette
|
||||
// 3: gBattleAnimAttacker partner OBJ palette
|
||||
// 4: gBattleAnimTarget partner OBJ palette
|
||||
// 5: BG palette 4
|
||||
// 6: BG palette 5
|
||||
// 7: Player battler left
|
||||
// 8: Player battler right
|
||||
// 9: Enemy battler left
|
||||
// 10: Enemy battler right
|
||||
void AnimTask_BlendSelected(u8 taskId)
|
||||
{
|
||||
u32 selectedPalettes = UnpackSelectedBattleAnimPalettes(gBattleAnimArgs[0]);
|
||||
|
||||
selectedPalettes |= sub_8075CB8((gBattleAnimArgs[0] >> 7) & 1,
|
||||
(gBattleAnimArgs[0] >> 8) & 1,
|
||||
(gBattleAnimArgs[0] >> 9) & 1,
|
||||
(gBattleAnimArgs[0] >> 10) & 1);
|
||||
selectedPalettes |= SelectBattlerSpritePalettes(
|
||||
(gBattleAnimArgs[0] >> 7) & 1,
|
||||
(gBattleAnimArgs[0] >> 8) & 1,
|
||||
(gBattleAnimArgs[0] >> 9) & 1,
|
||||
(gBattleAnimArgs[0] >> 10) & 1);
|
||||
StartBlendAnimSpriteColor(taskId, selectedPalettes);
|
||||
}
|
||||
|
||||
void sub_80BA83C(u8 taskId)
|
||||
// gBattleAnimArgs[0] is a command ID
|
||||
// This command will blend bg and battlers except as commanded:
|
||||
// 0: Not attacker
|
||||
// 1: Not target
|
||||
// 2: Not attacker nor bg
|
||||
// 3: Not target nor bg
|
||||
// 4: Neither attacker nor target
|
||||
// 5: Blend all
|
||||
// 6: Neither bg nor attacker's partner
|
||||
// 7: Neither bg nor target's partner
|
||||
void AnimTask_BlendExcept(u8 taskId)
|
||||
{
|
||||
u8 battler;
|
||||
u32 selectedPalettes;
|
||||
@@ -95,7 +115,7 @@ void sub_80BA83C(u8 taskId)
|
||||
if (battler != animBattlers[0]
|
||||
&& battler != animBattlers[1]
|
||||
&& IsBattlerSpriteVisible(battler))
|
||||
selectedPalettes |= 0x10000 << sub_8075D80(battler);
|
||||
selectedPalettes |= 0x10000 << GetSpritePalIdxByBattler(battler);
|
||||
}
|
||||
StartBlendAnimSpriteColor(taskId, selectedPalettes);
|
||||
}
|
||||
@@ -190,23 +210,23 @@ static void AnimTask_BlendSpriteColor_Step2(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80BAB38(u8 taskId)
|
||||
void AnimTask_HardwarePaletteFade(u8 taskId)
|
||||
{
|
||||
BeginHardwarePaletteFade(gBattleAnimArgs[0],
|
||||
gBattleAnimArgs[1],
|
||||
gBattleAnimArgs[2],
|
||||
gBattleAnimArgs[3],
|
||||
gBattleAnimArgs[4]);
|
||||
gTasks[taskId].func = sub_80BAB78;
|
||||
gTasks[taskId].func = Task_WaitHardwarePaletteFade;
|
||||
}
|
||||
|
||||
static void sub_80BAB78(u8 taskId)
|
||||
static void Task_WaitHardwarePaletteFade(u8 taskId)
|
||||
{
|
||||
if (!gPaletteFade.active)
|
||||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
|
||||
void sub_80BAB98(u8 taskId)
|
||||
void AnimTask_CloneBattlerSpriteWithBlend(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
@@ -216,9 +236,9 @@ void sub_80BAB98(u8 taskId)
|
||||
task->data[3] = gBattleAnimArgs[2];
|
||||
task->data[4] = gBattleAnimArgs[3];
|
||||
task->data[5] = 0;
|
||||
task->func = sub_80BABD0;
|
||||
task->func = Task_DoCloneBattlerSpriteWithBlend;
|
||||
}
|
||||
static void sub_80BABD0(u8 taskId)
|
||||
static void Task_DoCloneBattlerSpriteWithBlend(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
@@ -237,7 +257,7 @@ static void sub_80BABD0(u8 taskId)
|
||||
gSprites[task->data[6]].data[0] = task->data[3];
|
||||
gSprites[task->data[6]].data[1] = taskId;
|
||||
gSprites[task->data[6]].data[2] = 5;
|
||||
gSprites[task->data[6]].callback = sub_80BACA8;
|
||||
gSprites[task->data[6]].callback = Task_FinishCloneBattlerSpriteWithBlend;
|
||||
++task->data[5];
|
||||
}
|
||||
--task->data[4];
|
||||
@@ -250,7 +270,7 @@ static void sub_80BABD0(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_80BACA8(struct Sprite *sprite)
|
||||
static void Task_FinishCloneBattlerSpriteWithBlend(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->data[0])
|
||||
{
|
||||
@@ -263,7 +283,7 @@ static void sub_80BACA8(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80BACEC(u8 taskId)
|
||||
void AnimTask_SetUpCurseBackground(u8 taskId)
|
||||
{
|
||||
u16 species;
|
||||
s32 newSpriteId;
|
||||
@@ -559,11 +579,11 @@ static void sub_80BB4B8(u8 taskId)
|
||||
|
||||
void sub_80BB660(u8 taskId)
|
||||
{
|
||||
u32 selectedPalettes = sub_8075CB8(1, 1, 1, 1);
|
||||
u32 selectedPalettes = SelectBattlerSpritePalettes(1, 1, 1, 1);
|
||||
|
||||
sub_80BB790(selectedPalettes, 0);
|
||||
gTasks[taskId].data[14] = selectedPalettes >> 16;
|
||||
selectedPalettes = sub_8075BE8(1, 0, 0, 0, 0, 0, 0) & 0xFFFF;
|
||||
selectedPalettes = SelectBattleAnimSpriteAndBgPalettes(1, 0, 0, 0, 0, 0, 0) & 0xFFFF;
|
||||
sub_80BB790(selectedPalettes, 0xFFFF);
|
||||
gTasks[taskId].data[15] = selectedPalettes;
|
||||
gTasks[taskId].data[0] = 0;
|
||||
@@ -835,7 +855,7 @@ void sub_80BBE6C(u8 taskId)
|
||||
s32 paletteIndex = 0;
|
||||
|
||||
if (gBattleAnimArgs[0] == 0)
|
||||
for (selectedPalettes = sub_8075BE8(1, 0, 0, 0, 0, 0, 0);
|
||||
for (selectedPalettes = SelectBattleAnimSpriteAndBgPalettes(1, 0, 0, 0, 0, 0, 0);
|
||||
(selectedPalettes & 1) == 0;
|
||||
++paletteIndex)
|
||||
selectedPalettes >>= 1;
|
||||
@@ -853,7 +873,7 @@ void sub_80BBF08(u8 taskId)
|
||||
s32 paletteIndex = 0;
|
||||
|
||||
if (gBattleAnimArgs[0] == 0)
|
||||
for (selectedPalettes = sub_8075BE8(1, 0, 0, 0, 0, 0, 0);
|
||||
for (selectedPalettes = SelectBattleAnimSpriteAndBgPalettes(1, 0, 0, 0, 0, 0, 0);
|
||||
(selectedPalettes & 1) == 0;
|
||||
++paletteIndex)
|
||||
selectedPalettes >>= 1;
|
||||
@@ -871,7 +891,7 @@ void sub_80BBFA4(u8 taskId)
|
||||
s32 paletteIndex = 0;
|
||||
|
||||
if (gBattleAnimArgs[0] == 0)
|
||||
for (selectedPalettes = sub_8075BE8(1, 0, 0, 0, 0, 0, 0);
|
||||
for (selectedPalettes = SelectBattleAnimSpriteAndBgPalettes(1, 0, 0, 0, 0, 0, 0);
|
||||
(selectedPalettes & 1) == 0;
|
||||
++paletteIndex)
|
||||
selectedPalettes >>= 1;
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
#include "global.h"
|
||||
#include "gflib.h"
|
||||
#include "data.h"
|
||||
#include "link.h"
|
||||
#include "m4a.h"
|
||||
#include "palette.h"
|
||||
#include "pokeball.h"
|
||||
#include "pokemon.h"
|
||||
#include "sound.h"
|
||||
#include "string_util.h"
|
||||
#include "task.h"
|
||||
#include "text.h"
|
||||
#include "util.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
#include "global.h"
|
||||
#include "gflib.h"
|
||||
#include "data.h"
|
||||
#include "link.h"
|
||||
#include "palette.h"
|
||||
#include "pokeball.h"
|
||||
#include "pokemon.h"
|
||||
#include "sound.h"
|
||||
#include "string_util.h"
|
||||
#include "task.h"
|
||||
#include "text.h"
|
||||
#include "util.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
|
||||
@@ -1,21 +1,14 @@
|
||||
#include "global.h"
|
||||
#include "gflib.h"
|
||||
#include "task.h"
|
||||
#include "pokemon.h"
|
||||
#include "pokeball.h"
|
||||
#include "party_menu.h"
|
||||
#include "bg.h"
|
||||
#include "data.h"
|
||||
#include "palette.h"
|
||||
#include "util.h"
|
||||
#include "m4a.h"
|
||||
#include "link.h"
|
||||
#include "sound.h"
|
||||
#include "item.h"
|
||||
#include "item_menu.h"
|
||||
#include "text.h"
|
||||
#include "strings.h"
|
||||
#include "string_util.h"
|
||||
#include "window.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_controllers.h"
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
#include "global.h"
|
||||
#include "gflib.h"
|
||||
#include "data.h"
|
||||
#include "main.h"
|
||||
#include "m4a.h"
|
||||
#include "task.h"
|
||||
#include "text.h"
|
||||
#include "util.h"
|
||||
#include "pokeball.h"
|
||||
#include "pokemon.h"
|
||||
#include "random.h"
|
||||
#include "sound.h"
|
||||
#include "string_util.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_controllers.h"
|
||||
|
||||
@@ -1,23 +1,16 @@
|
||||
#include "global.h"
|
||||
#include "bg.h"
|
||||
#include "gflib.h"
|
||||
#include "data.h"
|
||||
#include "item.h"
|
||||
#include "item_menu.h"
|
||||
#include "link.h"
|
||||
#include "main.h"
|
||||
#include "m4a.h"
|
||||
#include "palette.h"
|
||||
#include "party_menu.h"
|
||||
#include "pokeball.h"
|
||||
#include "pokemon.h"
|
||||
#include "sound.h"
|
||||
#include "strings.h"
|
||||
#include "string_util.h"
|
||||
#include "pokemon_special_anim.h"
|
||||
#include "task.h"
|
||||
#include "text.h"
|
||||
#include "util.h"
|
||||
#include "window.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_controllers.h"
|
||||
|
||||
@@ -1,21 +1,15 @@
|
||||
#include "global.h"
|
||||
#include "gflib.h"
|
||||
#include "task.h"
|
||||
#include "pokemon.h"
|
||||
#include "party_menu.h"
|
||||
#include "pokeball.h"
|
||||
#include "bg.h"
|
||||
#include "data.h"
|
||||
#include "palette.h"
|
||||
#include "util.h"
|
||||
#include "m4a.h"
|
||||
#include "link.h"
|
||||
#include "sound.h"
|
||||
#include "event_data.h"
|
||||
#include "item_menu.h"
|
||||
#include "text.h"
|
||||
#include "strings.h"
|
||||
#include "string_util.h"
|
||||
#include "window.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_controllers.h"
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
#include "global.h"
|
||||
#include "gflib.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_controllers.h"
|
||||
#include "battle_interface.h"
|
||||
#include "battle_message.h"
|
||||
#include "bg.h"
|
||||
#include "data.h"
|
||||
#include "item_menu.h"
|
||||
#include "link.h"
|
||||
#include "main.h"
|
||||
#include "palette.h"
|
||||
#include "pokeball.h"
|
||||
#include "pokemon.h"
|
||||
#include "sound.h"
|
||||
#include "text.h"
|
||||
#include "util.h"
|
||||
#include "strings.h"
|
||||
#include "constants/songs.h"
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "link_rfu.h"
|
||||
#include "cable_club.h"
|
||||
#include "party_menu.h"
|
||||
#include "pokemon.h"
|
||||
#include "task.h"
|
||||
#include "util.h"
|
||||
#include "constants/abilities.h"
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
#include "global.h"
|
||||
#include "main.h"
|
||||
#include "gflib.h"
|
||||
#include "m4a.h"
|
||||
#include "task.h"
|
||||
#include "malloc.h"
|
||||
#include "graphics.h"
|
||||
#include "sound.h"
|
||||
#include "decompress.h"
|
||||
#include "palette.h"
|
||||
#include "sprite.h"
|
||||
|
||||
@@ -1,19 +1,14 @@
|
||||
#include "global.h"
|
||||
#include "gflib.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_interface.h"
|
||||
#include "battle_message.h"
|
||||
#include "decompress.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "graphics.h"
|
||||
#include "menu.h"
|
||||
#include "palette.h"
|
||||
#include "pokedex.h"
|
||||
#include "pokemon_summary_screen.h"
|
||||
#include "safari_zone.h"
|
||||
#include "sound.h"
|
||||
#include "string_util.h"
|
||||
#include "text.h"
|
||||
#include "window.h"
|
||||
#include "constants/songs.h"
|
||||
|
||||
#define GetStringRightAlignXOffset(fontId, string, destWidth) ({ \
|
||||
|
||||
+1
-3
@@ -1,10 +1,8 @@
|
||||
#include "global.h"
|
||||
#include "gflib.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_setup.h"
|
||||
#include "bg.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "main.h"
|
||||
#include "scanline_effect.h"
|
||||
#include "task.h"
|
||||
#include "trig.h"
|
||||
|
||||
+1
-11
@@ -1,4 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "gflib.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_ai_script_commands.h"
|
||||
@@ -10,40 +11,29 @@
|
||||
#include "battle_setup.h"
|
||||
#include "battle_string_ids.h"
|
||||
#include "berry.h"
|
||||
#include "bg.h"
|
||||
#include "data.h"
|
||||
#include "decompress.h"
|
||||
#include "event_data.h"
|
||||
#include "evolution_scene.h"
|
||||
#include "graphics.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "help_system.h"
|
||||
#include "item.h"
|
||||
#include "link.h"
|
||||
#include "link_rfu.h"
|
||||
#include "load_save.h"
|
||||
#include "main.h"
|
||||
#include "malloc.h"
|
||||
#include "m4a.h"
|
||||
#include "palette.h"
|
||||
#include "party_menu.h"
|
||||
#include "pokeball.h"
|
||||
#include "pokedex.h"
|
||||
#include "pokemon.h"
|
||||
#include "quest_log.h"
|
||||
#include "random.h"
|
||||
#include "roamer.h"
|
||||
#include "safari_zone.h"
|
||||
#include "scanline_effect.h"
|
||||
#include "sound.h"
|
||||
#include "sprite.h"
|
||||
#include "string_util.h"
|
||||
#include "task.h"
|
||||
#include "text.h"
|
||||
#include "trig.h"
|
||||
#include "vs_seeker.h"
|
||||
#include "util.h"
|
||||
#include "window.h"
|
||||
#include "constants/abilities.h"
|
||||
#include "constants/battle_move_effects.h"
|
||||
#include "constants/battle_setup.h"
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
#include "global.h"
|
||||
#include "gflib.h"
|
||||
#include "battle_string_ids.h"
|
||||
#include "battle.h"
|
||||
#include "palette.h"
|
||||
#include "battle_anim.h"
|
||||
#include "string_util.h"
|
||||
#include "text.h"
|
||||
#include "window.h"
|
||||
#include "strings.h"
|
||||
#include "battle_message.h"
|
||||
#include "link.h"
|
||||
|
||||
@@ -1,20 +1,12 @@
|
||||
#include "global.h"
|
||||
#include "malloc.h"
|
||||
#include "main.h"
|
||||
#include "bg.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "gflib.h"
|
||||
#include "event_data.h"
|
||||
#include "palette.h"
|
||||
#include "task.h"
|
||||
#include "text.h"
|
||||
#include "window.h"
|
||||
#include "text_window.h"
|
||||
#include "battle.h"
|
||||
#include "trainer_tower.h"
|
||||
#include "trainer_pokemon_sprites.h"
|
||||
#include "scanline_effect.h"
|
||||
#include "sound.h"
|
||||
#include "string_util.h"
|
||||
#include "link.h"
|
||||
#include "menu.h"
|
||||
#include "overworld.h"
|
||||
|
||||
@@ -1,17 +1,10 @@
|
||||
#include "global.h"
|
||||
#include "gflib.h"
|
||||
#include "item.h"
|
||||
#include "util.h"
|
||||
#include "pokemon.h"
|
||||
#include "random.h"
|
||||
#include "text.h"
|
||||
#include "sound.h"
|
||||
#include "pokedex.h"
|
||||
#include "window.h"
|
||||
#include "main.h"
|
||||
#include "palette.h"
|
||||
#include "money.h"
|
||||
#include "bg.h"
|
||||
#include "string_util.h"
|
||||
#include "pokemon_icon.h"
|
||||
#include "mail.h"
|
||||
#include "event_data.h"
|
||||
|
||||
+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
@@ -457,7 +457,7 @@ static void CB2_InitBerryPouch(void)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
if ((u8)sub_80BF72C() == TRUE)
|
||||
if ((u8)MenuHelpers_CallLinkSomething() == TRUE)
|
||||
break;
|
||||
if (RunBerryPouchInit() == TRUE)
|
||||
break;
|
||||
@@ -934,7 +934,7 @@ static void Task_BerryPouchMain(u8 taskId)
|
||||
{
|
||||
s16 * data = gTasks[taskId].data;
|
||||
s32 menuInput;
|
||||
if (!gPaletteFade.active && (u8)sub_80BF72C() != TRUE)
|
||||
if (!gPaletteFade.active && (u8)MenuHelpers_CallLinkSomething() != TRUE)
|
||||
{
|
||||
menuInput = ListMenu_ProcessInput(data[0]);
|
||||
ListMenuGetScrollAndRow(data[0], &sStaticCnt.listMenuScrollOffset, &sStaticCnt.listMenuSelectedRow);
|
||||
@@ -1040,7 +1040,7 @@ static void Task_NormalContextMenu(u8 taskId)
|
||||
static void Task_NormalContextMenu_HandleInput(u8 taskId)
|
||||
{
|
||||
s8 input;
|
||||
if ((u8)sub_80BF72C() != TRUE)
|
||||
if ((u8)MenuHelpers_CallLinkSomething() != TRUE)
|
||||
{
|
||||
input = Menu_ProcessInputNoWrapAround();
|
||||
switch (input)
|
||||
|
||||
+114
-114
@@ -9,67 +9,67 @@
|
||||
#include "constants/map_types.h"
|
||||
#include "constants/songs.h"
|
||||
|
||||
static u8 sub_80BD0D4(u8 *, u16, u16);
|
||||
static u8 GetMovePlayerOnBikeFuncId(u8 *, u16, u16);
|
||||
static void sub_80BD664(void);
|
||||
static u8 sub_80BD4F0(u8, u8);
|
||||
static u8 sub_80BD3A0(u8);
|
||||
static u8 sub_80BD40C(struct ObjectEvent *, s16, s16, u8, u8);
|
||||
static bool8 sub_80BD4B8(u8);
|
||||
static void sub_80BD27C(u8);
|
||||
static void sub_80BD28C(u8);
|
||||
static void sub_80BD2C8(u8);
|
||||
static void sub_80BD358(u8);
|
||||
static void sub_80BD380(u8);
|
||||
static u8 sub_80BD100(u8 *, u16, u16);
|
||||
static u8 sub_80BD1C8(u8 *, u16, u16);
|
||||
static u8 sub_80BD1E8(u8 *, u16, u16);
|
||||
static u8 BikeCanFaceDIrectionOnRail(u8, u8);
|
||||
static u8 CheckNextTileForBikingCollision(u8);
|
||||
static u8 AdjustCollisionForBiking(struct ObjectEvent *, s16, s16, u8, u8);
|
||||
static bool8 MetatileBehaviorForbidsBiking(u8);
|
||||
static void BikeFaceDirection(u8);
|
||||
static void BikeFaceDirectionAccountForRail(u8);
|
||||
static void BikeTryMoveFastInDirection(u8);
|
||||
static void BikeLetGravityTakeTheWheel(u8);
|
||||
static void BikeTryMoveInDirection(u8);
|
||||
static u8 GetBikeMoveCmd_0(u8 *, u16, u16);
|
||||
static u8 GetBikeMoveCmd_1(u8 *, u16, u16);
|
||||
static u8 GetBikeMoveCmd_2(u8 *, u16, u16);
|
||||
|
||||
static void (*const gUnknown_83E7CFC[])(u8) =
|
||||
static void (*const sMovePlayerOnBikeFuncs[])(u8) =
|
||||
{
|
||||
sub_80BD27C,
|
||||
sub_80BD28C,
|
||||
sub_80BD2C8,
|
||||
sub_80BD358,
|
||||
sub_80BD380,
|
||||
BikeFaceDirection,
|
||||
BikeFaceDirectionAccountForRail,
|
||||
BikeTryMoveFastInDirection,
|
||||
BikeLetGravityTakeTheWheel,
|
||||
BikeTryMoveInDirection,
|
||||
};
|
||||
|
||||
static u8 (*const gUnknown_83E7D10[])(u8 *, u16, u16) =
|
||||
static u8 (*const sGetMovePlayerOnBikeFuncIdFuncs[])(u8 *, u16, u16) =
|
||||
{
|
||||
sub_80BD100,
|
||||
sub_80BD1C8,
|
||||
sub_80BD1E8,
|
||||
GetBikeMoveCmd_0,
|
||||
GetBikeMoveCmd_1,
|
||||
GetBikeMoveCmd_2,
|
||||
};
|
||||
|
||||
void MovePlayerOnBike(u8 direction, u16 newKeys, u16 heldKeys)
|
||||
{
|
||||
gUnknown_83E7CFC[sub_80BD0D4(&direction, newKeys, heldKeys)](direction);
|
||||
sMovePlayerOnBikeFuncs[GetMovePlayerOnBikeFuncId(&direction, newKeys, heldKeys)](direction);
|
||||
}
|
||||
|
||||
static u8 sub_80BD0D4(u8 *direction, u16 newKeys, u16 heldKeys)
|
||||
static u8 GetMovePlayerOnBikeFuncId(u8 *direction, u16 newKeys, u16 heldKeys)
|
||||
{
|
||||
return gUnknown_83E7D10[gPlayerAvatar.acroBikeState](direction, newKeys, heldKeys);
|
||||
return sGetMovePlayerOnBikeFuncIdFuncs[gPlayerAvatar.acroBikeState](direction, newKeys, heldKeys);
|
||||
}
|
||||
|
||||
static u8 sub_80BD100(u8 *r6, u16 sl, u16 sb)
|
||||
static u8 GetBikeMoveCmd_0(u8 *direction_p, u16 newKeys, u16 heldKeys)
|
||||
{
|
||||
struct ObjectEvent *r4 = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
u8 r7 = GetPlayerMovementDirection();
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
u8 direction = GetPlayerMovementDirection();
|
||||
|
||||
gPlayerAvatar.bikeFrameCounter = 0;
|
||||
if (MetatileBehavior_IsCyclingRoadPullDownTile(r4->currentMetatileBehavior) == TRUE)
|
||||
if (MetatileBehavior_IsCyclingRoadPullDownTile(playerObjEvent->currentMetatileBehavior) == TRUE)
|
||||
{
|
||||
if (!JOY_HELD(B_BUTTON))
|
||||
{
|
||||
gPlayerAvatar.acroBikeState = ACRO_STATE_WHEELIE_STANDING;
|
||||
gPlayerAvatar.runningState = 2;
|
||||
if (*r6 < 2)
|
||||
if (*direction_p < DIR_NORTH)
|
||||
return 3;
|
||||
else
|
||||
return 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*r6 != 0)
|
||||
if (*direction_p != DIR_NONE)
|
||||
{
|
||||
gPlayerAvatar.acroBikeState = ACRO_STATE_WHEELIE_STANDING;
|
||||
gPlayerAvatar.runningState = 2;
|
||||
@@ -83,21 +83,21 @@ static u8 sub_80BD100(u8 *r6, u16 sl, u16 sb)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*r6 == 0)
|
||||
if (*direction_p == DIR_NONE)
|
||||
{
|
||||
_080BD17E:
|
||||
*r6 = r7;
|
||||
*direction_p = direction;
|
||||
gPlayerAvatar.runningState = 0;
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*r6 != r7 && gPlayerAvatar.runningState != 2)
|
||||
if (*direction_p != direction && gPlayerAvatar.runningState != 2)
|
||||
{
|
||||
gPlayerAvatar.acroBikeState = ACRO_STATE_TURNING;
|
||||
gPlayerAvatar.newDirBackup = *r6;
|
||||
gPlayerAvatar.newDirBackup = *direction_p;
|
||||
gPlayerAvatar.runningState = 0;
|
||||
return sub_80BD0D4(r6, sl, sb);
|
||||
return GetMovePlayerOnBikeFuncId(direction_p, newKeys, heldKeys);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -108,33 +108,33 @@ static u8 sub_80BD100(u8 *r6, u16 sl, u16 sb)
|
||||
}
|
||||
}
|
||||
|
||||
static u8 sub_80BD1C8(u8 *r0, UNUSED u16 r1, UNUSED u16 r2)
|
||||
static u8 GetBikeMoveCmd_1(u8 *direction_p, UNUSED u16 newKeys, UNUSED u16 heldKeys)
|
||||
{
|
||||
*r0 = gPlayerAvatar.newDirBackup;
|
||||
*direction_p = gPlayerAvatar.newDirBackup;
|
||||
gPlayerAvatar.runningState = 1;
|
||||
gPlayerAvatar.acroBikeState = ACRO_STATE_NORMAL;
|
||||
sub_80BD664();
|
||||
return 1;
|
||||
}
|
||||
|
||||
static u8 sub_80BD1E8(u8 *r6, u16 sb, u16 r8)
|
||||
static u8 GetBikeMoveCmd_2(u8 *direction_p, u16 newKeys, u16 heldKeys)
|
||||
{
|
||||
u8 r5 = GetPlayerMovementDirection();
|
||||
u8 r1 = gPlayerAvatar.objectEventId;
|
||||
if (MetatileBehavior_IsCyclingRoadPullDownTile(r1[gObjectEvents].currentMetatileBehavior) == TRUE)
|
||||
u8 direction = GetPlayerMovementDirection();
|
||||
u8 playerObjEventId = gPlayerAvatar.objectEventId;
|
||||
if (MetatileBehavior_IsCyclingRoadPullDownTile(playerObjEventId[gObjectEvents].currentMetatileBehavior) == TRUE)
|
||||
{
|
||||
if (*r6 != r5)
|
||||
if (*direction_p != direction)
|
||||
{
|
||||
gPlayerAvatar.acroBikeState = ACRO_STATE_TURNING;
|
||||
gPlayerAvatar.newDirBackup = *r6;
|
||||
gPlayerAvatar.newDirBackup = *direction_p;
|
||||
gPlayerAvatar.runningState = 0;
|
||||
return sub_80BD0D4(r6, sb, r8);
|
||||
return GetMovePlayerOnBikeFuncId(direction_p, newKeys, heldKeys);
|
||||
}
|
||||
else
|
||||
{
|
||||
gPlayerAvatar.runningState = 2;
|
||||
gPlayerAvatar.acroBikeState = ACRO_STATE_WHEELIE_STANDING;
|
||||
if (*r6 < 2)
|
||||
if (*direction_p < DIR_NORTH)
|
||||
return 3;
|
||||
else
|
||||
return 4;
|
||||
@@ -143,9 +143,9 @@ static u8 sub_80BD1E8(u8 *r6, u16 sb, u16 r8)
|
||||
else
|
||||
{
|
||||
gPlayerAvatar.acroBikeState = ACRO_STATE_NORMAL;
|
||||
if (*r6 == 0)
|
||||
if (*direction_p == DIR_NONE)
|
||||
{
|
||||
*r6 = r5;
|
||||
*direction_p = direction;
|
||||
gPlayerAvatar.runningState = 0;
|
||||
return 0;
|
||||
}
|
||||
@@ -157,100 +157,100 @@ static u8 sub_80BD1E8(u8 *r6, u16 sb, u16 r8)
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_80BD27C(u8 r0)
|
||||
static void BikeFaceDirection(u8 direction)
|
||||
{
|
||||
PlayerFaceDirection(r0);
|
||||
PlayerFaceDirection(direction);
|
||||
}
|
||||
|
||||
static void sub_80BD28C(u8 r4)
|
||||
static void BikeFaceDirectionAccountForRail(u8 direction)
|
||||
{
|
||||
struct ObjectEvent *r5 = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
|
||||
if (!sub_80BD4F0(r4, r5->currentMetatileBehavior))
|
||||
r4 = r5->movementDirection;
|
||||
PlayerFaceDirection(r4);
|
||||
if (!BikeCanFaceDIrectionOnRail(direction, playerObjEvent->currentMetatileBehavior))
|
||||
direction = playerObjEvent->movementDirection;
|
||||
PlayerFaceDirection(direction);
|
||||
}
|
||||
|
||||
static void sub_80BD2C8(u8 r4)
|
||||
static void BikeTryMoveFastInDirection(u8 direction)
|
||||
{
|
||||
struct ObjectEvent *r5;
|
||||
struct ObjectEvent *playerObjEvent;
|
||||
|
||||
r5 = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
if (!sub_80BD4F0(r4, r5->currentMetatileBehavior))
|
||||
playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
if (!BikeCanFaceDIrectionOnRail(direction, playerObjEvent->currentMetatileBehavior))
|
||||
{
|
||||
sub_80BD27C(r5->movementDirection);
|
||||
BikeFaceDirection(playerObjEvent->movementDirection);
|
||||
}
|
||||
else
|
||||
{
|
||||
u8 r1 = sub_80BD3A0(r4);
|
||||
u8 collision = CheckNextTileForBikingCollision(direction);
|
||||
|
||||
if (r1 > 0 && r1 <= 11)
|
||||
if (collision > COLLISION_NONE && collision <= COLLISION_ISOLATED_HORIZONTAL_RAIL)
|
||||
{
|
||||
if (r1 == 6)
|
||||
PlayerJumpLedge(r4);
|
||||
else if (r1 != 5 && r1 != 6 && r1 != 7 && r1 != 8)
|
||||
PlayerOnBikeCollide(r4);
|
||||
if (collision == COLLISION_LEDGE_JUMP)
|
||||
PlayerJumpLedge(direction);
|
||||
else if (collision != COLLISION_STOP_SURFING && collision != COLLISION_LEDGE_JUMP && collision != COLLISION_PUSHED_BOULDER && collision != COLLISION_UNKNOWN_WARP_6C_6D_6E_6F)
|
||||
PlayerOnBikeCollide(direction);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (r1 == 14)
|
||||
PlayerGoSpeed2(r4);
|
||||
else if (PlayerIsMovingOnRockStairs(r4))
|
||||
PlayerGoSpeed2(r4);
|
||||
if (collision == COLLISION_COUNT)
|
||||
PlayerGoSpeed2(direction);
|
||||
else if (PlayerIsMovingOnRockStairs(direction))
|
||||
PlayerGoSpeed2(direction);
|
||||
else
|
||||
PlayerRideWaterCurrent(r4);
|
||||
PlayerRideWaterCurrent(direction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_80BD358(UNUSED u8 v)
|
||||
static void BikeLetGravityTakeTheWheel(UNUSED u8 v)
|
||||
{
|
||||
u8 r0 = sub_80BD3A0(1);
|
||||
u8 collision = CheckNextTileForBikingCollision(DIR_SOUTH);
|
||||
|
||||
if (r0 == 0)
|
||||
sub_805C164(1);
|
||||
else if (r0 == 6)
|
||||
PlayerJumpLedge(1);
|
||||
if (collision == COLLISION_NONE)
|
||||
sub_805C164(DIR_SOUTH);
|
||||
else if (collision == COLLISION_LEDGE_JUMP)
|
||||
PlayerJumpLedge(DIR_SOUTH);
|
||||
}
|
||||
|
||||
static void sub_80BD380(u8 r4)
|
||||
static void BikeTryMoveInDirection(u8 direction)
|
||||
{
|
||||
if (sub_80BD3A0(r4) == 0)
|
||||
PlayerGoSpeed1(r4);
|
||||
if (CheckNextTileForBikingCollision(direction) == COLLISION_NONE)
|
||||
PlayerGoSpeed1(direction);
|
||||
}
|
||||
|
||||
static u8 sub_80BD3A0(u8 r6)
|
||||
static u8 CheckNextTileForBikingCollision(u8 direction)
|
||||
{
|
||||
struct ObjectEvent *r4 = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
s16 sp04, sp06;
|
||||
u8 r0;
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
s16 x, y;
|
||||
u8 metatileBehavior;
|
||||
|
||||
sp04 = r4->currentCoords.x;
|
||||
sp06 = r4->currentCoords.y;
|
||||
MoveCoords(r6, &sp04, &sp06);
|
||||
r0 = MapGridGetMetatileBehaviorAt(sp04, sp06);
|
||||
return sub_80BD40C(r4, sp04, sp06, r6, r0);
|
||||
x = playerObjEvent->currentCoords.x;
|
||||
y = playerObjEvent->currentCoords.y;
|
||||
MoveCoords(direction, &x, &y);
|
||||
metatileBehavior = MapGridGetMetatileBehaviorAt(x, y);
|
||||
return AdjustCollisionForBiking(playerObjEvent, x, y, direction, metatileBehavior);
|
||||
}
|
||||
|
||||
static u8 sub_80BD40C(struct ObjectEvent *r0, s16 r1, s16 r2, u8 r3, u8 r5)
|
||||
static u8 AdjustCollisionForBiking(struct ObjectEvent *playerObjEvent, s16 x, s16 y, u8 direction, u8 metatileBehavior)
|
||||
{
|
||||
u8 r4 = CheckForObjectEventCollision(r0, r1, r2, r3, r5);
|
||||
u8 retVal = CheckForObjectEventCollision(playerObjEvent, x, y, direction, metatileBehavior);
|
||||
|
||||
if (r4 <= 4)
|
||||
if (retVal <= COLLISION_OBJECT_EVENT)
|
||||
{
|
||||
u8 r0 = MetatileBehavior_IsCrackedIce(r5);
|
||||
if (r0 == TRUE)
|
||||
return 14;
|
||||
if (r4 == 0 && sub_80BD4B8(r5))
|
||||
r4 = 2;
|
||||
bool8 isCrackedIce = MetatileBehavior_IsCrackedIce(metatileBehavior);
|
||||
if (isCrackedIce == TRUE)
|
||||
return COLLISION_COUNT;
|
||||
if (retVal == COLLISION_NONE && MetatileBehaviorForbidsBiking(metatileBehavior))
|
||||
retVal = COLLISION_IMPASSABLE;
|
||||
}
|
||||
return r4;
|
||||
return retVal;
|
||||
}
|
||||
|
||||
bool8 sub_80BD460(u8 r0)
|
||||
{
|
||||
if (sub_80BD4B8(r0))
|
||||
if (MetatileBehaviorForbidsBiking(r0))
|
||||
return TRUE;
|
||||
if (gMapHeader.mapType != MAP_TYPE_INDOOR)
|
||||
return FALSE;
|
||||
@@ -262,13 +262,13 @@ bool32 IsRunningDisallowed(u8 metatileBehavior)
|
||||
{
|
||||
if (!(gMapHeader.flags & MAP_ALLOW_RUN))
|
||||
return TRUE;
|
||||
if (sub_80BD4B8(metatileBehavior) != TRUE)
|
||||
if (MetatileBehaviorForbidsBiking(metatileBehavior) != TRUE)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static bool8 sub_80BD4B8(u8 r4)
|
||||
static bool8 MetatileBehaviorForbidsBiking(u8 r4)
|
||||
{
|
||||
if (MetatileBehavior_IsMB0A(r4))
|
||||
return TRUE;
|
||||
@@ -279,31 +279,31 @@ static bool8 sub_80BD4B8(u8 r4)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static bool8 sub_80BD4F0(u8 r0, u8 r4)
|
||||
static bool8 BikeCanFaceDIrectionOnRail(u8 direction, u8 metatileBehavior)
|
||||
{
|
||||
if (r0 == DIR_EAST || r0 == DIR_WEST)
|
||||
if (direction == DIR_EAST || direction == DIR_WEST)
|
||||
{
|
||||
if (MetatileBehavior_IsIsolatedVerticalRail(r4) || MetatileBehavior_IsVerticalRail(r4))
|
||||
if (MetatileBehavior_IsIsolatedVerticalRail(metatileBehavior) || MetatileBehavior_IsVerticalRail(metatileBehavior))
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (MetatileBehavior_IsIsolatedHorizontalRail(r4) || MetatileBehavior_IsHorizontalRail(r4))
|
||||
if (MetatileBehavior_IsIsolatedHorizontalRail(metatileBehavior) || MetatileBehavior_IsHorizontalRail(metatileBehavior))
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 sub_80BD540(void)
|
||||
bool8 MetatileAtPlayerPositionForbidsBiking(void)
|
||||
{
|
||||
s16 sp00, sp02;
|
||||
u8 r0;
|
||||
s16 x, y;
|
||||
u8 metatileBehavior;
|
||||
|
||||
if (!(gPlayerAvatar.flags & (PLAYER_AVATAR_FLAG_UNDERWATER | PLAYER_AVATAR_FLAG_SURFING)))
|
||||
{
|
||||
PlayerGetDestCoords(&sp00, &sp02);
|
||||
r0 = MapGridGetMetatileBehaviorAt(sp00, sp02);
|
||||
if (!sub_80BD4B8(r0))
|
||||
PlayerGetDestCoords(&x, &y);
|
||||
metatileBehavior = MapGridGetMetatileBehaviorAt(x, y);
|
||||
if (!MetatileBehaviorForbidsBiking(metatileBehavior))
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
@@ -331,7 +331,7 @@ void StartTransitionToFlipBikeState(u8 flags)
|
||||
else
|
||||
{
|
||||
SetPlayerAvatarTransitionFlags(flags);
|
||||
if (sub_8056124(MUS_CYCLING))
|
||||
if (Overworld_MusicCanOverrideMapMusic(MUS_CYCLING))
|
||||
{
|
||||
Overworld_SetSavedMusic(MUS_CYCLING);
|
||||
Overworld_ChangeMusicTo(MUS_CYCLING);
|
||||
@@ -339,7 +339,7 @@ void StartTransitionToFlipBikeState(u8 flags)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80BD620(u32 directionHistory, u32 abStartSelectHistory)
|
||||
void InitPlayerAvatarBikeState(u32 directionHistory, u32 abStartSelectHistory)
|
||||
{
|
||||
u8 i;
|
||||
|
||||
|
||||
+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);
|
||||
}
|
||||
|
||||
+2
-2
@@ -738,7 +738,7 @@ static void CB2_Credits(void)
|
||||
sCreditsMgr->unk_1D++;
|
||||
break;
|
||||
case 2:
|
||||
FlagClear(FLAG_SPECIAL_FLAG_0x4000);
|
||||
FlagClear(FLAG_DONT_SHOW_MAP_NAME_POPUP);
|
||||
gDisableMapMusicChangeOnMapLoad = MUSIC_DISABLE_OFF;
|
||||
Free(sCreditsMgr);
|
||||
SoftReset(RESET_ALL);
|
||||
@@ -785,7 +785,7 @@ static bool32 DoOverworldMapScrollScene(UNUSED u8 unused)
|
||||
switch (sCreditsMgr->subseqno)
|
||||
{
|
||||
case 0:
|
||||
FlagSet(FLAG_SPECIAL_FLAG_0x4000);
|
||||
FlagSet(FLAG_DONT_SHOW_MAP_NAME_POPUP);
|
||||
gDisableMapMusicChangeOnMapLoad = MUSIC_DISABLE_KEEP;
|
||||
sCreditsMgr->ovwldseqno = 0;
|
||||
sCreditsMgr->subseqno++;
|
||||
|
||||
@@ -0,0 +1,573 @@
|
||||
const u8 DecorDesc_SMALL_DESK[] = _(
|
||||
"A small desk built\n"
|
||||
"for one.");
|
||||
|
||||
const u8 DecorDesc_POKEMON_DESK[] = _(
|
||||
"A small desk built in\n"
|
||||
"the shape of a POKé\n"
|
||||
"BALL.");
|
||||
|
||||
const u8 DecorDesc_HEAVY_DESK[] = _(
|
||||
"A large desk made\n"
|
||||
"of steel. Put some\n"
|
||||
"decorations on it.");
|
||||
|
||||
const u8 DecorDesc_RAGGED_DESK[] = _(
|
||||
"A large desk made\n"
|
||||
"of wood. Put some\n"
|
||||
"decorations on it.");
|
||||
|
||||
const u8 DecorDesc_COMFORT_DESK[] = _(
|
||||
"A large desk made\n"
|
||||
"of leaves. Put some\n"
|
||||
"decorations on it.");
|
||||
|
||||
const u8 DecorDesc_PRETTY_DESK[] = _(
|
||||
"A huge desk made\n"
|
||||
"of glass. Holds lots\n"
|
||||
"of decorations.");
|
||||
|
||||
const u8 DecorDesc_BRICK_DESK[] = _(
|
||||
"A huge desk made\n"
|
||||
"of brick. Holds lots\n"
|
||||
"of decorations.");
|
||||
|
||||
const u8 DecorDesc_CAMP_DESK[] = _(
|
||||
"A huge desk made\n"
|
||||
"of logs. Put lots of\n"
|
||||
"decorations on it.");
|
||||
|
||||
const u8 DecorDesc_HARD_DESK[] = _(
|
||||
"A huge desk made\n"
|
||||
"of rocks. Holds\n"
|
||||
"many decorations.");
|
||||
|
||||
const u8 DecorDesc_SMALL_CHAIR[] = _(
|
||||
"A small chair made\n"
|
||||
"for one.");
|
||||
|
||||
const u8 DecorDesc_POKEMON_CHAIR[] = _(
|
||||
"A small chair built\n"
|
||||
"in the shape of a\n"
|
||||
"POKé BALL.");
|
||||
|
||||
const u8 DecorDesc_HEAVY_CHAIR[] = _(
|
||||
"A small chair made\n"
|
||||
"of steel.");
|
||||
|
||||
const u8 DecorDesc_PRETTY_CHAIR[] = _(
|
||||
"A small chair made\n"
|
||||
"of glass.");
|
||||
|
||||
const u8 DecorDesc_COMFORT_CHAIR[] = _(
|
||||
"A small chair made\n"
|
||||
"of leaves.");
|
||||
|
||||
const u8 DecorDesc_RAGGED_CHAIR[] = _(
|
||||
"A small chair made\n"
|
||||
"of wood.");
|
||||
|
||||
const u8 DecorDesc_BRICK_CHAIR[] = _(
|
||||
"A small chair made\n"
|
||||
"of brick.");
|
||||
|
||||
const u8 DecorDesc_CAMP_CHAIR[] = _(
|
||||
"A small chair made\n"
|
||||
"of logs.");
|
||||
|
||||
const u8 DecorDesc_HARD_CHAIR[] = _(
|
||||
"A small chair made\n"
|
||||
"of rock.");
|
||||
|
||||
const u8 DecorDesc_RED_PLANT[] = _(
|
||||
"A vivid red potted\n"
|
||||
"plant.");
|
||||
|
||||
const u8 DecorDesc_TROPICAL_PLANT[] = _(
|
||||
"A flowering tropical\n"
|
||||
"plant in a pot.");
|
||||
|
||||
const u8 DecorDesc_PRETTY_FLOWERS[] = _(
|
||||
"A pot of cute\n"
|
||||
"flowers.");
|
||||
|
||||
const u8 DecorDesc_COLORFUL_PLANT[] = _(
|
||||
"A large pot with\n"
|
||||
"many colorful\n"
|
||||
"flowers.");
|
||||
|
||||
const u8 DecorDesc_BIG_PLANT[] = _(
|
||||
"A large, umbrella-\n"
|
||||
"shaped plant in a\n"
|
||||
"big pot.");
|
||||
|
||||
const u8 DecorDesc_GORGEOUS_PLANT[] = _(
|
||||
"A large, impressive\n"
|
||||
"plant in a big pot.");
|
||||
|
||||
const u8 DecorDesc_RED_BRICK[] = _(
|
||||
"A red-colored brick.\n"
|
||||
"Decorations can be\n"
|
||||
"placed on top.");
|
||||
|
||||
const u8 DecorDesc_YELLOW_BRICK[] = _(
|
||||
"A yellow-colored\n"
|
||||
"brick. Put some\n"
|
||||
"decorations on top.");
|
||||
|
||||
const u8 DecorDesc_BLUE_BRICK[] = _(
|
||||
"A blue-colored\n"
|
||||
"brick. Put some\n"
|
||||
"decorations on top.");
|
||||
|
||||
const u8 DecorDesc_RED_BALLOON[] = _(
|
||||
"A red balloon filled\n"
|
||||
"with water. Bursts\n"
|
||||
"if stepped on.");
|
||||
|
||||
const u8 DecorDesc_BLUE_BALLOON[] = _(
|
||||
"A blue balloon filled\n"
|
||||
"with water. Bursts\n"
|
||||
"if stepped on.");
|
||||
|
||||
const u8 DecorDesc_YELLOW_BALLOON[] = _(
|
||||
"A yellow balloon\n"
|
||||
"filled with water.\n"
|
||||
"Pops if stepped on.");
|
||||
|
||||
const u8 DecorDesc_RED_TENT[] = _(
|
||||
"A large red tent.\n"
|
||||
"You can hide inside\n"
|
||||
"it.");
|
||||
|
||||
const u8 DecorDesc_BLUE_TENT[] = _(
|
||||
"A large blue tent.\n"
|
||||
"You can hide inside\n"
|
||||
"it.");
|
||||
|
||||
const u8 DecorDesc_SOLID_BOARD[] = _(
|
||||
"Place over a hole to\n"
|
||||
"cross to the other\n"
|
||||
"side.");
|
||||
|
||||
const u8 DecorDesc_SLIDE[] = _(
|
||||
"Use to slide down\n"
|
||||
"from the platform.");
|
||||
|
||||
const u8 DecorDesc_FENCE_LENGTH[] = _(
|
||||
"A small fence that\n"
|
||||
"blocks passage.");
|
||||
|
||||
const u8 DecorDesc_FENCE_WIDTH[] = _(
|
||||
"A small fence that\n"
|
||||
"blocks passage.");
|
||||
|
||||
const u8 DecorDesc_TIRE[] = _(
|
||||
"An old large tire.\n"
|
||||
"Decorations can be\n"
|
||||
"placed on top.");
|
||||
|
||||
const u8 DecorDesc_STAND[] = _(
|
||||
"A large pedestal\n"
|
||||
"with steps.");
|
||||
|
||||
const u8 DecorDesc_MUD_BALL[] = _(
|
||||
"A large ball of mud.\n"
|
||||
"Crumbles if stepped\n"
|
||||
"on.");
|
||||
|
||||
const u8 DecorDesc_BREAKABLE_DOOR[] = _(
|
||||
"A weird door that\n"
|
||||
"people can walk\n"
|
||||
"right through.");
|
||||
|
||||
const u8 DecorDesc_SAND_ORNAMENT[] = _(
|
||||
"An ornament made\n"
|
||||
"of sand. Crumbles if\n"
|
||||
"touched.");
|
||||
|
||||
const u8 DecorDesc_SILVER_SHIELD[] = _(
|
||||
"Awarded for 50\n"
|
||||
"straight wins at\n"
|
||||
"the BATTLE TOWER.");
|
||||
|
||||
const u8 DecorDesc_GOLD_SHIELD[] = _(
|
||||
"Awarded for 100\n"
|
||||
"straight wins at\n"
|
||||
"the BATTLE TOWER.");
|
||||
|
||||
const u8 DecorDesc_GLASS_ORNAMENT[] = _(
|
||||
"A glass replica of\n"
|
||||
"a famous sculpture\n"
|
||||
"at the ART MUSEUM.");
|
||||
|
||||
const u8 DecorDesc_TV[] = _(
|
||||
"A small, gray-\n"
|
||||
"colored toy TV.");
|
||||
|
||||
const u8 DecorDesc_ROUND_TV[] = _(
|
||||
"A toy TV modeled\n"
|
||||
"in the image of a\n"
|
||||
"SEEDOT.");
|
||||
|
||||
const u8 DecorDesc_CUTE_TV[] = _(
|
||||
"A toy TV modeled\n"
|
||||
"in the image of a\n"
|
||||
"SKITTY.");
|
||||
|
||||
const u8 DecorDesc_GLITTER_MAT[] = _(
|
||||
"An odd mat that\n"
|
||||
"glitters if stepped\n"
|
||||
"on.");
|
||||
|
||||
const u8 DecorDesc_JUMP_MAT[] = _(
|
||||
"A trick mat that\n"
|
||||
"jumps when it is\n"
|
||||
"stepped on.");
|
||||
|
||||
const u8 DecorDesc_SPIN_MAT[] = _(
|
||||
"A trick mat that\n"
|
||||
"spins around when\n"
|
||||
"stepped on.");
|
||||
|
||||
const u8 DecorDesc_C_LOW_NOTE_MAT[] = _(
|
||||
"A mat that plays\n"
|
||||
"a low C note when\n"
|
||||
"stepped on.");
|
||||
|
||||
const u8 DecorDesc_D_NOTE_MAT[] = _(
|
||||
"A mat that plays\n"
|
||||
"a D note when\n"
|
||||
"stepped on.");
|
||||
|
||||
const u8 DecorDesc_E_NOTE_MAT[] = _(
|
||||
"A mat that plays\n"
|
||||
"an E note when\n"
|
||||
"stepped on.");
|
||||
|
||||
const u8 DecorDesc_F_NOTE_MAT[] = _(
|
||||
"A mat that plays\n"
|
||||
"an F note when\n"
|
||||
"stepped on.");
|
||||
|
||||
const u8 DecorDesc_G_NOTE_MAT[] = _(
|
||||
"A mat that plays\n"
|
||||
"a G note when\n"
|
||||
"stepped on.");
|
||||
|
||||
const u8 DecorDesc_A_NOTE_MAT[] = _(
|
||||
"A mat that plays\n"
|
||||
"an A note when\n"
|
||||
"stepped on.");
|
||||
|
||||
const u8 DecorDesc_B_NOTE_MAT[] = _(
|
||||
"A mat that plays\n"
|
||||
"a B note when\n"
|
||||
"stepped on.");
|
||||
|
||||
const u8 DecorDesc_C_HIGH_NOTE_MAT[] = _(
|
||||
"A mat that plays\n"
|
||||
"a high C note when\n"
|
||||
"stepped on.");
|
||||
|
||||
const u8 DecorDesc_SURF_MAT[] = _(
|
||||
"A mat designed with\n"
|
||||
"a SURF image.\n"
|
||||
"Put items on top.");
|
||||
|
||||
const u8 DecorDesc_THUNDER_MAT[] = _(
|
||||
"A mat designed with\n"
|
||||
"a THUNDER image.\n"
|
||||
"Put items on top.");
|
||||
|
||||
const u8 DecorDesc_FIRE_BLAST_MAT[] = _(
|
||||
"A mat designed with\n"
|
||||
"a FIRE BLAST image.\n"
|
||||
"Put items on top.");
|
||||
|
||||
const u8 DecorDesc_POWDER_SNOW_MAT[] = _(
|
||||
"A mat with a POWDER\n"
|
||||
"SNOW image design.\n"
|
||||
"Put items on top.");
|
||||
|
||||
const u8 DecorDesc_ATTRACT_MAT[] = _(
|
||||
"A mat designed with\n"
|
||||
"an ATTRACT image.\n"
|
||||
"Put items on top.");
|
||||
|
||||
const u8 DecorDesc_FISSURE_MAT[] = _(
|
||||
"A mat designed with\n"
|
||||
"a FISSURE image.\n"
|
||||
"Put items on top.");
|
||||
|
||||
const u8 DecorDesc_SPIKES_MAT[] = _(
|
||||
"A mat designed with\n"
|
||||
"a SPIKES image.\n"
|
||||
"Put items on top.");
|
||||
|
||||
const u8 DecorDesc_BALL_POSTER[] = _(
|
||||
"A small poster\n"
|
||||
"printed with POKé\n"
|
||||
"BALLS.");
|
||||
|
||||
const u8 DecorDesc_GREEN_POSTER[] = _(
|
||||
"A small poster with\n"
|
||||
"a TREECKO print.");
|
||||
|
||||
const u8 DecorDesc_RED_POSTER[] = _(
|
||||
"A small poster with\n"
|
||||
"a TORCHIC print.");
|
||||
|
||||
const u8 DecorDesc_BLUE_POSTER[] = _(
|
||||
"A small poster with\n"
|
||||
"a MUDKIP print.");
|
||||
|
||||
const u8 DecorDesc_CUTE_POSTER[] = _(
|
||||
"A small poster with\n"
|
||||
"an AZURILL print.");
|
||||
|
||||
const u8 DecorDesc_PIKA_POSTER[] = _(
|
||||
"A large poster with\n"
|
||||
"a PIKACHU and\n"
|
||||
"PICHU print.");
|
||||
|
||||
const u8 DecorDesc_LONG_POSTER[] = _(
|
||||
"A large poster with\n"
|
||||
"a SEVIPER print.");
|
||||
|
||||
const u8 DecorDesc_SEA_POSTER[] = _(
|
||||
"A large poster with\n"
|
||||
"a RELICANTH print.");
|
||||
|
||||
const u8 DecorDesc_SKY_POSTER[] = _(
|
||||
"A large poster with\n"
|
||||
"a WINGULL print.");
|
||||
|
||||
const u8 DecorDesc_KISS_POSTER[] = _(
|
||||
"A large poster with\n"
|
||||
"a SMOOCHUM print.");
|
||||
|
||||
const u8 DecorDesc_PICHU_DOLL[] = _(
|
||||
"A PICHU doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_PIKACHU_DOLL[] = _(
|
||||
"A PIKACHU doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_MARILL_DOLL[] = _(
|
||||
"A MARILL doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_TOGEPI_DOLL[] = _(
|
||||
"A TOGEPI doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_CYNDAQUIL_DOLL[] = _(
|
||||
"A CYNDAQUIL doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_CHIKORITA_DOLL[] = _(
|
||||
"A CHIKORITA doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_TOTODILE_DOLL[] = _(
|
||||
"A TOTODILE doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_JIGGLYPUFF_DOLL[] = _(
|
||||
"A JIGGLYPUFF doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_MEOWTH_DOLL[] = _(
|
||||
"A MEOWTH doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_CLEFAIRY_DOLL[] = _(
|
||||
"A CLEFAIRY doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_DITTO_DOLL[] = _(
|
||||
"A DITTO doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_SMOOCHUM_DOLL[] = _(
|
||||
"A SMOOCHUM doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_TREECKO_DOLL[] = _(
|
||||
"A TREECKO doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_TORCHIC_DOLL[] = _(
|
||||
"A TORCHIC doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_MUDKIP_DOLL[] = _(
|
||||
"A MUDKIP doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_DUSKULL_DOLL[] = _(
|
||||
"A DUSKULL doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_WYNAUT_DOLL[] = _(
|
||||
"A WYNAUT doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_BALTOY_DOLL[] = _(
|
||||
"A BALTOY doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_KECLEON_DOLL[] = _(
|
||||
"A KECLEON doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_AZURILL_DOLL[] = _(
|
||||
"An AZURILL doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_SKITTY_DOLL[] = _(
|
||||
"A SKITTY doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_SWABLU_DOLL[] = _(
|
||||
"A SWABLU doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_GULPIN_DOLL[] = _(
|
||||
"A GULPIN doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_LOTAD_DOLL[] = _(
|
||||
"A LOTAD doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_SEEDOT_DOLL[] = _(
|
||||
"A SEEDOT doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_PIKA_CUSHION[] = _(
|
||||
"A PIKACHU cushion.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_ROUND_CUSHION[] = _(
|
||||
"A MARILL cushion.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_KISS_CUSHION[] = _(
|
||||
"A SMOOCHUM\n"
|
||||
"cushion. Place it on\n"
|
||||
"a mat or a desk.");
|
||||
|
||||
const u8 DecorDesc_ZIGZAG_CUSHION[] = _(
|
||||
"A ZIGZAGOON\n"
|
||||
"cushion. Place it on\n"
|
||||
"a mat or a desk.");
|
||||
|
||||
const u8 DecorDesc_SPIN_CUSHION[] = _(
|
||||
"A SPINDA cushion.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_DIAMOND_CUSHION[] = _(
|
||||
"A SABLEYE cushion.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_BALL_CUSHION[] = _(
|
||||
"A BALL cushion.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_GRASS_CUSHION[] = _(
|
||||
"A grass-mark\n"
|
||||
"cushion. Place it on\n"
|
||||
"a mat or a desk.");
|
||||
|
||||
const u8 DecorDesc_FIRE_CUSHION[] = _(
|
||||
"A fire-mark\n"
|
||||
"cushion. Place it on\n"
|
||||
"a mat or a desk.");
|
||||
|
||||
const u8 DecorDesc_WATER_CUSHION[] = _(
|
||||
"A water-mark\n"
|
||||
"cushion. Place it on\n"
|
||||
"a mat or a desk.");
|
||||
|
||||
const u8 DecorDesc_SNORLAX_DOLL[] = _(
|
||||
"A large doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_RHYDON_DOLL[] = _(
|
||||
"A large doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_LAPRAS_DOLL[] = _(
|
||||
"A large doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_VENUSAUR_DOLL[] = _(
|
||||
"A large doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_CHARIZARD_DOLL[] = _(
|
||||
"A large doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_BLASTOISE_DOLL[] = _(
|
||||
"A large doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_WAILMER_DOLL[] = _(
|
||||
"A large doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_REGIROCK_DOLL[] = _(
|
||||
"A large doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_REGICE_DOLL[] = _(
|
||||
"A large doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
|
||||
const u8 DecorDesc_REGISTEEL_DOLL[] = _(
|
||||
"A large doll.\n"
|
||||
"Place it on a mat\n"
|
||||
"or a desk.");
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,643 @@
|
||||
#include "constants/event_objects.h"
|
||||
|
||||
const u16 DecorGfx_SMALL_DESK[] = {
|
||||
0x87
|
||||
};
|
||||
|
||||
const u16 DecorGfx_POKEMON_DESK[] = {
|
||||
0x8F
|
||||
};
|
||||
|
||||
const u16 DecorGfx_HEAVY_DESK[] = {
|
||||
0x90,
|
||||
0x91,
|
||||
0x92,
|
||||
0x98,
|
||||
0x99,
|
||||
0x9A
|
||||
};
|
||||
|
||||
const u16 DecorGfx_RAGGED_DESK[] = {
|
||||
0x93,
|
||||
0x94,
|
||||
0x95,
|
||||
0x9B,
|
||||
0x9C,
|
||||
0x9D
|
||||
};
|
||||
|
||||
const u16 DecorGfx_COMFORT_DESK[] = {
|
||||
0x96,
|
||||
0x97,
|
||||
0xA3,
|
||||
0x9E,
|
||||
0x9F,
|
||||
0xAB
|
||||
};
|
||||
|
||||
const u16 DecorGfx_PRETTY_DESK[] = {
|
||||
0xBD,
|
||||
0xBE,
|
||||
0xBF,
|
||||
0xC5,
|
||||
0xC6,
|
||||
0xC7,
|
||||
0xCD,
|
||||
0xCE,
|
||||
0xCF
|
||||
};
|
||||
|
||||
const u16 DecorGfx_BRICK_DESK[] = {
|
||||
0xA0,
|
||||
0xA1,
|
||||
0xA2,
|
||||
0xA8,
|
||||
0xA9,
|
||||
0xAA,
|
||||
0xB0,
|
||||
0xB1,
|
||||
0xB2
|
||||
};
|
||||
|
||||
const u16 DecorGfx_CAMP_DESK[] = {
|
||||
0xA4,
|
||||
0xA5,
|
||||
0xA6,
|
||||
0xAC,
|
||||
0xAD,
|
||||
0xAE,
|
||||
0xB4,
|
||||
0xB5,
|
||||
0xB6
|
||||
};
|
||||
|
||||
const u16 DecorGfx_HARD_DESK[] = {
|
||||
0xA7,
|
||||
0xBB,
|
||||
0xBC,
|
||||
0xAF,
|
||||
0xC3,
|
||||
0xC4,
|
||||
0xB7,
|
||||
0xCB,
|
||||
0xCC
|
||||
};
|
||||
|
||||
const u16 DecorGfx_SMALL_CHAIR[] = {
|
||||
0xB8
|
||||
};
|
||||
|
||||
const u16 DecorGfx_POKEMON_CHAIR[] = {
|
||||
0xB9
|
||||
};
|
||||
|
||||
const u16 DecorGfx_HEAVY_CHAIR[] = {
|
||||
0xBA
|
||||
};
|
||||
|
||||
const u16 DecorGfx_PRETTY_CHAIR[] = {
|
||||
0xC0
|
||||
};
|
||||
|
||||
const u16 DecorGfx_COMFORT_CHAIR[] = {
|
||||
0xC1
|
||||
};
|
||||
|
||||
const u16 DecorGfx_RAGGED_CHAIR[] = {
|
||||
0xC2
|
||||
};
|
||||
|
||||
const u16 DecorGfx_BRICK_CHAIR[] = {
|
||||
0xC8
|
||||
};
|
||||
|
||||
const u16 DecorGfx_CAMP_CHAIR[] = {
|
||||
0xC9
|
||||
};
|
||||
|
||||
const u16 DecorGfx_HARD_CHAIR[] = {
|
||||
0xCA
|
||||
};
|
||||
|
||||
const u16 DecorGfx_RED_PLANT[] = {
|
||||
0xD0,
|
||||
0xD8
|
||||
};
|
||||
|
||||
const u16 DecorGfx_TROPICAL_PLANT[] = {
|
||||
0xD2,
|
||||
0xDA
|
||||
};
|
||||
|
||||
const u16 DecorGfx_PRETTY_FLOWERS[] = {
|
||||
0xD4,
|
||||
0xDC
|
||||
};
|
||||
|
||||
const u16 DecorGfx_COLORFUL_PLANT[] = {
|
||||
0xE0,
|
||||
0xE2,
|
||||
0xE8,
|
||||
0xE9
|
||||
};
|
||||
|
||||
const u16 DecorGfx_BIG_PLANT[] = {
|
||||
0xE4,
|
||||
0xE6,
|
||||
0xEC,
|
||||
0xED
|
||||
};
|
||||
|
||||
const u16 DecorGfx_GORGEOUS_PLANT[] = {
|
||||
0xF0,
|
||||
0xF2,
|
||||
0xF8,
|
||||
0xF9
|
||||
};
|
||||
|
||||
const u16 DecorGfx_RED_BRICK[] = {
|
||||
0x25,
|
||||
0x2D
|
||||
};
|
||||
|
||||
const u16 DecorGfx_YELLOW_BRICK[] = {
|
||||
0x26,
|
||||
0x2E
|
||||
};
|
||||
|
||||
const u16 DecorGfx_BLUE_BRICK[] = {
|
||||
0x27,
|
||||
0x2F
|
||||
};
|
||||
|
||||
const u16 DecorGfx_RED_BALLOON[] = {
|
||||
0x138
|
||||
};
|
||||
|
||||
const u16 DecorGfx_BLUE_BALLOON[] = {
|
||||
0x13C
|
||||
};
|
||||
|
||||
const u16 DecorGfx_YELLOW_BALLOON[] = {
|
||||
0x140
|
||||
};
|
||||
|
||||
const u16 DecorGfx_RED_TENT[] = {
|
||||
0x30,
|
||||
0x31,
|
||||
0x32,
|
||||
0x38,
|
||||
0x39,
|
||||
0x3A,
|
||||
0x40,
|
||||
0x41,
|
||||
0x3B
|
||||
};
|
||||
|
||||
const u16 DecorGfx_BLUE_TENT[] = {
|
||||
0x48,
|
||||
0x49,
|
||||
0x68,
|
||||
0x50,
|
||||
0x51,
|
||||
0x70,
|
||||
0x58,
|
||||
0x59,
|
||||
0x69
|
||||
};
|
||||
|
||||
const u16 DecorGfx_SOLID_BOARD[] = {
|
||||
0x34,
|
||||
0x3C
|
||||
};
|
||||
|
||||
const u16 DecorGfx_SLIDE[] = {
|
||||
0x35,
|
||||
0x36,
|
||||
0x3D,
|
||||
0x3E,
|
||||
0x63,
|
||||
0x64,
|
||||
0x6F,
|
||||
0x77
|
||||
};
|
||||
|
||||
const u16 DecorGfx_FENCE_LENGTH[] = {
|
||||
0x33
|
||||
};
|
||||
|
||||
const u16 DecorGfx_FENCE_WIDTH[] = {
|
||||
0x2C
|
||||
};
|
||||
|
||||
const u16 DecorGfx_TIRE[] = {
|
||||
0x80,
|
||||
0x81,
|
||||
0x88,
|
||||
0x89
|
||||
};
|
||||
|
||||
const u16 DecorGfx_STAND[] = {
|
||||
0x6A,
|
||||
0x6B,
|
||||
0x6C,
|
||||
0x6D,
|
||||
0x72,
|
||||
0x73,
|
||||
0x74,
|
||||
0x75
|
||||
};
|
||||
|
||||
const u16 DecorGfx_MUD_BALL[] = {
|
||||
0x28
|
||||
};
|
||||
|
||||
const u16 DecorGfx_BREAKABLE_DOOR[] = {
|
||||
0x37,
|
||||
0x3F
|
||||
};
|
||||
|
||||
const u16 DecorGfx_SAND_ORNAMENT[] = {
|
||||
0x85,
|
||||
0x8D
|
||||
};
|
||||
|
||||
const u16 DecorGfx_SILVER_SHIELD[] = {
|
||||
0xD6,
|
||||
0xDE
|
||||
};
|
||||
|
||||
const u16 DecorGfx_GOLD_SHIELD[] = {
|
||||
0x12E,
|
||||
0x136
|
||||
};
|
||||
|
||||
const u16 DecorGfx_GLASS_ORNAMENT[] = {
|
||||
0x82,
|
||||
0x8A
|
||||
};
|
||||
|
||||
const u16 DecorGfx_TV[] = {
|
||||
0xF4
|
||||
};
|
||||
|
||||
const u16 DecorGfx_ROUND_TV[] = {
|
||||
0xF5
|
||||
};
|
||||
|
||||
const u16 DecorGfx_CUTE_TV[] = {
|
||||
0xF6
|
||||
};
|
||||
|
||||
const u16 DecorGfx_GLITTER_MAT[] = {
|
||||
0x60
|
||||
};
|
||||
|
||||
const u16 DecorGfx_JUMP_MAT[] = {
|
||||
0x61
|
||||
};
|
||||
|
||||
const u16 DecorGfx_SPIN_MAT[] = {
|
||||
0x62
|
||||
};
|
||||
|
||||
const u16 DecorGfx_C_LOW_NOTE_MAT[] = {
|
||||
0x78
|
||||
};
|
||||
|
||||
const u16 DecorGfx_D_NOTE_MAT[] = {
|
||||
0x79
|
||||
};
|
||||
|
||||
const u16 DecorGfx_E_NOTE_MAT[] = {
|
||||
0x7A
|
||||
};
|
||||
|
||||
const u16 DecorGfx_F_NOTE_MAT[] = {
|
||||
0x7B
|
||||
};
|
||||
|
||||
const u16 DecorGfx_G_NOTE_MAT[] = {
|
||||
0x7C
|
||||
};
|
||||
|
||||
const u16 DecorGfx_A_NOTE_MAT[] = {
|
||||
0x7D
|
||||
};
|
||||
|
||||
const u16 DecorGfx_B_NOTE_MAT[] = {
|
||||
0x7E
|
||||
};
|
||||
|
||||
const u16 DecorGfx_C_HIGH_NOTE_MAT[] = {
|
||||
0xB3
|
||||
};
|
||||
|
||||
const u16 DecorGfx_SURF_MAT[] = {
|
||||
0x42,
|
||||
0x43,
|
||||
0x44,
|
||||
0x4A,
|
||||
0x4B,
|
||||
0x4C,
|
||||
0x52,
|
||||
0x53,
|
||||
0x54
|
||||
};
|
||||
|
||||
const u16 DecorGfx_THUNDER_MAT[] = {
|
||||
0x45,
|
||||
0x46,
|
||||
0x47,
|
||||
0x4D,
|
||||
0x4E,
|
||||
0x4F,
|
||||
0x55,
|
||||
0x56,
|
||||
0x57
|
||||
};
|
||||
|
||||
const u16 DecorGfx_FIRE_BLAST_MAT[] = {
|
||||
0x5A,
|
||||
0x5B,
|
||||
0x5C,
|
||||
0x5D,
|
||||
0x5E,
|
||||
0x5F,
|
||||
0x65,
|
||||
0x66,
|
||||
0x67
|
||||
};
|
||||
|
||||
const u16 DecorGfx_POWDER_SNOW_MAT[] = {
|
||||
0x100,
|
||||
0x101,
|
||||
0x102,
|
||||
0x108,
|
||||
0x109,
|
||||
0x10A,
|
||||
0x110,
|
||||
0x111,
|
||||
0x112
|
||||
};
|
||||
|
||||
const u16 DecorGfx_ATTRACT_MAT[] = {
|
||||
0x103,
|
||||
0x104,
|
||||
0x105,
|
||||
0x10B,
|
||||
0x10C,
|
||||
0x10D,
|
||||
0x113,
|
||||
0x114,
|
||||
0x115
|
||||
};
|
||||
|
||||
const u16 DecorGfx_FISSURE_MAT[] = {
|
||||
0x106,
|
||||
0x107,
|
||||
0x118,
|
||||
0x10E,
|
||||
0x10F,
|
||||
0x120,
|
||||
0x116,
|
||||
0x117,
|
||||
0x128
|
||||
};
|
||||
|
||||
const u16 DecorGfx_SPIKES_MAT[] = {
|
||||
0x119,
|
||||
0x11A,
|
||||
0x11B,
|
||||
0x121,
|
||||
0x122,
|
||||
0x123,
|
||||
0x129,
|
||||
0x12A,
|
||||
0x12B
|
||||
};
|
||||
|
||||
const u16 DecorGfx_BALL_POSTER[] = {
|
||||
0x130
|
||||
};
|
||||
|
||||
const u16 DecorGfx_GREEN_POSTER[] = {
|
||||
0x131
|
||||
};
|
||||
|
||||
const u16 DecorGfx_RED_POSTER[] = {
|
||||
0x132
|
||||
};
|
||||
|
||||
const u16 DecorGfx_BLUE_POSTER[] = {
|
||||
0x133
|
||||
};
|
||||
|
||||
const u16 DecorGfx_CUTE_POSTER[] = {
|
||||
0x134
|
||||
};
|
||||
|
||||
const u16 DecorGfx_PIKA_POSTER[] = {
|
||||
0x11C,
|
||||
0x11D
|
||||
};
|
||||
|
||||
const u16 DecorGfx_LONG_POSTER[] = {
|
||||
0x11E,
|
||||
0x11F
|
||||
};
|
||||
|
||||
const u16 DecorGfx_SEA_POSTER[] = {
|
||||
0x124,
|
||||
0x125
|
||||
};
|
||||
|
||||
const u16 DecorGfx_SKY_POSTER[] = {
|
||||
0x126,
|
||||
0x127
|
||||
};
|
||||
|
||||
const u16 DecorGfx_KISS_POSTER[] = {
|
||||
0x12C,
|
||||
0x12D
|
||||
};
|
||||
|
||||
const u16 DecorGfx_PICHU_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_PIKACHU_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_MARILL_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_TOGEPI_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_CYNDAQUIL_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_CHIKORITA_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_TOTODILE_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_JIGGLYPUFF_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_MEOWTH_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_CLEFAIRY_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_DITTO_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_SMOOCHUM_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_TREECKO_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_TORCHIC_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_MUDKIP_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_DUSKULL_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_WYNAUT_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_BALTOY_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_KECLEON_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_AZURILL_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_SKITTY_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_SWABLU_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_GULPIN_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_LOTAD_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_SEEDOT_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_PIKA_CUSHION[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_ROUND_CUSHION[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_KISS_CUSHION[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_ZIGZAG_CUSHION[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_SPIN_CUSHION[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_DIAMOND_CUSHION[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_BALL_CUSHION[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_GRASS_CUSHION[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_FIRE_CUSHION[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_WATER_CUSHION[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_SNORLAX_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_RHYDON_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_LAPRAS_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_VENUSAUR_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_CHARIZARD_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_BLASTOISE_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_WAILMER_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_REGIROCK_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_REGICE_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
|
||||
const u16 DecorGfx_REGISTEEL_DOLL[] = {
|
||||
OBJ_EVENT_GFX_ITEM_BALL
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "decoration.h"
|
||||
#include "constants/decorations.h"
|
||||
|
||||
#include "data/decoration/tiles.h"
|
||||
#include "data/decoration/description.h"
|
||||
#include "data/decoration/header.h"
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
+1
-1
@@ -2889,7 +2889,7 @@ u8 FldEff_UseSurf(void)
|
||||
u8 taskId = CreateTask(Task_FldEffUseSurf, 0xff);
|
||||
gTasks[taskId].data[15] = gFieldEffectArguments[0];
|
||||
Overworld_ClearSavedMusic();
|
||||
if (sub_8056124(MUS_NAMINORI))
|
||||
if (Overworld_MusicCanOverrideMapMusic(MUS_NAMINORI))
|
||||
Overworld_ChangeMusicTo(MUS_NAMINORI);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,6 @@ static void PlayerNotOnBikeNotMoving(u8 direction, u16 heldKeys);
|
||||
static void PlayerNotOnBikeTurningInPlace(u8 direction, u16 heldKeys);
|
||||
static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys);
|
||||
static u8 CheckForPlayerAvatarCollision(u8 direction);
|
||||
u8 CheckForObjectEventCollision(struct ObjectEvent * objectEvent, s16 x, s16 y, u8 direction, u8 metatileBehavior);
|
||||
static bool8 CanStopSurfing(s16 x, s16 y, u8 direction);
|
||||
static bool8 ShouldJumpLedge(s16 x, s16 y, u8 direction);
|
||||
static bool8 TryPushBoulder(s16 x, s16 y, u8 direction);
|
||||
@@ -722,7 +721,7 @@ static void PlayerAvatarTransition_Bike(struct ObjectEvent * playerObjEvent)
|
||||
{
|
||||
sub_8150474(1);
|
||||
sub_8150498(1);
|
||||
sub_80BD620(0, 0);
|
||||
InitPlayerAvatarBikeState(0, 0);
|
||||
}
|
||||
|
||||
static void PlayerAvatarTransition_Surfing(struct ObjectEvent * playerObjEvent)
|
||||
@@ -1115,7 +1114,7 @@ void sub_805C774(void)
|
||||
ForcedMovement_None();
|
||||
}
|
||||
|
||||
void sub_805C780(void)
|
||||
void StopPlayerAvatar(void)
|
||||
{
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
|
||||
@@ -1597,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
@@ -984,7 +984,7 @@ static void sub_80B6468(u8 taskId)
|
||||
right = 240;
|
||||
top = 0;
|
||||
bottom = 112;
|
||||
selectedPalettes = sub_8075BE8(1, 0, 0, 0, 0, 0, 0);
|
||||
selectedPalettes = SelectBattleAnimSpriteAndBgPalettes(1, 0, 0, 0, 0, 0, 0);
|
||||
BeginNormalPaletteFade(selectedPalettes, 0, 16, 16, RGB(0, 0, 0));
|
||||
gTasks[taskId].func = sub_80B65F0;
|
||||
}
|
||||
|
||||
+2
-2
@@ -431,7 +431,7 @@ static void Task_Hof_InitTeamSaveData(u8 taskId)
|
||||
u16 i;
|
||||
struct HallofFameTeam* lastSavedTeam = (struct HallofFameTeam *)(gDecompressionBuffer);
|
||||
|
||||
sub_8112450();
|
||||
SaveQuestLogData();
|
||||
if (!gHasHallOfFameRecords)
|
||||
{
|
||||
memset(gDecompressionBuffer, 0, 0x2000);
|
||||
@@ -706,7 +706,7 @@ static void Task_Hof_HandleExit(u8 taskId)
|
||||
static void SetWarpsToRollCredits(void)
|
||||
{
|
||||
VarSet(VAR_MAP_SCENE_INDIGO_PLATEAU_EXTERIOR, 1);
|
||||
FlagSet(FLAG_SPECIAL_FLAG_0x4000);
|
||||
FlagSet(FLAG_DONT_SHOW_MAP_NAME_POPUP);
|
||||
gDisableMapMusicChangeOnMapLoad = 2;
|
||||
SetWarpDestination(MAP_GROUP(INDIGO_PLATEAU_EXTERIOR), MAP_NUM(INDIGO_PLATEAU_EXTERIOR), -1, 11, 6);
|
||||
DoWarp();
|
||||
|
||||
+625
-625
File diff suppressed because it is too large
Load Diff
+5
-5
@@ -377,7 +377,7 @@ static void CB2_OpenBagMenu(void)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
if ((u8)sub_80BF72C() == TRUE)
|
||||
if ((u8)MenuHelpers_CallLinkSomething() == TRUE)
|
||||
break;
|
||||
if (LoadBagMenuGraphics() == TRUE)
|
||||
break;
|
||||
@@ -1050,7 +1050,7 @@ static void Task_BagMenu_HandleInput(u8 taskId)
|
||||
return;
|
||||
if (FuncIsActiveTask(Task_AnimateWin0v) == TRUE)
|
||||
return;
|
||||
if ((u8)sub_80BF72C() == TRUE)
|
||||
if ((u8)MenuHelpers_CallLinkSomething() == TRUE)
|
||||
return;
|
||||
switch (ProcessPocketSwitchInput(taskId, gBagMenuState.pocket))
|
||||
{
|
||||
@@ -1244,7 +1244,7 @@ static void Task_MoveItemInPocket_HandleInput(u8 taskId)
|
||||
s32 input;
|
||||
u16 itemsAbove;
|
||||
u16 cursorPos;
|
||||
if ((u8)sub_80BF72C() == TRUE)
|
||||
if ((u8)MenuHelpers_CallLinkSomething() == TRUE)
|
||||
return;
|
||||
input = ListMenu_ProcessInput(data[0]);
|
||||
ListMenuGetScrollAndRow(data[0], &gBagMenuState.cursorPos[gBagMenuState.pocket], &gBagMenuState.itemsAbove[gBagMenuState.pocket]);
|
||||
@@ -1447,7 +1447,7 @@ static void Task_ItemContext_FieldOrBattle(u8 taskId)
|
||||
static void Task_FieldItemContextMenuHandleInput(u8 taskId)
|
||||
{
|
||||
s8 input;
|
||||
if ((u8)sub_80BF72C() != TRUE)
|
||||
if ((u8)MenuHelpers_CallLinkSomething() != TRUE)
|
||||
{
|
||||
input = Menu_ProcessInputNoWrapAround();
|
||||
switch (input)
|
||||
@@ -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
@@ -385,7 +385,7 @@ static bool8 ItemPc_DoGfxSetup(void)
|
||||
gMain.state++;
|
||||
break;
|
||||
case 20:
|
||||
if ((u8)sub_80BF72C() != TRUE)
|
||||
if ((u8)MenuHelpers_CallLinkSomething() != TRUE)
|
||||
gMain.state++;
|
||||
break;
|
||||
default:
|
||||
|
||||
+1
-1
@@ -268,7 +268,7 @@ void FieldUseFunc_MachBike(u8 taskId)
|
||||
|| MetatileBehavior_IsIsolatedVerticalRail(behavior) == TRUE
|
||||
|| MetatileBehavior_IsIsolatedHorizontalRail(behavior) == TRUE)
|
||||
sub_80A10C4(taskId, gTasks[taskId].data[3], 2, gUnknown_8416451);
|
||||
else if (Overworld_IsBikingAllowed() == TRUE && !sub_80BD540())
|
||||
else if (Overworld_IsBikingAllowed() == TRUE && !MetatileAtPlayerPositionForbidsBiking())
|
||||
{
|
||||
sItemUseOnFieldCB = ItemUseOnFieldCB_Bicycle;
|
||||
sub_80A103C(taskId);
|
||||
|
||||
+1
-1
@@ -588,7 +588,7 @@ static bool8 DoInitMailView(void)
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
if (sub_8058244() == TRUE)
|
||||
if (Overworld_LinkRecvQueueLengthMoreThan2() == TRUE)
|
||||
return FALSE;
|
||||
break;
|
||||
case 16:
|
||||
|
||||
+65
-44
@@ -18,26 +18,36 @@ static u16 MapNamePopupCreateWindow(bool32 palIntoFadedBuffer);
|
||||
static void MapNamePopupPrintMapNameOnWindow(u16 windowId);
|
||||
static u8 *MapNamePopupAppendFloorNum(u8 *dest, s8 flags);
|
||||
|
||||
#define tState data[0]
|
||||
#define tTimer data[1]
|
||||
#define tPos data[2]
|
||||
#define tReshow data[3]
|
||||
#define tWindowId data[4]
|
||||
#define tWindowExists data[5]
|
||||
#define tWindowCleared data[6]
|
||||
#define tWindowDestroyed data[7]
|
||||
#define tPalIntoFadedBuffer data[8]
|
||||
|
||||
void ShowMapNamePopup(bool32 palIntoFadedBuffer)
|
||||
{
|
||||
u8 taskId;
|
||||
if (FlagGet(FLAG_SPECIAL_FLAG_0x4000) != TRUE && !(gQuestLogState == 2 || gQuestLogState == 3))
|
||||
if (FlagGet(FLAG_DONT_SHOW_MAP_NAME_POPUP) != TRUE && !(gQuestLogState == QL_STATE_2 || gQuestLogState == QL_STATE_3))
|
||||
{
|
||||
taskId = FindTaskIdByFunc(Task_MapNamePopup);
|
||||
if (taskId == 0xFF)
|
||||
{
|
||||
taskId = CreateTask(Task_MapNamePopup, 90);
|
||||
ChangeBgX(0, 0x00000000, 0);
|
||||
ChangeBgY(0, 0xFFFFEF7F, 0);
|
||||
gTasks[taskId].data[0] = 0;
|
||||
gTasks[taskId].data[2] = 0;
|
||||
gTasks[taskId].data[8] = palIntoFadedBuffer;
|
||||
ChangeBgX(0, 0x0000, 0);
|
||||
ChangeBgY(0, -0x1081, 0);
|
||||
gTasks[taskId].tState = 0;
|
||||
gTasks[taskId].tPos = 0;
|
||||
gTasks[taskId].tPalIntoFadedBuffer = palIntoFadedBuffer;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gTasks[taskId].data[0] != 4)
|
||||
gTasks[taskId].data[0] = 4;
|
||||
gTasks[taskId].data[3] = 1;
|
||||
if (gTasks[taskId].tState != 4)
|
||||
gTasks[taskId].tState = 4;
|
||||
gTasks[taskId].tReshow = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -45,71 +55,71 @@ void ShowMapNamePopup(bool32 palIntoFadedBuffer)
|
||||
static void Task_MapNamePopup(u8 taskId)
|
||||
{
|
||||
struct Task * task = &gTasks[taskId];
|
||||
switch (task->data[0])
|
||||
switch (task->tState)
|
||||
{
|
||||
case 0:
|
||||
task->data[4] = MapNamePopupCreateWindow(task->data[8]);
|
||||
task->data[5] = 1;
|
||||
task->data[0] = 1;
|
||||
task->tWindowId = MapNamePopupCreateWindow(task->tPalIntoFadedBuffer);
|
||||
task->tWindowExists = TRUE;
|
||||
task->tState = 1;
|
||||
break;
|
||||
case 1:
|
||||
if (IsDma3ManagerBusyWithBgCopy())
|
||||
break;
|
||||
// fallthrough
|
||||
case 2:
|
||||
task->data[2] -= 2;
|
||||
if (task->data[2] <= -24)
|
||||
task->tPos -= 2;
|
||||
if (task->tPos <= -24)
|
||||
{
|
||||
task->data[0] = 3;
|
||||
task->data[1] = 0;
|
||||
task->tState = 3;
|
||||
task->tTimer = 0;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
task->data[1]++;
|
||||
if (task->data[1] > 120)
|
||||
task->tTimer++;
|
||||
if (task->tTimer > 120)
|
||||
{
|
||||
task->data[1] = 0;
|
||||
task->data[0] = 4;
|
||||
task->tTimer = 0;
|
||||
task->tState = 4;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
task->data[2] += 2;
|
||||
if (task->data[2] >= 0)
|
||||
task->tPos += 2;
|
||||
if (task->tPos >= 0)
|
||||
{
|
||||
if (task->data[3])
|
||||
if (task->tReshow)
|
||||
{
|
||||
MapNamePopupPrintMapNameOnWindow(task->data[4]);
|
||||
CopyWindowToVram(task->data[4], 2);
|
||||
task->data[0] = 1;
|
||||
task->data[3] = 0;
|
||||
MapNamePopupPrintMapNameOnWindow(task->tWindowId);
|
||||
CopyWindowToVram(task->tWindowId, 2);
|
||||
task->tState = 1;
|
||||
task->tReshow = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
task->data[0] = 6;
|
||||
task->tState = 6;
|
||||
return;
|
||||
}
|
||||
}
|
||||
case 5:
|
||||
break;
|
||||
case 6:
|
||||
if (task->data[5] && !task->data[6])
|
||||
if (task->tWindowExists && !task->tWindowCleared)
|
||||
{
|
||||
rbox_fill_rectangle(task->data[4]);
|
||||
CopyWindowToVram(task->data[4], 1);
|
||||
task->data[6] = 1;
|
||||
rbox_fill_rectangle(task->tWindowId);
|
||||
CopyWindowToVram(task->tWindowId, 1);
|
||||
task->tWindowCleared = TRUE;
|
||||
}
|
||||
task->data[0] = 7;
|
||||
task->tState = 7;
|
||||
return;
|
||||
case 7:
|
||||
if (!IsDma3ManagerBusyWithBgCopy())
|
||||
{
|
||||
if (task->data[5])
|
||||
if (task->tWindowExists)
|
||||
{
|
||||
RemoveWindow(task->data[4]);
|
||||
task->data[5] = 0;
|
||||
task->data[7] = 1;
|
||||
RemoveWindow(task->tWindowId);
|
||||
task->tWindowExists = FALSE;
|
||||
task->tWindowDestroyed = TRUE;
|
||||
}
|
||||
task->data[0] = 8;
|
||||
task->tState = 8;
|
||||
ChangeBgY(0, 0x00000000, 0);
|
||||
}
|
||||
return;
|
||||
@@ -117,7 +127,7 @@ static void Task_MapNamePopup(u8 taskId)
|
||||
DestroyTask(taskId);
|
||||
return;
|
||||
}
|
||||
SetGpuReg(REG_OFFSET_BG0VOFS, task->data[2]);
|
||||
SetGpuReg(REG_OFFSET_BG0VOFS, task->tPos);
|
||||
}
|
||||
|
||||
void DismissMapNamePopup(void)
|
||||
@@ -128,8 +138,8 @@ void DismissMapNamePopup(void)
|
||||
if (taskId != 0xFF)
|
||||
{
|
||||
data = gTasks[taskId].data;
|
||||
if (data[0] < 6)
|
||||
data[0] = 6;
|
||||
if (tState < 6)
|
||||
tState = 6;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,6 +170,7 @@ static u16 MapNamePopupCreateWindow(bool32 palintoFadedBuffer)
|
||||
}
|
||||
else
|
||||
{
|
||||
// ROOFTOP
|
||||
windowTemplate.width += 8;
|
||||
r6 = 0x02D;
|
||||
}
|
||||
@@ -194,7 +205,7 @@ static void MapNamePopupPrintMapNameOnWindow(u16 windowId)
|
||||
}
|
||||
xpos = (maxWidth - GetStringWidth(2, mapName, -1)) / 2;
|
||||
FillWindowPixelBuffer(windowId, PIXEL_FILL(1));
|
||||
AddTextPrinterParameterized(windowId, 2, mapName, xpos, 2, 0xFF, NULL);
|
||||
AddTextPrinterParameterized(windowId, 2, mapName, xpos, 2, TEXT_SPEED_FF, NULL);
|
||||
}
|
||||
|
||||
static u8 *MapNamePopupAppendFloorNum(u8 *dest, s8 floorNum)
|
||||
@@ -203,7 +214,7 @@ static u8 *MapNamePopupAppendFloorNum(u8 *dest, s8 floorNum)
|
||||
return dest;
|
||||
*dest++ = CHAR_SPACE;
|
||||
if (floorNum == 0x7F)
|
||||
return StringCopy(dest, gUnknown_841D18D);
|
||||
return StringCopy(dest, gText_Rooftop2);
|
||||
if (floorNum < 0)
|
||||
{
|
||||
*dest++ = CHAR_B;
|
||||
@@ -214,3 +225,13 @@ static u8 *MapNamePopupAppendFloorNum(u8 *dest, s8 floorNum)
|
||||
*dest = EOS;
|
||||
return dest;
|
||||
}
|
||||
|
||||
#undef tPalIntoFadedBuffer
|
||||
#undef tWindowDestroyed
|
||||
#undef tWindowCleared
|
||||
#undef tWindowExists
|
||||
#undef tWindowId
|
||||
#undef tReshow
|
||||
#undef tPos
|
||||
#undef tTimer
|
||||
#undef tState
|
||||
|
||||
+3
-3
@@ -125,17 +125,17 @@ bool8 MenuHelpers_LinkSomething(void)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool32 sub_80BF72C(void)
|
||||
bool32 MenuHelpers_CallLinkSomething(void)
|
||||
{
|
||||
if (!MenuHelpers_LinkSomething())
|
||||
return FALSE;
|
||||
else
|
||||
return (u8)sub_8058244();
|
||||
return (u8)Overworld_LinkRecvQueueLengthMoreThan2();
|
||||
}
|
||||
|
||||
bool8 sub_80BF748(void)
|
||||
{
|
||||
if ((u8)sub_80BF72C() == TRUE)
|
||||
if ((u8)MenuHelpers_CallLinkSomething() == TRUE)
|
||||
return TRUE;
|
||||
else if (sub_800B270() != TRUE)
|
||||
return FALSE;
|
||||
|
||||
+3
-3
@@ -326,7 +326,7 @@ u32 UnpackSelectedBattleAnimPalettes(s16 selector)
|
||||
u8 arg5 = (selector >> 5) & 1;
|
||||
u8 arg6 = (selector >> 6) & 1;
|
||||
|
||||
return sub_8075BE8(battleBackground, attacker, target, attackerPartner, targetPartner, arg5, arg6);
|
||||
return SelectBattleAnimSpriteAndBgPalettes(battleBackground, attacker, target, attackerPartner, targetPartner, arg5, arg6);
|
||||
}
|
||||
|
||||
static void AnimSimplePaletteBlendStep(struct Sprite *sprite)
|
||||
@@ -406,7 +406,7 @@ static void sub_80B9B8C(struct Sprite *sprite)
|
||||
sprite->callback(sprite);
|
||||
}
|
||||
|
||||
void sub_80B9BDC(u8 taskId)
|
||||
void AnimTask_CurseBlendEffect(u8 taskId)
|
||||
{
|
||||
gTasks[taskId].data[0] = gBattleAnimArgs[0];
|
||||
gTasks[taskId].data[1] = gBattleAnimArgs[1];
|
||||
@@ -659,7 +659,7 @@ void sub_80BA0E8(u8 taskId)
|
||||
u8 targetBattler = gBattleAnimTarget;
|
||||
|
||||
if (gBattleAnimArgs[0] & 0x100)
|
||||
selectedPalettes = sub_8075BE8(1, 0, 0, 0, 0, 0, 0);
|
||||
selectedPalettes = SelectBattleAnimSpriteAndBgPalettes(1, 0, 0, 0, 0, 0, 0);
|
||||
if (gBattleAnimArgs[1] & 0x100)
|
||||
selectedPalettes |= (0x10000 << attackerBattler);
|
||||
if (gBattleAnimArgs[2] & 0x100)
|
||||
|
||||
+46
-43
@@ -43,11 +43,10 @@ enum
|
||||
struct OptionMenu
|
||||
{
|
||||
/*0x00*/ u16 option[MENUITEM_COUNT];
|
||||
/*0x0E*/ u16 unkE;
|
||||
/*0x10*/ u8 state3;
|
||||
/*0x0E*/ u16 cursorPos;
|
||||
/*0x10*/ u8 loadState;
|
||||
/*0x11*/ u8 state;
|
||||
/*0x12*/ u8 state2;
|
||||
/*0x13*/ u8 unk13;
|
||||
/*0x12*/ u8 loadPaletteState;
|
||||
};
|
||||
|
||||
static EWRAM_DATA struct OptionMenu *sOptionMenuPtr = NULL;
|
||||
@@ -68,9 +67,9 @@ static u8 OptionMenu_ProcessInput(void);
|
||||
static void BufferOptionMenuString(u8 selection);
|
||||
static void CloseAndSaveOptionMenu(u8 taskId);
|
||||
static void PrintOptionMenuHeader(void);
|
||||
static void sub_8088C0C(void);
|
||||
static void DrawOptionMenuBg(void);
|
||||
static void LoadOptionMenuItemNames(void);
|
||||
static void sub_8088DE0(u16 selection);
|
||||
static void UpdateSettingSelectionDisplay(u16 selection);
|
||||
|
||||
// Data Definitions
|
||||
static const struct WindowTemplate sOptionMenuWinTemplates[] =
|
||||
@@ -208,10 +207,10 @@ void CB2_OptionsMenuFromStartMenu(void)
|
||||
if (gMain.savedCallback == NULL)
|
||||
gMain.savedCallback = CB2_ReturnToFieldWithOpenMenu;
|
||||
sOptionMenuPtr = AllocZeroed(sizeof(struct OptionMenu));
|
||||
sOptionMenuPtr->state3 = 0;
|
||||
sOptionMenuPtr->state2 = 0;
|
||||
sOptionMenuPtr->loadState = 0;
|
||||
sOptionMenuPtr->loadPaletteState = 0;
|
||||
sOptionMenuPtr->state = 0;
|
||||
sOptionMenuPtr->unkE = 0;
|
||||
sOptionMenuPtr->cursorPos = 0;
|
||||
sOptionMenuPtr->option[MENUITEM_TEXTSPEED] = gSaveBlock2Ptr->optionsTextSpeed;
|
||||
sOptionMenuPtr->option[MENUITEM_BATTLESCENE] = gSaveBlock2Ptr->optionsBattleSceneOff;
|
||||
sOptionMenuPtr->option[MENUITEM_BATTLESTYLE] = gSaveBlock2Ptr->optionsBattleStyle;
|
||||
@@ -262,7 +261,7 @@ static void CB2_OptionMenu(void)
|
||||
PrintOptionMenuHeader();
|
||||
break;
|
||||
case 5:
|
||||
sub_8088C0C();
|
||||
DrawOptionMenuBg();
|
||||
break;
|
||||
case 6:
|
||||
LoadOptionMenuItemNames();
|
||||
@@ -272,7 +271,7 @@ static void CB2_OptionMenu(void)
|
||||
BufferOptionMenuString(i);
|
||||
break;
|
||||
case 8:
|
||||
sub_8088DE0(sOptionMenuPtr->unkE);
|
||||
UpdateSettingSelectionDisplay(sOptionMenuPtr->cursorPos);
|
||||
break;
|
||||
case 9:
|
||||
OptionMenu_PickSwitchCancel();
|
||||
@@ -340,7 +339,7 @@ static void OptionMenu_ResetSpriteData(void)
|
||||
|
||||
static bool8 LoadOptionMenuPalette(void)
|
||||
{
|
||||
switch (sOptionMenuPtr->state2)
|
||||
switch (sOptionMenuPtr->loadPaletteState)
|
||||
{
|
||||
case 0:
|
||||
LoadBgTiles(1, GetUserFrameGraphicsInfo(sOptionMenuPtr->option[MENUITEM_FRAMETYPE])->tiles, 0x120, 0x1AA);
|
||||
@@ -358,51 +357,55 @@ static bool8 LoadOptionMenuPalette(void)
|
||||
default:
|
||||
return TRUE;
|
||||
}
|
||||
sOptionMenuPtr->state2++;
|
||||
sOptionMenuPtr->loadPaletteState++;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void Task_OptionMenu(u8 taskId)
|
||||
{
|
||||
switch (sOptionMenuPtr->state3)
|
||||
switch (sOptionMenuPtr->loadState)
|
||||
{
|
||||
case 0:
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
|
||||
OptionMenu_SetVBlankCallback();
|
||||
sOptionMenuPtr->state3++;
|
||||
sOptionMenuPtr->loadState++;
|
||||
break;
|
||||
case 1:
|
||||
if (gPaletteFade.active)
|
||||
return;
|
||||
sOptionMenuPtr->loadState++;
|
||||
break;
|
||||
case 2:
|
||||
if (sub_80BF72C() == TRUE)
|
||||
if (MenuHelpers_CallLinkSomething() == TRUE)
|
||||
break;
|
||||
switch (OptionMenu_ProcessInput())
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
sOptionMenuPtr->state3++;
|
||||
sOptionMenuPtr->loadState++;
|
||||
break;
|
||||
case 2:
|
||||
LoadBgTiles(1, GetUserFrameGraphicsInfo(sOptionMenuPtr->option[MENUITEM_FRAMETYPE])->tiles, 0x120, 0x1AA);
|
||||
LoadPalette(GetUserFrameGraphicsInfo(sOptionMenuPtr->option[MENUITEM_FRAMETYPE])->palette, 0x20, 0x20);
|
||||
BufferOptionMenuString(sOptionMenuPtr->unkE);
|
||||
BufferOptionMenuString(sOptionMenuPtr->cursorPos);
|
||||
break;
|
||||
case 3:
|
||||
sub_8088DE0(sOptionMenuPtr->unkE);
|
||||
UpdateSettingSelectionDisplay(sOptionMenuPtr->cursorPos);
|
||||
break;
|
||||
case 4:
|
||||
BufferOptionMenuString(sOptionMenuPtr->unkE);
|
||||
BufferOptionMenuString(sOptionMenuPtr->cursorPos);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
|
||||
sOptionMenuPtr->state3++;
|
||||
sOptionMenuPtr->loadState++;
|
||||
break;
|
||||
case 1:
|
||||
case 4:
|
||||
if (gPaletteFade.active)
|
||||
return;
|
||||
sOptionMenuPtr->state3++;
|
||||
sOptionMenuPtr->loadState++;
|
||||
break;
|
||||
case 5:
|
||||
CloseAndSaveOptionMenu(taskId);
|
||||
@@ -416,43 +419,43 @@ static u8 OptionMenu_ProcessInput(void)
|
||||
u16* curr;
|
||||
if (JOY_REPT(DPAD_RIGHT))
|
||||
{
|
||||
current = sOptionMenuPtr->option[(sOptionMenuPtr->unkE)];
|
||||
if (current == (sOptionMenuItemCounts[sOptionMenuPtr->unkE] - 1))
|
||||
sOptionMenuPtr->option[sOptionMenuPtr->unkE] = 0;
|
||||
current = sOptionMenuPtr->option[(sOptionMenuPtr->cursorPos)];
|
||||
if (current == (sOptionMenuItemCounts[sOptionMenuPtr->cursorPos] - 1))
|
||||
sOptionMenuPtr->option[sOptionMenuPtr->cursorPos] = 0;
|
||||
else
|
||||
sOptionMenuPtr->option[sOptionMenuPtr->unkE] = current + 1;
|
||||
if (sOptionMenuPtr->unkE == MENUITEM_FRAMETYPE)
|
||||
sOptionMenuPtr->option[sOptionMenuPtr->cursorPos] = current + 1;
|
||||
if (sOptionMenuPtr->cursorPos == MENUITEM_FRAMETYPE)
|
||||
return 2;
|
||||
else
|
||||
return 4;
|
||||
}
|
||||
else if (JOY_REPT(DPAD_LEFT))
|
||||
{
|
||||
curr = &sOptionMenuPtr->option[sOptionMenuPtr->unkE];
|
||||
curr = &sOptionMenuPtr->option[sOptionMenuPtr->cursorPos];
|
||||
if (*curr == 0)
|
||||
*curr = sOptionMenuItemCounts[sOptionMenuPtr->unkE] - 1;
|
||||
*curr = sOptionMenuItemCounts[sOptionMenuPtr->cursorPos] - 1;
|
||||
else
|
||||
--*curr;
|
||||
|
||||
if (sOptionMenuPtr->unkE == MENUITEM_FRAMETYPE)
|
||||
if (sOptionMenuPtr->cursorPos == MENUITEM_FRAMETYPE)
|
||||
return 2;
|
||||
else
|
||||
return 4;
|
||||
}
|
||||
else if (JOY_REPT(DPAD_UP))
|
||||
{
|
||||
if (sOptionMenuPtr->unkE == MENUITEM_TEXTSPEED)
|
||||
sOptionMenuPtr->unkE = MENUITEM_CANCEL;
|
||||
if (sOptionMenuPtr->cursorPos == MENUITEM_TEXTSPEED)
|
||||
sOptionMenuPtr->cursorPos = MENUITEM_CANCEL;
|
||||
else
|
||||
sOptionMenuPtr->unkE = sOptionMenuPtr->unkE - 1;
|
||||
sOptionMenuPtr->cursorPos = sOptionMenuPtr->cursorPos - 1;
|
||||
return 3;
|
||||
}
|
||||
else if (JOY_REPT(DPAD_DOWN))
|
||||
{
|
||||
if (sOptionMenuPtr->unkE == MENUITEM_CANCEL)
|
||||
sOptionMenuPtr->unkE = MENUITEM_TEXTSPEED;
|
||||
if (sOptionMenuPtr->cursorPos == MENUITEM_CANCEL)
|
||||
sOptionMenuPtr->cursorPos = MENUITEM_TEXTSPEED;
|
||||
else
|
||||
sOptionMenuPtr->unkE = sOptionMenuPtr->unkE + 1;
|
||||
sOptionMenuPtr->cursorPos = sOptionMenuPtr->cursorPos + 1;
|
||||
return 3;
|
||||
}
|
||||
else if (JOY_NEW(B_BUTTON) || JOY_NEW(A_BUTTON))
|
||||
@@ -531,7 +534,7 @@ static void PrintOptionMenuHeader(void)
|
||||
CopyWindowToVram(0, 3);
|
||||
}
|
||||
|
||||
static void sub_8088C0C(void)
|
||||
static void DrawOptionMenuBg(void)
|
||||
{
|
||||
u8 h;
|
||||
h = 2;
|
||||
@@ -566,12 +569,12 @@ static void LoadOptionMenuItemNames(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8088DE0(u16 selection)
|
||||
static void UpdateSettingSelectionDisplay(u16 selection)
|
||||
{
|
||||
u16 v1, v2;
|
||||
u16 maxLetterHeight, y;
|
||||
|
||||
v1 = GetFontAttribute(2, FONTATTR_MAX_LETTER_HEIGHT);
|
||||
v2 = selection * (v1 - 1) + 0x3A;
|
||||
SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(v2, v2 + v1));
|
||||
maxLetterHeight = GetFontAttribute(2, FONTATTR_MAX_LETTER_HEIGHT);
|
||||
y = selection * (maxLetterHeight - 1) + 0x3A;
|
||||
SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(y, y + maxLetterHeight));
|
||||
SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(0x10, 0xE0));
|
||||
}
|
||||
|
||||
+14
-14
@@ -120,7 +120,7 @@ u8 gFieldLinkPlayerCount;
|
||||
|
||||
static u8 sPlayerTradingStates[4];
|
||||
static KeyInterCB sPlayerKeyInterceptCallback;
|
||||
static bool8 gUnknown_3000E88;
|
||||
static bool8 sReceivingFromLink;
|
||||
static u8 sRfuKeepAliveTimer;
|
||||
|
||||
static u8 CountBadgesForOverworldWhiteOutLossCalculation(void);
|
||||
@@ -1037,7 +1037,7 @@ void Overworld_PlaySpecialMapMusic(void)
|
||||
|
||||
if (gSaveBlock1Ptr->savedMusic)
|
||||
music = gSaveBlock1Ptr->savedMusic;
|
||||
else if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_SURFING) &&sub_8056124(MUS_NAMINORI))
|
||||
else if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_SURFING) && Overworld_MusicCanOverrideMapMusic(MUS_NAMINORI))
|
||||
music = MUS_NAMINORI;
|
||||
|
||||
if (music != GetCurrentMapMusic())
|
||||
@@ -1075,7 +1075,7 @@ static void Overworld_TryMapConnectionMusicTransition(void)
|
||||
currentMusic = GetCurrentMapMusic();
|
||||
if (currentMusic == MUS_NAMINORI)
|
||||
return;
|
||||
if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_SURFING) && sub_8056124(MUS_NAMINORI))
|
||||
if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_SURFING) && Overworld_MusicCanOverrideMapMusic(MUS_NAMINORI))
|
||||
newMusic = MUS_NAMINORI;
|
||||
if (newMusic != currentMusic)
|
||||
{
|
||||
@@ -1193,7 +1193,7 @@ static void ChooseAmbientCrySpecies(void)
|
||||
sAmbientCrySpecies = GetLocalWildMon(&sIsAmbientCryWaterMon);
|
||||
}
|
||||
|
||||
bool32 sub_8056124(u16 music)
|
||||
bool32 Overworld_MusicCanOverrideMapMusic(u16 music)
|
||||
{
|
||||
if (music == MUS_CYCLING || music == MUS_NAMINORI)
|
||||
{
|
||||
@@ -1427,7 +1427,7 @@ static void DoCB1_Overworld_QuestLogPlayback(void)
|
||||
sub_805BEB8();
|
||||
sub_8111C68();
|
||||
FieldClearPlayerInput(&fieldInput);
|
||||
fieldInput = gUnknown_3005E90;
|
||||
fieldInput = gQuestLogFieldInput;
|
||||
FieldInput_HandleCancelSignpost(&fieldInput);
|
||||
if (!ScriptContext2_IsEnabled())
|
||||
{
|
||||
@@ -1445,7 +1445,7 @@ static void DoCB1_Overworld_QuestLogPlayback(void)
|
||||
{
|
||||
RunQuestLogCB();
|
||||
}
|
||||
FieldClearPlayerInput(&gUnknown_3005E90);
|
||||
FieldClearPlayerInput(&gQuestLogFieldInput);
|
||||
}
|
||||
|
||||
void CB1_Overworld(void)
|
||||
@@ -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);
|
||||
@@ -1629,7 +1629,7 @@ static void CB2_ReturnToFieldLocal(void)
|
||||
|
||||
static void CB2_ReturnToFieldLink(void)
|
||||
{
|
||||
if (!sub_8058244() && map_loading_iteration_2_link(&gMain.state))
|
||||
if (!Overworld_LinkRecvQueueLengthMoreThan2() && map_loading_iteration_2_link(&gMain.state))
|
||||
SetMainCallback2(CB2_Overworld);
|
||||
}
|
||||
|
||||
@@ -3181,15 +3181,15 @@ static void sub_8058230(void)
|
||||
ScriptContext2_Enable();
|
||||
}
|
||||
|
||||
bool32 sub_8058244(void)
|
||||
bool32 Overworld_LinkRecvQueueLengthMoreThan2(void)
|
||||
{
|
||||
if (!IsUpdateLinkStateCBActive())
|
||||
return FALSE;
|
||||
if (GetLinkRecvQueueLength() >= 3)
|
||||
gUnknown_3000E88 = TRUE;
|
||||
sReceivingFromLink = TRUE;
|
||||
else
|
||||
gUnknown_3000E88 = FALSE;
|
||||
return gUnknown_3000E88;
|
||||
sReceivingFromLink = FALSE;
|
||||
return sReceivingFromLink;
|
||||
}
|
||||
|
||||
bool32 sub_8058274(void)
|
||||
@@ -3207,8 +3207,8 @@ bool32 sub_8058274(void)
|
||||
else if (sPlayerKeyInterceptCallback != KeyInterCB_DeferToEventScript)
|
||||
return FALSE;
|
||||
|
||||
temp = gUnknown_3000E88;
|
||||
gUnknown_3000E88 = FALSE;
|
||||
temp = sReceivingFromLink;
|
||||
sReceivingFromLink = FALSE;
|
||||
|
||||
if (temp == TRUE)
|
||||
return TRUE;
|
||||
|
||||
+66
-67
@@ -45,8 +45,6 @@
|
||||
#include "constants/field_weather.h"
|
||||
#include "constants/event_object_movement.h"
|
||||
|
||||
u8 gUnknown_3005E88;
|
||||
|
||||
struct TrainerFanClub
|
||||
{
|
||||
u8 timer:7;
|
||||
@@ -96,7 +94,7 @@ struct UnkStruct_203B044
|
||||
|
||||
u8 gUnknown_3005E88;
|
||||
u16 sNumEventsInLogEntry;
|
||||
struct FieldInput gUnknown_3005E90;
|
||||
struct FieldInput gQuestLogFieldInput;
|
||||
struct QuestLogEntry * sCurQuestLogEntry;
|
||||
|
||||
static struct UnkStruct_300201C * sFlagOrVarRecords;
|
||||
@@ -108,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;
|
||||
@@ -131,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);
|
||||
@@ -184,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 **);
|
||||
@@ -194,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 *);
|
||||
@@ -302,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;
|
||||
@@ -320,7 +318,7 @@ void ResetQuestLog(void)
|
||||
sCurrentSceneNum = 0;
|
||||
gQuestLogState = 0;
|
||||
sQuestLogCB = NULL;
|
||||
gUnknown_203AE08 = NULL;
|
||||
sEventRecordingPointer = NULL;
|
||||
gUnknown_203AE04 = NULL;
|
||||
sub_8113BD8();
|
||||
sub_81138F8();
|
||||
@@ -353,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;
|
||||
}
|
||||
@@ -377,7 +375,7 @@ static void sub_8110A00(void)
|
||||
if (TryRecordQuestLogEntrySequence(sQuestLogSceneRecordBuffer) != 1)
|
||||
{
|
||||
gUnknown_3005E88 = 0;
|
||||
sub_8110E3C();
|
||||
TryRecordEvent39_GoToNextScene();
|
||||
gQuestLogState = 0;
|
||||
sQuestLogCB = NULL;
|
||||
}
|
||||
@@ -418,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
|
||||
@@ -511,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;
|
||||
}
|
||||
@@ -524,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;
|
||||
@@ -545,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;
|
||||
@@ -968,7 +966,7 @@ bool8 QuestLog_SchedulePlaybackCB(void (*callback)(void))
|
||||
switch (gQuestLogState)
|
||||
{
|
||||
case 1:
|
||||
sub_8112364();
|
||||
QuestLog_OnInteractionWithSpecialNpc();
|
||||
break;
|
||||
case 2:
|
||||
gUnknown_3005E88 = 3;
|
||||
@@ -1089,13 +1087,13 @@ void sub_8111C68(void)
|
||||
{
|
||||
if (gUnknown_203AE94.unk_0_6 == 0)
|
||||
{
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
gUnknown_203AE94.unk_0_6 = 2;
|
||||
gUnknown_3005E88 = 0;
|
||||
sub_81118F4(-3);
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
gUnknown_203AE94.unk_0_6 = 1;
|
||||
gUnknown_3005E88 = 0;
|
||||
@@ -1230,7 +1228,7 @@ static void sub_8111F8C(u8 taskId)
|
||||
{
|
||||
FreezeObjectEvents();
|
||||
sub_805C270();
|
||||
sub_805C780();
|
||||
StopPlayerAvatar();
|
||||
ScriptContext2_Enable();
|
||||
task->func = Task_QuestLogScene_SavedGame;
|
||||
}
|
||||
@@ -1262,7 +1260,7 @@ static void Task_WaitAtEndOfQuestLog(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
if (gMain.newKeys & (A_BUTTON | B_BUTTON) || task->tTimer >= 127 || gUnknown_203AE94.unk_0_6 == 1)
|
||||
if (JOY_NEW(A_BUTTON | B_BUTTON) || task->tTimer >= 127 || gUnknown_203AE94.unk_0_6 == 1)
|
||||
{
|
||||
QuestLog_CloseTextWindow();
|
||||
task->tTimer = 0;
|
||||
@@ -1313,7 +1311,7 @@ static void Task_EndQuestLog(u8 taskId)
|
||||
break;
|
||||
default:
|
||||
if (gUnknown_203AE94.unk_0_6 == 1)
|
||||
ShowMapNamePopup(1);
|
||||
ShowMapNamePopup(TRUE);
|
||||
CpuCopy16(gUnknown_203AE90, gPlttBufferUnfaded, 0x400);
|
||||
Free(gUnknown_203AE90);
|
||||
gUnknown_203AE94 = (struct UnkStruct_203AE94){};
|
||||
@@ -1366,31 +1364,31 @@ 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)
|
||||
static void SortQuestLogInSav1(void)
|
||||
{
|
||||
struct QuestLog * buffer = AllocZeroed(QUEST_LOG_SCENE_COUNT * sizeof(struct QuestLog));
|
||||
u8 i;
|
||||
@@ -1412,12 +1410,12 @@ void sub_81123BC(void)
|
||||
Free(buffer);
|
||||
}
|
||||
|
||||
void sub_8112450(void)
|
||||
void SaveQuestLogData(void)
|
||||
{
|
||||
if (MenuHelpers_LinkSomething() != TRUE)
|
||||
{
|
||||
sub_8112364();
|
||||
sub_81123BC();
|
||||
QuestLog_OnInteractionWithSpecialNpc();
|
||||
SortQuestLogInSav1();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1616,7 +1614,7 @@ static void SetUpQuestLogEntry(u8 kind, struct QuestLogEntry *entry, u16 size)
|
||||
}
|
||||
sQuestLogCursor = 0;
|
||||
gUnknown_203B01C = 0;
|
||||
gUnknown_3005E90 = (struct FieldInput){};
|
||||
gQuestLogFieldInput = (struct FieldInput){};
|
||||
sNextStepDelay = sCurQuestLogEntry[sQuestLogCursor].unk_4;
|
||||
sMovementScripts[0][0] = sCurQuestLogEntry[sQuestLogCursor].unk_3;
|
||||
sMovementScripts[0][1] = 0xFF;
|
||||
@@ -1688,7 +1686,8 @@ void sub_8112B3C(void)
|
||||
sMovementScripts[sCurQuestLogEntry[sQuestLogCursor].unk_0][1] = sCurQuestLogEntry[sQuestLogCursor].unk_3;
|
||||
break;
|
||||
case 2:
|
||||
*(u32 *)&gUnknown_3005E90 = ((sCurQuestLogEntry[sQuestLogCursor].unk_3 << 24) | (sCurQuestLogEntry[sQuestLogCursor].unk_2 << 16) | (sCurQuestLogEntry[sQuestLogCursor].unk_1 << 8) | (sCurQuestLogEntry[sQuestLogCursor].unk_0 << 0));
|
||||
// Player input command
|
||||
*(u32 *)&gQuestLogFieldInput = ((sCurQuestLogEntry[sQuestLogCursor].unk_3 << 24) | (sCurQuestLogEntry[sQuestLogCursor].unk_2 << 16) | (sCurQuestLogEntry[sQuestLogCursor].unk_1 << 8) | (sCurQuestLogEntry[sQuestLogCursor].unk_0 << 0));
|
||||
break;
|
||||
case 3:
|
||||
gUnknown_3005E88 = 3;
|
||||
@@ -2443,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
|
||||
@@ -2455,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)
|
||||
@@ -2466,7 +2465,7 @@ void SetQuestLogEvent(u16 eventId, const u16 *eventData)
|
||||
return;
|
||||
}
|
||||
|
||||
gUnknown_203AE08 = r1;
|
||||
sEventRecordingPointer = r1;
|
||||
if (gUnknown_203B048 == 0)
|
||||
return;
|
||||
sub_811231C();
|
||||
@@ -2518,7 +2517,7 @@ bool8 sub_8113748(void)
|
||||
return TRUE;
|
||||
|
||||
if (gQuestLogState == QL_STATE_1)
|
||||
sub_8112364();
|
||||
QuestLog_OnInteractionWithSpecialNpc();
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -2584,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)
|
||||
@@ -2614,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();
|
||||
}
|
||||
}
|
||||
@@ -2655,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++;
|
||||
}
|
||||
|
||||
@@ -2854,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;
|
||||
@@ -2864,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;
|
||||
@@ -2875,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;
|
||||
@@ -2886,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];
|
||||
@@ -2901,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;
|
||||
@@ -2916,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];
|
||||
@@ -2932,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;
|
||||
@@ -2951,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;
|
||||
|
||||
@@ -68,7 +68,7 @@ static void sub_81504E8(void)
|
||||
sub_81507BC(objectEvent, GetPlayerAvatarGraphicsIdByStateId(1));
|
||||
ObjectEventTurn(objectEvent, objectEvent->movementDirection);
|
||||
SetPlayerAvatarStateMask(PLAYER_AVATAR_FLAG_MACH_BIKE);
|
||||
sub_80BD620(0, 0);
|
||||
InitPlayerAvatarBikeState(0, 0);
|
||||
}
|
||||
|
||||
static void sub_8150530(void)
|
||||
|
||||
+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);
|
||||
|
||||
+18
-18
@@ -120,7 +120,7 @@ static void CB2_InitBuyMenu(void);
|
||||
static bool8 InitShopData(void);
|
||||
static void BuyMenuInitBgs(void);
|
||||
static void BuyMenuDecompressBgGraphics(void);
|
||||
static void sub_809B10C(bool32 a0);
|
||||
static void RecolorItemDescriptionBox(bool32 a0);
|
||||
static void BuyMenuDrawGraphics(void);
|
||||
static bool8 BuyMenuBuildListMenuTemplate(void);
|
||||
static void PokeMartWriteNameAndIdAt(struct ListMenuItem *list, u16 index, u8* dst);
|
||||
@@ -134,7 +134,7 @@ static void SetShopExitCallback(void);
|
||||
static void BuyMenuAddScrollIndicatorArrows(void);
|
||||
static void BuyQuantityAddScrollIndicatorArrows(void);
|
||||
static void BuyMenuRemoveScrollIndicatorArrows(void);
|
||||
static void sub_809B764(void);
|
||||
static void BuyMenuDrawMapView(void);
|
||||
static void BuyMenuDrawMapBg(void);
|
||||
static void BuyMenuDrawMapMetatile(s16 x, s16 y, const u16 *src, u8 metatileLayerType);
|
||||
static void BuyMenuDrawMapMetatileLayer(u16 *dest, s16 offset1, s16 offset2, const u16 *src);
|
||||
@@ -152,8 +152,8 @@ static void Task_ReturnToItemListAfterItemPurchase(u8 taskId);
|
||||
static void BuyMenuReturnToItemList(u8 taskId);
|
||||
static void ExitBuyMenu(u8 taskId);
|
||||
static void Task_ExitBuyMenu(u8 taskId);
|
||||
static void nullsub_52(u8 taskId);
|
||||
static void nullsub_53(void);
|
||||
static void DebugFunc_PrintPurchaseDetails(u8 taskId);
|
||||
static void DebugFunc_PrintShopMenuHistoryBeforeClearMaybe(void);
|
||||
static void RecordQuestLogItemPurchase(void);
|
||||
|
||||
static const struct MenuAction sShopMenuActions_BuySellQuit[] =
|
||||
@@ -496,26 +496,26 @@ static void BuyMenuDecompressBgGraphics(void)
|
||||
Free(pal);
|
||||
}
|
||||
|
||||
static void sub_809B10C(bool32 a0)
|
||||
static void RecolorItemDescriptionBox(bool32 a0)
|
||||
{
|
||||
u8 v;
|
||||
u8 paletteNum;
|
||||
|
||||
if (a0 == FALSE)
|
||||
v = 0xB;
|
||||
paletteNum = 0xB;
|
||||
else
|
||||
v = 6;
|
||||
paletteNum = 0x6;
|
||||
|
||||
if ((gShopData.martType) != MART_TYPE_TMHM)
|
||||
SetBgTilemapPalette(1, 0, 0xE, 0x1E, 6, v);
|
||||
SetBgTilemapPalette(1, 0, 14, 30, 6, paletteNum);
|
||||
else
|
||||
SetBgTilemapPalette(1, 0, 0xC, 0x1E, 8, v);
|
||||
SetBgTilemapPalette(1, 0, 12, 30, 8, paletteNum);
|
||||
|
||||
ScheduleBgCopyTilemapToVram(1);
|
||||
}
|
||||
|
||||
static void BuyMenuDrawGraphics(void)
|
||||
{
|
||||
sub_809B764();
|
||||
BuyMenuDrawMapView();
|
||||
BuyMenuCopyTilemapData();
|
||||
BuyMenuDrawMoneyBox();
|
||||
ScheduleBgCopyTilemapToVram(0);
|
||||
@@ -732,7 +732,7 @@ static void BuyMenuRemoveScrollIndicatorArrows(void)
|
||||
gShopData.unk16_11 = 0x1F;
|
||||
}
|
||||
|
||||
static void sub_809B764(void)
|
||||
static void BuyMenuDrawMapView(void)
|
||||
{
|
||||
BuyMenuCollectObjectEventData();
|
||||
BuyMenuDrawObjectEvents();
|
||||
@@ -913,7 +913,7 @@ static void Task_BuyMenu(u8 taskId)
|
||||
ClearWindowTilemap(5);
|
||||
BuyMenuRemoveScrollIndicatorArrows();
|
||||
BuyMenuPrintCursor(tListTaskId, 2);
|
||||
sub_809B10C(1);
|
||||
RecolorItemDescriptionBox(1);
|
||||
gShopData.itemPrice = itemid_get_market_price(itemId);
|
||||
if (!IsEnoughMoney(&gSaveBlock1Ptr->money, gShopData.itemPrice))
|
||||
{
|
||||
@@ -1006,7 +1006,7 @@ static void BuyMenuTryMakePurchase(u8 taskId)
|
||||
if (AddBagItem(tItemId, tItemCount) == TRUE)
|
||||
{
|
||||
BuyMenuDisplayMessage(taskId, gText_HereYouGoThankYou, BuyMenuSubtractMoney);
|
||||
nullsub_52(taskId);
|
||||
DebugFunc_PrintPurchaseDetails(taskId);
|
||||
RecordItemPurchase(tItemId, tItemCount, 1);
|
||||
}
|
||||
else
|
||||
@@ -1039,7 +1039,7 @@ static void BuyMenuReturnToItemList(u8 taskId)
|
||||
|
||||
ClearDialogWindowAndFrameToTransparent(2, 0);
|
||||
BuyMenuPrintCursor(tListTaskId, 1);
|
||||
sub_809B10C(0);
|
||||
RecolorItemDescriptionBox(0);
|
||||
PutWindowTilemap(4);
|
||||
PutWindowTilemap(5);
|
||||
if (gShopData.martType == MART_TYPE_TMHM)
|
||||
@@ -1070,11 +1070,11 @@ static void Task_ExitBuyMenu(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
static void nullsub_52(u8 taskId)
|
||||
static void DebugFunc_PrintPurchaseDetails(u8 taskId)
|
||||
{
|
||||
}
|
||||
|
||||
static void nullsub_53(void)
|
||||
static void DebugFunc_PrintShopMenuHistoryBeforeClearMaybe(void)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1138,7 +1138,7 @@ void CreatePokemartMenu(const u16 *itemsForSale)
|
||||
SetShopItemsForSale(itemsForSale);
|
||||
CreateShopMenu(MART_TYPE_REGULAR);
|
||||
SetShopMenuCallback(EnableBothScriptContexts);
|
||||
nullsub_53();
|
||||
DebugFunc_PrintShopMenuHistoryBeforeClearMaybe();
|
||||
memset(&gShopMenuHistory, 0, sizeof(gShopMenuHistory));
|
||||
gShopMenuHistory[0].unk8 = gMapHeader.regionMapSectionId;
|
||||
gShopMenuHistory[1].unk8 = gMapHeader.regionMapSectionId;
|
||||
|
||||
+1
-3
@@ -1,7 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "sprite.h"
|
||||
#include "main.h"
|
||||
#include "palette.h"
|
||||
#include "gflib.h"
|
||||
|
||||
#define MAX_SPRITE_COPY_REQUESTS 64
|
||||
|
||||
|
||||
+3
-7
@@ -1,7 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "palette.h"
|
||||
#include "bg.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "gflib.h"
|
||||
#include "scanline_effect.h"
|
||||
#include "overworld.h"
|
||||
#include "link.h"
|
||||
@@ -17,7 +15,6 @@
|
||||
#include "menu.h"
|
||||
#include "load_save.h"
|
||||
#include "strings.h"
|
||||
#include "string_util.h"
|
||||
#include "menu_helpers.h"
|
||||
#include "text_window.h"
|
||||
#include "field_fadetransition.h"
|
||||
@@ -26,7 +23,6 @@
|
||||
#include "event_object_movement.h"
|
||||
#include "event_object_lock.h"
|
||||
#include "script.h"
|
||||
#include "sound.h"
|
||||
#include "quest_log.h"
|
||||
#include "new_game.h"
|
||||
#include "event_scripts.h"
|
||||
@@ -395,7 +391,7 @@ void ShowStartMenu(void)
|
||||
{
|
||||
FreezeObjectEvents();
|
||||
sub_805C270();
|
||||
sub_805C780();
|
||||
StopPlayerAvatar();
|
||||
}
|
||||
OpenStartMenuWithFollowupFunc(Task_StartMenuHandleInput);
|
||||
ScriptContext2_Enable();
|
||||
@@ -779,7 +775,7 @@ static u8 SaveDialogCB_AskOverwriteOrReplacePreviousFileHandleInput(void)
|
||||
|
||||
static u8 SaveDialogCB_PrintSavingDontTurnOffPower(void)
|
||||
{
|
||||
sub_8112450();
|
||||
SaveQuestLogData();
|
||||
PrintSaveTextWithFollowupFunc(gText_SavingDontTurnOffThePower, SaveDialogCB_DoSave);
|
||||
return SAVECB_RETURN_CONTINUE;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1059,7 +1059,7 @@ ALIGNED(4) const u8 gText_Ghost[] = _("GHOST");
|
||||
const u8 gText_PokemonOnHook[] = _("A POKéMON's on the hook!{PAUSE_UNTIL_PRESS}");
|
||||
const u8 gText_NotEvenANibble[] = _("Not even a nibble‥{PAUSE_UNTIL_PRESS}");
|
||||
const u8 gText_ItGotAway[] = _("It got away‥{PAUSE_UNTIL_PRESS}");
|
||||
const u8 gUnknown_841D18D[] = _("ROOFTOP");
|
||||
const u8 gText_Rooftop2[] = _("ROOFTOP");
|
||||
ALIGNED(4) const u8 gString_PokemonFireRed_Staff[] = _("Pokémon FireRed Version\nStaff");
|
||||
ALIGNED(4) const u8 gString_PokemonLeafGreen_Staff[] = _("Pokémon LeafGreen Version\nStaff");
|
||||
ALIGNED(4) const u8 gCreditsString_Director[] = _("\n\nDirector\n\n\n\n");
|
||||
|
||||
+1
-1
@@ -668,7 +668,7 @@ static void SetTitleScreenScene_Restart(s16 * data)
|
||||
case 4:
|
||||
HelpSystem_Disable();
|
||||
DestroyTask(FindTaskIdByFunc(Task_TitleScreenMain));
|
||||
SetMainCallback2(sub_80EC864);
|
||||
SetMainCallback2(CB2_CopyrightScreen);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -304,7 +304,7 @@ static void CB2_SetUpTMCaseUI_Blocking(void)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
if ((u8)sub_80BF72C() == TRUE)
|
||||
if ((u8)MenuHelpers_CallLinkSomething() == TRUE)
|
||||
break;
|
||||
if (DoSetUpTMCaseUI() == TRUE)
|
||||
break;
|
||||
@@ -733,7 +733,7 @@ static void Task_TMCaseMain(u8 taskId)
|
||||
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
if ((u8)sub_80BF72C() != TRUE)
|
||||
if ((u8)MenuHelpers_CallLinkSomething() != TRUE)
|
||||
{
|
||||
input = ListMenu_ProcessInput(data[0]);
|
||||
ListMenuGetScrollAndRow(data[0], &sTMCaseStaticResources.scrollOffset, &sTMCaseStaticResources.selectedRow);
|
||||
@@ -814,7 +814,7 @@ static void Task_TMContextMenu_HandleInput(u8 taskId)
|
||||
{
|
||||
s8 input;
|
||||
|
||||
if ((u8)sub_80BF72C() != TRUE)
|
||||
if ((u8)MenuHelpers_CallLinkSomething() != TRUE)
|
||||
{
|
||||
input = Menu_ProcessInputNoWrapAround();
|
||||
switch (input)
|
||||
|
||||
+3
-3
@@ -589,7 +589,7 @@ static void Task_TrainerCard(u8 taskId)
|
||||
}
|
||||
break;
|
||||
case STATE_WAIT_FLIP_TO_BACK:
|
||||
if (IsCardFlipTaskActive() && sub_8058244() != TRUE)
|
||||
if (IsCardFlipTaskActive() && Overworld_LinkRecvQueueLengthMoreThan2() != TRUE)
|
||||
{
|
||||
PlaySE(SE_CARD3);
|
||||
sTrainerCardDataPtr->mainState = STATE_HANDLE_INPUT_BACK;
|
||||
@@ -647,7 +647,7 @@ static void Task_TrainerCard(u8 taskId)
|
||||
CloseTrainerCard(taskId);
|
||||
break;
|
||||
case STATE_WAIT_FLIP_TO_FRONT:
|
||||
if (IsCardFlipTaskActive() && sub_8058244() != TRUE)
|
||||
if (IsCardFlipTaskActive() && Overworld_LinkRecvQueueLengthMoreThan2() != TRUE)
|
||||
{
|
||||
sTrainerCardDataPtr->mainState = STATE_HANDLE_INPUT_FRONT;
|
||||
PlaySE(SE_CARD3);
|
||||
@@ -1727,7 +1727,7 @@ static bool8 Task_AnimateCardFlipDown(struct Task* task)
|
||||
static bool8 Task_DrawFlippedCardSide(struct Task* task)
|
||||
{
|
||||
sTrainerCardDataPtr->allowDMACopy = FALSE;
|
||||
if (sub_8058244() == TRUE)
|
||||
if (Overworld_LinkRecvQueueLengthMoreThan2() == TRUE)
|
||||
return FALSE;
|
||||
|
||||
do
|
||||
|
||||
+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