More battle doc, add battle window ids

This commit is contained in:
GriffinR 2021-10-08 16:50:52 -04:00
parent 31b501e7eb
commit d8e65fc4b6
26 changed files with 523 additions and 523 deletions

View File

Before

Width:  |  Height:  |  Size: 174 B

After

Width:  |  Height:  |  Size: 174 B

View File

@ -3,8 +3,9 @@
#include "constants/pokemon.h"
#define WINDOW_CLEAR 0x1
#define WINDOW_x80 0x80
// Arguments for 'flags' in HandleBattleWindow
#define WINDOW_CLEAR (1 << 0)
#define WINDOW_BG1 (1 << 7)
void AI_CalcDmg(u8 battlerIdAtk, u8 battlerIdDef);
u8 TypeCalc(u16 move, u8 battlerIdAtk, u8 battlerIdDef);

View File

@ -319,4 +319,43 @@
#define B_WIN_TYPE_NORMAL 0
#define B_WIN_TYPE_ARENA 1
// Window Ids for gStandardBattleWindowTemplates / gBattleArenaWindowTemplates
#define B_WIN_MSG 0
#define B_WIN_ACTION_PROMPT 1 // "What will {x} do?"
#define B_WIN_ACTION_MENU 2 // "Fight/Pokémon/Bag/Run" menu
#define B_WIN_MOVE_NAME_1 3 // Top left
#define B_WIN_MOVE_NAME_2 4 // Top right
#define B_WIN_MOVE_NAME_3 5 // Bottom left
#define B_WIN_MOVE_NAME_4 6 // Bottom right
#define B_WIN_PP 7
#define B_WIN_DUMMY 8
#define B_WIN_PP_REMAINING 9
#define B_WIN_MOVE_TYPE 10
#define B_WIN_SWITCH_PROMPT 11 // "Switch which?"
#define B_WIN_YESNO 12
#define B_WIN_LEVEL_UP_BOX 13
#define B_WIN_LEVEL_UP_BANNER 14
#define B_WIN_VS_PLAYER 15
#define B_WIN_VS_OPPONENT 16
#define B_WIN_VS_MULTI_PLAYER_1 17
#define B_WIN_VS_MULTI_PLAYER_2 18
#define B_WIN_VS_MULTI_PLAYER_3 19
#define B_WIN_VS_MULTI_PLAYER_4 20
#define B_WIN_VS_OUTCOME_DRAW 21
#define B_WIN_VS_OUTCOME_LEFT 22
#define B_WIN_VS_OUTCOME_RIGHT 23
// The following are duplicate id values for windows that Battle Arena uses differently.
#define ARENA_WIN_PLAYER_NAME 15
#define ARENA_WIN_VS 16
#define ARENA_WIN_OPPONENT_NAME 17
#define ARENA_WIN_MIND 18
#define ARENA_WIN_SKILL 19
#define ARENA_WIN_BODY 20
#define ARENA_WIN_JUDGEMENT_TITLE 21
#define ARENA_WIN_JUDGEMENT_TEXT 22
// Flag for BattlePutTextOnWindow. Never set
#define B_WIN_COPYTOVRAM (1 << 7)
#endif // GUARD_CONSTANTS_BATTLE_H

View File

@ -20,10 +20,6 @@
#define ANIM_SPRITE_INDEX_COUNT 8
extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern struct MusicPlayerInfo gMPlayInfo_SE1;
extern struct MusicPlayerInfo gMPlayInfo_SE2;
extern const u16 gMovesWithQuietBGM[];
extern const u8 *const gBattleAnims_Moves[];

View File

@ -28,7 +28,6 @@
#include "constants/moves.h"
#include "constants/rgb.h"
// This file's functions.
static void InitArenaChallenge(void);
static void GetArenaData(void);
static void SetArenaData(void);
@ -39,7 +38,6 @@ static void BufferArenaOpponentName(void);
static void SpriteCb_JudgmentIcon(struct Sprite *sprite);
static void ShowJudgmentSprite(u8 x, u8 y, u8 category, u8 battler);
// Const rom data.
static const s8 sMindRatings[] =
{
[MOVE_NONE] = 0,
@ -501,7 +499,6 @@ static const u16 sLongStreakPrizeItems[] =
ITEM_CHOICE_BAND,
};
// code
void CallBattleArenaFunction(void)
{
sArenaFunctions[gSpecialVar_0x8004]();
@ -537,15 +534,15 @@ u8 BattleArena_ShowJudgmentWindow(u8 *state)
gBattleTextBuff2[0] = CHAR_0;
gBattleTextBuff2[1] = EOS;
BattleStringExpandPlaceholdersToDisplayedString(gText_PlayerMon1Name);
BattlePutTextOnWindow(gDisplayedStringBattle, 15);
BattlePutTextOnWindow(gText_Vs, 16);
BattlePutTextOnWindow(gDisplayedStringBattle, ARENA_WIN_PLAYER_NAME);
BattlePutTextOnWindow(gText_Vs, ARENA_WIN_VS);
BattleStringExpandPlaceholdersToDisplayedString(gText_OpponentMon1Name);
BattlePutTextOnWindow(gDisplayedStringBattle, 17);
BattlePutTextOnWindow(gText_Mind, 18);
BattlePutTextOnWindow(gText_Skill, 19);
BattlePutTextOnWindow(gText_Body, 20);
BattlePutTextOnWindow(gDisplayedStringBattle, ARENA_WIN_OPPONENT_NAME);
BattlePutTextOnWindow(gText_Mind, ARENA_WIN_MIND);
BattlePutTextOnWindow(gText_Skill, ARENA_WIN_SKILL);
BattlePutTextOnWindow(gText_Body, ARENA_WIN_BODY);
BattleStringExpandPlaceholdersToDisplayedString(gText_Judgement);
BattlePutTextOnWindow(gDisplayedStringBattle, 21);
BattlePutTextOnWindow(gDisplayedStringBattle, ARENA_WIN_JUDGEMENT_TITLE);
(*state)++;
}
break;
@ -567,7 +564,7 @@ u8 BattleArena_ShowJudgmentWindow(u8 *state)
ShowJudgmentSprite(80, 40, ARENA_CATEGORY_MIND, B_POSITION_PLAYER_LEFT);
ShowJudgmentSprite(160, 40, ARENA_CATEGORY_MIND, B_POSITION_OPPONENT_LEFT);
BattleStringExpandPlaceholdersToDisplayedString(gText_Judgement);
BattlePutTextOnWindow(gDisplayedStringBattle, 21);
BattlePutTextOnWindow(gDisplayedStringBattle, ARENA_WIN_JUDGEMENT_TITLE);
(*state)++;
ret = 1;
break;
@ -576,7 +573,7 @@ u8 BattleArena_ShowJudgmentWindow(u8 *state)
ShowJudgmentSprite(80, 56, ARENA_CATEGORY_SKILL, B_POSITION_PLAYER_LEFT);
ShowJudgmentSprite(160, 56, ARENA_CATEGORY_SKILL, B_POSITION_OPPONENT_LEFT);
BattleStringExpandPlaceholdersToDisplayedString(gText_Judgement);
BattlePutTextOnWindow(gDisplayedStringBattle, 21);
BattlePutTextOnWindow(gDisplayedStringBattle, ARENA_WIN_JUDGEMENT_TITLE);
(*state)++;
ret = 1;
break;
@ -585,7 +582,7 @@ u8 BattleArena_ShowJudgmentWindow(u8 *state)
ShowJudgmentSprite(80, 72, ARENA_CATEGORY_BODY, B_POSITION_PLAYER_LEFT);
ShowJudgmentSprite(160, 72, ARENA_CATEGORY_BODY, B_POSITION_OPPONENT_LEFT);
BattleStringExpandPlaceholdersToDisplayedString(gText_Judgement);
BattlePutTextOnWindow(gDisplayedStringBattle, 21);
BattlePutTextOnWindow(gDisplayedStringBattle, ARENA_WIN_JUDGEMENT_TITLE);
(*state)++;
ret = 1;
break;

View File

