Document some of trade

This commit is contained in:
GriffinR 2019-10-03 19:39:37 -04:00
parent c3c8fb40cf
commit 4a7f061885
13 changed files with 1147 additions and 1102 deletions

View File

@ -107,12 +107,19 @@
#define TEXT_COLOR_TRANSPARENT 0x0
#define TEXT_COLOR_WHITE 0x1
#define TEXT_COLOR_DARK_GREY 0x2
// 0x3
#define TEXT_COLOR_LIGHT_GREY 0x3
#define TEXT_COLOR_RED 0x4
// 0x5
#define TEXT_COLOR_LIGHT_RED 0x5
#define TEXT_COLOR_GREEN 0x6
// 0x7
#define TEXT_COLOR_LIGHT_GREEN 0x7
#define TEXT_COLOR_BLUE 0x8
#define TEXT_COLOR_LIGHT_BLUE 0x9
#define TEXT_DYNAMIC_COLOR_1 0xA // Usually white
#define TEXT_DYNAMIC_COLOR_2 0xB // Usually white w/ tinge of green
#define TEXT_DYNAMIC_COLOR_3 0xC // Usually white
#define TEXT_DYNAMIC_COLOR_4 0xD // Usually aquamarine
#define TEXT_DYNAMIC_COLOR_5 0xE // Usually blue-green
#define TEXT_DYNAMIC_COLOR_6 0xF // Usually cerulean
#define PLACEHOLDER_ID_UNKNOWN 0x0
#define PLACEHOLDER_ID_PLAYER 0x1

View File

@ -3,11 +3,40 @@
#define TRADE_PLAYER 0
#define TRADE_PARTNER 1
#define TRADE_PARTICIPANT_COUNT 2
#define INGAME_TRADE_SEEDOT 0
#define INGAME_TRADE_PLUSLE 1
#define INGAME_TRADE_HORSEA 2
#define INGAME_TRADE_MEOWTH 3
#define INGAME_TRADE_MAIL_LENGTH 9
#define PLAYER_MON_INVALID 0
#define PLAYER_MON_VALID 1
#define PARTNER_MON_INVALID 2
#define MON_VALID 0
#define TRADE_ACTION_TEXT_CANCEL 0
#define TRADE_ACTION_TEXT_CHOOSE_MON 1
#define TRADE_ACTION_TEXT_SUMMARY 2
#define TRADE_ACTION_TEXT_TRADE 3
#define TRADE_ACTION_TEXT_CANCEL_TRADE 4
#define TRADE_ACTION_TEXT_JP_QUIT 5
#define MENU_ACTION_SUMMARY 0
#define MENU_ACTION_TRADE 1
#define TRADE_MSG_STANDBY 0
#define TRADE_MSG_CANCELED 1
#define TRADE_MSG_ONLY_MON1 2
#define TRADE_MSG_ONLY_MON2 3
#define TRADE_MSG_WAITING_FOR_FRIEND 4
#define TRADE_MSG_FRIEND_WANTS_TO_TRADE 5
#define TRADE_MSG_MON_CANT_BE_TRADED 6
#define TRADE_MSG_EGG_CANT_BE_TRADED 7
#define TRADE_MSG_FRIENDS_MON_CANT_BE_TRADED 8
#endif //GUARD_CONSTANTS_TRADE_H

View File

@ -22,7 +22,7 @@ u8 UpdateMonIconFrame(struct Sprite *sprite);
void LoadMonIconPalette(u16 species);
void sub_80D328C(struct Sprite *sprite);
void sub_80D3014(struct Sprite *sprite);
void sub_80D32C8(struct Sprite *sprite, u8 animNum);
void SetPartyHPBarSprite(struct Sprite *sprite, u8 animNum);
u8 GetMonIconPaletteIndexFromSpecies(u16 species);
#endif // GUARD_POKEMON_ICON_H

View File

