2019-03-03 08:50:40 +01:00
|
|
|
#include "global.h"
|
|
|
|
#include "main.h"
|
|
|
|
#include "battle.h"
|
|
|
|
#include "bg.h"
|
|
|
|
#include "contest_effect.h"
|
2019-04-04 23:53:06 +02:00
|
|
|
#include "data.h"
|
2019-03-03 08:50:40 +01:00
|
|
|
#include "event_data.h"
|
|
|
|
#include "field_screen_effect.h"
|
|
|
|
#include "gpu_regs.h"
|
2019-03-05 02:56:39 +01:00
|
|
|
#include "move_relearner.h"
|
2019-03-03 08:50:40 +01:00
|
|
|
#include "list_menu.h"
|
2019-09-09 03:07:54 +02:00
|
|
|
#include "malloc.h"
|
2019-03-03 08:50:40 +01:00
|
|
|
#include "menu.h"
|
|
|
|
#include "menu_helpers.h"
|
2019-03-08 08:17:01 +01:00
|
|
|
#include "menu_specialized.h"
|
2019-03-03 08:50:40 +01:00
|
|
|
#include "overworld.h"
|
|
|
|
#include "palette.h"
|
|
|
|
#include "pokemon_summary_screen.h"
|
|
|
|
#include "script.h"
|
|
|
|
#include "sound.h"
|
|
|
|
#include "sprite.h"
|
|
|
|
#include "string_util.h"
|
|
|
|
#include "strings.h"
|
|
|
|
#include "task.h"
|
|
|
|
#include "constants/rgb.h"
|
|
|
|
#include "constants/songs.h"
|
|
|
|
|
|
|
|
/*
|
2019-03-05 02:56:39 +01:00
|
|
|
* Move relearner state machine
|
2019-03-03 08:50:40 +01:00
|
|
|
* ------------------------
|
2021-08-25 00:59:32 +02:00
|
|
|
*
|
2019-03-05 02:56:39 +01:00
|
|
|
* Entry point: TeachMoveRelearnerMove
|
2021-08-25 00:59:32 +02:00
|
|
|
*
|
2019-03-05 02:56:39 +01:00
|
|
|
* TeachMoveRelearnerMove
|
2019-03-03 08:50:40 +01:00
|
|
|
* Task_WaitForFadeOut
|
|
|
|
* CB2_InitLearnMove
|
|
|
|
* - Creates moveDisplayArrowTask to listen to right/left buttons.
|
|
|
|
* - Creates moveListScrollArrowTask to listen to up/down buttons.
|
2019-03-05 02:56:39 +01:00
|
|
|
* - Whenever the selected move changes (and once on init), the MoveRelearnerCursorCallback
|
2019-03-08 08:10:44 +01:00
|
|
|
* is called (see sMoveRelearnerMovesListTemplate). That callback will reload the contest
|
2019-03-03 08:50:40 +01:00
|
|
|
* display and battle display windows for the new move. Both are always loaded in
|
|
|
|
* memory, but only the currently active one is copied to VRAM. The exception to this
|
2019-03-05 02:56:39 +01:00
|
|
|
* is the appeal and jam hearts, which are sprites. MoveRelearnerShowHideHearts is called
|
2019-03-03 08:50:40 +01:00
|
|
|
* while reloading the contest display to control them.
|
2019-03-05 02:56:39 +01:00
|
|
|
* DoMoveRelearnerMain: MENU_STATE_FADE_TO_BLACK
|
|
|
|
* DoMoveRelearnerMain: MENU_STATE_WAIT_FOR_FADE
|
2019-03-03 08:50:40 +01:00
|
|
|
* - Go to MENU_STATE_IDLE_BATTLE_MODE
|
2021-08-25 00:59:32 +02:00
|
|
|
*
|
2019-03-05 02:56:39 +01:00
|
|
|
* DoMoveRelearnerMain: MENU_STATE_SETUP_BATTLE_MODE
|
|
|
|
* DoMoveRelearnerMain: MENU_STATE_IDLE_BATTLE_MODE
|
2019-03-03 08:50:40 +01:00
|
|
|
* - If the player selected a move (pressed A), go to MENU_STATE_PRINT_TEACH_MOVE_PROMPT.
|
|
|
|
* - If the player cancelled (pressed B), go to MENU_STATE_PRINT_GIVE_UP_PROMPT.
|
|
|
|
* - If the player pressed left or right, swap the move display window to contest mode,
|
|
|
|
* and go to MENU_STATE_SETUP_CONTEST_MODE.
|
2021-08-25 00:59:32 +02:00
|
|
|
*
|
2019-03-05 02:56:39 +01:00
|
|
|
* DoMoveRelearnerMain: MENU_STATE_SETUP_CONTEST_MODE
|
|
|
|
* DoMoveRelearnerMain: MENU_STATE_IDLE_CONTEST_MODE
|
2019-03-03 08:50:40 +01:00
|
|
|
* - If the player selected a move, go to MENU_STATE_PRINT_TEACH_MOVE_PROMPT.
|
|
|
|
* - If the player cancelled, go to MENU_STATE_PRINT_GIVE_UP_PROMPT
|
|
|
|
* - If the player pressed left or right, swap the move display window to battle mode,
|
|
|
|
* and go to MENU_STATE_SETUP_BATTLE_MODE.
|
2021-08-25 00:59:32 +02:00
|
|
|
*
|
2019-03-05 02:56:39 +01:00
|
|
|
* DoMoveRelearnerMain: MENU_STATE_PRINT_TEACH_MOVE_PROMPT
|
|
|
|
* DoMoveRelearnerMain: MENU_STATE_TEACH_MOVE_CONFIRM
|
2019-03-03 08:50:40 +01:00
|
|
|
* - Wait for the player to confirm.
|
|
|
|
* - If cancelled, go to either MENU_STATE_SETUP_BATTLE_MODE or MENU_STATE_SETUP_CONTEST_MODE.
|
|
|
|
* - If confirmed and the pokemon had an empty move slot, set VAR_0x8004 to TRUE and go to
|
|
|
|
* MENU_STATE_PRINT_TEXT_THEN_FANFARE.
|
|
|
|
* - If confirmed and the pokemon doesn't have an empty move slot, go to
|
|
|
|
* MENU_STATE_PRINT_TRYING_TO_LEARN_PROMPT.
|
2021-08-25 00:59:32 +02:00
|
|
|
*
|
2019-03-05 02:56:39 +01:00
|
|
|
* DoMoveRelearnerMain: MENU_STATE_PRINT_TRYING_TO_LEARN_PROMPT
|
|
|
|
* DoMoveRelearnerMain: MENU_STATE_WAIT_FOR_TRYING_TO_LEARN
|
|
|
|
* DoMoveRelearnerMain: MENU_STATE_CONFIRM_DELETE_OLD_MOVE
|
2019-03-03 08:50:40 +01:00
|
|
|
* - If the player confirms, go to MENU_STATE_PRINT_WHICH_MOVE_PROMPT.
|
|
|
|
* - If the player cancels, go to MENU_STATE_PRINT_STOP_TEACHING
|
2021-08-25 00:59:32 +02:00
|
|
|
*
|
2019-03-05 02:56:39 +01:00
|
|
|
* DoMoveRelearnerMain: MENU_STATE_PRINT_STOP_TEACHING
|
|
|
|
* DoMoveRelearnerMain: MENU_STATE_WAIT_FOR_STOP_TEACHING
|
|
|
|
* DoMoveRelearnerMain: MENU_STATE_CONFIRM_STOP_TEACHING
|
2019-03-03 08:50:40 +01:00
|
|
|
* - If the player confirms, go to MENU_STATE_CHOOSE_SETUP_STATE.
|
|
|
|
* - If the player cancels, go back to MENU_STATE_PRINT_TRYING_TO_LEARN_PROMPT.
|
2021-08-25 00:59:32 +02:00
|
|
|
*
|
2019-03-05 02:56:39 +01:00
|
|
|
* DoMoveRelearnerMain: MENU_STATE_PRINT_WHICH_MOVE_PROMPT
|
|
|
|
* DoMoveRelearnerMain: MENU_STATE_SHOW_MOVE_SUMMARY_SCREEN
|
2019-03-03 08:50:40 +01:00
|
|
|
* - Go to ShowSelectMovePokemonSummaryScreen. When done, control returns to
|
|
|
|
* CB2_InitLearnMoveReturnFromSelectMove.
|
2021-08-25 00:59:32 +02:00
|
|
|
*
|
2019-03-05 02:56:39 +01:00
|
|
|
* DoMoveRelearnerMain: MENU_STATE_DOUBLE_FANFARE_FORGOT_MOVE
|
|
|
|
* DoMoveRelearnerMain: MENU_STATE_PRINT_TEXT_THEN_FANFARE
|
|
|
|
* DoMoveRelearnerMain: MENU_STATE_WAIT_FOR_FANFARE
|
|
|
|
* DoMoveRelearnerMain: MENU_STATE_WAIT_FOR_A_BUTTON
|
|
|
|
* DoMoveRelearnerMain: MENU_STATE_FADE_AND_RETURN
|
|
|
|
* DoMoveRelearnerMain: MENU_STATE_RETURN_TO_FIELD
|
2019-03-03 08:50:40 +01:00
|
|
|
* - Clean up and go to CB2_ReturnToField.
|
2021-08-25 00:59:32 +02:00
|
|
|
*
|
2019-03-05 02:56:39 +01:00
|
|
|
* DoMoveRelearnerMain: MENU_STATE_PRINT_GIVE_UP_PROMPT
|
|
|
|
* DoMoveRelearnerMain: MENU_STATE_GIVE_UP_CONFIRM
|
2019-03-03 08:50:40 +01:00
|
|
|
* - If the player confirms, go to MENU_STATE_FADE_AND_RETURN, and set VAR_0x8004 to FALSE.
|
|
|
|
* - If the player cancels, go to either MENU_STATE_SETUP_BATTLE_MODE or
|
|
|
|
* MENU_STATE_SETUP_CONTEST_MODE.
|
2021-08-25 00:59:32 +02:00
|
|
|
*
|
2019-03-03 08:50:40 +01:00
|
|
|
* CB2_InitLearnMoveReturnFromSelectMove:
|
|
|
|
* - Do most of the same stuff as CB2_InitLearnMove.
|
2019-03-05 02:56:39 +01:00
|
|
|
* DoMoveRelearnerMain: MENU_STATE_FADE_FROM_SUMMARY_SCREEN
|
|
|
|
* DoMoveRelearnerMain: MENU_STATE_TRY_OVERWRITE_MOVE
|
2019-03-03 08:50:40 +01:00
|
|
|
* - If any of the pokemon's existing moves were chosen, overwrite the move and
|
|
|
|
* go to MENU_STATE_DOUBLE_FANFARE_FORGOT_MOVE and set VAR_0x8004 to TRUE.
|
|
|
|
* - If the chosen move is the one the player selected before the summary screen,
|
|
|
|
* go to MENU_STATE_PRINT_STOP_TEACHING.
|
2021-08-25 00:59:32 +02:00
|
|
|
*
|
2019-03-03 08:50:40 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#define MENU_STATE_FADE_TO_BLACK 0
|
|
|
|
#define MENU_STATE_WAIT_FOR_FADE 1
|
|
|
|
#define MENU_STATE_UNREACHABLE 2
|
|
|
|
#define MENU_STATE_SETUP_BATTLE_MODE 3
|
|
|
|
#define MENU_STATE_IDLE_BATTLE_MODE 4
|
|
|
|
#define MENU_STATE_SETUP_CONTEST_MODE 5
|
|
|
|
#define MENU_STATE_IDLE_CONTEST_MODE 6
|
|
|
|
// State 7 is skipped.
|
|
|
|
#define MENU_STATE_PRINT_TEACH_MOVE_PROMPT 8
|
|
|
|
#define MENU_STATE_TEACH_MOVE_CONFIRM 9
|
|
|
|
// States 10 and 11 are skipped.
|
|
|
|
#define MENU_STATE_PRINT_GIVE_UP_PROMPT 12
|
|
|
|
#define MENU_STATE_GIVE_UP_CONFIRM 13
|
|
|
|
#define MENU_STATE_FADE_AND_RETURN 14
|
|
|
|
#define MENU_STATE_RETURN_TO_FIELD 15
|
|
|
|
#define MENU_STATE_PRINT_TRYING_TO_LEARN_PROMPT 16
|
|
|
|
#define MENU_STATE_WAIT_FOR_TRYING_TO_LEARN 17
|
|
|
|
#define MENU_STATE_CONFIRM_DELETE_OLD_MOVE 18
|
|
|
|
#define MENU_STATE_PRINT_WHICH_MOVE_PROMPT 19
|
|
|
|
#define MENU_STATE_SHOW_MOVE_SUMMARY_SCREEN 20
|
|
|
|
// States 21, 22, and 23 are skipped.
|
|
|
|
#define MENU_STATE_PRINT_STOP_TEACHING 24
|
|
|
|
#define MENU_STATE_WAIT_FOR_STOP_TEACHING 25
|
|
|
|
#define MENU_STATE_CONFIRM_STOP_TEACHING 26
|
|
|
|
#define MENU_STATE_CHOOSE_SETUP_STATE 27
|
|
|
|
#define MENU_STATE_FADE_FROM_SUMMARY_SCREEN 28
|
|
|
|
#define MENU_STATE_TRY_OVERWRITE_MOVE 29
|
|
|
|
#define MENU_STATE_DOUBLE_FANFARE_FORGOT_MOVE 30
|
|
|
|
#define MENU_STATE_PRINT_TEXT_THEN_FANFARE 31
|
|
|
|
#define MENU_STATE_WAIT_FOR_FANFARE 32
|
|
|
|
#define MENU_STATE_WAIT_FOR_A_BUTTON 33
|
|
|
|
|
|
|
|
// The different versions of hearts are selected using animation
|
|
|
|
// commands.
|
|
|
|
#define APPEAL_HEART_EMPTY 0
|
|
|
|
#define APPEAL_HEART_FULL 1
|
|
|
|
#define JAM_HEART_EMPTY 2
|
|
|
|
#define JAM_HEART_FULL 3
|
|
|
|
|
2020-08-29 01:02:20 +02:00
|
|
|
#define MAX_RELEARNER_MOVES (MAX_LEVEL_UP_MOVES > 25 ? MAX_LEVEL_UP_MOVES : 25)
|
|
|
|
|
2019-03-03 08:50:40 +01:00
|
|
|
static EWRAM_DATA struct
|
|
|
|
{
|
|
|
|
u8 state;
|
2020-08-29 01:09:17 +02:00
|
|
|
u8 heartSpriteIds[16]; /*0x001*/
|
2020-08-29 01:02:20 +02:00
|
|
|
u16 movesToLearn[MAX_RELEARNER_MOVES]; /*0x01A*/
|
2020-08-29 01:09:17 +02:00
|
|
|
u8 partyMon; /*0x044*/
|
|
|
|
u8 moveSlot; /*0x045*/
|
2020-08-29 01:02:20 +02:00
|
|
|
struct ListMenuItem menuItems[MAX_RELEARNER_MOVES]; /*0x0E8*/
|
2020-08-29 01:09:17 +02:00
|
|
|
u8 numMenuChoices; /*0x110*/
|
|
|
|
u8 numToShowAtOnce; /*0x111*/
|
|
|
|
u8 moveListMenuTask; /*0x112*/
|
|
|
|
u8 moveListScrollArrowTask; /*0x113*/
|
|
|
|
u8 moveDisplayArrowTask; /*0x114*/
|
|
|
|
u16 scrollOffset; /*0x116*/
|
2019-03-05 02:56:39 +01:00
|
|
|
} *sMoveRelearnerStruct = {0};
|
2019-03-03 08:50:40 +01:00
|
|
|
|
|
|
|
static EWRAM_DATA struct {
|
|
|
|
u16 listOffset;
|
|
|
|
u16 listRow;
|
|
|
|
bool8 showContestInfo;
|
2019-03-05 02:56:39 +01:00
|
|
|
} sMoveRelearnerMenuSate = {0};
|
2019-03-03 08:50:40 +01:00
|
|
|
|
2019-03-05 02:56:39 +01:00
|
|
|
static const u16 sMoveRelearnerPaletteData[] = INCBIN_U16("graphics/interface/ui_learn_move.gbapal");
|
2019-03-03 08:50:40 +01:00
|
|
|
|
|
|
|
// The arrow sprites in this spritesheet aren't used. The scroll-arrow system provides its own
|
|
|
|
// arrow sprites.
|
2019-03-05 02:56:39 +01:00
|
|
|
static const u8 sMoveRelearnerSpriteSheetData[] = INCBIN_U8("graphics/interface/ui_learn_move.4bpp");
|
2019-03-03 08:50:40 +01:00
|
|
|
|
|
|
|
static const struct OamData sHeartSpriteOamData =
|
|
|
|
{
|
|
|
|
.y = 0,
|
2019-12-04 21:25:13 +01:00
|
|
|
.affineMode = ST_OAM_AFFINE_OFF,
|
2019-03-03 08:50:40 +01:00
|
|
|
.objMode = ST_OAM_OBJ_NORMAL,
|
|
|
|
.mosaic = 0,
|
|
|
|
.bpp = ST_OAM_4BPP,
|
2019-12-04 21:25:13 +01:00
|
|
|
.shape = SPRITE_SHAPE(8x8),
|
2019-03-03 08:50:40 +01:00
|
|
|
.x = 0,
|
|
|
|
.matrixNum = 0,
|
2019-12-04 21:25:13 +01:00
|
|
|
.size = SPRITE_SIZE(8x8),
|
2019-03-03 08:50:40 +01:00
|
|
|
.tileNum = 0,
|
|
|
|
.priority = 0,
|
|
|
|
.paletteNum = 0,
|
|
|
|
.affineParam = 0,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct OamData sUnusedOam1 =
|
|
|
|
{
|
|
|
|
.y = 0,
|
2019-12-04 21:25:13 +01:00
|
|
|
.affineMode = ST_OAM_AFFINE_OFF,
|
2019-03-03 08:50:40 +01:00
|
|
|
.objMode = ST_OAM_OBJ_NORMAL,
|
|
|
|
.mosaic = 0,
|
|
|
|
.bpp = ST_OAM_4BPP,
|
2019-12-04 21:25:13 +01:00
|
|
|
.shape = SPRITE_SHAPE(8x16),
|
2019-03-03 08:50:40 +01:00
|
|
|
.x = 0,
|
|
|
|
.matrixNum = 0,
|
2019-12-04 21:25:13 +01:00
|
|
|
.size = SPRITE_SIZE(8x16),
|
2019-03-03 08:50:40 +01:00
|
|
|
.tileNum = 0,
|
|
|
|
.priority = 0,
|
|
|
|
.paletteNum = 0,
|
|
|
|
.affineParam = 0,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct OamData sUnusedOam2 =
|
|
|
|
{
|
|
|
|
.y = 0,
|
2019-12-04 21:25:13 +01:00
|
|
|
.affineMode = ST_OAM_AFFINE_OFF,
|
2019-03-03 08:50:40 +01:00
|
|
|
.objMode = ST_OAM_OBJ_NORMAL,
|
|
|
|
.mosaic = 0,
|
|
|
|
.bpp = ST_OAM_4BPP,
|
2019-12-04 21:25:13 +01:00
|
|
|
.shape = SPRITE_SHAPE(16x8),
|
2019-03-03 08:50:40 +01:00
|
|
|
.x = 0,
|
|
|
|
.matrixNum = 0,
|
2019-12-04 21:25:13 +01:00
|
|
|
.size = SPRITE_SIZE(16x8),
|
2019-03-03 08:50:40 +01:00
|
|
|
.tileNum = 0,
|
|
|
|
.priority = 0,
|
|
|
|
.paletteNum = 0,
|
|
|
|
.affineParam = 0,
|
|
|
|
};
|
|
|
|
|
2019-03-05 02:56:39 +01:00
|
|
|
static const struct SpriteSheet sMoveRelearnerSpriteSheet =
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
.data = sMoveRelearnerSpriteSheetData,
|
2019-03-03 08:50:40 +01:00
|
|
|
.size = 0x180,
|
|
|
|
.tag = 5525
|
|
|
|
};
|
|
|
|
|
2019-03-05 02:56:39 +01:00
|
|
|
static const struct SpritePalette sMoveRelearnerPalette =
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
.data = sMoveRelearnerPaletteData,
|
2019-03-03 08:50:40 +01:00
|
|
|
.tag = 5526
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct ScrollArrowsTemplate sDisplayModeArrowsTemplate =
|
|
|
|
{
|
|
|
|
.firstArrowType = SCROLL_ARROW_LEFT,
|
|
|
|
.firstX = 27,
|
|
|
|
.firstY = 16,
|
|
|
|
.secondArrowType = SCROLL_ARROW_RIGHT,
|
|
|
|
.secondX = 117,
|
|
|
|
.secondY = 16,
|
|
|
|
.fullyUpThreshold = -1,
|
|
|
|
.fullyDownThreshold = -1,
|
|
|
|
.tileTag = 5325,
|
|
|
|
.palTag = 5325,
|
|
|
|
.palNum = 0,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct ScrollArrowsTemplate sMoveListScrollArrowsTemplate =
|
|
|
|
{
|
|
|
|
.firstArrowType = SCROLL_ARROW_UP,
|
|
|
|
.firstX = 192,
|
|
|
|
.firstY = 8,
|
|
|
|
.secondArrowType = SCROLL_ARROW_DOWN,
|
|
|
|
.secondX = 192,
|
|
|
|
.secondY = 104,
|
|
|
|
.fullyUpThreshold = 0,
|
|
|
|
.fullyDownThreshold = 0,
|
|
|
|
.tileTag = 5425,
|
|
|
|
.palTag = 5425,
|
|
|
|
.palNum = 0,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const union AnimCmd sHeartSprite_AppealEmptyFrame[] =
|
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(8, 5, FALSE, FALSE),
|
|
|
|
ANIMCMD_END
|
|
|
|
};
|
|
|
|
|
|
|
|
static const union AnimCmd sHeartSprite_AppealFullFrame[] =
|
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(9, 5, FALSE, FALSE),
|
|
|
|
ANIMCMD_END
|
|
|
|
};
|
|
|
|
|
|
|
|
static const union AnimCmd sHeartSprite_JamEmptyFrame[] =
|
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(10, 5, FALSE, FALSE),
|
|
|
|
ANIMCMD_END
|
|
|
|
};
|
|
|
|
|
|
|
|
static const union AnimCmd sHeartSprite_JamFullFrame[] =
|
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(11, 5, FALSE, FALSE),
|
|
|
|
ANIMCMD_END
|
|
|
|
};
|
|
|
|
|
|
|
|
static const union AnimCmd *const sHeartSpriteAnimationCommands[] =
|
|
|
|
{
|
|
|
|
[APPEAL_HEART_EMPTY] = sHeartSprite_AppealEmptyFrame,
|
|
|
|
[APPEAL_HEART_FULL] = sHeartSprite_AppealFullFrame,
|
|
|
|
[JAM_HEART_EMPTY] = sHeartSprite_JamEmptyFrame,
|
|
|
|
[JAM_HEART_FULL] = sHeartSprite_JamFullFrame,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct SpriteTemplate sConstestMoveHeartSprite =
|
|
|
|
{
|
|
|
|
.tileTag = 5525,
|
|
|
|
.paletteTag = 5526,
|
|
|
|
.oam = &sHeartSpriteOamData,
|
|
|
|
.anims = sHeartSpriteAnimationCommands,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
|
|
|
.callback = SpriteCallbackDummy
|
|
|
|
};
|
|
|
|
|
2019-03-05 02:56:39 +01:00
|
|
|
static const struct BgTemplate sMoveRelearnerMenuBackgroundTemplates[] =
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
|
|
|
{
|
|
|
|
.bg = 0,
|
|
|
|
.charBaseIndex = 0,
|
|
|
|
.mapBaseIndex = 31,
|
|
|
|
.screenSize = 0,
|
|
|
|
.paletteMode = 0,
|
|
|
|
.priority = 0,
|
|
|
|
.baseTile = 0,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.bg = 1,
|
|
|
|
.charBaseIndex = 0,
|
|
|
|
.mapBaseIndex = 30,
|
|
|
|
.screenSize = 0,
|
|
|
|
.paletteMode = 0,
|
|
|
|
.priority = 1,
|
|
|
|
.baseTile = 0,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2019-03-05 02:56:39 +01:00
|
|
|
static void DoMoveRelearnerMain(void);
|
2019-03-03 08:50:40 +01:00
|
|
|
static void CreateLearnableMovesList(void);
|
|
|
|
static void CreateUISprites(void);
|
2019-03-05 02:56:39 +01:00
|
|
|
static void CB2_MoveRelearnerMain(void);
|
2019-03-03 08:50:40 +01:00
|
|
|
static void Task_WaitForFadeOut(u8 taskId);
|
|
|
|
static void CB2_InitLearnMove(void);
|
|
|
|
static void CB2_InitLearnMoveReturnFromSelectMove(void);
|
2019-03-05 02:56:39 +01:00
|
|
|
static void InitMoveRelearnerBackgroundLayers(void);
|
2019-03-03 08:50:40 +01:00
|
|
|
static void AddScrollArrows(void);
|
|
|
|
static void HandleInput(u8);
|
|
|
|
static void ShowTeachMoveText(u8);
|
|
|
|
static s32 GetCurrentSelectedMove(void);
|
2019-03-05 02:56:39 +01:00
|
|
|
static void FreeMoveRelearnerResources(void);
|
2019-03-03 08:50:40 +01:00
|
|
|
static void RemoveScrollArrows(void);
|
|
|
|
static void HideHeartSpritesAndShowTeachMoveText(bool8);
|
|
|
|
|
2019-03-05 02:56:39 +01:00
|
|
|
static void VBlankCB_MoveRelearner(void)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
|
|
|
LoadOam();
|
|
|
|
ProcessSpriteCopyRequests();
|
|
|
|
TransferPlttBuffer();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Script arguments: The pokemon to teach is in VAR_0x8004
|
2019-03-05 02:56:39 +01:00
|
|
|
void TeachMoveRelearnerMove(void)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
|
|
|
ScriptContext2_Enable();
|
|
|
|
CreateTask(Task_WaitForFadeOut, 10);
|
|
|
|
// Fade to black
|
2021-02-24 17:01:02 +01:00
|
|
|
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void Task_WaitForFadeOut(u8 taskId)
|
|
|
|
{
|
|
|
|
if (!gPaletteFade.active)
|
|
|
|
{
|
|
|
|
SetMainCallback2(CB2_InitLearnMove);
|
2019-12-17 09:24:44 +01:00
|
|
|
gFieldCallback = FieldCB_ContinueScriptHandleMusic;
|
2019-03-03 08:50:40 +01:00
|
|
|
DestroyTask(taskId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void CB2_InitLearnMove(void)
|
|
|
|
{
|
|
|
|
ResetSpriteData();
|
|
|
|
FreeAllSpritePalettes();
|
|
|
|
ResetTasks();
|
2020-06-20 01:58:56 +02:00
|
|
|
ClearScheduledBgCopiesToVram();
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct = AllocZeroed(sizeof(*sMoveRelearnerStruct));
|
|
|
|
sMoveRelearnerStruct->partyMon = gSpecialVar_0x8004;
|
|
|
|
SetVBlankCallback(VBlankCB_MoveRelearner);
|
2019-03-03 08:50:40 +01:00
|
|
|
|
2019-03-05 02:56:39 +01:00
|
|
|
InitMoveRelearnerBackgroundLayers();
|
|
|
|
InitMoveRelearnerWindows(FALSE);
|
2019-03-03 08:50:40 +01:00
|
|
|
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerMenuSate.listOffset = 0;
|
|
|
|
sMoveRelearnerMenuSate.listRow = 0;
|
|
|
|
sMoveRelearnerMenuSate.showContestInfo = FALSE;
|
2019-03-03 08:50:40 +01:00
|
|
|
|
|
|
|
CreateLearnableMovesList();
|
|
|
|
|
2019-03-05 02:56:39 +01:00
|
|
|
LoadSpriteSheet(&sMoveRelearnerSpriteSheet);
|
|
|
|
LoadSpritePalette(&sMoveRelearnerPalette);
|
2019-03-03 08:50:40 +01:00
|
|
|
CreateUISprites();
|
|
|
|
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->moveListMenuTask = ListMenuInit(&gMultiuseListMenuTemplate, sMoveRelearnerMenuSate.listOffset, sMoveRelearnerMenuSate.listRow);
|
2019-03-03 08:50:40 +01:00
|
|
|
FillPalette(RGB_BLACK, 0, 2);
|
2019-03-05 02:56:39 +01:00
|
|
|
SetMainCallback2(CB2_MoveRelearnerMain);
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void CB2_InitLearnMoveReturnFromSelectMove(void)
|
|
|
|
{
|
|
|
|
ResetSpriteData();
|
|
|
|
FreeAllSpritePalettes();
|
|
|
|
ResetTasks();
|
2020-06-20 01:58:56 +02:00
|
|
|
ClearScheduledBgCopiesToVram();
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct = AllocZeroed(sizeof(*sMoveRelearnerStruct));
|
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_FADE_FROM_SUMMARY_SCREEN;
|
|
|
|
sMoveRelearnerStruct->partyMon = gSpecialVar_0x8004;
|
|
|
|
sMoveRelearnerStruct->moveSlot = gSpecialVar_0x8005;
|
|
|
|
SetVBlankCallback(VBlankCB_MoveRelearner);
|
|
|
|
|
|
|
|
InitMoveRelearnerBackgroundLayers();
|
|
|
|
InitMoveRelearnerWindows(sMoveRelearnerMenuSate.showContestInfo);
|
2019-03-03 08:50:40 +01:00
|
|
|
CreateLearnableMovesList();
|
|
|
|
|
2019-03-05 02:56:39 +01:00
|
|
|
LoadSpriteSheet(&sMoveRelearnerSpriteSheet);
|
|
|
|
LoadSpritePalette(&sMoveRelearnerPalette);
|
2019-03-03 08:50:40 +01:00
|
|
|
CreateUISprites();
|
|
|
|
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->moveListMenuTask = ListMenuInit(&gMultiuseListMenuTemplate, sMoveRelearnerMenuSate.listOffset, sMoveRelearnerMenuSate.listRow);
|
2019-03-03 08:50:40 +01:00
|
|
|
FillPalette(RGB_BLACK, 0, 2);
|
2019-03-05 02:56:39 +01:00
|
|
|
SetMainCallback2(CB2_MoveRelearnerMain);
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
|
2019-03-05 02:56:39 +01:00
|
|
|
static void InitMoveRelearnerBackgroundLayers(void)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
|
|
|
ResetVramOamAndBgCntRegs();
|
|
|
|
ResetBgsAndClearDma3BusyFlags(0);
|
2019-03-05 02:56:39 +01:00
|
|
|
InitBgsFromTemplates(0, sMoveRelearnerMenuBackgroundTemplates, ARRAY_COUNT(sMoveRelearnerMenuBackgroundTemplates));
|
2019-03-03 08:50:40 +01:00
|
|
|
ResetAllBgsCoordinates();
|
|
|
|
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 |
|
|
|
|
DISPCNT_OBJ_1D_MAP |
|
|
|
|
DISPCNT_OBJ_ON);
|
|
|
|
ShowBg(0);
|
|
|
|
ShowBg(1);
|
|
|
|
SetGpuReg(REG_OFFSET_BLDCNT, 0);
|
|
|
|
}
|
|
|
|
|
2019-03-05 02:56:39 +01:00
|
|
|
static void CB2_MoveRelearnerMain(void)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
DoMoveRelearnerMain();
|
2019-03-03 08:50:40 +01:00
|
|
|
RunTasks();
|
|
|
|
AnimateSprites();
|
|
|
|
BuildOamBuffer();
|
2020-06-20 01:58:56 +02:00
|
|
|
DoScheduledBgTilemapCopiesToVram();
|
2019-03-03 08:50:40 +01:00
|
|
|
UpdatePaletteFade();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void FormatAndPrintText(const u8 *src)
|
|
|
|
{
|
|
|
|
StringExpandPlaceholders(gStringVar4, src);
|
2019-03-05 02:56:39 +01:00
|
|
|
MoveRelearnerPrintText(gStringVar4);
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// See the state machine doc at the top of the file.
|
2019-03-05 02:56:39 +01:00
|
|
|
static void DoMoveRelearnerMain(void)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
switch (sMoveRelearnerStruct->state)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
|
|
|
case MENU_STATE_FADE_TO_BLACK:
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state++;
|
2019-03-03 08:50:40 +01:00
|
|
|
HideHeartSpritesAndShowTeachMoveText(FALSE);
|
2021-02-24 17:01:02 +01:00
|
|
|
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
|
2019-03-03 08:50:40 +01:00
|
|
|
break;
|
|
|
|
case MENU_STATE_WAIT_FOR_FADE:
|
|
|
|
if (!gPaletteFade.active)
|
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_IDLE_BATTLE_MODE;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MENU_STATE_UNREACHABLE:
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state++;
|
2019-03-03 08:50:40 +01:00
|
|
|
break;
|
|
|
|
case MENU_STATE_SETUP_BATTLE_MODE:
|
|
|
|
|
|
|
|
HideHeartSpritesAndShowTeachMoveText(FALSE);
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state++;
|
2019-03-03 08:50:40 +01:00
|
|
|
AddScrollArrows();
|
|
|
|
break;
|
|
|
|
case MENU_STATE_IDLE_BATTLE_MODE:
|
|
|
|
HandleInput(FALSE);
|
|
|
|
break;
|
|
|
|
case MENU_STATE_SETUP_CONTEST_MODE:
|
|
|
|
ShowTeachMoveText(FALSE);
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state++;
|
2019-03-03 08:50:40 +01:00
|
|
|
AddScrollArrows();
|
|
|
|
break;
|
|
|
|
case MENU_STATE_IDLE_CONTEST_MODE:
|
|
|
|
HandleInput(TRUE);
|
|
|
|
break;
|
|
|
|
case MENU_STATE_PRINT_TEACH_MOVE_PROMPT:
|
2019-03-05 02:56:39 +01:00
|
|
|
if (!MoveRelearnerRunTextPrinters())
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
MoveRelearnerCreateYesNoMenu();
|
|
|
|
sMoveRelearnerStruct->state++;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MENU_STATE_TEACH_MOVE_CONFIRM:
|
|
|
|
{
|
|
|
|
s8 selection = Menu_ProcessInputNoWrapClearOnChoose();
|
|
|
|
|
|
|
|
if (selection == 0)
|
|
|
|
{
|
2019-10-18 01:22:03 +02:00
|
|
|
if (GiveMoveToMon(&gPlayerParty[sMoveRelearnerStruct->partyMon], GetCurrentSelectedMove()) != MON_HAS_MAX_MOVES)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
FormatAndPrintText(gText_MoveRelearnerPkmnLearnedMove);
|
2019-03-03 08:50:40 +01:00
|
|
|
gSpecialVar_0x8004 = TRUE;
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_PRINT_TEXT_THEN_FANFARE;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_PRINT_TRYING_TO_LEARN_PROMPT;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (selection == MENU_B_PRESSED || selection == 1)
|
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
if (sMoveRelearnerMenuSate.showContestInfo == FALSE)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_SETUP_BATTLE_MODE;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
2019-03-05 02:56:39 +01:00
|
|
|
else if (sMoveRelearnerMenuSate.showContestInfo == TRUE)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_SETUP_CONTEST_MODE;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MENU_STATE_PRINT_GIVE_UP_PROMPT:
|
2019-03-05 02:56:39 +01:00
|
|
|
if (!MoveRelearnerRunTextPrinters())
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
MoveRelearnerCreateYesNoMenu();
|
|
|
|
sMoveRelearnerStruct->state++;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MENU_STATE_GIVE_UP_CONFIRM:
|
|
|
|
{
|
|
|
|
s8 selection = Menu_ProcessInputNoWrapClearOnChoose();
|
|
|
|
|
|
|
|
if (selection == 0)
|
|
|
|
{
|
|
|
|
gSpecialVar_0x8004 = FALSE;
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_FADE_AND_RETURN;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
else if (selection == -1 || selection == 1)
|
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
if (sMoveRelearnerMenuSate.showContestInfo == FALSE)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_SETUP_BATTLE_MODE;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
2019-03-05 02:56:39 +01:00
|
|
|
else if (sMoveRelearnerMenuSate.showContestInfo == TRUE)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_SETUP_CONTEST_MODE;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MENU_STATE_PRINT_TRYING_TO_LEARN_PROMPT:
|
2019-03-05 02:56:39 +01:00
|
|
|
FormatAndPrintText(gText_MoveRelearnerPkmnTryingToLearnMove);
|
|
|
|
sMoveRelearnerStruct->state++;
|
2019-03-03 08:50:40 +01:00
|
|
|
break;
|
|
|
|
case MENU_STATE_WAIT_FOR_TRYING_TO_LEARN:
|
2019-03-05 02:56:39 +01:00
|
|
|
if (!MoveRelearnerRunTextPrinters())
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
MoveRelearnerCreateYesNoMenu();
|
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_CONFIRM_DELETE_OLD_MOVE;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MENU_STATE_CONFIRM_DELETE_OLD_MOVE:
|
|
|
|
{
|
|
|
|
s8 var = Menu_ProcessInputNoWrapClearOnChoose();
|
|
|
|
|
|
|
|
if (var == 0)
|
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
FormatAndPrintText(gText_MoveRelearnerWhichMoveToForget);
|
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_PRINT_WHICH_MOVE_PROMPT;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
else if (var == -1 || var == 1)
|
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_PRINT_STOP_TEACHING;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MENU_STATE_PRINT_STOP_TEACHING:
|
|
|
|
StringCopy(gStringVar2, gMoveNames[GetCurrentSelectedMove()]);
|
2019-03-05 02:56:39 +01:00
|
|
|
FormatAndPrintText(gText_MoveRelearnerStopTryingToTeachMove);
|
|
|
|
sMoveRelearnerStruct->state++;
|
2019-03-03 08:50:40 +01:00
|
|
|
break;
|
|
|
|
case MENU_STATE_WAIT_FOR_STOP_TEACHING:
|
2019-03-05 02:56:39 +01:00
|
|
|
if (!MoveRelearnerRunTextPrinters())
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
MoveRelearnerCreateYesNoMenu();
|
|
|
|
sMoveRelearnerStruct->state++;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MENU_STATE_CONFIRM_STOP_TEACHING:
|
|
|
|
{
|
|
|
|
s8 var = Menu_ProcessInputNoWrapClearOnChoose();
|
|
|
|
|
|
|
|
if (var == 0)
|
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_CHOOSE_SETUP_STATE;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
else if (var == MENU_B_PRESSED || var == 1)
|
|
|
|
{
|
|
|
|
// What's the point? It gets set to MENU_STATE_PRINT_TRYING_TO_LEARN_PROMPT, anyway.
|
2019-03-05 02:56:39 +01:00
|
|
|
if (sMoveRelearnerMenuSate.showContestInfo == FALSE)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_SETUP_BATTLE_MODE;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
2019-03-05 02:56:39 +01:00
|
|
|
else if (sMoveRelearnerMenuSate.showContestInfo == TRUE)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_SETUP_CONTEST_MODE;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_PRINT_TRYING_TO_LEARN_PROMPT;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MENU_STATE_CHOOSE_SETUP_STATE:
|
2019-03-05 02:56:39 +01:00
|
|
|
if (!MoveRelearnerRunTextPrinters())
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
|
|
|
FillWindowPixelBuffer(3, 0x11);
|
2019-03-05 02:56:39 +01:00
|
|
|
if (sMoveRelearnerMenuSate.showContestInfo == FALSE)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_SETUP_BATTLE_MODE;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
2019-03-05 02:56:39 +01:00
|
|
|
else if (sMoveRelearnerMenuSate.showContestInfo == TRUE)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_SETUP_CONTEST_MODE;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MENU_STATE_PRINT_WHICH_MOVE_PROMPT:
|
2019-03-05 02:56:39 +01:00
|
|
|
if (!MoveRelearnerRunTextPrinters())
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_SHOW_MOVE_SUMMARY_SCREEN;
|
2021-02-24 17:01:02 +01:00
|
|
|
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MENU_STATE_SHOW_MOVE_SUMMARY_SCREEN:
|
|
|
|
if (!gPaletteFade.active)
|
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
ShowSelectMovePokemonSummaryScreen(gPlayerParty, sMoveRelearnerStruct->partyMon, gPlayerPartyCount - 1, CB2_InitLearnMoveReturnFromSelectMove, GetCurrentSelectedMove());
|
|
|
|
FreeMoveRelearnerResources();
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 21:
|
2019-03-05 02:56:39 +01:00
|
|
|
if (!MoveRelearnerRunTextPrinters())
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_FADE_AND_RETURN;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 22:
|
2021-02-24 17:01:02 +01:00
|
|
|
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
|
2019-03-03 08:50:40 +01:00
|
|
|
break;
|
|
|
|
case MENU_STATE_FADE_AND_RETURN:
|
2021-02-24 17:01:02 +01:00
|
|
|
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state++;
|
2019-03-03 08:50:40 +01:00
|
|
|
break;
|
|
|
|
case MENU_STATE_RETURN_TO_FIELD:
|
|
|
|
if (!gPaletteFade.active)
|
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
FreeMoveRelearnerResources();
|
2019-03-03 08:50:40 +01:00
|
|
|
SetMainCallback2(CB2_ReturnToField);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MENU_STATE_FADE_FROM_SUMMARY_SCREEN:
|
2021-02-24 17:01:02 +01:00
|
|
|
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state++;
|
|
|
|
if (sMoveRelearnerMenuSate.showContestInfo == FALSE)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
|
|
|
HideHeartSpritesAndShowTeachMoveText(TRUE);
|
|
|
|
}
|
2019-03-05 02:56:39 +01:00
|
|
|
else if (sMoveRelearnerMenuSate.showContestInfo == TRUE)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
|
|
|
ShowTeachMoveText(TRUE);
|
|
|
|
}
|
|
|
|
RemoveScrollArrows();
|
2021-11-03 20:29:18 +01:00
|
|
|
CopyWindowToVram(3, COPYWIN_GFX);
|
2019-03-03 08:50:40 +01:00
|
|
|
break;
|
|
|
|
case MENU_STATE_TRY_OVERWRITE_MOVE:
|
|
|
|
if (!gPaletteFade.active)
|
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
if (sMoveRelearnerStruct->moveSlot == MAX_MON_MOVES)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_PRINT_STOP_TEACHING;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
u16 moveId = GetMonData(&gPlayerParty[sMoveRelearnerStruct->partyMon], MON_DATA_MOVE1 + sMoveRelearnerStruct->moveSlot);
|
2019-03-03 08:50:40 +01:00
|
|
|
|
|
|
|
StringCopy(gStringVar3, gMoveNames[moveId]);
|
2019-03-05 02:56:39 +01:00
|
|
|
RemoveMonPPBonus(&gPlayerParty[sMoveRelearnerStruct->partyMon], sMoveRelearnerStruct->moveSlot);
|
|
|
|
SetMonMoveSlot(&gPlayerParty[sMoveRelearnerStruct->partyMon], GetCurrentSelectedMove(), sMoveRelearnerStruct->moveSlot);
|
2019-03-03 08:50:40 +01:00
|
|
|
StringCopy(gStringVar2, gMoveNames[GetCurrentSelectedMove()]);
|
2019-03-05 02:56:39 +01:00
|
|
|
FormatAndPrintText(gText_MoveRelearnerAndPoof);
|
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_DOUBLE_FANFARE_FORGOT_MOVE;
|
2019-03-03 08:50:40 +01:00
|
|
|
gSpecialVar_0x8004 = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MENU_STATE_DOUBLE_FANFARE_FORGOT_MOVE:
|
2019-03-05 02:56:39 +01:00
|
|
|
if (!MoveRelearnerRunTextPrinters())
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
FormatAndPrintText(gText_MoveRelearnerPkmnForgotMoveAndLearnedNew);
|
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_PRINT_TEXT_THEN_FANFARE;
|
2020-08-21 00:02:00 +02:00
|
|
|
PlayFanfare(MUS_LEVEL_UP);
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MENU_STATE_PRINT_TEXT_THEN_FANFARE:
|
2019-03-05 02:56:39 +01:00
|
|
|
if (!MoveRelearnerRunTextPrinters())
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2020-08-21 00:02:00 +02:00
|
|
|
PlayFanfare(MUS_LEVEL_UP);
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_WAIT_FOR_FANFARE;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MENU_STATE_WAIT_FOR_FANFARE:
|
|
|
|
if (IsFanfareTaskInactive())
|
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_WAIT_FOR_A_BUTTON;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MENU_STATE_WAIT_FOR_A_BUTTON:
|
2020-09-05 03:11:55 +02:00
|
|
|
if (JOY_NEW(A_BUTTON))
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
|
|
|
PlaySE(SE_SELECT);
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_FADE_AND_RETURN;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-05 02:56:39 +01:00
|
|
|
static void FreeMoveRelearnerResources(void)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
|
|
|
RemoveScrollArrows();
|
2019-03-05 02:56:39 +01:00
|
|
|
DestroyListMenuTask(sMoveRelearnerStruct->moveListMenuTask, &sMoveRelearnerMenuSate.listOffset, &sMoveRelearnerMenuSate.listRow);
|
2019-03-03 08:50:40 +01:00
|
|
|
FreeAllWindowBuffers();
|
2019-03-05 02:56:39 +01:00
|
|
|
FREE_AND_SET_NULL(sMoveRelearnerStruct);
|
2019-03-03 08:50:40 +01:00
|
|
|
ResetSpriteData();
|
|
|
|
FreeAllSpritePalettes();
|
|
|
|
}
|
|
|
|
|
2019-03-05 02:56:39 +01:00
|
|
|
// Note: The hearts are already made invisible by MoveRelearnerShowHideHearts,
|
2019-03-03 08:50:40 +01:00
|
|
|
// which is called whenever the cursor in either list changes.
|
|
|
|
static void HideHeartSpritesAndShowTeachMoveText(bool8 onlyHideSprites)
|
|
|
|
{
|
|
|
|
s32 i;
|
|
|
|
|
|
|
|
for (i = 0; i < 16; i++)
|
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
gSprites[sMoveRelearnerStruct->heartSpriteIds[i]].invisible = TRUE;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!onlyHideSprites)
|
|
|
|
{
|
|
|
|
StringExpandPlaceholders(gStringVar4, gText_TeachWhichMoveToPkmn);
|
|
|
|
FillWindowPixelBuffer(3, 0x11);
|
2021-10-30 22:47:37 +02:00
|
|
|
AddTextPrinterParameterized(3, FONT_NORMAL, gStringVar4, 0, 1, 0, NULL);
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void HandleInput(bool8 showContest)
|
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
s32 itemId = ListMenu_ProcessInput(sMoveRelearnerStruct->moveListMenuTask);
|
|
|
|
ListMenuGetScrollAndRow(sMoveRelearnerStruct->moveListMenuTask, &sMoveRelearnerMenuSate.listOffset, &sMoveRelearnerMenuSate.listRow);
|
2019-03-03 08:50:40 +01:00
|
|
|
|
|
|
|
switch (itemId)
|
|
|
|
{
|
|
|
|
case LIST_NOTHING_CHOSEN:
|
2020-09-05 03:11:55 +02:00
|
|
|
if (!(JOY_NEW(DPAD_LEFT | DPAD_RIGHT)) && !GetLRKeysPressed())
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
PlaySE(SE_SELECT);
|
|
|
|
|
|
|
|
if (showContest == FALSE)
|
|
|
|
{
|
|
|
|
PutWindowTilemap(1);
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_SETUP_CONTEST_MODE;
|
|
|
|
sMoveRelearnerMenuSate.showContestInfo = TRUE;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
PutWindowTilemap(0);
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_SETUP_BATTLE_MODE;
|
|
|
|
sMoveRelearnerMenuSate.showContestInfo = FALSE;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
|
2020-05-14 10:37:09 +02:00
|
|
|
ScheduleBgCopyTilemapToVram(1);
|
2019-03-05 02:56:39 +01:00
|
|
|
MoveRelearnerShowHideHearts(GetCurrentSelectedMove());
|
2019-03-03 08:50:40 +01:00
|
|
|
break;
|
|
|
|
case LIST_CANCEL:
|
|
|
|
PlaySE(SE_SELECT);
|
|
|
|
RemoveScrollArrows();
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_PRINT_GIVE_UP_PROMPT;
|
|
|
|
StringExpandPlaceholders(gStringVar4, gText_MoveRelearnerGiveUp);
|
|
|
|
MoveRelearnerPrintText(gStringVar4);
|
2019-03-03 08:50:40 +01:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
PlaySE(SE_SELECT);
|
|
|
|
RemoveScrollArrows();
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->state = MENU_STATE_PRINT_TEACH_MOVE_PROMPT;
|
2019-03-03 08:50:40 +01:00
|
|
|
StringCopy(gStringVar2, gMoveNames[itemId]);
|
2019-03-05 02:56:39 +01:00
|
|
|
StringExpandPlaceholders(gStringVar4, gText_MoveRelearnerTeachMoveConfirm);
|
|
|
|
MoveRelearnerPrintText(gStringVar4);
|
2019-03-03 08:50:40 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static s32 GetCurrentSelectedMove(void)
|
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
return sMoveRelearnerStruct->menuItems[sMoveRelearnerMenuSate.listRow + sMoveRelearnerMenuSate.listOffset].id;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Theory: This used to make the heart sprites visible again (i.e.
|
|
|
|
// this was the inverse of HideHeartsAndShowTeachMoveText), but the
|
|
|
|
// code was commented out. The bool argument would have been named
|
|
|
|
// "justShowHearts." The code for showing/hiding the heards was moved
|
2019-03-05 02:56:39 +01:00
|
|
|
// to MoveRelearnerShowHideHearts, which is called whenever a new move is
|
2019-03-03 08:50:40 +01:00
|
|
|
// selected and whenever the display mode changes.
|
|
|
|
static void ShowTeachMoveText(bool8 shouldDoNothingInstead)
|
|
|
|
{
|
|
|
|
if (shouldDoNothingInstead == FALSE)
|
|
|
|
{
|
|
|
|
StringExpandPlaceholders(gStringVar4, gText_TeachWhichMoveToPkmn);
|
|
|
|
FillWindowPixelBuffer(3, 0x11);
|
2021-10-30 22:47:37 +02:00
|
|
|
AddTextPrinterParameterized(3, FONT_NORMAL, gStringVar4, 0, 1, 0, NULL);
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void CreateUISprites(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
2021-02-20 05:22:26 +01:00
|
|
|
sMoveRelearnerStruct->moveDisplayArrowTask = TASK_NONE;
|
|
|
|
sMoveRelearnerStruct->moveListScrollArrowTask = TASK_NONE;
|
2019-03-03 08:50:40 +01:00
|
|
|
AddScrollArrows();
|
|
|
|
|
|
|
|
// These are the appeal hearts.
|
|
|
|
for (i = 0; i < 8; i++)
|
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->heartSpriteIds[i] = CreateSprite(&sConstestMoveHeartSprite, (i - (i / 4) * 4) * 8 + 104, (i / 4) * 8 + 36, 0);
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// These are the jam harts.
|
|
|
|
// The animation is used to toggle between full/empty heart sprites.
|
|
|
|
for (i = 0; i < 8; i++)
|
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->heartSpriteIds[i + 8] = CreateSprite(&sConstestMoveHeartSprite, (i - (i / 4) * 4) * 8 + 104, (i / 4) * 8 + 52, 0);
|
|
|
|
StartSpriteAnim(&gSprites[sMoveRelearnerStruct->heartSpriteIds[i + 8]], 2);
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < 16; i++)
|
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
gSprites[sMoveRelearnerStruct->heartSpriteIds[i]].invisible = TRUE;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void AddScrollArrows(void)
|
|
|
|
{
|
2021-02-20 05:22:26 +01:00
|
|
|
if (sMoveRelearnerStruct->moveDisplayArrowTask == TASK_NONE)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->moveDisplayArrowTask = AddScrollIndicatorArrowPair(&sDisplayModeArrowsTemplate, &sMoveRelearnerStruct->scrollOffset);
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
|
2021-02-20 05:22:26 +01:00
|
|
|
if (sMoveRelearnerStruct->moveListScrollArrowTask == TASK_NONE)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
|
|
|
gTempScrollArrowTemplate = sMoveListScrollArrowsTemplate;
|
2019-03-05 02:56:39 +01:00
|
|
|
gTempScrollArrowTemplate.fullyDownThreshold = sMoveRelearnerStruct->numMenuChoices - sMoveRelearnerStruct->numToShowAtOnce;
|
|
|
|
sMoveRelearnerStruct->moveListScrollArrowTask = AddScrollIndicatorArrowPair(&gTempScrollArrowTemplate, &sMoveRelearnerMenuSate.listOffset);
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void RemoveScrollArrows(void)
|
|
|
|
{
|
2021-02-20 05:22:26 +01:00
|
|
|
if (sMoveRelearnerStruct->moveDisplayArrowTask != TASK_NONE)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
RemoveScrollIndicatorArrowPair(sMoveRelearnerStruct->moveDisplayArrowTask);
|
2021-02-20 05:22:26 +01:00
|
|
|
sMoveRelearnerStruct->moveDisplayArrowTask = TASK_NONE;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
|
2021-02-20 05:22:26 +01:00
|
|
|
if (sMoveRelearnerStruct->moveListScrollArrowTask != TASK_NONE)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
RemoveScrollIndicatorArrowPair(sMoveRelearnerStruct->moveListScrollArrowTask);
|
2021-02-20 05:22:26 +01:00
|
|
|
sMoveRelearnerStruct->moveListScrollArrowTask = TASK_NONE;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void CreateLearnableMovesList(void)
|
|
|
|
{
|
|
|
|
s32 i;
|
|
|
|
u8 nickname[POKEMON_NAME_LENGTH + 1];
|
|
|
|
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->numMenuChoices = GetMoveRelearnerMoves(&gPlayerParty[sMoveRelearnerStruct->partyMon], sMoveRelearnerStruct->movesToLearn);
|
2019-03-03 08:50:40 +01:00
|
|
|
|
2019-03-05 02:56:39 +01:00
|
|
|
for (i = 0; i < sMoveRelearnerStruct->numMenuChoices; i++)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->menuItems[i].name = gMoveNames[sMoveRelearnerStruct->movesToLearn[i]];
|
|
|
|
sMoveRelearnerStruct->menuItems[i].id = sMoveRelearnerStruct->movesToLearn[i];
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
|
2019-03-05 02:56:39 +01:00
|
|
|
GetMonData(&gPlayerParty[sMoveRelearnerStruct->partyMon], MON_DATA_NICKNAME, nickname);
|
2021-11-18 04:11:03 +01:00
|
|
|
StringCopy_Nickname(gStringVar1, nickname);
|
2019-03-05 02:56:39 +01:00
|
|
|
sMoveRelearnerStruct->menuItems[sMoveRelearnerStruct->numMenuChoices].name = gText_Cancel;
|
|
|
|
sMoveRelearnerStruct->menuItems[sMoveRelearnerStruct->numMenuChoices].id = LIST_CANCEL;
|
|
|
|
sMoveRelearnerStruct->numMenuChoices++;
|
|
|
|
sMoveRelearnerStruct->numToShowAtOnce = LoadMoveRelearnerMovesList(sMoveRelearnerStruct->menuItems, sMoveRelearnerStruct->numMenuChoices);
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
|
2019-03-05 02:56:39 +01:00
|
|
|
void MoveRelearnerShowHideHearts(s32 moveId)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
|
|
|
u16 numHearts;
|
|
|
|
u16 i;
|
|
|
|
|
2019-03-05 02:56:39 +01:00
|
|
|
if (!sMoveRelearnerMenuSate.showContestInfo || moveId == LIST_CANCEL)
|
2019-03-03 08:50:40 +01:00
|
|
|
{
|
|
|
|
for (i = 0; i < 16; i++)
|
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
gSprites[sMoveRelearnerStruct->heartSpriteIds[i]].invisible = TRUE;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
numHearts = (u8)(gContestEffects[gContestMoves[moveId].effect].appeal / 10);
|
|
|
|
|
|
|
|
if (numHearts == 0xFF)
|
|
|
|
{
|
|
|
|
numHearts = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < 8; i++)
|
|
|
|
{
|
|
|
|
if (i < numHearts)
|
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
StartSpriteAnim(&gSprites[sMoveRelearnerStruct->heartSpriteIds[i]], 1);
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
StartSpriteAnim(&gSprites[sMoveRelearnerStruct->heartSpriteIds[i]], 0);
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
2019-03-05 02:56:39 +01:00
|
|
|
gSprites[sMoveRelearnerStruct->heartSpriteIds[i]].invisible = FALSE;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
numHearts = (u8)(gContestEffects[gContestMoves[moveId].effect].jam / 10);
|
|
|
|
|
|
|
|
if (numHearts == 0xFF)
|
|
|
|
{
|
|
|
|
numHearts = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < 8; i++)
|
|
|
|
{
|
|
|
|
if (i < numHearts)
|
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
StartSpriteAnim(&gSprites[sMoveRelearnerStruct->heartSpriteIds[i + 8]], 3);
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-03-05 02:56:39 +01:00
|
|
|
StartSpriteAnim(&gSprites[sMoveRelearnerStruct->heartSpriteIds[i + 8]], 2);
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
2019-03-05 02:56:39 +01:00
|
|
|
gSprites[sMoveRelearnerStruct->heartSpriteIds[i + 8]].invisible = FALSE;
|
2019-03-03 08:50:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|