@ -161,7 +161,7 @@ const struct BgTemplate gBattleBgTemplates[] =
static const struct WindowTemplate gStandardBattleWindowTemplates[] =
{
{ // 0 Standard battle message
[B_WIN_MSG] = {
.bg = 0,
.tilemapLeft = 2,
.tilemapTop = 15,
@ -170,7 +170,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
.paletteNum = 0,
.baseBlock = 0x0090,
},
{ // 1 "What will (pokemon) do?"
[B_WIN_ACTION_PROMPT] = {
.bg = 0,
.tilemapLeft = 1,
.tilemapTop = 35,
@ -179,7 +179,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
.paletteNum = 0,
.baseBlock = 0x01c0,
},
{ // 2 "Fight/Pokemon/Bag/Run"
[B_WIN_ACTION_MENU] = {
.bg = 0,
.tilemapLeft = 17,
.tilemapTop = 35,
@ -188,7 +188,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0190,
},
{ // 3 Top left move
[B_WIN_MOVE_NAME_1] = {
.bg = 0,
.tilemapLeft = 2,
.tilemapTop = 55,
@ -197,7 +197,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0300,
},
{ // 4 Top right move
[B_WIN_MOVE_NAME_2] = {
.bg = 0,
.tilemapLeft = 11,
.tilemapTop = 55,
@ -206,7 +206,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0310,
},
{ // 5 Bottom left move
[B_WIN_MOVE_NAME_3] = {
.bg = 0,
.tilemapLeft = 2,
.tilemapTop = 57,
@ -215,7 +215,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0320,
},
{ // 6 Bottom right move
[B_WIN_MOVE_NAME_4] = {
.bg = 0,
.tilemapLeft = 11,
.tilemapTop = 57,
@ -224,7 +224,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0330,
},
{
[B_WIN_PP] = {
.bg = 0,
.tilemapLeft = 21,
.tilemapTop = 55,
@ -233,7 +233,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0290,
},
{
[B_WIN_DUMMY] = {
.bg = 0,
.tilemapLeft = 21,
.tilemapTop = 57,
@ -242,7 +242,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0298,
},
{
[B_WIN_PP_REMAINING] = {
.bg = 0,
.tilemapLeft = 25,
.tilemapTop = 55,
@ -251,7 +251,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0298,
},
{
[B_WIN_MOVE_TYPE] = {
.bg = 0,
.tilemapLeft = 21,
.tilemapTop = 57,
@ -260,7 +260,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x02a0,
},
{
[B_WIN_SWITCH_PROMPT] = {
.bg = 0,
.tilemapLeft = 21,
.tilemapTop = 55,
@ -269,7 +269,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x02b0,
},
{
[B_WIN_YESNO] = {
.bg = 0,
.tilemapLeft = 26,
.tilemapTop = 9,
@ -278,7 +278,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0100,
},
{
[B_WIN_LEVEL_UP_BOX] = {
.bg = 1,
.tilemapLeft = 19,
.tilemapTop = 8,
@ -287,7 +287,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0100,
},
{
[B_WIN_LEVEL_UP_BANNER] = {
.bg = 2,
.tilemapLeft = 18,
.tilemapTop = 0,
@ -296,7 +296,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
.paletteNum = 6,
.baseBlock = 0x016e,
},
{
[B_WIN_VS_PLAYER] = {
.bg = 1,
.tilemapLeft = 2,
.tilemapTop = 3,
@ -305,7 +305,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0020,
},
{
[B_WIN_VS_OPPONENT] = {
.bg = 2,
.tilemapLeft = 2,
.tilemapTop = 3,
@ -314,7 +314,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0040,
},
{
[B_WIN_VS_MULTI_PLAYER_1] = {
.bg = 1,
.tilemapLeft = 2,
.tilemapTop = 2,
@ -323,7 +323,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0020,
},
{
[B_WIN_VS_MULTI_PLAYER_2] = {
.bg = 2,
.tilemapLeft = 2,
.tilemapTop = 2,
@ -332,7 +332,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0040,
},
{
[B_WIN_VS_MULTI_PLAYER_3] = {
.bg = 1,
.tilemapLeft = 2,
.tilemapTop = 6,
@ -341,7 +341,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0060,
},
{
[B_WIN_VS_MULTI_PLAYER_4] = {
.bg = 2,
.tilemapLeft = 2,
.tilemapTop = 6,
@ -350,7 +350,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0080,
},
{
[B_WIN_VS_OUTCOME_DRAW] = {
.bg = 0,
.tilemapLeft = 12,
.tilemapTop = 2,
@ -359,7 +359,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
.paletteNum = 0,
.baseBlock = 0x00a0,
},
{
[B_WIN_VS_OUTCOME_LEFT] = {
.bg = 0,
.tilemapLeft = 4,
.tilemapTop = 2,
@ -368,7 +368,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
.paletteNum = 0,
.baseBlock = 0x00a0,
},
{
[B_WIN_VS_OUTCOME_RIGHT] = {
.bg = 0,
.tilemapLeft = 19,
.tilemapTop = 2,
@ -382,7 +382,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
static const struct WindowTemplate gBattleArenaWindowTemplates[] =
{
{
[B_WIN_MSG] = {
.bg = 0,
.tilemapLeft = 2,
.tilemapTop = 15,
@ -391,7 +391,7 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
.paletteNum = 0,
.baseBlock = 0x0090,
},
{
[B_WIN_ACTION_PROMPT] = {
.bg = 0,
.tilemapLeft = 1,
.tilemapTop = 35,
@ -400,7 +400,7 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
.paletteNum = 0,
.baseBlock = 0x01c0,
},
{
[B_WIN_ACTION_MENU] = {
.bg = 0,
.tilemapLeft = 17,
.tilemapTop = 35,
@ -409,7 +409,7 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0190,
},
{
[B_WIN_MOVE_NAME_1] = {
.bg = 0,
.tilemapLeft = 2,
.tilemapTop = 55,
@ -418,7 +418,7 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0300,
},
{
[B_WIN_MOVE_NAME_2] = {
.bg = 0,
.tilemapLeft = 11,
.tilemapTop = 55,
@ -427,7 +427,7 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0310,
},
{
[B_WIN_MOVE_NAME_3] = {
.bg = 0,
.tilemapLeft = 2,
.tilemapTop = 57,
@ -436,7 +436,7 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0320,
},
{
[B_WIN_MOVE_NAME_4] = {
.bg = 0,
.tilemapLeft = 11,
.tilemapTop = 57,
@ -445,7 +445,7 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0330,
},
{
[B_WIN_PP] = {
.bg = 0,
.tilemapLeft = 21,
.tilemapTop = 55,
@ -454,7 +454,7 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0290,
},
{
[B_WIN_DUMMY] = {
.bg = 0,
.tilemapLeft = 21,
.tilemapTop = 57,
@ -463,7 +463,7 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0298,
},
{
[B_WIN_PP_REMAINING] = {
.bg = 0,
.tilemapLeft = 25,
.tilemapTop = 55,
@ -472,7 +472,7 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0298,
},
{
[B_WIN_MOVE_TYPE] = {
.bg = 0,
.tilemapLeft = 21,
.tilemapTop = 57,
@ -481,7 +481,7 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x02a0,
},
{
[B_WIN_SWITCH_PROMPT] = {
.bg = 0,
.tilemapLeft = 21,
.tilemapTop = 55,
@ -490,7 +490,7 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x02b0,
},
{
[B_WIN_YESNO] = {
.bg = 0,
.tilemapLeft = 26,
.tilemapTop = 9,
@ -499,7 +499,7 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0100,
},
{
[B_WIN_LEVEL_UP_BOX] = {
.bg = 1,
.tilemapLeft = 19,
.tilemapTop = 8,
@ -508,7 +508,7 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0100,
},
{
[B_WIN_LEVEL_UP_BANNER] = {
.bg = 2,
.tilemapLeft = 18,
.tilemapTop = 0,
@ -517,7 +517,7 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
.paletteNum = 6,
.baseBlock = 0x016e,
},
{
[ARENA_WIN_PLAYER_NAME] = {
.bg = 0,
.tilemapLeft = 6,
.tilemapTop = 1,
@ -526,7 +526,7 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0100,
},
{
[ARENA_WIN_VS] = {
.bg = 0,
.tilemapLeft = 14,
.tilemapTop = 1,
@ -535,7 +535,7 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0110,
},
{
[ARENA_WIN_OPPONENT_NAME] = {
.bg = 0,
.tilemapLeft = 16,
.tilemapTop = 1,
@ -544,7 +544,7 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0114,
},
{
[ARENA_WIN_MIND] = {
.bg = 0,
.tilemapLeft = 12,
.tilemapTop = 4,
@ -553,7 +553,7 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0124,
},
{
[ARENA_WIN_SKILL] = {
.bg = 0,
.tilemapLeft = 12,
.tilemapTop = 6,
@ -562,7 +562,7 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0130,
},
{
[ARENA_WIN_BODY] = {
.bg = 0,
.tilemapLeft = 12,
.tilemapTop = 8,
@ -571,7 +571,7 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x013c,
},
{
[ARENA_WIN_JUDGEMENT_TITLE] = {
.bg = 0,
.tilemapLeft = 8,
.tilemapTop = 11,
@ -580,7 +580,7 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
.paletteNum = 5,
.baseBlock = 0x0148,
},
{
[ARENA_WIN_JUDGEMENT_TEXT] = {
.bg = 0,
.tilemapLeft = 2,
.tilemapTop = 15,
@ -935,7 +935,7 @@ static void DrawLinkBattleVsScreenOutcomeText(void)
{
if (gBattleOutcome == B_OUTCOME_DREW)
{
BattlePutTextOnWindow(gText_Draw, 0x15);
BattlePutTextOnWindow(gText_Draw, B_WIN_VS_OUTCOME_DRAW);
}
else if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
{
@ -944,20 +944,20 @@ static void DrawLinkBattleVsScreenOutcomeText(void)
switch (gLinkPlayers[gBattleScripting.multiplayerId].id)
{
case 0:
BattlePutTextOnWindow(gText_Win, 0x16);
BattlePutTextOnWindow(gText_Loss, 0x17);
BattlePutTextOnWindow(gText_Win, B_WIN_VS_OUTCOME_LEFT);
BattlePutTextOnWindow(gText_Loss, B_WIN_VS_OUTCOME_RIGHT);
break;
case 1:
BattlePutTextOnWindow(gText_Win, 0x17);
BattlePutTextOnWindow(gText_Loss, 0x16);
BattlePutTextOnWindow(gText_Win, B_WIN_VS_OUTCOME_RIGHT);
BattlePutTextOnWindow(gText_Loss, B_WIN_VS_OUTCOME_LEFT);
break;
case 2:
BattlePutTextOnWindow(gText_Win, 0x16);
BattlePutTextOnWindow(gText_Loss, 0x17);
BattlePutTextOnWindow(gText_Win, B_WIN_VS_OUTCOME_LEFT);
BattlePutTextOnWindow(gText_Loss, B_WIN_VS_OUTCOME_RIGHT);
break;
case 3:
BattlePutTextOnWindow(gText_Win, 0x17);
BattlePutTextOnWindow(gText_Loss, 0x16);
BattlePutTextOnWindow(gText_Win, B_WIN_VS_OUTCOME_RIGHT);
BattlePutTextOnWindow(gText_Loss, B_WIN_VS_OUTCOME_LEFT);
break;
}
}
@ -966,20 +966,20 @@ static void DrawLinkBattleVsScreenOutcomeText(void)
switch (gLinkPlayers[gBattleScripting.multiplayerId].id)
{
case 0:
BattlePutTextOnWindow(gText_Win, 0x17);
BattlePutTextOnWindow(gText_Loss, 0x16);
BattlePutTextOnWindow(gText_Win, B_WIN_VS_OUTCOME_RIGHT);
BattlePutTextOnWindow(gText_Loss, B_WIN_VS_OUTCOME_LEFT);
break;
case 1:
BattlePutTextOnWindow(gText_Win, 0x16);
BattlePutTextOnWindow(gText_Loss, 0x17);
BattlePutTextOnWindow(gText_Win, B_WIN_VS_OUTCOME_LEFT);
BattlePutTextOnWindow(gText_Loss, B_WIN_VS_OUTCOME_RIGHT);
break;
case 2:
BattlePutTextOnWindow(gText_Win, 0x17);
BattlePutTextOnWindow(gText_Loss, 0x16);
BattlePutTextOnWindow(gText_Win, B_WIN_VS_OUTCOME_RIGHT);
BattlePutTextOnWindow(gText_Loss, B_WIN_VS_OUTCOME_LEFT);
break;
case 3:
BattlePutTextOnWindow(gText_Win, 0x16);
BattlePutTextOnWindow(gText_Loss, 0x17);
BattlePutTextOnWindow(gText_Win, B_WIN_VS_OUTCOME_LEFT);
BattlePutTextOnWindow(gText_Loss, B_WIN_VS_OUTCOME_RIGHT);
break;
}
}
@ -988,26 +988,26 @@ static void DrawLinkBattleVsScreenOutcomeText(void)
{
if (gLinkPlayers[gBattleScripting.multiplayerId].id != 0)
{
BattlePutTextOnWindow(gText_Win, 0x17);
BattlePutTextOnWindow(gText_Loss, 0x16);
BattlePutTextOnWindow(gText_Win, B_WIN_VS_OUTCOME_RIGHT);
BattlePutTextOnWindow(gText_Loss, B_WIN_VS_OUTCOME_LEFT);
}
else
{
BattlePutTextOnWindow(gText_Win, 0x16);
BattlePutTextOnWindow(gText_Loss, 0x17);
BattlePutTextOnWindow(gText_Win, B_WIN_VS_OUTCOME_LEFT);
BattlePutTextOnWindow(gText_Loss, B_WIN_VS_OUTCOME_RIGHT);
}
}
else
{
if (gLinkPlayers[gBattleScripting.multiplayerId].id != 0)
{
BattlePutTextOnWindow(gText_Win, 0x16);
BattlePutTextOnWindow(gText_Loss, 0x17);
BattlePutTextOnWindow(gText_Win, B_WIN_VS_OUTCOME_LEFT);
BattlePutTextOnWindow(gText_Loss, B_WIN_VS_OUTCOME_RIGHT);
}
else
{
BattlePutTextOnWindow(gText_Win, 0x17);
BattlePutTextOnWindow(gText_Loss, 0x16);
BattlePutTextOnWindow(gText_Win, B_WIN_VS_OUTCOME_RIGHT);
BattlePutTextOnWindow(gText_Loss, B_WIN_VS_OUTCOME_LEFT);
}
}
}
@ -1031,19 +1031,19 @@ void InitLinkBattleVsScreen(u8 taskId)
switch (linkPlayer->id)
{
case 0:
BattlePutTextOnWindow(name, 0x11);
BattlePutTextOnWindow(name, B_WIN_VS_MULTI_PLAYER_1);
DrawLinkBattleParticipantPokeballs(taskId, linkPlayer->id, 1, 2, 4);
break;
case 1:
BattlePutTextOnWindow(name, 0x12);
BattlePutTextOnWindow(name, B_WIN_VS_MULTI_PLAYER_2);
DrawLinkBattleParticipantPokeballs(taskId, linkPlayer->id, 2, 2, 4);
break;
case 2:
BattlePutTextOnWindow(name, 0x13);
BattlePutTextOnWindow(name, B_WIN_VS_MULTI_PLAYER_3);
DrawLinkBattleParticipantPokeballs(taskId, linkPlayer->id, 1, 2, 8);
break;
case 3:
BattlePutTextOnWindow(name, 0x14);
BattlePutTextOnWindow(name, B_WIN_VS_MULTI_PLAYER_4);
DrawLinkBattleParticipantPokeballs(taskId, linkPlayer->id, 2, 2, 8);
break;
}
@ -1059,10 +1059,10 @@ void InitLinkBattleVsScreen(u8 taskId)
opponentId = playerId, playerId = opponentId_copy;
name = gLinkPlayers[playerId].name;
BattlePutTextOnWindow(name, 0xF);
BattlePutTextOnWindow(name, B_WIN_VS_PLAYER);
name = gLinkPlayers[opponentId].name;
BattlePutTextOnWindow(name, 0x10);
BattlePutTextOnWindow(name, B_WIN_VS_OPPONENT);
DrawLinkBattleParticipantPokeballs(taskId, playerId, 1, 2, 7);
DrawLinkBattleParticipantPokeballs(taskId, opponentId, 2, 2, 7);

View File

@ -29,9 +29,6 @@
#include "constants/trainers.h"
#include "recorded_battle.h"
extern struct MusicPlayerInfo gMPlayInfo_BGM;
// this file's functions
static void LinkOpponentHandleGetMonData(void);
static void LinkOpponentHandleGetRawMonData(void);
static void LinkOpponentHandleSetMonData(void);
@ -424,7 +421,7 @@ static void FreeMonSpriteAfterSwitchOutAnim(void)
static void CompleteOnInactiveTextPrinter(void)
{
if (!IsTextPrinterActive(0))
if (!IsTextPrinterActive(B_WIN_MSG))
LinkOpponentBufferExecCompleted();
}
@ -1471,7 +1468,7 @@ static void LinkOpponentHandlePrintString(void)
gBattle_BG0_Y = 0;
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
BufferStringBattle(*stringId);
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
BattleTv_SetDataBasedOnString(*stringId);
}

View File

@ -29,7 +29,6 @@
#include "constants/trainers.h"
#include "recorded_battle.h"
// this file's functions
static void LinkPartnerHandleGetMonData(void);
static void LinkPartnerHandleGetRawMonData(void);
static void LinkPartnerHandleSetMonData(void);
@ -313,7 +312,7 @@ static void FreeMonSpriteAfterSwitchOutAnim(void)
static void CompleteOnInactiveTextPrinter(void)
{
if (!IsTextPrinterActive(0))
if (!IsTextPrinterActive(B_WIN_MSG))
LinkPartnerBufferExecCompleted();
}
@ -1301,7 +1300,7 @@ static void LinkPartnerHandlePrintString(void)
gBattle_BG0_Y = 0;
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
BufferStringBattle(*stringId);
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
BattleTv_SetDataBasedOnString(*stringId);
}

View File

@ -34,9 +34,6 @@
#include "constants/trainers.h"
#include "trainer_hill.h"
extern struct MusicPlayerInfo gMPlayInfo_BGM;
// this file's functions
static void OpponentHandleGetMonData(void);
static void OpponentHandleGetRawMonData(void);
static void OpponentHandleSetMonData(void);
@ -430,7 +427,7 @@ static void FreeMonSpriteAfterSwitchOutAnim(void)
static void CompleteOnInactiveTextPrinter(void)
{
if (!IsTextPrinterActive(0))
if (!IsTextPrinterActive(B_WIN_MSG))
OpponentBufferExecCompleted();
}
@ -1524,7 +1521,7 @@ static void OpponentHandlePrintString(void)
gBattle_BG0_Y = 0;
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
BufferStringBattle(*stringId);
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
BattleArena_DeductMindPoints(gActiveBattler, *stringId);
}

View File

@ -36,9 +36,6 @@
#include "constants/trainers.h"
#include "constants/rgb.h"
extern struct MusicPlayerInfo gMPlayInfo_BGM;
// this file's functions
static void PlayerHandleGetMonData(void);
static void PlayerHandleSetMonData(void);
static void PlayerHandleSetRawMonData(void);
@ -611,7 +608,7 @@ static void HandleInputChooseMove(void)
gMultiUsePlayerCursor = gMoveSelectionCursor[gActiveBattler] + 1;
MoveSelectionCreateCursorAt(gMultiUsePlayerCursor, 27);
BattlePutTextOnWindow(gText_BattleSwitchWhich, 0xB);
BattlePutTextOnWindow(gText_BattleSwitchWhich, B_WIN_SWITCH_PROMPT);
gBattlerControllerFuncs[gActiveBattler] = HandleMoveSwitching;
}
}
@ -1145,7 +1142,7 @@ static void CompleteOnHealthbarDone(void)
static void CompleteOnInactiveTextPrinter(void)
{
if (!IsTextPrinterActive(0))
if (!IsTextPrinterActive(B_WIN_MSG))
PlayerBufferExecCompleted();
}
@ -1341,7 +1338,7 @@ static void FreeMonSpriteAfterSwitchOutAnim(void)
static void CompleteOnInactiveTextPrinter2(void)
{
if (!IsTextPrinterActive(0))
if (!IsTextPrinterActive(B_WIN_MSG))
PlayerBufferExecCompleted();
}
@ -1466,7 +1463,8 @@ static void MoveSelectionDisplayMoveNames(void)
{
MoveSelectionDestroyCursorAt(i);
StringCopy(gDisplayedStringBattle, gMoveNames[moveInfo->moves[i]]);
BattlePutTextOnWindow(gDisplayedStringBattle, i + 3);
// Prints on windows B_WIN_MOVE_NAME_1, B_WIN_MOVE_NAME_2, B_WIN_MOVE_NAME_3, B_WIN_MOVE_NAME_4
BattlePutTextOnWindow(gDisplayedStringBattle, i + B_WIN_MOVE_NAME_1);
if (moveInfo->moves[i] != MOVE_NONE)
gNumberOfMovesToChoose++;
}
@ -1475,7 +1473,7 @@ static void MoveSelectionDisplayMoveNames(void)
static void MoveSelectionDisplayPpString(void)
{
StringCopy(gDisplayedStringBattle, gText_MoveInterfacePP);
BattlePutTextOnWindow(gDisplayedStringBattle, 7);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_PP);
}
static void MoveSelectionDisplayPpNumber(void)
@ -1492,7 +1490,7 @@ static void MoveSelectionDisplayPpNumber(void)
*(txtPtr)++ = CHAR_SLASH;
ConvertIntToDecimalStringN(txtPtr, moveInfo->maxPp[gMoveSelectionCursor[gActiveBattler]], STR_CONV_MODE_RIGHT_ALIGN, 2);
BattlePutTextOnWindow(gDisplayedStringBattle, 9);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_PP_REMAINING);
}
static void MoveSelectionDisplayMoveType(void)
@ -1506,7 +1504,7 @@ static void MoveSelectionDisplayMoveType(void)
*(txtPtr)++ = 1;
StringCopy(txtPtr, gTypeNames[gBattleMoves[moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]].type]);
BattlePutTextOnWindow(gDisplayedStringBattle, 10);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MOVE_TYPE);
}
static void MoveSelectionCreateCursorAt(u8 cursorPosition, u8 arg1)
@ -1577,7 +1575,7 @@ static void PrintLinkStandbyMsg(void)
{
gBattle_BG0_X = 0;
gBattle_BG0_Y = 0;
BattlePutTextOnWindow(gText_LinkStandby, 0);
BattlePutTextOnWindow(gText_LinkStandby, B_WIN_MSG);
}
}
@ -2549,7 +2547,7 @@ static void PlayerHandlePrintString(void)
gBattle_BG0_Y = 0;
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
BufferStringBattle(*stringId);
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter2;
BattleTv_SetDataBasedOnString(*stringId);
BattleArena_DeductMindPoints(gActiveBattler, *stringId);
@ -2579,14 +2577,14 @@ static void PlayerHandleChooseAction(void)
gBattlerControllerFuncs[gActiveBattler] = HandleChooseActionAfterDma3;
BattleTv_ClearExplosionFaintCause();
BattlePutTextOnWindow(gText_BattleMenu, 2);
BattlePutTextOnWindow(gText_BattleMenu, B_WIN_ACTION_MENU);
for (i = 0; i < 4; i++)
ActionSelectionDestroyCursorAt(i);
ActionSelectionCreateCursorAt(gActionSelectionCursor[gActiveBattler], 0);
BattleStringExpandPlaceholdersToDisplayedString(gText_WhatWillPkmnDo);
BattlePutTextOnWindow(gDisplayedStringBattle, 1);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_ACTION_PROMPT);
}
static void PlayerHandleYesNoBox(void)
@ -2594,7 +2592,7 @@ static void PlayerHandleYesNoBox(void)
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
{
HandleBattleWindow(0x18, 8, 0x1D, 0xD, 0);
BattlePutTextOnWindow(gText_BattleYesNoChoice, 12);
BattlePutTextOnWindow(gText_BattleYesNoChoice, B_WIN_YESNO);
gMultiUsePlayerCursor = 1;
BattleCreateYesNoCursorAt(1);
gBattlerControllerFuncs[gActiveBattler] = PlayerHandleYesNoInput;

View File

@ -27,7 +27,6 @@
#include "constants/songs.h"
#include "constants/trainers.h"
// this file's functions
static void PlayerPartnerHandleGetMonData(void);
static void PlayerPartnerHandleGetRawMonData(void);
static void PlayerPartnerHandleSetMonData(void);
@ -300,7 +299,7 @@ static void CompleteOnHealthbarDone(void)
static void CompleteOnInactiveTextPrinter(void)
{
if (!IsTextPrinterActive(0))
if (!IsTextPrinterActive(B_WIN_MSG))
PlayerPartnerBufferExecCompleted();
}
@ -497,7 +496,7 @@ static void FreeMonSpriteAfterSwitchOutAnim(void)
static void CompleteOnInactiveTextPrinter2(void)
{
if (!IsTextPrinterActive(0))
if (!IsTextPrinterActive(B_WIN_MSG))
PlayerPartnerBufferExecCompleted();
}
@ -1491,7 +1490,7 @@ static void PlayerPartnerHandlePrintString(void)
gBattle_BG0_Y = 0;
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
BufferStringBattle(*stringId);
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter2;
}

View File

@ -29,9 +29,6 @@
#include "constants/songs.h"
#include "constants/trainers.h"
extern struct MusicPlayerInfo gMPlayInfo_BGM;
// this file's functions
static void RecordedOpponentHandleGetMonData(void);
static void RecordedOpponentHandleGetRawMonData(void);
static void RecordedOpponentHandleSetMonData(void);
@ -408,7 +405,7 @@ static void FreeMonSpriteAfterSwitchOutAnim(void)
static void CompleteOnInactiveTextPrinter(void)
{
if (!IsTextPrinterActive(0))
if (!IsTextPrinterActive(B_WIN_MSG))
RecordedOpponentBufferExecCompleted();
}
@ -1398,7 +1395,7 @@ static void RecordedOpponentHandlePrintString(void)
gBattle_BG0_Y = 0;
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
BufferStringBattle(*stringId);
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
}

View File

@ -25,9 +25,6 @@
#include "constants/battle_anim.h"
#include "constants/songs.h"
extern struct MusicPlayerInfo gMPlayInfo_BGM;
// this file's functions
static void RecordedPlayerHandleGetMonData(void);
static void RecordedPlayerHandleGetRawMonData(void);
static void RecordedPlayerHandleSetMonData(void);
@ -390,7 +387,7 @@ static void FreeMonSpriteAfterSwitchOutAnim(void)
static void CompleteOnInactiveTextPrinter(void)
{
if (!IsTextPrinterActive(0))
if (!IsTextPrinterActive(B_WIN_MSG))
RecordedPlayerBufferExecCompleted();
}
@ -1404,7 +1401,7 @@ static void RecordedPlayerHandlePrintString(void)
gBattle_BG0_Y = 0;
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
BufferStringBattle(*stringId);
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
}

View File

@ -24,7 +24,6 @@
#include "constants/songs.h"
#include "constants/rgb.h"
// this file's functions
static void SafariHandleGetMonData(void);
static void SafariHandleGetRawMonData(void);
static void SafariHandleSetMonData(void);
@ -241,7 +240,7 @@ static void CompleteOnBattlerSpriteCallbackDummy(void)
static void CompleteOnInactiveTextPrinter(void)
{
if (!IsTextPrinterActive(0))
if (!IsTextPrinterActive(B_WIN_MSG))
SafariBufferExecCompleted();
}
@ -425,7 +424,7 @@ static void SafariHandlePrintString(void)
gBattle_BG0_Y = 0;
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
BufferStringBattle(*stringId);
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
}
@ -452,14 +451,14 @@ static void SafariHandleChooseAction(void)
s32 i;
gBattlerControllerFuncs[gActiveBattler] = HandleChooseActionAfterDma3;
BattlePutTextOnWindow(gText_SafariZoneMenu, 2);
BattlePutTextOnWindow(gText_SafariZoneMenu, B_WIN_ACTION_MENU);
for (i = 0; i < 4; i++)
ActionSelectionDestroyCursorAt(i);
ActionSelectionCreateCursorAt(gActionSelectionCursor[gActiveBattler], 0);
BattleStringExpandPlaceholdersToDisplayedString(gText_WhatWillPkmnDo2);
BattlePutTextOnWindow(gDisplayedStringBattle, 1);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_ACTION_PROMPT);
}
static void SafariHandleYesNoBox(void)

View File

@ -253,7 +253,7 @@ static void CompleteOnBattlerSpriteCallbackDummy(void)
static void CompleteOnInactiveTextPrinter(void)
{
if (!IsTextPrinterActive(0))
if (!IsTextPrinterActive(B_WIN_MSG))
WallyBufferExecCompleted();
}
@ -1178,7 +1178,7 @@ static void WallyHandlePrintString(void)
gBattle_BG0_Y = 0;
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
BufferStringBattle(*stringId);
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
}
@ -1205,14 +1205,14 @@ static void WallyHandleChooseAction(void)
s32 i;
gBattlerControllerFuncs[gActiveBattler] = HandleChooseActionAfterDma3;
BattlePutTextOnWindow(gText_BattleMenu, 2);
BattlePutTextOnWindow(gText_BattleMenu, B_WIN_ACTION_MENU);
for (i = 0; i < 4; i++)
ActionSelectionDestroyCursorAt(i);
ActionSelectionCreateCursorAt(gActionSelectionCursor[gActiveBattler], 0);
BattleStringExpandPlaceholdersToDisplayedString(gText_WhatWillWallyDo);
BattlePutTextOnWindow(gDisplayedStringBattle, 1);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_ACTION_PROMPT);
}
static void WallyHandleYesNoBox(void)

View File

@ -26,10 +26,6 @@
#include "constants/rgb.h"
#include "constants/battle_palace.h"
extern struct MusicPlayerInfo gMPlayInfo_SE1;
extern struct MusicPlayerInfo gMPlayInfo_SE2;
extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern const u8 gBattlePalaceNatureToMoveTarget[];
extern const u8 * const gBattleAnims_General[];
extern const u8 * const gBattleAnims_Special[];

View File

@ -2341,12 +2341,12 @@ static void EndLinkBattleInSteps(void)
if (IsLinkTaskFinished() == TRUE)
{
SetLinkStandbyCallback();
BattlePutTextOnWindow(gText_LinkStandby3, 0);
BattlePutTextOnWindow(gText_LinkStandby3, B_WIN_MSG);
gBattleCommunication[MULTIUSE_STATE]++;
}
break;
case 7:
if (!IsTextPrinterActive(0))
if (!IsTextPrinterActive(B_WIN_MSG))
{
if (IsLinkTaskFinished() == TRUE)
gBattleCommunication[MULTIUSE_STATE]++;
@ -2484,15 +2484,15 @@ static void AskRecordBattle(void)
if (!gPaletteFade.active)
{
// "Would you like to record your battle on your FRONTIER PASS?"
BattlePutTextOnWindow(gText_RecordBattleToPass, 0);
BattlePutTextOnWindow(gText_RecordBattleToPass, B_WIN_MSG);
gBattleCommunication[MULTIUSE_STATE]++;
}
break;
case STATE_PRINT_YES_NO:
if (!IsTextPrinterActive(0))
if (!IsTextPrinterActive(B_WIN_MSG))
{
HandleBattleWindow(0x18, 8, 0x1D, 0xD, 0);
BattlePutTextOnWindow(gText_BattleYesNoChoice, 0xC);
BattlePutTextOnWindow(gText_BattleYesNoChoice, B_WIN_YESNO);
gBattleCommunication[CURSOR_POSITION] = 1;
BattleCreateYesNoCursorAt(1);
gBattleCommunication[MULTIUSE_STATE]++;
@ -2551,7 +2551,7 @@ static void AskRecordBattle(void)
{
// Other battlers may be recording, wait for them
SetLinkStandbyCallback();
BattlePutTextOnWindow(gText_LinkStandby3, 0);
BattlePutTextOnWindow(gText_LinkStandby3, B_WIN_MSG);
}
gBattleCommunication[MULTIUSE_STATE]++; // STATE_END_RECORD_NO
}
@ -2582,32 +2582,32 @@ static void AskRecordBattle(void)
{
PlaySE(SE_SAVE);
BattleStringExpandPlaceholdersToDisplayedString(gText_BattleRecordedOnPass);
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
gBattleCommunication[1] = 128; // Delay
gBattleCommunication[MULTIUSE_STATE]++;
}
else
{
BattleStringExpandPlaceholdersToDisplayedString(BattleFrontier_BattleTowerBattleRoom_Text_RecordCouldntBeSaved);
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
gBattleCommunication[1] = 128; // Delay
gBattleCommunication[MULTIUSE_STATE]++;
}
break;
case STATE_RECORD_WAIT:
if (IsLinkTaskFinished() == TRUE && !IsTextPrinterActive(0) && --gBattleCommunication[1] == 0)
if (IsLinkTaskFinished() == TRUE && !IsTextPrinterActive(B_WIN_MSG) && --gBattleCommunication[1] == 0)
{
if (gMain.anyLinkBattlerHasFrontierPass)
{
SetLinkStandbyCallback();
BattlePutTextOnWindow(gText_LinkStandby3, 0);
BattlePutTextOnWindow(gText_LinkStandby3, B_WIN_MSG);
}
gBattleCommunication[MULTIUSE_STATE]++;
}
break;
case STATE_END_RECORD_YES:
case STATE_END_RECORD_NO:
if (!IsTextPrinterActive(0))
if (!IsTextPrinterActive(B_WIN_MSG))
{
if (gMain.anyLinkBattlerHasFrontierPass)
{
@ -3866,7 +3866,7 @@ static void TryDoEventsBeforeFirstTurn(void)
TurnValuesCleanUp(FALSE);
SpecialStatusesClear();
*(&gBattleStruct->field_91) = gAbsentBattlerFlags;
BattlePutTextOnWindow(gText_EmptyString3, 0);
BattlePutTextOnWindow(gText_EmptyString3, B_WIN_MSG);
gBattleMainFunc = HandleTurnActionSelectionState;
ResetSentPokesToOpponentValue();
@ -3973,7 +3973,7 @@ void BattleTurnPassed(void)
*(gBattleStruct->monToSwitchIntoId + i) = PARTY_SIZE;
*(&gBattleStruct->field_91) = gAbsentBattlerFlags;
BattlePutTextOnWindow(gText_EmptyString3, 0);
BattlePutTextOnWindow(gText_EmptyString3, B_WIN_MSG);
gBattleMainFunc = HandleTurnActionSelectionState;
gRandomTurnNumber = Random();

View File

@ -1480,8 +1480,7 @@ static const u8 sDummyWeirdStatusString[] = {EOS, EOS, EOS, EOS, EOS, EOS, EOS,
static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
{
// The corresponding WindowTemplate is gStandardBattleWindowTemplates[] within src/battle_bg.c
{ // 0 Standard battle message
[B_WIN_MSG] = {
.fillValue = PIXEL_FILL(0xF),
.fontId = 1,
.x = 0,
@ -1489,11 +1488,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 1,
.fgColor = 1,
.bgColor = 15,
.shadowColor = 6,
.fgColor = TEXT_COLOR_WHITE,
.bgColor = TEXT_DYNAMIC_COLOR_6,
.shadowColor = TEXT_COLOR_GREEN,
},
{ // 1 "What will (pokemon) do?"
[B_WIN_ACTION_PROMPT] = {
.fillValue = PIXEL_FILL(0xF),
.fontId = 1,
.x = 1,
@ -1501,11 +1500,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 1,
.bgColor = 15,
.shadowColor = 6,
.fgColor = TEXT_COLOR_WHITE,
.bgColor = TEXT_DYNAMIC_COLOR_6,
.shadowColor = TEXT_COLOR_GREEN,
},
{ // 2 "Fight/Pokemon/Bag/Run"
[B_WIN_ACTION_MENU] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 1,
.x = 0,
@ -1513,11 +1512,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 3 Top left move
[B_WIN_MOVE_NAME_1] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 7,
.x = 0,
@ -1525,11 +1524,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 4 Top right move
[B_WIN_MOVE_NAME_2] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 7,
.x = 0,
@ -1537,11 +1536,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 5 Bottom left move
[B_WIN_MOVE_NAME_3] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 7,
.x = 0,
@ -1549,11 +1548,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 6 Bottom right move
[B_WIN_MOVE_NAME_4] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 7,
.x = 0,
@ -1561,11 +1560,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 7 "PP"
[B_WIN_PP] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 7,
.x = 0,
@ -1573,11 +1572,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 12,
.bgColor = 14,
.shadowColor = 11,
.fgColor = TEXT_DYNAMIC_COLOR_3,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_2,
},
{ // 8
[B_WIN_DUMMY] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 1,
.x = 0,
@ -1585,11 +1584,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 9 PP remaining
[B_WIN_PP_REMAINING] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 1,
.x = 2,
@ -1597,11 +1596,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 12,
.bgColor = 14,
.shadowColor = 11,
.fgColor = TEXT_DYNAMIC_COLOR_3,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_2,
},
{ // 10 "type"
[B_WIN_MOVE_TYPE] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 7,
.x = 0,
@ -1609,11 +1608,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 11 "switch which?"
[B_WIN_SWITCH_PROMPT] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 7,
.x = 0,
@ -1621,11 +1620,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 12 "gText_BattleYesNoChoice"
[B_WIN_YESNO] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 1,
.x = 0,
@ -1633,11 +1632,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 13
[B_WIN_LEVEL_UP_BOX] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 1,
.x = 0,
@ -1645,11 +1644,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 14
[B_WIN_LEVEL_UP_BANNER] = {
.fillValue = PIXEL_FILL(0),
.fontId = 1,
.x = 32,
@ -1657,11 +1656,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 1,
.bgColor = 0,
.shadowColor = 2,
.fgColor = TEXT_COLOR_WHITE,
.bgColor = TEXT_COLOR_TRANSPARENT,
.shadowColor = TEXT_COLOR_DARK_GRAY,
},
{ // 15
[B_WIN_VS_PLAYER] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 1,
.x = -1,
@ -1669,11 +1668,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 16
[B_WIN_VS_OPPONENT] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 1,
.x = -1,
@ -1681,11 +1680,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 17
[B_WIN_VS_MULTI_PLAYER_1] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 1,
.x = -1,
@ -1693,11 +1692,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 18
[B_WIN_VS_MULTI_PLAYER_2] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 1,
.x = -1,
@ -1705,11 +1704,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 19
[B_WIN_VS_MULTI_PLAYER_3] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 1,
.x = -1,
@ -1717,11 +1716,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 20
[B_WIN_VS_MULTI_PLAYER_4] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 1,
.x = -1,
@ -1729,11 +1728,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 21
[B_WIN_VS_OUTCOME_DRAW] = {
.fillValue = PIXEL_FILL(0),
.fontId = 1,
.x = -1,
@ -1741,11 +1740,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 1,
.bgColor = 0,
.shadowColor = 6,
.fgColor = TEXT_COLOR_WHITE,
.bgColor = TEXT_COLOR_TRANSPARENT,
.shadowColor = TEXT_COLOR_GREEN,
},
{ // 22
[B_WIN_VS_OUTCOME_LEFT] = {
.fillValue = PIXEL_FILL(0),
.fontId = 1,
.x = -1,
@ -1753,11 +1752,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 1,
.bgColor = 0,
.shadowColor = 6,
.fgColor = TEXT_COLOR_WHITE,
.bgColor = TEXT_COLOR_TRANSPARENT,
.shadowColor = TEXT_COLOR_GREEN,
},
{ // 23
[B_WIN_VS_OUTCOME_RIGHT] = {
.fillValue = PIXEL_FILL(0x0),
.fontId = 1,
.x = -1,
@ -1765,15 +1764,15 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 1,
.bgColor = 0,
.shadowColor = 6,
.fgColor = TEXT_COLOR_WHITE,
.bgColor = TEXT_COLOR_TRANSPARENT,
.shadowColor = TEXT_COLOR_GREEN,
},
};
static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
{
{ // 0
[B_WIN_MSG] = {
.fillValue = PIXEL_FILL(0xF),
.fontId = 1,
.x = 0,
@ -1781,11 +1780,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 1,
.fgColor = 1,
.bgColor = 15,
.shadowColor = 6,
.fgColor = TEXT_COLOR_WHITE,
.bgColor = TEXT_DYNAMIC_COLOR_6,
.shadowColor = TEXT_COLOR_GREEN,
},
{ // 1
[B_WIN_ACTION_PROMPT] = {
.fillValue = PIXEL_FILL(0xF),
.fontId = 1,
.x = 1,
@ -1793,11 +1792,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 1,
.bgColor = 15,
.shadowColor = 6,
.fgColor = TEXT_COLOR_WHITE,
.bgColor = TEXT_DYNAMIC_COLOR_6,
.shadowColor = TEXT_COLOR_GREEN,
},
{ // 2
[B_WIN_ACTION_MENU] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 1,
.x = 0,
@ -1805,11 +1804,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 3
[B_WIN_MOVE_NAME_1] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 7,
.x = 0,
@ -1817,11 +1816,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 4
[B_WIN_MOVE_NAME_2] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 7,
.x = 0,
@ -1829,11 +1828,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 5
[B_WIN_MOVE_NAME_3] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 7,
.x = 0,
@ -1841,11 +1840,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 6
[B_WIN_MOVE_NAME_4] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 7,
.x = 0,
@ -1853,11 +1852,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 7
[B_WIN_PP] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 7,
.x = 0,
@ -1865,11 +1864,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 12,
.bgColor = 14,
.shadowColor = 11,
.fgColor = TEXT_DYNAMIC_COLOR_3,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_2,
},
{ // 8
[B_WIN_DUMMY] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 1,
.x = 0,
@ -1877,11 +1876,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 9
[B_WIN_PP_REMAINING] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 1,
.x = 2,
@ -1889,11 +1888,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 12,
.bgColor = 14,
.shadowColor = 11,
.fgColor = TEXT_DYNAMIC_COLOR_3,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_2,
},
{ // 10
[B_WIN_MOVE_TYPE] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 7,
.x = 0,
@ -1901,11 +1900,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 11
[B_WIN_SWITCH_PROMPT] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 7,
.x = 0,
@ -1913,11 +1912,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 12
[B_WIN_YESNO] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 1,
.x = 0,
@ -1925,11 +1924,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 13
[B_WIN_LEVEL_UP_BOX] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 1,
.x = 0,
@ -1937,11 +1936,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 14
[B_WIN_LEVEL_UP_BANNER] = {
.fillValue = PIXEL_FILL(0),
.fontId = 1,
.x = 32,
@ -1949,11 +1948,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 1,
.bgColor = 0,
.shadowColor = 2,
.fgColor = TEXT_COLOR_WHITE,
.bgColor = TEXT_COLOR_TRANSPARENT,
.shadowColor = TEXT_COLOR_DARK_GRAY,
},
{ // 15
[ARENA_WIN_PLAYER_NAME] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 1,
.x = -1,
@ -1961,11 +1960,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 1,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_COLOR_WHITE,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 16
[ARENA_WIN_VS] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 1,
.x = -1,
@ -1973,11 +1972,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 17
[ARENA_WIN_OPPONENT_NAME] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 1,
.x = -1,
@ -1985,11 +1984,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 18
[ARENA_WIN_MIND] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 1,
.x = -1,
@ -1997,11 +1996,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 19
[ARENA_WIN_SKILL] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 1,
.x = -1,
@ -2009,11 +2008,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 20
[ARENA_WIN_BODY] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 1,
.x = -1,
@ -2021,11 +2020,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 21
[ARENA_WIN_JUDGEMENT_TITLE] = {
.fillValue = PIXEL_FILL(0xE),
.fontId = 1,
.x = -1,
@ -2033,11 +2032,11 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 0,
.fgColor = 13,
.bgColor = 14,
.shadowColor = 15,
.fgColor = TEXT_DYNAMIC_COLOR_4,
.bgColor = TEXT_DYNAMIC_COLOR_5,
.shadowColor = TEXT_DYNAMIC_COLOR_6,
},
{ // 22
[ARENA_WIN_JUDGEMENT_TEXT] = {
.fillValue = PIXEL_FILL(0x1),
.fontId = 1,
.x = 0,
@ -2045,9 +2044,9 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
.letterSpacing = 0,
.lineSpacing = 0,
.speed = 1,
.fgColor = 2,
.bgColor = 1,
.shadowColor = 3,
.fgColor = TEXT_COLOR_DARK_GRAY,
.bgColor = TEXT_COLOR_WHITE,
.shadowColor = TEXT_COLOR_LIGHT_GRAY,
},
};
@ -3055,9 +3054,9 @@ void BattlePutTextOnWindow(const u8 *text, u8 windowId)
struct TextPrinterTemplate printerTemplate;
u8 speed;
if (windowId & 0x80)
if (windowId & B_WIN_COPYTOVRAM)
{
windowId &= ~(0x80);
windowId &= ~B_WIN_COPYTOVRAM;
copyToVram = FALSE;
}
else
@ -3087,17 +3086,17 @@ void BattlePutTextOnWindow(const u8 *text, u8 windowId)
printerTemplate.x = printerTemplate.currentX = alignX;
}
if (windowId == 0x16)
gTextFlags.useAlternateDownArrow = 0;
if (windowId == ARENA_WIN_JUDGEMENT_TEXT)
gTextFlags.useAlternateDownArrow = FALSE;
else
gTextFlags.useAlternateDownArrow = 1;
gTextFlags.useAlternateDownArrow = TRUE;
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED))
gTextFlags.autoScroll = 1;
gTextFlags.autoScroll = TRUE;
else
gTextFlags.autoScroll = 0;
gTextFlags.autoScroll = FALSE;
if (windowId == 0 || windowId == 0x16)
if (windowId == B_WIN_MSG || windowId == ARENA_WIN_JUDGEMENT_TEXT)
{
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK))
speed = 1;

View File

@ -53,28 +53,29 @@
#include "data.h"
#include "constants/party_menu.h"
extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern const u8* const gBattleScriptsForMoveEffects[];
#define DEFENDER_IS_PROTECTED ((gProtectStructs[gBattlerTarget].protected) && (gBattleMoves[gCurrentMove].flags & FLAG_PROTECT_AFFECTED))
// this file's functions
#define LEVEL_UP_BANNER_START 416
#define LEVEL_UP_BANNER_END 512
#define TAG_LVLUP_BANNER_MON_ICON 55130
static bool8 IsTwoTurnsMove(u16 move);
static void TrySetDestinyBondToHappen(void);
static u8 AttacksThisTurn(u8 battlerId, u16 move); // Note: returns 1 if it's a charging turn, otherwise 2.
static void CheckWonderGuardAndLevitate(void);
static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8, const u8* BS_ptr);
static bool32 IsMonGettingExpSentOut(void);
static void sub_804F17C(void);
static bool8 sub_804F1CC(void);
static void InitLevelUpBanner(void);
static bool8 SlideInLevelUpBanner(void);
static bool8 SlideOutLevelUpBanner(void);
static void DrawLevelUpWindow1(void);
static void DrawLevelUpWindow2(void);
static bool8 sub_804F344(void);
static void PutMonIconOnLvlUpBox(void);
static void PutLevelAndGenderOnLvlUpBox(void);
static void SpriteCB_MonIconOnLvlUpBox(struct Sprite* sprite);
static void PutMonIconOnLvlUpBanner(void);
static void DrawLevelUpBannerText(void);
static void SpriteCB_MonIconOnLvlUpBanner(struct Sprite* sprite);
static void Cmd_attackcanceler(void);
static void Cmd_accuracycheck(void);
@ -667,10 +668,18 @@ static const u8* const sMoveEffectBS_Ptrs[] =
[MOVE_EFFECT_RECOIL_33] = BattleScript_MoveEffectRecoil,
};
static const struct WindowTemplate sUnusedWinTemplate = {0, 1, 3, 7, 0xF, 0x1F, 0x3F};
static const struct WindowTemplate sUnusedWinTemplate = {
.bg = 0,
.tilemapLeft = 1,
.tilemapTop = 3,
.width = 7,
.height = 15,
.paletteNum = 31,
.baseBlock = 0x3F
};
static const u16 sUnknown_0831C2C8[] = INCBIN_U16("graphics/battle_interface/unk_battlebox.gbapal");
static const u32 sUnknown_0831C2E8[] = INCBIN_U32("graphics/battle_interface/unk_battlebox.4bpp.lz");
static const u16 sLevelUpBanner_Pal[] = INCBIN_U16("graphics/battle_interface/level_up_banner.gbapal");
static const u32 sLevelUpBanner_Gfx[] = INCBIN_U32("graphics/battle_interface/level_up_banner.4bpp.lz");
// unused
static const u8 sRubyLevelUpStatBoxStats[] =
@ -679,9 +688,7 @@ static const u8 sRubyLevelUpStatBoxStats[] =
MON_DATA_SPDEF, MON_DATA_DEF, MON_DATA_SPEED
};
#define MON_ICON_LVLUP_BOX_TAG 0xD75A
static const struct OamData sOamData_MonIconOnLvlUpBox =
static const struct OamData sOamData_MonIconOnLvlUpBanner =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@ -698,15 +705,15 @@ static const struct OamData sOamData_MonIconOnLvlUpBox =
.affineParam = 0,
};
static const struct SpriteTemplate sSpriteTemplate_MonIconOnLvlUpBox =
static const struct SpriteTemplate sSpriteTemplate_MonIconOnLvlUpBanner =
{
.tileTag = MON_ICON_LVLUP_BOX_TAG,
.paletteTag = MON_ICON_LVLUP_BOX_TAG,
.oam = &sOamData_MonIconOnLvlUpBox,
.tileTag = TAG_LVLUP_BANNER_MON_ICON,
.paletteTag = TAG_LVLUP_BANNER_MON_ICON,
.oam = &sOamData_MonIconOnLvlUpBanner,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCB_MonIconOnLvlUpBox
.callback = SpriteCB_MonIconOnLvlUpBanner
};
static const u16 sProtectSuccessRates[] = {USHRT_MAX, USHRT_MAX / 2, USHRT_MAX / 4, USHRT_MAX / 8};
@ -2971,13 +2978,13 @@ static void Cmd_tryfaintmon(void)
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
{
gHitMarker |= HITMARKER_PLAYER_FAINTED;
if (gBattleResults.playerFaintCounter < 0xFF)
if (gBattleResults.playerFaintCounter < 255)
gBattleResults.playerFaintCounter++;
AdjustFriendshipOnBattleFaint(gActiveBattler);
}
else
{
if (gBattleResults.opponentFaintCounter < 0xFF)
if (gBattleResults.opponentFaintCounter < 255)
gBattleResults.opponentFaintCounter++;
gBattleResults.lastOpponentSpecies = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES, NULL);
}
@ -3033,7 +3040,7 @@ static void Cmd_cleareffectsonfaint(void)
if (!(gBattleTypeFlags & BATTLE_TYPE_ARENA) || gBattleMons[gActiveBattler].hp == 0)
{
gBattleMons[gActiveBattler].status1 = 0;
BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 0x4, &gBattleMons[gActiveBattler].status1);
BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1);
MarkBattlerForControllerExec(gActiveBattler);
}
@ -3765,9 +3772,7 @@ static void Cmd_jumpifarraynotequal(void)
for (i = 0; i < size; i++)
{
if (*mem1 == *mem2)
{
equalBytes++;
}
mem1++, mem2++;
}
@ -3807,9 +3812,7 @@ static void Cmd_copyarray(void)
s32 i;
for (i = 0; i < size; i++)
{
dest[i] = src[i];
}
gBattlescriptCurrInstr += 10;
}
@ -3823,9 +3826,7 @@ static void Cmd_copyarraywithindex(void)
s32 i;
for (i = 0; i < size; i++)
{
dest[i] = src[i + *index];
}
gBattlescriptCurrInstr += 14;
}
@ -4591,9 +4592,7 @@ static void Cmd_switchindataupdate(void)
monData = (u8*)(&gBattleMons[gActiveBattler]);
for (i = 0; i < sizeof(struct BattlePokemon); i++)
{
monData[i] = gBattleBufferB[gActiveBattler][4 + i];
}
gBattleMons[gActiveBattler].type1 = gBaseStats[gBattleMons[gActiveBattler].species].type1;
gBattleMons[gActiveBattler].type2 = gBaseStats[gBattleMons[gActiveBattler].species].type2;
@ -4681,9 +4680,9 @@ static void Cmd_jumpifcantswitch(void)
lastMonId = 0;
if (gActiveBattler & 2)
lastMonId = 3;
lastMonId = MULTI_PARTY_SIZE;
for (i = lastMonId; i < lastMonId + 3; i++)
for (i = lastMonId; i < lastMonId + MULTI_PARTY_SIZE; i++)
{
if (GetMonData(&party[i], MON_DATA_SPECIES) != SPECIES_NONE
&& !GetMonData(&party[i], MON_DATA_IS_EGG)
@ -4692,7 +4691,7 @@ static void Cmd_jumpifcantswitch(void)
break;
}
if (i == lastMonId + 3)
if (i == lastMonId + MULTI_PARTY_SIZE)
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 2);
else
gBattlescriptCurrInstr += 6;
@ -4707,7 +4706,7 @@ static void Cmd_jumpifcantswitch(void)
lastMonId = 0;
if (GetLinkTrainerFlankId(GetBattlerMultiplayerId(gActiveBattler)) == TRUE)
lastMonId = 3;
lastMonId = MULTI_PARTY_SIZE;
}
else
{
@ -4716,7 +4715,7 @@ static void Cmd_jumpifcantswitch(void)
if (gActiveBattler == 1)
lastMonId = 0;
else
lastMonId = 3;
lastMonId = MULTI_PARTY_SIZE;
}
}
else
@ -4728,10 +4727,10 @@ static void Cmd_jumpifcantswitch(void)
lastMonId = 0;
if (GetLinkTrainerFlankId(GetBattlerMultiplayerId(gActiveBattler)) == TRUE)
lastMonId = 3;
lastMonId = MULTI_PARTY_SIZE;
}
for (i = lastMonId; i < lastMonId + 3; i++)
for (i = lastMonId; i < lastMonId + MULTI_PARTY_SIZE; i++)
{
if (GetMonData(&party[i], MON_DATA_SPECIES) != SPECIES_NONE
&& !GetMonData(&party[i], MON_DATA_IS_EGG)
@ -4740,7 +4739,7 @@ static void Cmd_jumpifcantswitch(void)
break;
}
if (i == lastMonId + 3)
if (i == lastMonId + MULTI_PARTY_SIZE)
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 2);
else
gBattlescriptCurrInstr += 6;
@ -4751,9 +4750,9 @@ static void Cmd_jumpifcantswitch(void)
lastMonId = 0;
if (gActiveBattler == B_POSITION_OPPONENT_RIGHT)
lastMonId = 3;
lastMonId = PARTY_SIZE / 2;
for (i = lastMonId; i < lastMonId + 3; i++)
for (i = lastMonId; i < lastMonId + (PARTY_SIZE / 2); i++)
{
if (GetMonData(&party[i], MON_DATA_SPECIES) != SPECIES_NONE
&& !GetMonData(&party[i], MON_DATA_IS_EGG)
@ -4762,7 +4761,7 @@ static void Cmd_jumpifcantswitch(void)
break;
}
if (i == lastMonId + 3)
if (i == lastMonId + (PARTY_SIZE / 2))
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 2);
else
gBattlescriptCurrInstr += 6;
@ -5080,7 +5079,7 @@ static void Cmd_openpartyscreen(void)
gBattlescriptCurrInstr += 6;
if (GetBattlerPosition(gActiveBattler) == 0 && gBattleResults.playerSwitchesCounter < 0xFF)
if (GetBattlerPosition(gActiveBattler) == 0 && gBattleResults.playerSwitchesCounter < 255)
gBattleResults.playerSwitchesCounter++;
if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
@ -5120,7 +5119,7 @@ static void Cmd_switchhandleorder(void)
case 0:
for (i = 0; i < gBattlersCount; i++)
{
if (gBattleBufferB[i][0] == 0x22)
if (gBattleBufferB[i][0] == CONTROLLER_CHOSENMONRETURNVALUE)
{
*(gBattleStruct->monToSwitchIntoId + i) = gBattleBufferB[i][1];
if (!(gBattleStruct->field_93 & gBitTable[i]))
@ -5357,8 +5356,8 @@ static void Cmd_yesnoboxlearnmove(void)
switch (gBattleScripting.learnMoveState)
{
case 0:
HandleBattleWindow(0x18, 8, 0x1D, 0xD, 0);
BattlePutTextOnWindow(gText_BattleYesNoChoice, 0xC);
HandleBattleWindow(24, 8, 29, 13, 0);
BattlePutTextOnWindow(gText_BattleYesNoChoice, B_WIN_YESNO);
gBattleScripting.learnMoveState++;
gBattleCommunication[CURSOR_POSITION] = 0;
BattleCreateYesNoCursorAt(0);
@ -5383,8 +5382,8 @@ static void Cmd_yesnoboxlearnmove(void)
PlaySE(SE_SELECT);
if (gBattleCommunication[1] == 0)
{
HandleBattleWindow(0x18, 0x8, 0x1D, 0xD, WINDOW_CLEAR);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
HandleBattleWindow(24, 8, 29, 13, WINDOW_CLEAR);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
gBattleScripting.learnMoveState++;
}
else
@ -5457,7 +5456,7 @@ static void Cmd_yesnoboxlearnmove(void)
}
break;
case 5:
HandleBattleWindow(0x18, 8, 0x1D, 0xD, WINDOW_CLEAR);
HandleBattleWindow(24, 8, 29, 13, WINDOW_CLEAR);
gBattlescriptCurrInstr += 5;
break;
case 6:
@ -5474,8 +5473,8 @@ static void Cmd_yesnoboxstoplearningmove(void)
switch (gBattleScripting.learnMoveState)
{
case 0:
HandleBattleWindow(0x18, 8, 0x1D, 0xD, 0);
BattlePutTextOnWindow(gText_BattleYesNoChoice, 0xC);
HandleBattleWindow(24, 8, 29, 13, 0);
BattlePutTextOnWindow(gText_BattleYesNoChoice, B_WIN_YESNO);
gBattleScripting.learnMoveState++;
gBattleCommunication[CURSOR_POSITION] = 0;
BattleCreateYesNoCursorAt(0);
@ -5504,13 +5503,13 @@ static void Cmd_yesnoboxstoplearningmove(void)
else
gBattlescriptCurrInstr += 5;
HandleBattleWindow(0x18, 0x8, 0x1D, 0xD, WINDOW_CLEAR);
HandleBattleWindow(24, 8, 29, 13, WINDOW_CLEAR);
}
else if (JOY_NEW(B_BUTTON))
{
PlaySE(SE_SELECT);
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
HandleBattleWindow(0x18, 0x8, 0x1D, 0xD, WINDOW_CLEAR);
HandleBattleWindow(24, 8, 29, 13, WINDOW_CLEAR);
}
break;
}
@ -5769,8 +5768,8 @@ static void Cmd_yesnobox(void)
switch (gBattleCommunication[0])
{
case 0:
HandleBattleWindow(0x18, 8, 0x1D, 0xD, 0);
BattlePutTextOnWindow(gText_BattleYesNoChoice, 0xC);
HandleBattleWindow(24, 8, 29, 13, 0);
BattlePutTextOnWindow(gText_BattleYesNoChoice, B_WIN_YESNO);
gBattleCommunication[0]++;
gBattleCommunication[CURSOR_POSITION] = 0;
BattleCreateYesNoCursorAt(0);
@ -5794,13 +5793,13 @@ static void Cmd_yesnobox(void)
{
gBattleCommunication[CURSOR_POSITION] = 1;
PlaySE(SE_SELECT);
HandleBattleWindow(0x18, 8, 0x1D, 0xD, WINDOW_CLEAR);
HandleBattleWindow(24, 8, 29, 13, WINDOW_CLEAR);
gBattlescriptCurrInstr++;
}
else if (JOY_NEW(A_BUTTON))
{
PlaySE(SE_SELECT);
HandleBattleWindow(0x18, 8, 0x1D, 0xD, WINDOW_CLEAR);
HandleBattleWindow(24, 8, 29, 13, WINDOW_CLEAR);
gBattlescriptCurrInstr++;
}
break;
@ -5884,6 +5883,9 @@ static void Cmd_drawlvlupbox(void)
{
if (gBattleScripting.drawlvlupboxState == 0)
{
// If the Pokémon getting exp is not in-battle then
// slide out a banner with their name and icon on it.
// Otherwise skip ahead.
if (IsMonGettingExpSentOut())
gBattleScripting.drawlvlupboxState = 3;
else
@ -5893,34 +5895,38 @@ static void Cmd_drawlvlupbox(void)
switch (gBattleScripting.drawlvlupboxState)
{
case 1:
gBattle_BG2_Y = 0x60;
// Start level up banner
gBattle_BG2_Y = 96;
SetBgAttribute(2, BG_ATTR_PRIORITY, 0);
ShowBg(2);
sub_804F17C();
InitLevelUpBanner();
gBattleScripting.drawlvlupboxState = 2;
break;
case 2:
if (!sub_804F1CC())
if (!SlideInLevelUpBanner())
gBattleScripting.drawlvlupboxState = 3;
break;
case 3:
// Init level up box
gBattle_BG1_X = 0;
gBattle_BG1_Y = 0x100;
gBattle_BG1_Y = 256;
SetBgAttribute(0, BG_ATTR_PRIORITY, 1);
SetBgAttribute(1, BG_ATTR_PRIORITY, 0);
ShowBg(0);
ShowBg(1);
HandleBattleWindow(0x12, 7, 0x1D, 0x13, WINDOW_x80);
HandleBattleWindow(18, 7, 29, 19, WINDOW_BG1);
gBattleScripting.drawlvlupboxState = 4;
break;
case 4:
// Draw page 1 of level up box
DrawLevelUpWindow1();
PutWindowTilemap(13);
CopyWindowToVram(13, 3);
PutWindowTilemap(B_WIN_LEVEL_UP_BOX);
CopyWindowToVram(B_WIN_LEVEL_UP_BOX, 3);
gBattleScripting.drawlvlupboxState++;
break;
case 5:
case 7:
// Wait for draw after each page
if (!IsDma3ManagerBusyWithBgCopy())
{
gBattle_BG1_Y = 0;
@ -5930,28 +5936,30 @@ static void Cmd_drawlvlupbox(void)
case 6:
if (gMain.newKeys != 0)
{
// Draw page 2 of level up box
PlaySE(SE_SELECT);
DrawLevelUpWindow2();
CopyWindowToVram(13, 2);
CopyWindowToVram(B_WIN_LEVEL_UP_BOX, 2);
gBattleScripting.drawlvlupboxState++;
}
break;
case 8:
if (gMain.newKeys != 0)
{
// Close level up box
PlaySE(SE_SELECT);
HandleBattleWindow(0x12, 7, 0x1D, 0x13, WINDOW_x80 | WINDOW_CLEAR);
HandleBattleWindow(18, 7, 29, 19, WINDOW_BG1 | WINDOW_CLEAR);
gBattleScripting.drawlvlupboxState++;
}
break;
case 9:
if (!sub_804F344())
if (!SlideOutLevelUpBanner())
{
ClearWindowTilemap(14);
CopyWindowToVram(14, 1);
ClearWindowTilemap(B_WIN_LEVEL_UP_BANNER);
CopyWindowToVram(B_WIN_LEVEL_UP_BANNER, 1);
ClearWindowTilemap(13);
CopyWindowToVram(13, 1);
ClearWindowTilemap(B_WIN_LEVEL_UP_BOX);
CopyWindowToVram(B_WIN_LEVEL_UP_BOX, 1);
SetBgAttribute(2, BG_ATTR_PRIORITY, 2);
ShowBg(2);
@ -5977,7 +5985,7 @@ static void DrawLevelUpWindow1(void)
u16 currStats[NUM_STATS];
GetMonLevelUpWindowStats(&gPlayerParty[gBattleStruct->expGetterMonId], currStats);
DrawLevelUpWindowPg1(0xD, gBattleResources->beforeLvlUp->stats, currStats, TEXT_DYNAMIC_COLOR_5, TEXT_DYNAMIC_COLOR_4, TEXT_DYNAMIC_COLOR_6);
DrawLevelUpWindowPg1(B_WIN_LEVEL_UP_BOX, gBattleResources->beforeLvlUp->stats, currStats, TEXT_DYNAMIC_COLOR_5, TEXT_DYNAMIC_COLOR_4, TEXT_DYNAMIC_COLOR_6);
}
static void DrawLevelUpWindow2(void)
@ -5985,41 +5993,41 @@ static void DrawLevelUpWindow2(void)
u16 currStats[NUM_STATS];
GetMonLevelUpWindowStats(&gPlayerParty[gBattleStruct->expGetterMonId], currStats);
DrawLevelUpWindowPg2(0xD, currStats, TEXT_DYNAMIC_COLOR_5, TEXT_DYNAMIC_COLOR_4, TEXT_DYNAMIC_COLOR_6);
DrawLevelUpWindowPg2(B_WIN_LEVEL_UP_BOX, currStats, TEXT_DYNAMIC_COLOR_5, TEXT_DYNAMIC_COLOR_4, TEXT_DYNAMIC_COLOR_6);
}
static void sub_804F17C(void)
static void InitLevelUpBanner(void)
{
gBattle_BG2_Y = 0;
gBattle_BG2_X = 0x1A0;
gBattle_BG2_X = LEVEL_UP_BANNER_START;
LoadPalette(sUnknown_0831C2C8, 0x60, 0x20);
CopyToWindowPixelBuffer(14, sUnknown_0831C2E8, 0, 0);
PutWindowTilemap(14);
CopyWindowToVram(14, 3);
LoadPalette(sLevelUpBanner_Pal, 0x60, 0x20);
CopyToWindowPixelBuffer(B_WIN_LEVEL_UP_BANNER, sLevelUpBanner_Gfx, 0, 0);
PutWindowTilemap(B_WIN_LEVEL_UP_BANNER);
CopyWindowToVram(B_WIN_LEVEL_UP_BANNER, 3);
PutMonIconOnLvlUpBox();
PutMonIconOnLvlUpBanner();
}
static bool8 sub_804F1CC(void)
static bool8 SlideInLevelUpBanner(void)
{
if (IsDma3ManagerBusyWithBgCopy())
return TRUE;
if (gBattle_BG2_X == 0x200)
if (gBattle_BG2_X == LEVEL_UP_BANNER_END)
return FALSE;
if (gBattle_BG2_X == 0x1A0)
PutLevelAndGenderOnLvlUpBox();
if (gBattle_BG2_X == LEVEL_UP_BANNER_START)
DrawLevelUpBannerText();
gBattle_BG2_X += 8;
if (gBattle_BG2_X >= 0x200)
gBattle_BG2_X = 0x200;
if (gBattle_BG2_X >= LEVEL_UP_BANNER_END)
gBattle_BG2_X = LEVEL_UP_BANNER_END;
return (gBattle_BG2_X != 0x200);
return (gBattle_BG2_X != LEVEL_UP_BANNER_END);
}
static void PutLevelAndGenderOnLvlUpBox(void)
static void DrawLevelUpBannerText(void)
{
u16 monLevel;
u8 monGender;
@ -6032,7 +6040,7 @@ static void PutLevelAndGenderOnLvlUpBox(void)
GetMonNickname(&gPlayerParty[gBattleStruct->expGetterMonId], gStringVar4);
printerTemplate.currentChar = gStringVar4;
printerTemplate.windowId = 14;
printerTemplate.windowId = B_WIN_LEVEL_UP_BANNER;
printerTemplate.fontId = 0;
printerTemplate.x = 32;
printerTemplate.y = 0;
@ -6045,7 +6053,7 @@ static void PutLevelAndGenderOnLvlUpBox(void)
printerTemplate.bgColor = TEXT_COLOR_TRANSPARENT;
printerTemplate.shadowColor = TEXT_COLOR_DARK_GRAY;
AddTextPrinter(&printerTemplate, 0xFF, NULL);
AddTextPrinter(&printerTemplate, TEXT_SPEED_FF, NULL);
txtPtr = gStringVar4;
*(txtPtr)++ = CHAR_EXTRA_SYMBOL;
@ -6060,14 +6068,14 @@ static void PutLevelAndGenderOnLvlUpBox(void)
{
if (monGender == MON_MALE)
{
txtPtr = WriteColorChangeControlCode(txtPtr, 0, 0xC);
txtPtr = WriteColorChangeControlCode(txtPtr, 1, 0xD);
txtPtr = WriteColorChangeControlCode(txtPtr, 0, TEXT_DYNAMIC_COLOR_3);
txtPtr = WriteColorChangeControlCode(txtPtr, 1, TEXT_DYNAMIC_COLOR_4);
*(txtPtr++) = CHAR_MALE;
}
else
{
txtPtr = WriteColorChangeControlCode(txtPtr, 0, 0xE);
txtPtr = WriteColorChangeControlCode(txtPtr, 1, 0xF);
txtPtr = WriteColorChangeControlCode(txtPtr, 0, TEXT_DYNAMIC_COLOR_5);
txtPtr = WriteColorChangeControlCode(txtPtr, 1, TEXT_DYNAMIC_COLOR_6);
*(txtPtr++) = CHAR_FEMALE;
}
*(txtPtr++) = EOS;
@ -6075,28 +6083,28 @@ static void PutLevelAndGenderOnLvlUpBox(void)
printerTemplate.y = 10;
printerTemplate.currentY = 10;
AddTextPrinter(&printerTemplate, 0xFF, NULL);
AddTextPrinter(&printerTemplate, TEXT_SPEED_FF, NULL);
CopyWindowToVram(14, 2);
CopyWindowToVram(B_WIN_LEVEL_UP_BANNER, 2);
}
static bool8 sub_804F344(void)
static bool8 SlideOutLevelUpBanner(void)
{
if (gBattle_BG2_X == 0x1A0)
if (gBattle_BG2_X == LEVEL_UP_BANNER_START)
return FALSE;
if (gBattle_BG2_X - 16 < 0x1A0)
gBattle_BG2_X = 0x1A0;
if (gBattle_BG2_X - 16 < LEVEL_UP_BANNER_START)
gBattle_BG2_X = LEVEL_UP_BANNER_START;
else
gBattle_BG2_X -= 16;
return (gBattle_BG2_X != 0x1A0);
return (gBattle_BG2_X != LEVEL_UP_BANNER_START);
}
#define sDestroy data[0]
#define sSavedLvlUpBoxXPosition data[1]
#define sDestroy data[0]
#define sXOffset data[1]
static void PutMonIconOnLvlUpBox(void)
static void PutMonIconOnLvlUpBanner(void)
{
u8 spriteId;
const u16* iconPal;
@ -6109,23 +6117,23 @@ static void PutMonIconOnLvlUpBox(void)
const u8* iconPtr = GetMonIconPtr(species, personality, 1);
iconSheet.data = iconPtr;
iconSheet.size = 0x200;
iconSheet.tag = MON_ICON_LVLUP_BOX_TAG;
iconSheet.tag = TAG_LVLUP_BANNER_MON_ICON;
iconPal = GetValidMonIconPalettePtr(species);
iconPalSheet.data = iconPal;
iconPalSheet.tag = MON_ICON_LVLUP_BOX_TAG;
iconPalSheet.tag = TAG_LVLUP_BANNER_MON_ICON;
LoadSpriteSheet(&iconSheet);
LoadSpritePalette(&iconPalSheet);
spriteId = CreateSprite(&sSpriteTemplate_MonIconOnLvlUpBox, 256, 10, 0);
spriteId = CreateSprite(&sSpriteTemplate_MonIconOnLvlUpBanner, 256, 10, 0);
gSprites[spriteId].sDestroy = FALSE;
gSprites[spriteId].sSavedLvlUpBoxXPosition = gBattle_BG2_X;
gSprites[spriteId].sXOffset = gBattle_BG2_X;
}
static void SpriteCB_MonIconOnLvlUpBox(struct Sprite* sprite)
static void SpriteCB_MonIconOnLvlUpBanner(struct Sprite* sprite)
{
sprite->x2 = sprite->sSavedLvlUpBoxXPosition - gBattle_BG2_X;
sprite->x2 = sprite->sXOffset - gBattle_BG2_X;
if (sprite->x2 != 0)
{
@ -6134,13 +6142,13 @@ static void SpriteCB_MonIconOnLvlUpBox(struct Sprite* sprite)
else if (sprite->sDestroy)
{
DestroySprite(sprite);
FreeSpriteTilesByTag(MON_ICON_LVLUP_BOX_TAG);
FreeSpritePaletteByTag(MON_ICON_LVLUP_BOX_TAG);
FreeSpriteTilesByTag(TAG_LVLUP_BANNER_MON_ICON);
FreeSpritePaletteByTag(TAG_LVLUP_BANNER_MON_ICON);
}
}
#undef sDestroy
#undef sSavedLvlUpBoxXPosition
#undef sXOffset
static bool32 IsMonGettingExpSentOut(void)
{
@ -6389,10 +6397,10 @@ static void Cmd_various(void)
break;
case VARIOUS_ARENA_JUDGMENT_STRING:
BattleStringExpandPlaceholdersToDisplayedString(gRefereeStringsTable[gBattlescriptCurrInstr[1]]);
BattlePutTextOnWindow(gDisplayedStringBattle, 22);
BattlePutTextOnWindow(gDisplayedStringBattle, ARENA_WIN_JUDGEMENT_TEXT);
break;
case VARIOUS_ARENA_WAIT_STRING:
if (IsTextPrinterActive(22))
if (IsTextPrinterActive(ARENA_WIN_JUDGEMENT_TEXT))
return;
break;
case VARIOUS_WAIT_CRY:
@ -7828,7 +7836,7 @@ static void Cmd_psywavedamageeffect(void)
{
s32 randDamage;
while ((randDamage = (Random() & 0xF)) > 10);
while ((randDamage = Random() % 16) > 10);
randDamage *= 10;
gBattleMoveDamage = gBattleMons[gBattlerAttacker].level * (randDamage + 50) / 100;
@ -7966,8 +7974,8 @@ static void Cmd_painsplitdmgcalc(void)
static void Cmd_settypetorandomresistance(void) // conversion 2
{
if (gLastLandedMoves[gBattlerAttacker] == 0
|| gLastLandedMoves[gBattlerAttacker] == 0xFFFF)
if (gLastLandedMoves[gBattlerAttacker] == MOVE_NONE
|| gLastLandedMoves[gBattlerAttacker] == 0xFFFF)
{
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
}
@ -7982,7 +7990,7 @@ static void Cmd_settypetorandomresistance(void) // conversion 2
for (rands = 0; rands < 1000; rands++)
{
while (((i = (Random() & 0x7F)) > sizeof(gTypeEffectiveness) / 3));
while (((i = Random() % 128) > sizeof(gTypeEffectiveness) / 3));
i *= 3;
@ -8145,7 +8153,7 @@ static void Cmd_trychoosesleeptalkmove(void)
}
unusableMovesBits = CheckMoveLimitations(gBattlerAttacker, unusableMovesBits, ~MOVE_LIMITATION_PP);
if (unusableMovesBits == 0xF) // all 4 moves cannot be chosen
if (unusableMovesBits == (1 << MAX_MON_MOVES) - 1) // all 4 moves cannot be chosen
{
gBattlescriptCurrInstr += 5;
}
@ -8329,7 +8337,7 @@ static void Cmd_healpartystatus(void)
else // Aromatherapy
{
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SOOTHING_AROMA;
toHeal = 0x3F;
toHeal = (1 << PARTY_SIZE) - 1;
gBattleMons[gBattlerAttacker].status1 = 0;
gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_NIGHTMARE;
@ -9959,7 +9967,7 @@ static void Cmd_displaydexinfo(void)
switch (gBattleCommunication[0])
{
case 0:
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
gBattleCommunication[0]++;
break;
case 1:
@ -9984,13 +9992,13 @@ static void Cmd_displaydexinfo(void)
case 3:
InitBattleBgsVideo();
LoadBattleTextboxAndBackground();
gBattle_BG3_X = 0x100;
gBattle_BG3_X = 256;
gBattleCommunication[0]++;
break;
case 4:
if (!IsDma3ManagerBusyWithBgCopy())
{
BeginNormalPaletteFade(PALETTES_BG, 0, 0x10, 0, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_BG, 0, 16, 0, RGB_BLACK);
ShowBg(0);
ShowBg(3);
gBattleCommunication[0]++;
@ -10043,7 +10051,7 @@ void HandleBattleWindow(u8 xStart, u8 yStart, u8 xEnd, u8 yEnd, u8 flags)
if (flags & WINDOW_CLEAR)
var = 0;
if (flags & WINDOW_x80)
if (flags & WINDOW_BG1)
CopyToBgTilemapBufferRect_ChangePalette(1, &var, destX, destY, 1, 1, 0x11);
else
CopyToBgTilemapBufferRect_ChangePalette(0, &var, destX, destY, 1, 1, 0x11);
@ -10076,8 +10084,8 @@ static void Cmd_trygivecaughtmonnick(void)
switch (gBattleCommunication[MULTIUSE_STATE])
{
case 0:
HandleBattleWindow(0x18, 8, 0x1D, 0xD, 0);
BattlePutTextOnWindow(gText_BattleYesNoChoice, 0xC);
HandleBattleWindow(24, 8, 29, 13, 0);
BattlePutTextOnWindow(gText_BattleYesNoChoice, B_WIN_YESNO);
gBattleCommunication[MULTIUSE_STATE]++;
gBattleCommunication[CURSOR_POSITION] = 0;
BattleCreateYesNoCursorAt(0);

View File

@ -661,7 +661,7 @@ static void Task_EvolutionScene(u8 taskId)
if (!gPaletteFade.active)
{
StringExpandPlaceholders(gStringVar4, gText_PkmnIsEvolving);
BattlePutTextOnWindow(gStringVar4, 0);
BattlePutTextOnWindow(gStringVar4, B_WIN_MSG);
gTasks[taskId].tState++;
}
break;
@ -758,7 +758,7 @@ static void Task_EvolutionScene(u8 taskId)
if (IsCryFinished())
{
StringExpandPlaceholders(gStringVar4, gText_CongratsPkmnEvolved);
BattlePutTextOnWindow(gStringVar4, 0);
BattlePutTextOnWindow(gStringVar4, B_WIN_MSG);
PlayBGM(MUS_EVOLVED);
gTasks[taskId].tState++;
SetMonData(mon, MON_DATA_SPECIES, (void*)(&gTasks[taskId].tPostEvoSpecies));
@ -845,7 +845,7 @@ static void Task_EvolutionScene(u8 taskId)
else // Fire Red leftover probably
StringExpandPlaceholders(gStringVar4, gText_PkmnStoppedEvolving);
BattlePutTextOnWindow(gStringVar4, 0);
BattlePutTextOnWindow(gStringVar4, B_WIN_MSG);
gTasks[taskId].tEvoWasStopped = TRUE;
gTasks[taskId].tState = EVOSTATE_TRY_LEARN_MOVE;
}
@ -856,7 +856,7 @@ static void Task_EvolutionScene(u8 taskId)
BufferMoveToLearnIntoBattleTextBuff2();
PlayFanfare(MUS_LEVEL_UP);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_PKMNLEARNEDMOVE - BATTLESTRINGS_ID_ADDER]);
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
gTasks[taskId].tLearnsFirstMove = 0x40; // re-used as a counter
gTasks[taskId].tState++;
}
@ -874,7 +874,7 @@ static void Task_EvolutionScene(u8 taskId)
// "{mon} is trying to learn {move}"
BufferMoveToLearnIntoBattleTextBuff2();
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_TRYTOLEARNMOVE1 - BATTLESTRINGS_ID_ADDER]);
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
gTasks[taskId].tLearnMoveState++;
}
break;
@ -883,7 +883,7 @@ static void Task_EvolutionScene(u8 taskId)
{
// "But, {mon} can't learn more than four moves"
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_TRYTOLEARNMOVE2 - BATTLESTRINGS_ID_ADDER]);
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
gTasks[taskId].tLearnMoveState++;
}
break;
@ -892,7 +892,7 @@ static void Task_EvolutionScene(u8 taskId)
{
// "Delete a move to make room for {move}?"
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_TRYTOLEARNMOVE3 - BATTLESTRINGS_ID_ADDER]);
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
gTasks[taskId].tLearnMoveYesState = MVSTATE_SHOW_MOVE_SELECT;
gTasks[taskId].tLearnMoveNoState = MVSTATE_ASK_CANCEL;
gTasks[taskId].tLearnMoveState++;
@ -901,7 +901,7 @@ static void Task_EvolutionScene(u8 taskId)
if (!IsTextPrinterActive(0) && !IsSEPlaying())
{
HandleBattleWindow(0x18, 8, 0x1D, 0xD, 0);
BattlePutTextOnWindow(gText_BattleYesNoChoice, 0xC);
BattlePutTextOnWindow(gText_BattleYesNoChoice, B_WIN_YESNO);
gTasks[taskId].tLearnMoveState++;
sEvoCursorPos = 0;
BattleCreateYesNoCursorAt(0);
@ -980,7 +980,7 @@ static void Task_EvolutionScene(u8 taskId)
{
// Can't forget HMs
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_HMMOVESCANTBEFORGOTTEN - BATTLESTRINGS_ID_ADDER]);
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
gTasks[taskId].tLearnMoveState = MVSTATE_RETRY_AFTER_HM;
}
else
@ -997,14 +997,14 @@ static void Task_EvolutionScene(u8 taskId)
break;
case MVSTATE_FORGET_MSG_1:
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_123POOF - BATTLESTRINGS_ID_ADDER]);
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
gTasks[taskId].tLearnMoveState++;
break;
case MVSTATE_FORGET_MSG_2:
if (!IsTextPrinterActive(0) && !IsSEPlaying())
{
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_PKMNFORGOTMOVE - BATTLESTRINGS_ID_ADDER]);
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
gTasks[taskId].tLearnMoveState++;
}
break;
@ -1012,20 +1012,20 @@ static void Task_EvolutionScene(u8 taskId)
if (!IsTextPrinterActive(0) && !IsSEPlaying())
{
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_ANDELLIPSIS - BATTLESTRINGS_ID_ADDER]);
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
gTasks[taskId].tState = EVOSTATE_LEARNED_MOVE;
}
break;
case MVSTATE_ASK_CANCEL:
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_STOPLEARNINGMOVE - BATTLESTRINGS_ID_ADDER]);
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
gTasks[taskId].tLearnMoveYesState = MVSTATE_CANCEL;
gTasks[taskId].tLearnMoveNoState = MVSTATE_INTRO_MSG_1;
gTasks[taskId].tLearnMoveState = MVSTATE_PRINT_YES_NO;
break;
case MVSTATE_CANCEL:
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_DIDNOTLEARNMOVE - BATTLESTRINGS_ID_ADDER]);
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
gTasks[taskId].tState = EVOSTATE_TRY_LEARN_MOVE;
break;
case MVSTATE_RETRY_AFTER_HM:

View File

@ -64,8 +64,6 @@ static EWRAM_DATA u32 sHofFadePalettes = 0;
static EWRAM_DATA struct HallofFameTeam *sHofMonPtr = NULL;
static EWRAM_DATA struct HofGfx *sHofGfxPtr = NULL;
extern struct MusicPlayerInfo gMPlayInfo_BGM;
static void ClearVramOamPltt_LoadHofPal(void);
static void LoadHofGfx(void);
static void InitHofBgs(void);

View File

@ -15,9 +15,6 @@
#include "data.h"
#include "constants/songs.h"
extern struct MusicPlayerInfo gMPlayInfo_BGM;
// this file's functions
static void Task_DoPokeballSendOutAnim(u8 taskId);
static void SpriteCB_PlayerMonSendOut_1(struct Sprite *sprite);
static void SpriteCB_PlayerMonSendOut_2(struct Sprite *sprite);

View File

@ -116,8 +116,6 @@ struct PokeblockFeed
u8 unused4;
};
extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern const u16 gUnknown_0860F074[];
static void HandleInitBackgrounds(void);

View File

@ -148,8 +148,6 @@ struct SearchMenuItem
u8 selectionBgWidth;
};
extern struct MusicPlayerInfo gMPlayInfo_BGM;
struct PokedexListItem
{
u16 dexNum;

View File

@ -14,24 +14,17 @@ struct Fanfare
u16 duration;
};
// ewram
EWRAM_DATA struct MusicPlayerInfo* gMPlay_PokemonCry = NULL;
EWRAM_DATA u8 gPokemonCryBGMDuckingCounter = 0;
// iwram bss
static u16 sCurrentMapMusic;
static u16 sNextMapMusic;
static u8 sMapMusicState;
static u8 sMapMusicFadeInSpeed;
static u16 sFanfareCounter;
// iwram common
bool8 gDisableMusic;
extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern struct MusicPlayerInfo gMPlayInfo_SE1;
extern struct MusicPlayerInfo gMPlayInfo_SE2;
extern struct MusicPlayerInfo gMPlayInfo_SE3;
extern struct ToneData gCryTable[];
extern struct ToneData gCryTable2[];

View File

@ -35,9 +35,6 @@
#define BERRY_UPDATE_BUTTON_COMBO (B_BUTTON | SELECT_BUTTON)
#define A_B_START_SELECT (A_BUTTON | B_BUTTON | START_BUTTON | SELECT_BUTTON)
extern struct MusicPlayerInfo gMPlayInfo_BGM;
// this file's functions
static void MainCB2(void);
static void Task_TitleScreenPhase1(u8);
static void Task_TitleScreenPhase2(u8);