@ -2,6 +2,7 @@
#define GUARD_TRADE_H
#include "link_rfu.h"
#include "constants/trade.h"
// Exported type declarations
@ -21,6 +22,6 @@ int sub_807A918(struct Pokemon*, u16);
void sub_807B140(void);
void sub_807B154(void);
void sub_807F19C(void);
void sub_807F1A8(u8, const u8 *, u8);
void DrawTextOnTradeWindow(u8, const u8 *, u8);
#endif //GUARD_TRADE_H

View File

@ -1084,8 +1084,8 @@ static void sub_80B37FC(u8 taskId)
task->data[0]++;
break;
case 2:
gSelectedTradeMonPositions[0] = 0;
gSelectedTradeMonPositions[1] = 0;
gSelectedTradeMonPositions[TRADE_PLAYER] = 0;
gSelectedTradeMonPositions[TRADE_PARTNER] = 0;
m4aMPlayAllStop();
sub_800AC34();
task->data[0]++;
@ -1117,8 +1117,8 @@ static void sub_80B3894(u8 taskId)
data[0]++;
break;
case 2:
gSelectedTradeMonPositions[0] = 0;
gSelectedTradeMonPositions[1] = 0;
gSelectedTradeMonPositions[TRADE_PLAYER] = 0;
gSelectedTradeMonPositions[TRADE_PARTNER] = 0;
m4aMPlayAllStop();
sub_800ADF8();
data[0]++;

View File

@ -7,6 +7,7 @@ static const u32 sUnref_0832C6A8[] =
0x00000064,
0x00000528
};
static const u16 gTradeMovesBoxTilemap[] = INCBIN_U16("graphics/trade/moves_box_map.bin");
static const u16 gTradePartyBoxTilemap[] = INCBIN_U16("graphics/trade/party_box_map.bin");
static const u8 gTradeStripesBG2Tilemap[] = INCBIN_U8("graphics/trade/stripes_bg2_map.bin");
@ -24,19 +25,19 @@ static const u8 gText_ThreeDashes2[] = _("---");
static const u8 gText_FourQuestionMarks[] = _("????");
static const u8 gText_832DAE4[] = _("");
static const u8 gText_IsThisTradeOkay[] = _("Is this trade okay?");
static const u8 gText_Cancel6[] = _("CANCEL");
static const u8 gText_ChooseAPkmn[] = _("Choose a POKéMON.");
static const u8 gText_Summary3[] = _("SUMMARY");
static const u8 gText_Trade2[] = _("TRADE");
static const u8 gText_CancelTrade[] = _("Cancel trade?");
static const u8 gJPText_832DB2E[] = _("Bボタン  もどります");
static const u8 gText_Summary4[] = _("SUMMARY");
static const u8 gText_Trade3[] = _("TRADE");
static const u8 gText_CommunicationStandby6[] = _("{COLOR DARK_GREY}{HIGHLIGHT WHITE}{SHADOW LIGHT_GREY}Communication standby…\nPlease wait.");
static const u8 gText_TheTradeHasBeenCanceled[] = _("{COLOR DARK_GREY}{HIGHLIGHT WHITE}{SHADOW LIGHT_GREY}The trade has\nbeen canceled.");
static const u8 gText_YourOnlyPkmnForBattle[] = _("That's your only\nPOKéMON for battle.");
static const u8 gText_WaitingForYourFriend[] = _("{COLOR DARK_GREY}{HIGHLIGHT WHITE}{SHADOW LIGHT_GREY}Waiting for your friend\nto finish…");
static const u8 gText_YourFriendWantsToTrade[] = _("Your friend wants\nto trade POKéMON.");
static const u8 sText_Cancel[] = _("CANCEL");
static const u8 sText_ChooseAPkmn[] = _("Choose a POKéMON.");
static const u8 sText_Summary[] = _("SUMMARY");
static const u8 sText_Trade[] = _("TRADE");
static const u8 sText_CancelTrade[] = _("Cancel trade?");
static const u8 sJPText_PressBButtonToQuit[] = _("Bボタン  もどります");
static const u8 sText_Summary2[] = _("SUMMARY");
static const u8 sText_Trade2[] = _("TRADE");
static const u8 sText_CommunicationStandby[] = _("{COLOR DARK_GREY}{HIGHLIGHT WHITE}{SHADOW LIGHT_GREY}Communication standby…\nPlease wait.");
static const u8 sText_TheTradeHasBeenCanceled[] = _("{COLOR DARK_GREY}{HIGHLIGHT WHITE}{SHADOW LIGHT_GREY}The trade has\nbeen canceled.");
static const u8 sText_OnlyPkmnForBattle[] = _("That's your only\nPOKéMON for battle.");
static const u8 sText_WaitingForYourFriend[] = _("{COLOR DARK_GREY}{HIGHLIGHT WHITE}{SHADOW LIGHT_GREY}Waiting for your friend\nto finish…");
static const u8 sText_YourFriendWantsToTrade[] = _("Your friend wants\nto trade POKéMON.");
static const struct OamData gOamData_832DC14 =
{
@ -336,35 +337,41 @@ static const u8 sUnref_0832DE6E[] =
0x17, 0x0c
};
static const u8 *const gUnknown_0832DE94[] =
static const u8 *const sTradeActionTexts[] =
{
gText_Cancel6,
gText_ChooseAPkmn,
gText_Summary3,
gText_Trade2,
gText_CancelTrade,
gJPText_832DB2E
[TRADE_ACTION_TEXT_CANCEL] = sText_Cancel,
[TRADE_ACTION_TEXT_CHOOSE_MON] = sText_ChooseAPkmn,
[TRADE_ACTION_TEXT_SUMMARY] = sText_Summary,
[TRADE_ACTION_TEXT_TRADE] = sText_Trade,
[TRADE_ACTION_TEXT_CANCEL_TRADE] = sText_CancelTrade,
[TRADE_ACTION_TEXT_JP_QUIT] = sJPText_PressBButtonToQuit
};
static const struct MenuAction gUnknown_0832DEAC[] =
static const struct MenuAction sSelectTradeMonActions[] =
{
{gText_Summary4, sub_807A000},
{gText_Trade3, sub_807A024}
[MENU_ACTION_SUMMARY] = {sText_Summary2, sub_807A000},
[MENU_ACTION_TRADE] = {sText_Trade2, sub_807A024}
};
static const u8 *const gUnknown_0832DEBC[] = {
gText_CommunicationStandby6,
gText_TheTradeHasBeenCanceled,
gText_YourOnlyPkmnForBattle,
gText_OnlyPkmnForBattle,
gText_WaitingForYourFriend,
gText_YourFriendWantsToTrade,
gText_PkmnCantBeTradedNow,
gText_EggCantBeTradedNow,
gText_OtherTrainersPkmnCantBeTraded
static const u8 *const sTradeMessageTexts[] =
{
[TRADE_MSG_STANDBY] = sText_CommunicationStandby,
[TRADE_MSG_CANCELED] = sText_TheTradeHasBeenCanceled,
[TRADE_MSG_ONLY_MON1] = sText_OnlyPkmnForBattle,
[TRADE_MSG_ONLY_MON2] = gText_OnlyPkmnForBattle, //identical text to above
[TRADE_MSG_WAITING_FOR_FRIEND] = sText_WaitingForYourFriend,
[TRADE_MSG_FRIEND_WANTS_TO_TRADE] = sText_YourFriendWantsToTrade,
[TRADE_MSG_MON_CANT_BE_TRADED] = gText_PkmnCantBeTradedNow,
[TRADE_MSG_EGG_CANT_BE_TRADED] = gText_EggCantBeTradedNow,
[TRADE_MSG_FRIENDS_MON_CANT_BE_TRADED] = gText_OtherTrainersPkmnCantBeTraded
};
static const u8 gUnknown_0832DEE0[] = { 0, 1, 2 };
static const u8 sTradeTextColors[] =
{
TEXT_COLOR_TRANSPARENT, //bg color
TEXT_COLOR_WHITE, //fg color
TEXT_COLOR_DARK_GREY //shadow color
};
static const struct BgTemplate gUnknown_0832DEE4[] =
{
@ -573,7 +580,7 @@ static const struct WindowTemplate gUnknown_0832DEF4[] =
DUMMY_WIN_TEMPLATE,
};
static const struct WindowTemplate gUnknown_0832DF8C =
static const struct WindowTemplate sTradeYesNoWindowTemplate =
{
.bg = 0,
.tilemapLeft = 23,
@ -584,7 +591,7 @@ static const struct WindowTemplate gUnknown_0832DF8C =
.baseBlock = 582
};
static const u8 gJPText_Shedinja[] = _("ヌケニン");
static const u8 sJPText_Shedinja[] = _("ヌケニン");
static const u8 gUnknown_0832DF99[][2] =
{
{4, 3},
@ -592,20 +599,20 @@ static const u8 gUnknown_0832DF99[][2] =
{0, 0}
};
static const u16 gTradeBallPalette[] = INCBIN_U16("graphics/trade/ball.gbapal");
static const u8 gTradeBallTiles[] = INCBIN_U8("graphics/trade/ball.4bpp");
static const u8 gUnknown_832E5C0[] = INCBIN_U8("graphics/trade/pokeball_symbol.8bpp");
static const u16 gUnknown_0832FFC0[] = INCBIN_U16("graphics/trade/cable_closeup_map.bin");
static const u16 gUnknown_083307C0[] = INCBIN_U16("graphics/trade/pokeball_symbol_map.bin");
static const u16 sTradePal_Ball[] = INCBIN_U16("graphics/trade/ball.gbapal");
static const u8 sTradeGfx_Ball[] = INCBIN_U8("graphics/trade/ball.4bpp");
static const u8 sTradeGfx_PokeBallSymbol[] = INCBIN_U8("graphics/trade/pokeball_symbol.8bpp"); // unused?
static const u16 sTradeTilemap_Cable[] = INCBIN_U16("graphics/trade/cable_closeup_map.bin");
static const u16 sTradeTilemap_PokeBallSymbol[] = INCBIN_U16("graphics/trade/pokeball_symbol_map.bin"); // unused?
static const u16 sUnref_083308C0[] = INCBIN_U16("graphics/trade/unknown_3308C0.gbapal");
static const u16 gUnknown_083308E0[] = INCBIN_U16("graphics/trade/gba.gbapal");
static const u16 gUnref_08330900[] = INCBIN_U16("graphics/trade/shadow.gbapal");
static const u16 gUnref_08330920[] = INCBIN_U16("graphics/trade/black.gbapal");
static const u16 gUnknown_08330940[] = INCBIN_U16("graphics/trade/misc.gbapal");
static const u8 gTradeGlow1Tiles[] = INCBIN_U8("graphics/trade/glow1.4bpp");
static const u8 gTradeGlow2Tiles[] = INCBIN_U8("graphics/trade/glow2.4bpp");
static const u8 gTradeCableEndTiles[] = INCBIN_U8("graphics/trade/cable_end.4bpp");
static const u8 gTradeGBAScreenTiles[] = INCBIN_U8("graphics/trade/gba_screen.4bpp");
static const u16 sTradePal_Gba[] = INCBIN_U16("graphics/trade/gba.gbapal");
static const u16 sTradePal_ShadowUnused[] = INCBIN_U16("graphics/trade/shadow.gbapal");
static const u16 sTradePal_BlackUnused[] = INCBIN_U16("graphics/trade/black.gbapal");
static const u16 sTradePal_Misc[] = INCBIN_U16("graphics/trade/misc.gbapal");
static const u8 sTradeGfx_Glow1[] = INCBIN_U8("graphics/trade/glow1.4bpp");
static const u8 sTradeGfx_Glow2[] = INCBIN_U8("graphics/trade/glow2.4bpp");
static const u8 sTradeGfx_CableEnd[] = INCBIN_U8("graphics/trade/cable_end.4bpp");
static const u8 sTradeGfx_GbaScreen[] = INCBIN_U8("graphics/trade/gba_screen.4bpp");
const u16 gUnknown_08331F60[] = INCBIN_U16("graphics/trade/shadow_map.bin");
static const u8 gUnknown_08332F60[] = INCBIN_U8("graphics/trade/gba_affine.8bpp");
static const u8 sFiller_08335760[64] = {};
@ -614,11 +621,11 @@ static const u8 gUnknown_083358A0[] = INCBIN_U8("graphics/trade/gba_affine_map_w
static const u16 gUnknown_083359A0[] = INCBIN_U16("graphics/trade/gba_map_wireless.bin");
static const u16 gUnknown_083369A0[] = INCBIN_U16("graphics/trade/gba_map_cable.bin");
static const u32 gUnknown_083379A0[] = INCBIN_U32("graphics/trade/unknown_3379A0.bin.lz");
static const u16 gUnknown_08337AA0[] = INCBIN_U16("graphics/trade/wireless_signal_send.gbapal");
static const u16 gUnknown_08337CA0[] = INCBIN_U16("graphics/trade/wireless_signal_receive.gbapal");
static const u16 gUnknown_08337EA0[] = INCBIN_U16("graphics/trade/black.gbapal");
static const u32 gUnknown_08337EC0[] = INCBIN_U32("graphics/trade/wireless_signal.4bpp.lz");
static const u32 gUnknown_08338550[] = INCBIN_U32("graphics/trade/wireless_signal.bin.lz");
static const u16 sTradePal_WirelessSignalSend[] = INCBIN_U16("graphics/trade/wireless_signal_send.gbapal");
static const u16 sTradePal_WirelessSignalReceive[] = INCBIN_U16("graphics/trade/wireless_signal_receive.gbapal");
static const u16 sTradePal_Black[] = INCBIN_U16("graphics/trade/black.gbapal");
static const u32 sTradeGfx_WirelessSignal[] = INCBIN_U32("graphics/trade/wireless_signal.4bpp.lz");
static const u32 sTradeTilemap_WirelessSignal[] = INCBIN_U32("graphics/trade/wireless_signal.bin.lz");
static const struct OamData gOamData_8338C44 =
{
@ -700,14 +707,14 @@ static const union AffineAnimCmd *const gSpriteAffineAnimTable_8338D0C[] =
static const struct SpriteSheet gUnknown_08338D18 =
{
.data = gTradeBallTiles,
.data = sTradeGfx_Ball,
.size = 0x600,
.tag = 5557
};
static const struct SpritePalette gUnknown_08338D20 =
{
.data = gTradeBallPalette,
.data = sTradePal_Ball,
.tag = 5558
};
@ -756,20 +763,20 @@ static const union AffineAnimCmd *const gSpriteAffineAnimTable_8338D6C[] =
static const struct SpriteSheet gUnknown_08338D70 =
{
.data = gTradeGlow1Tiles,
.data = sTradeGfx_Glow1,
.size = 0x200,
.tag = 5550
};
static const struct SpritePalette gUnknown_08338D78 =
{
.data = gUnknown_08330940,
.data = sTradePal_Misc,
.tag = 5551
};
static const struct SpritePalette gUnknown_08338D80 =
{
.data = gUnknown_083308E0,
.data = sTradePal_Gba,
.tag = 5555
};
@ -811,7 +818,7 @@ static const union AnimCmd *const gSpriteAnimTable_8338DB8[] =
static const struct SpriteSheet gUnknown_08338DC0 =
{
.data = gTradeGlow2Tiles,
.data = sTradeGfx_Glow2,
.size = 0x300,
.tag = 5552
};
@ -847,7 +854,7 @@ static const union AnimCmd *const gSpriteAnimTable_8338DF0[] =
static const struct SpriteSheet gUnknown_08338DF4 =
{
.data = gTradeCableEndTiles,
.data = sTradeGfx_CableEnd,
.size = 0x100,
.tag = 5554
};
@ -908,7 +915,7 @@ static const union AnimCmd *const gSpriteAnimTable_8338E68[] =
static const struct SpriteSheet gUnknown_08338E6C =
{
.data = gTradeGBAScreenTiles,
.data = sTradeGfx_GbaScreen,
.size = 0x1000,
.tag = 5556
};
@ -1016,7 +1023,7 @@ static const struct InGameTrade sIngameTrades[] =
}
};
static const u16 gIngameTradeMail[][10] =
static const u16 sIngameTradeMail[][INGAME_TRADE_MAIL_LENGTH + 1] =
{
{
EC_WORD_BE,

View File

@ -985,7 +985,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
{
case 0:
StringExpandPlaceholders(gStringVar4, gText_PkmnIsEvolving);
sub_807F1A8(0, gStringVar4, 1);
DrawTextOnTradeWindow(0, gStringVar4, 1);
gTasks[taskID].tState++;
break;
case 1:
@ -1075,7 +1075,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
if (IsCryFinished())
{
StringExpandPlaceholders(gStringVar4, gText_CongratsPkmnEvolved);
sub_807F1A8(0, gStringVar4, 1);
DrawTextOnTradeWindow(0, gStringVar4, 1);
PlayFanfare(MUS_FANFA5);
gTasks[taskID].tState++;
SetMonData(mon, MON_DATA_SPECIES, (&gTasks[taskID].tPostEvoSpecies));
@ -1110,7 +1110,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
else
{
PlayBGM(MUS_SHINKA);
sub_807F1A8(0, gText_CommunicationStandby5, 1);
DrawTextOnTradeWindow(0, gText_CommunicationStandby5, 1);
gTasks[taskID].tState++;
}
}
@ -1144,7 +1144,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
if (EvoScene_IsMonAnimFinished(sEvoStructPtr->preEvoSpriteID))
{
StringExpandPlaceholders(gStringVar4, gText_EllipsisQuestionMark);
sub_807F1A8(0, gStringVar4, 1);
DrawTextOnTradeWindow(0, gStringVar4, 1);
gTasks[taskID].tEvoWasStopped = 1;
gTasks[taskID].tState = 13;
}
@ -1155,7 +1155,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
BufferMoveToLearnIntoBattleTextBuff2();
PlayFanfare(MUS_FANFA1);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_PKMNLEARNEDMOVE - BATTLESTRINGS_ID_ADDER]);
sub_807F1A8(0, gDisplayedStringBattle, 1);
DrawTextOnTradeWindow(0, gDisplayedStringBattle, 1);
gTasks[taskID].tLearnsFirstMove = 0x40; // re-used as a counter
gTasks[taskID].tState++;
}
@ -1172,7 +1172,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
{
BufferMoveToLearnIntoBattleTextBuff2();
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_TRYTOLEARNMOVE1 - BATTLESTRINGS_ID_ADDER]);
sub_807F1A8(0, gDisplayedStringBattle, 1);
DrawTextOnTradeWindow(0, gDisplayedStringBattle, 1);
gTasks[taskID].tLearnMoveState++;
}
break;
@ -1180,7 +1180,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
if (!IsTextPrinterActive(0) && !IsSEPlaying())
{
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_TRYTOLEARNMOVE2 - BATTLESTRINGS_ID_ADDER]);
sub_807F1A8(0, gDisplayedStringBattle, 1);
DrawTextOnTradeWindow(0, gDisplayedStringBattle, 1);
gTasks[taskID].tLearnMoveState++;
}
break;
@ -1188,7 +1188,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
if (!IsTextPrinterActive(0) && !IsSEPlaying())
{
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_TRYTOLEARNMOVE3 - BATTLESTRINGS_ID_ADDER]);
sub_807F1A8(0, gDisplayedStringBattle, 1);
DrawTextOnTradeWindow(0, gDisplayedStringBattle, 1);
gTasks[taskID].tData7 = 5;
gTasks[taskID].tData8 = 9;
gTasks[taskID].tLearnMoveState++;
@ -1209,7 +1209,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
case 0:
sEvoCursorPos = 0;
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_EMPTYSTRING3 - BATTLESTRINGS_ID_ADDER]);
sub_807F1A8(0, gDisplayedStringBattle, 1);
DrawTextOnTradeWindow(0, gDisplayedStringBattle, 1);
gTasks[taskID].tLearnMoveState = gTasks[taskID].tData7;
if (gTasks[taskID].tLearnMoveState == 5)
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
@ -1218,7 +1218,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
case -1:
sEvoCursorPos = 1;
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_EMPTYSTRING3 - BATTLESTRINGS_ID_ADDER]);
sub_807F1A8(0, gDisplayedStringBattle, 1);
DrawTextOnTradeWindow(0, gDisplayedStringBattle, 1);
gTasks[taskID].tLearnMoveState = gTasks[taskID].tData8;
break;
}
@ -1254,7 +1254,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
if (IsHMMove2(move))
{
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_HMMOVESCANTBEFORGOTTEN - BATTLESTRINGS_ID_ADDER]);
sub_807F1A8(0, gDisplayedStringBattle, 1);
DrawTextOnTradeWindow(0, gDisplayedStringBattle, 1);
gTasks[taskID].tLearnMoveState = 11;
}
else
@ -1264,7 +1264,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
RemoveMonPPBonus(mon, var);
SetMonMoveSlot(mon, gMoveToLearn, var);
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_123POOF - BATTLESTRINGS_ID_ADDER]);
sub_807F1A8(0, gDisplayedStringBattle, 1);
DrawTextOnTradeWindow(0, gDisplayedStringBattle, 1);
gTasks[taskID].tLearnMoveState++;
}
}
@ -1274,7 +1274,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
if (!IsTextPrinterActive(0) && !IsSEPlaying())
{
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_PKMNFORGOTMOVE - BATTLESTRINGS_ID_ADDER]);
sub_807F1A8(0, gDisplayedStringBattle, 1);
DrawTextOnTradeWindow(0, gDisplayedStringBattle, 1);
gTasks[taskID].tLearnMoveState++;
}
break;
@ -1282,20 +1282,20 @@ static void Task_TradeEvolutionScene(u8 taskID)
if (!IsTextPrinterActive(0) && !IsSEPlaying())
{
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_ANDELLIPSIS - BATTLESTRINGS_ID_ADDER]);
sub_807F1A8(0, gDisplayedStringBattle, 1);
DrawTextOnTradeWindow(0, gDisplayedStringBattle, 1);
gTasks[taskID].tState = 18;
}
break;
case 9:
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_STOPLEARNINGMOVE - BATTLESTRINGS_ID_ADDER]);
sub_807F1A8(0, gDisplayedStringBattle, 1);
DrawTextOnTradeWindow(0, gDisplayedStringBattle, 1);
gTasks[taskID].tData7 = 10;
gTasks[taskID].tData8 = 0;
gTasks[taskID].tLearnMoveState = 3;
break;
case 10:
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_DIDNOTLEARNMOVE - BATTLESTRINGS_ID_ADDER]);
sub_807F1A8(0, gDisplayedStringBattle, 1);
DrawTextOnTradeWindow(0, gDisplayedStringBattle, 1);
gTasks[taskID].tState = 13;
break;
case 11:

View File

@ -1516,17 +1516,13 @@ asm(".space 0x20"); //blank palette??
#include "data/graphics/berry_fix.h"
// more trade stuff?
// Trade
const u16 gTradeMenu_Pal[] = INCBIN_U16("graphics/trade/menu.gbapal");
const u16 gUnknown_08DDB444[] = INCBIN_U16("graphics/unknown/unknown_DDB444.gbapal");
const u8 gTradeMenu_Gfx[] = INCBIN_U8("graphics/trade/menu.4bpp");
const u8 gTradeButtons_Gfx[] = INCBIN_U8("graphics/trade/buttons.4bpp");
const u16 gUnused_DDCEE4[] = INCBIN_U16("graphics/unused/unused_DDCEE4.bin");
const u16 gUnknown_08DDCF04[] = INCBIN_U16("graphics/unknown/unknown_DDCF04.bin");
const u16 gUnknown_08DDD704[] = INCBIN_U16("graphics/unknown/unknown_DDD704.bin"); // textbox tilemap??
const u16 gMessageBox_Pal[] = INCBIN_U16("graphics/text_window/message_box.gbapal");

View File

@ -4983,19 +4983,19 @@ static void sub_81B5A8C(u8 spriteId, u16 hp, u16 maxhp)
switch (GetHPBarLevel(hp, maxhp))
{
case HP_BAR_FULL:
sub_80D32C8(&gSprites[spriteId], 0);
SetPartyHPBarSprite(&gSprites[spriteId], 0);
break;
case HP_BAR_GREEN:
sub_80D32C8(&gSprites[spriteId], 1);
SetPartyHPBarSprite(&gSprites[spriteId], 1);
break;
case HP_BAR_YELLOW:
sub_80D32C8(&gSprites[spriteId], 2);
SetPartyHPBarSprite(&gSprites[spriteId], 2);
break;
case HP_BAR_RED:
sub_80D32C8(&gSprites[spriteId], 3);
SetPartyHPBarSprite(&gSprites[spriteId], 3);
break;
default:
sub_80D32C8(&gSprites[spriteId], 4);
SetPartyHPBarSprite(&gSprites[spriteId], 4);
break;
}
}

View File

@ -1302,7 +1302,7 @@ void sub_80D328C(struct Sprite *sprite)
DestroySprite(sprite);
}
void sub_80D32C8(struct Sprite *sprite, u8 animNum)
void SetPartyHPBarSprite(struct Sprite *sprite, u8 animNum)
{
sprite->animNum = animNum;
sprite->animDelayCounter = 0;

View File

@ -1540,7 +1540,7 @@ static const u8 gHandCursorTiles[] = INCBIN_U8("graphics/pokemon_storage/hand_cu
static const u8 gHandCursorShadowTiles[] = INCBIN_U8("graphics/pokemon_storage/hand_cursor_shadow.4bpp");
// code
void sub_80C6D80(const u8 *string, void *dst, u8 arg2, u8 arg3, s32 arg4)
void sub_80C6D80(const u8 *string, void *dst, u8 zero1, u8 zero2, s32 arg4)
{
s32 i, val, val2;
u16 windowId;
@ -1551,14 +1551,14 @@ void sub_80C6D80(const u8 *string, void *dst, u8 arg2, u8 arg3, s32 arg4)
winTemplate.width = 24;
winTemplate.height = 2;
windowId = AddWindow(&winTemplate);
FillWindowPixelBuffer(windowId, PIXEL_FILL(arg3));
FillWindowPixelBuffer(windowId, PIXEL_FILL(zero2));
tileData1 = (u8*) GetWindowAttribute(windowId, WINDOW_TILE_DATA);
tileData2 = (winTemplate.width * 32) + tileData1;
if (!arg2)
txtColor[0] = 0;
if (!zero1)
txtColor[0] = TEXT_COLOR_TRANSPARENT;
else
txtColor[0] = arg3;
txtColor[0] = zero2;
txtColor[1] = 0xF;
txtColor[2] = 0xE;
AddTextPrinterParameterized4(windowId, 1, 0, 1, 0, 0, txtColor, -1, string);
@ -1580,7 +1580,7 @@ void sub_80C6D80(const u8 *string, void *dst, u8 arg2, u8 arg3, s32 arg4)
}
if (val2 > 0)
CpuFill16((arg3 << 4) | arg3, dst, (u32)(val2) * 0x100);
CpuFill16((zero2 << 4) | zero2, dst, (u32)(val2) * 0x100);
RemoveWindow(windowId);
}

File diff suppressed because it is too large Load Diff

View File

@ -2347,8 +2347,8 @@ void sub_8013F90(u8 taskId)
{
memcpy(gUnknown_020321C0, gBlockRecvBuffer[GetMultiplayerId() ^ 1], sizeof(struct MailStruct) * PARTY_SIZE);
ResetBlockReceivedFlags();
gSelectedTradeMonPositions[0] = monId;
gSelectedTradeMonPositions[1] = PARTY_SIZE;
gSelectedTradeMonPositions[TRADE_PLAYER] = monId;
gSelectedTradeMonPositions[TRADE_PARTNER] = PARTY_SIZE;
gMain.savedCallback = CB2_ReturnToField;
SetMainCallback2(sub_807AE50);
sub_801807C(&gUnknown_02022C40);