More trade/union room doc, incidental party_menu doc

This commit is contained in:
GriffinR 2019-10-04 23:31:25 -04:00
parent 6b556900f8
commit dadb1cb9f1
12 changed files with 386 additions and 388 deletions

View File

@ -1032,7 +1032,7 @@ OldaleTown_PokemonCenter_2F_EventScript_27759F:: @ 827759F
hideobjectat EVENT_OBJ_ID_PLAYER, MAP_PETALBURG_CITY hideobjectat EVENT_OBJ_ID_PLAYER, MAP_PETALBURG_CITY
closedoor 5, 1 closedoor 5, 1
waitdooranim waitdooranim
special sub_8018090 special Script_ResetUnionRoomTrade
special SetCableClubWarp special SetCableClubWarp
warpteleport2 MAP_UNION_ROOM, 255, 7, 11 warpteleport2 MAP_UNION_ROOM, 255, 7, 11
waitstate waitstate

View File

@ -432,7 +432,7 @@ gSpecials:: @ 81DBA64
def_special BufferUnionRoomPlayerName def_special BufferUnionRoomPlayerName
def_special sub_801DC20 def_special sub_801DC20
def_special sub_81B8958 def_special sub_81B8958
def_special sub_8018090 def_special Script_ResetUnionRoomTrade
def_special IsBadEggInParty def_special IsBadEggInParty
def_special ValidateReceivedWonderCard def_special ValidateReceivedWonderCard
def_special HasAtLeastOneBerry def_special HasAtLeastOneBerry

View File

@ -48,5 +48,10 @@
#define UR_TRADE_MSG_CANT_TRADE_WITH_PARTNER_1 8 #define UR_TRADE_MSG_CANT_TRADE_WITH_PARTNER_1 8
#define UR_TRADE_MSG_CANT_TRADE_WITH_PARTNER_2 9 #define UR_TRADE_MSG_CANT_TRADE_WITH_PARTNER_2 9
// Return values for CanRegisterMonForTradingBoard
#define CAN_REGISTER_MON 0
#define CANT_REGISTER_MON 1
#define CANT_REGISTER_EGG 2
#endif //GUARD_CONSTANTS_TRADE_H #endif //GUARD_CONSTANTS_TRADE_H

View File

@ -93,12 +93,12 @@ u8 GetCursorSelectionMonId(void);
u8 sub_81B1360(void); u8 sub_81B1360(void);
void sub_81B1370(u8 taskId); void sub_81B1370(u8 taskId);
u8* GetMonNickname(struct Pokemon *mon, u8 *dest); u8* GetMonNickname(struct Pokemon *mon, u8 *dest);
u8 sub_81B1B5C(const u8* str, u8 b); u8 DisplayPartyMenuMessage(const u8* str, u8 b);
bool8 sub_81B1BD4(void); bool8 sub_81B1BD4(void);
void sub_81B1F18(u8 taskId, u8 slot, s8 c, s16 HPDifference, TaskFunc func); void sub_81B1F18(u8 taskId, u8 slot, s8 c, s16 HPDifference, TaskFunc func);
u8 pokemon_ailments_get_primary(u32 status); u8 pokemon_ailments_get_primary(u32 status);
u8 GetMonAilment(struct Pokemon *mon); u8 GetMonAilment(struct Pokemon *mon);
void display_pokemon_menu_message(u32 stringID); void DisplayPartyMenuStdMessage(u32 stringID);
void sub_81B47E0(u8 taskId); void sub_81B47E0(u8 taskId);
bool8 FieldCallback_PrepareFadeInFromMenu(void); bool8 FieldCallback_PrepareFadeInFromMenu(void);
void sub_81B58A8(void); void sub_81B58A8(void);

View File

@ -16,7 +16,7 @@ extern const struct WindowTemplate gUnknown_0833900C;
s32 sub_807A728(void); s32 sub_807A728(void);
void sub_80773AC(void); void sub_80773AC(void);
void sub_807AE50(void); void sub_807AE50(void);
int sub_807A8D0(struct UnkLinkRfuStruct_02022B14Substruct a0, u16, u16, u8); int CanRegisterMonForTradingBoard(struct UnkLinkRfuStruct_02022B14Substruct a0, u16, u16, u8);
int GetUnionRoomTradeMessageId(struct UnkLinkRfuStruct_02022B14Substruct a0, struct UnkLinkRfuStruct_02022B14Substruct a1, u16 a2, u16 a3, u8 a4, u16 a5, u8 a6); int GetUnionRoomTradeMessageId(struct UnkLinkRfuStruct_02022B14Substruct a0, struct UnkLinkRfuStruct_02022B14Substruct a1, u16 a2, u16 a3, u8 a4, u16 a5, u8 a6);
int sub_807A918(struct Pokemon*, u16); int sub_807A918(struct Pokemon*, u16);
void sub_807B140(void); void sub_807B140(void);

View File

@ -135,7 +135,7 @@ union UnkUnion_Main
struct UnkStruct_URoom *uRoom; struct UnkStruct_URoom *uRoom;
}; };
struct TradeUnkStruct struct UnionRoomTrade
{ {
u16 field_0; u16 field_0;
u16 type; u16 type;

View File

@ -51,16 +51,12 @@ const u8 gText_5PlayerMode[] = _("5-PLAYER\nMODE");
const u8 *const gUnknown_082EDB60[][5] = { const u8 *const gUnknown_082EDB60[][5] = {
{ {
gText_1PlayerNeeded, gText_1PlayerNeeded,
gText_2PlayerMode, gText_2PlayerMode
NULL,
NULL,
NULL
}, { }, {
gText_3PlayersNeeded, gText_3PlayersNeeded,
gText_2PlayersNeeded, gText_2PlayersNeeded,
gText_1PlayerNeeded, gText_1PlayerNeeded,
gText_4PlayerMode, gText_4PlayerMode
NULL
}, { }, {
gText_1PlayerNeeded, gText_1PlayerNeeded,
gText_2PlayerMode, gText_2PlayerMode,
@ -77,8 +73,7 @@ const u8 *const gUnknown_082EDB60[][5] = {
gText_1PlayerNeeded, gText_1PlayerNeeded,
gText_2PlayerMode, gText_2PlayerMode,
gText_3PlayerMode, gText_3PlayerMode,
gText_4PlayerMode, gText_4PlayerMode
NULL
} }
}; };
@ -196,55 +191,56 @@ const u8 *const unref_text_ptrs_union_room_2[][2] = {
} }
}; };
ALIGNED(4) const u8 gUnknown_082EE2E8[] = _("Somebody has contacted you.{PAUSE 60}"); ALIGNED(4) const u8 sText_SomebodyHasContactedYou[] = _("Somebody has contacted you.{PAUSE 60}");
ALIGNED(4) const u8 gUnknown_082EE308[] = _("{STR_VAR_1} has contacted you.{PAUSE 60}"); ALIGNED(4) const u8 sText_XHasContactedYou[] = _("{STR_VAR_1} has contacted you.{PAUSE 60}");
const u8 *const gUnknown_082EE324[] = { static const u8 *const gUnknown_082EE324[] = {
gUnknown_082EE2E8, sText_SomebodyHasContactedYou,
gUnknown_082EE308 sText_XHasContactedYou
}; };
ALIGNED(4) const u8 gUnknown_082EE32C[] = _("Awaiting a response from\nthe other TRAINER…"); ALIGNED(4) const u8 sUnionRoom_AwaitingResponseFromTrainer[] = _("Awaiting a response from\nthe other TRAINER…");
ALIGNED(4) const u8 gUnknown_082EE358[] = _("Awaiting a response from\n{STR_VAR_1}…"); ALIGNED(4) const u8 sUnionRoom_AwaitingResponseFromX[] = _("Awaiting a response from\n{STR_VAR_1}…");
const u8 *const gUnknown_082EE378[] = { static const u8 *const sUnionRoomTexts_AwaitingResponse[] = {
gUnknown_082EE32C, sUnionRoom_AwaitingResponseFromTrainer,
gUnknown_082EE358 sUnionRoom_AwaitingResponseFromX
}; };
ALIGNED(4) const u8 gUnionRoom_ShowTrainerCard[] = _("The other TRAINER showed\nyou their TRAINER CARD.\pWould you like to show your\nTRAINER CARD?"); ALIGNED(4) const u8 sText_ShowTrainerCard[] = _("The other TRAINER showed\nyou their TRAINER CARD.\pWould you like to show your\nTRAINER CARD?");
ALIGNED(4) const u8 gUnionRoom_BattleChallenge[] = _("The other TRAINER challenges you\nto battle.\pWill you accept the battle\nchallenge?"); ALIGNED(4) const u8 sText_BattleChallenge[] = _("The other TRAINER challenges you\nto battle.\pWill you accept the battle\nchallenge?");
ALIGNED(4) const u8 gUnionRoom_ChatInvitation[] = _("The other TRAINER invites you\nto chat.\pWill you accept the chat\ninvitation?"); ALIGNED(4) const u8 sText_ChatInvitation[] = _("The other TRAINER invites you\nto chat.\pWill you accept the chat\ninvitation?");
ALIGNED(4) const u8 gUnionRoom_OfferToTradeMon[] = _("There is an offer to trade your\nregistered Lv. {SPECIAL_F7 0x00} {SPECIAL_F7 0x01}\pin exchange for a\nLv. {SPECIAL_F7 0x02} {SPECIAL_F7 0x03}.\pWill you accept this trade\noffer?"); ALIGNED(4) const u8 sText_OfferToTradeMon[] = _("There is an offer to trade your\nregistered Lv. {SPECIAL_F7 0x00} {SPECIAL_F7 0x01}\pin exchange for a\nLv. {SPECIAL_F7 0x02} {SPECIAL_F7 0x03}.\pWill you accept this trade\noffer?");
ALIGNED(4) const u8 gUnionRoom_OfferToTradeEgg[] = _("There is an offer to trade your\nregistered EGG.\lWill you accept this trade offer?"); ALIGNED(4) const u8 sText_OfferToTradeEgg[] = _("There is an offer to trade your\nregistered EGG.\lWill you accept this trade offer?");
ALIGNED(4) const u8 gUnionRoom_ChatDropped[] = _("The chat has been dropped.\p"); ALIGNED(4) const u8 sText_ChatDropped[] = _("The chat has been dropped.\p");
ALIGNED(4) const u8 gUnionRoom_OfferDeclined1[] = _("You declined the offer.\p"); ALIGNED(4) const u8 sText_OfferDeclined1[] = _("You declined the offer.\p");
ALIGNED(4) const u8 gUnionRoom_OfferDeclined2[] = _("You declined the offer.\p"); ALIGNED(4) const u8 sText_OfferDeclined2[] = _("You declined the offer.\p");
ALIGNED(4) const u8 gUnionRoom_ChatEnded[] = _("The chat was ended.\p"); ALIGNED(4) const u8 sText_ChatEnded[] = _("The chat was ended.\p");
const u8 *const unref_text_ptrs_union_room_3[] = { // Unused
gUnionRoom_ShowTrainerCard, static const u8 *const sUnionRoomTexts_Invitation[] = {
gUnionRoom_BattleChallenge, sText_ShowTrainerCard,
gUnionRoom_ChatInvitation, sText_BattleChallenge,
gUnionRoom_OfferToTradeMon sText_ChatInvitation,
sText_OfferToTradeMon
}; };
ALIGNED(4) const u8 gUnknown_082EE5C0[] = _("Oh, hey! We're in a chat right now.\nWant to join us?"); ALIGNED(4) const u8 sText_JoinChatMale[] = _("Oh, hey! We're in a chat right now.\nWant to join us?");
ALIGNED(4) const u8 gUnknown_082EE5F8[] = _("{STR_VAR_1}: Hey, {PLAYER}!\nWe're having a chat right now.\lWant to join us?"); ALIGNED(4) const u8 sText_PlayerJoinChatMale[] = _("{STR_VAR_1}: Hey, {PLAYER}!\nWe're having a chat right now.\lWant to join us?");
ALIGNED(4) const u8 gUnknown_082EE638[] = _("Oh, hi! We're having a chat now.\nWould you like to join us?"); ALIGNED(4) const u8 sText_JoinChatFemale[] = _("Oh, hi! We're having a chat now.\nWould you like to join us?");
ALIGNED(4) const u8 gUnknown_082EE674[] = _("{STR_VAR_1}: Oh, hi, {PLAYER}!\nWe're having a chat now.\lWould you like to join us?"); ALIGNED(4) const u8 sText_PlayerJoinChatFemale[] = _("{STR_VAR_1}: Oh, hi, {PLAYER}!\nWe're having a chat now.\lWould you like to join us?");
const u8 *const gUnknown_082EE6B8[][2] = { const u8 *const sUnionRoomTexts_JoinChat[][GENDER_COUNT] = {
{ {
gUnknown_082EE5C0, sText_JoinChatMale,
gUnknown_082EE638 sText_JoinChatFemale
}, { }, {
gUnknown_082EE5F8, sText_PlayerJoinChatMale,
gUnknown_082EE674 sText_PlayerJoinChatFemale
} }
}; };
ALIGNED(4) const u8 gUnknown_082EE6C8[] = _("……\nThe TRAINER appears to be busy…\p"); ALIGNED(4) const u8 sText_TrainerAppearsBusy[] = _("……\nThe TRAINER appears to be busy…\p");
ALIGNED(4) const u8 gUnknown_082EE6EC[] = _("A battle, huh?\nAll right, just give me some time."); ALIGNED(4) const u8 gUnknown_082EE6EC[] = _("A battle, huh?\nAll right, just give me some time.");
ALIGNED(4) const u8 gUnknown_082EE720[] = _("You want to chat, huh?\nSure, just wait a little."); ALIGNED(4) const u8 gUnknown_082EE720[] = _("You want to chat, huh?\nSure, just wait a little.");
ALIGNED(4) const u8 gUnknown_082EE754[] = _("Sure thing! As my “Greetings,”\nhere's my TRAINER CARD."); ALIGNED(4) const u8 gUnknown_082EE754[] = _("Sure thing! As my “Greetings,”\nhere's my TRAINER CARD.");
@ -323,15 +319,15 @@ const u8 *const gUnknown_082EEB80[] = {
gUnknown_082EEB4C gUnknown_082EEB4C
}; };
ALIGNED(4) const u8 gUnknown_082EEB88[] = _("Whoops! Sorry, but I have to do\nsomething else.\lAnother time, okay?\p"); ALIGNED(4) const u8 sText_TrainerBattleBusy[] = _("Whoops! Sorry, but I have to do\nsomething else.\lAnother time, okay?\p");
ALIGNED(4) const u8 gUnknown_082EEBD0[] = _("If you want to battle, you need\ntwo POKéMON that are below\lLv. 30.\p"); ALIGNED(4) const u8 sText_NeedTwoMonsOfLevel30OrLower1[] = _("If you want to battle, you need\ntwo POKéMON that are below\lLv. 30.\p");
ALIGNED(4) const u8 gUnknown_082EEC14[] = _("For a battle, you need two\nPOKéMON that are below Lv. 30.\p"); ALIGNED(4) const u8 sText_NeedTwoMonsOfLevel30OrLower2[] = _("For a battle, you need two\nPOKéMON that are below Lv. 30.\p");
ALIGNED(4) const u8 gUnknown_082EEC50[] = _("Oh, all right.\nCome see me anytime, okay?\p"); ALIGNED(4) const u8 sText_DeclineBattleMale[] = _("Oh, all right.\nCome see me anytime, okay?\p");
ALIGNED(4) const u8 gUnknown_082EEC7C[] = _("Oh…\nPlease come by anytime.\p"); ALIGNED(4) const u8 sText_DeclineBattleFemale[] = _("Oh…\nPlease come by anytime.\p");
const u8 *const gUnknown_082EEC9C[] = { const u8 *const sUnionRoomTexts_DeclineBattle[GENDER_COUNT] = {
gUnknown_082EEC50, [MALE] = sText_DeclineBattleMale,
gUnknown_082EEC7C [FEMALE] = sText_DeclineBattleFemale
}; };
ALIGNED(4) const u8 gUnknown_082EECA4[] = _("Oh, sorry!\nI just can't right this instant.\lLet's chat another time.\p"); ALIGNED(4) const u8 gUnknown_082EECA4[] = _("Oh, sorry!\nI just can't right this instant.\lLet's chat another time.\p");
@ -351,13 +347,16 @@ ALIGNED(4) const u8 gUnknown_082EEE24[] = _("That's it!\nThis is the right move
ALIGNED(4) const u8 gUnknown_082EEE4C[] = _("That's awesome!\nYou can battle that way?\p"); ALIGNED(4) const u8 gUnknown_082EEE4C[] = _("That's awesome!\nYou can battle that way?\p");
ALIGNED(4) const u8 gUnknown_082EEE78[] = _("You have exquisite timing for\nswitching POKéMON!\p"); ALIGNED(4) const u8 gUnknown_082EEE78[] = _("You have exquisite timing for\nswitching POKéMON!\p");
const u8 *const gUnknown_082EEEAC[][4] = { const u8 *const gUnknown_082EEEAC[GENDER_COUNT][4] = {
[MALE] =
{ {
gUnknown_082EED44, gUnknown_082EED44,
gUnknown_082EED6C, gUnknown_082EED6C,
gUnknown_082EED98, gUnknown_082EED98,
gUnknown_082EEDBC gUnknown_082EEDBC
}, { },
[FEMALE] =
{
gUnknown_082EEDF4, gUnknown_082EEDF4,
gUnknown_082EEE24, gUnknown_082EEE24,
gUnknown_082EEE4C, gUnknown_082EEE4C,
@ -374,13 +373,16 @@ ALIGNED(4) const u8 gUnknown_082EEFA0[] = _("Ahaha!\nWhat is that about?\p");
ALIGNED(4) const u8 gUnknown_082EEFBC[] = _("Yes, that's exactly it!\nThat's what I meant.\p"); ALIGNED(4) const u8 gUnknown_082EEFBC[] = _("Yes, that's exactly it!\nThat's what I meant.\p");
ALIGNED(4) const u8 gUnknown_082EEFEC[] = _("In other words…\nYes! That's right!\p"); ALIGNED(4) const u8 gUnknown_082EEFEC[] = _("In other words…\nYes! That's right!\p");
const u8 *const gUnknown_082EF010[][4] = { const u8 *const gUnknown_082EF010[GENDER_COUNT][4] = {
[MALE] =
{ {
gUnknown_082EEECC, gUnknown_082EEECC,
gUnknown_082EEEF0, gUnknown_082EEEF0,
gUnknown_082EEF2C, gUnknown_082EEF2C,
gUnknown_082EEF50 gUnknown_082EEF50
}, { },
[FEMALE] =
{
gUnknown_082EEF7C, gUnknown_082EEF7C,
gUnknown_082EEFA0, gUnknown_082EEFA0,
gUnknown_082EEFBC, gUnknown_082EEFBC,
@ -393,65 +395,68 @@ ALIGNED(4) const u8 gUnknown_082EF06C[] = _("I hope I get to know you better!\p"
ALIGNED(4) const u8 gUnknown_082EF090[] = _("We're showing each other our\nTRAINER CARDS to get acquainted.\p"); ALIGNED(4) const u8 gUnknown_082EF090[] = _("We're showing each other our\nTRAINER CARDS to get acquainted.\p");
ALIGNED(4) const u8 gUnknown_082EF0D0[] = _("Glad to meet you.\nPlease don't be a stranger!\p"); ALIGNED(4) const u8 gUnknown_082EF0D0[] = _("Glad to meet you.\nPlease don't be a stranger!\p");
const u8 *const gUnknown_082EF100[][2] = { const u8 *const gUnknown_082EF100[GENDER_COUNT][2] = {
[MALE] =
{ {
gUnknown_082EF030, gUnknown_082EF030,
gUnknown_082EF06C gUnknown_082EF06C
}, { },
[FEMALE] =
{
gUnknown_082EF090, gUnknown_082EF090,
gUnknown_082EF0D0 gUnknown_082EF0D0
} }
}; };
ALIGNED(4) const u8 gUnknown_082EF110[] = _("Yeahah!\nI really wanted this POKéMON!\p"); ALIGNED(4) const u8 sText_MaleTraded1[] = _("Yeahah!\nI really wanted this POKéMON!\p");
ALIGNED(4) const u8 gUnknown_082EF138[] = _("Finally, a trade got me that\nPOKéMON I'd wanted a long time.\p"); ALIGNED(4) const u8 sText_MaleTraded2[] = _("Finally, a trade got me that\nPOKéMON I'd wanted a long time.\p");
ALIGNED(4) const u8 gUnknown_082EF178[] = _("I'm trading POKéMON right now.\p"); ALIGNED(4) const u8 sText_FemaleTraded1[] = _("I'm trading POKéMON right now.\p");
ALIGNED(4) const u8 gUnknown_082EF198[] = _("I finally got that POKéMON I\nwanted in a trade!\p"); ALIGNED(4) const u8 sText_FemaleTraded2[] = _("I finally got that POKéMON I\nwanted in a trade!\p");
const u8 *const gUnknown_082EF1CC[][4] = { const u8 *const sUnionRoomTexts_Traded[GENDER_COUNT][4] = {
[MALE] =
{ {
gUnknown_082EF110, sText_MaleTraded1,
gUnknown_082EF138, sText_MaleTraded2
NULL, },
NULL [FEMALE] =
}, { {
gUnknown_082EF178, sText_FemaleTraded1,
gUnknown_082EF198, sText_FemaleTraded2
NULL,
NULL
} }
}; };
ALIGNED(4) const u8 gUnknown_082EF1EC[] = _("{STR_VAR_1} checked the\nTRADING BOARD.\p"); ALIGNED(4) const u8 sText_XCheckedTradingBoard[] = _("{STR_VAR_1} checked the\nTRADING BOARD.\p");
ALIGNED(4) const u8 gUnknown_082EF20C[] = _("Welcome to the TRADING BOARD.\pYou may register your POKéMON\nand offer it up for a trade.\pWould you like to register one of\nyour POKéMON?"); ALIGNED(4) const u8 sText_RegisterMonAtTradingBoard[] = _("Welcome to the TRADING BOARD.\pYou may register your POKéMON\nand offer it up for a trade.\pWould you like to register one of\nyour POKéMON?");
ALIGNED(4) const u8 gUnknown_082EF298[] = _("This TRADING BOARD is used for\noffering a POKéMON for a trade.\pAll you need to do is register a\nPOKéMON for a trade.\pAnother TRAINER may offer a party\nPOKéMON in return for the trade.\pWe hope you will register POKéMON\nand trade them with many, many\lother TRAINERS.\pWould you like to register one of\nyour POKéMON?"); ALIGNED(4) const u8 sText_TradingBoardInfo[] = _("This TRADING BOARD is used for\noffering a POKéMON for a trade.\pAll you need to do is register a\nPOKéMON for a trade.\pAnother TRAINER may offer a party\nPOKéMON in return for the trade.\pWe hope you will register POKéMON\nand trade them with many, many\lother TRAINERS.\pWould you like to register one of\nyour POKéMON?");
ALIGNED(4) const u8 unref_text_union_room_6[] = _("We have registered your POKéMON for\ntrade on the TRADING BOARD.\pThank you for using this service!\p"); ALIGNED(4) const u8 sText_ThankYouForRegistering[] = _("We have registered your POKéMON for\ntrade on the TRADING BOARD.\pThank you for using this service!\p"); // unused
ALIGNED(4) const u8 unref_text_union_room_7[] = _("Nobody has registered any POKéMON\nfor trade on the TRADING BOARD.\p\n"); ALIGNED(4) const u8 sText_NobodyHasRegistered[] = _("Nobody has registered any POKéMON\nfor trade on the TRADING BOARD.\p\n"); // unused
ALIGNED(4) const u8 gUnknown_082EF47C[] = _("Please choose the type of POKéMON\nthat you would like in the trade.\n"); ALIGNED(4) const u8 sText_ChooseRequestedMonType[] = _("Please choose the type of POKéMON\nthat you would like in the trade.\n");
ALIGNED(4) const u8 gUnknown_082EF4C4[] = _("Which of your party POKéMON will\nyou offer in trade?\p"); ALIGNED(4) const u8 sText_WhichMonWillYouOffer[] = _("Which of your party POKéMON will\nyou offer in trade?\p");
ALIGNED(4) const u8 gUnknown_082EF4FC[] = _("Registration has been canceled.\p"); ALIGNED(4) const u8 sText_RegistrationCanceled[] = _("Registration has been canceled.\p");
ALIGNED(4) const u8 gUnknown_082EF520[] = _("Registration has been completed.\p"); ALIGNED(4) const u8 sText_RegistraionCompleted[] = _("Registration has been completed.\p");
ALIGNED(4) const u8 gUnknown_082EF544[] = _("The trade has been canceled.\p"); ALIGNED(4) const u8 sText_TradeCanceled[] = _("The trade has been canceled.\p");
ALIGNED(4) const u8 gUnknown_082EF564[] = _("Cancel the registration of your\nLv. {STR_VAR_2} {STR_VAR_1}?"); ALIGNED(4) const u8 sText_CancelRegistrationOfMon[] = _("Cancel the registration of your\nLv. {STR_VAR_2} {STR_VAR_1}?");
ALIGNED(4) const u8 gUnknown_082EF590[] = _("Cancel the registration of your\nEGG?"); ALIGNED(4) const u8 sText_CancelRegistrationOfEgg[] = _("Cancel the registration of your\nEGG?");
ALIGNED(4) const u8 gUnknown_082EF5B8[] = _("The registration has been canceled.\p"); ALIGNED(4) const u8 sText_RegistrationCanceled2[] = _("The registration has been canceled.\p");
ALIGNED(4) const u8 unref_text_union_room_8[] = _("TRAINERS wishing to make a trade\nwill be listed."); ALIGNED(4) const u8 sText_TradeTrainersWillBeListed[] = _("TRAINERS wishing to make a trade\nwill be listed."); // unused
ALIGNED(4) const u8 unref_text_union_room_9[] = _("Please choose the TRAINER with whom\nyou would like to trade POKéMON."); ALIGNED(4) const u8 sText_ChooseTrainerToTradeWith[] = _("Please choose the TRAINER with whom\nyou would like to trade POKéMON."); // unused
ALIGNED(4) const u8 gUnknown_082EF65C[] = _("Would you like to ask {STR_VAR_1} to\nmake a trade?"); ALIGNED(4) const u8 sText_AskTrainerToMakeTrade[] = _("Would you like to ask {STR_VAR_1} to\nmake a trade?");
ALIGNED(4) const u8 unref_text_union_room_10[] = _("Awaiting a response from\nthe other TRAINER…"); ALIGNED(4) const u8 sText_AwaitingResponseFromTrainer[] = _("Awaiting a response from\nthe other TRAINER…"); // unused
ALIGNED(4) const u8 unref_text_union_room_11[] = _("You have not registered a POKéMON\nfor trading.\p"); ALIGNED(4) const u8 sText_NotRegisteredAMonForTrade[] = _("You have not registered a POKéMON\nfor trading.\p"); // unused
ALIGNED(4) const u8 gUnknown_082EF6E4[] = _("You don't have a {STR_VAR_2}-type\nPOKéMON that {STR_VAR_1} wants.\p"); ALIGNED(4) const u8 sText_DontHaveTypeTrainerWants[] = _("You don't have a {STR_VAR_2}-type\nPOKéMON that {STR_VAR_1} wants.\p");
ALIGNED(4) const u8 gUnknown_082EF718[] = _("You don't have an EGG that\n{STR_VAR_1} wants.\p"); ALIGNED(4) const u8 sText_DontHaveEggTrainerWants[] = _("You don't have an EGG that\n{STR_VAR_1} wants.\p");
ALIGNED(4) const u8 gUnknown_082EF740[] = _("{STR_VAR_1} can't make a trade for\nyour POKéMON right now.\p"); ALIGNED(4) const u8 sText_CantTradeMonRightNow[] = _("{STR_VAR_1} can't make a trade for\nyour POKéMON right now.\p");
ALIGNED(4) const u8 gUnknown_082EF774[] = _("You can't make a trade for\n{STR_VAR_1}'s POKéMON right now.\p"); ALIGNED(4) const u8 sText_CantTradePartnersMonRightNow[] = _("You can't make a trade for\n{STR_VAR_1}'s POKéMON right now.\p");
const u8 *const unref_text_ptrs_union_room_4[] = { // unused
gUnknown_082EF740, const u8 *const sUnionRoomTexts_CantTradeRightNow[] = {
gUnknown_082EF774 sText_CantTradeMonRightNow,
sText_CantTradePartnersMonRightNow
}; };
ALIGNED(4) const u8 gUnknown_082EF7B0[] = _("Your trade offer was rejected.\p"); ALIGNED(4) const u8 sText_TradeOfferRejected[] = _("Your trade offer was rejected.\p");
ALIGNED(4) const u8 gUnknown_082EF7D0[] = _("EGG TRADE"); ALIGNED(4) const u8 sText_EggTrade[] = _("EGG TRADE");
ALIGNED(4) const u8 gUnknown_082EF7DC[] = _("{DPAD_UPDOWN}CHOOSE {A_BUTTON}JOIN {B_BUTTON}CANCEL"); ALIGNED(4) const u8 gUnknown_082EF7DC[] = _("{DPAD_UPDOWN}CHOOSE {A_BUTTON}JOIN {B_BUTTON}CANCEL");
ALIGNED(4) const u8 gUnknown_082EF7F8[] = _("Please choose a TRAINER."); ALIGNED(4) const u8 gUnknown_082EF7F8[] = _("Please choose a TRAINER.");
ALIGNED(4) const u8 gUnknown_082EF814[] = _("Please choose a TRAINER for\na SINGLE BATTLE."); ALIGNED(4) const u8 gUnknown_082EF814[] = _("Please choose a TRAINER for\na SINGLE BATTLE.");

View File

@ -34,7 +34,7 @@ void sub_8161560(u8 taskId)
gUnknown_0203CEC8.unkB = 0xA; gUnknown_0203CEC8.unkB = 0xA;
gUnknown_0203CEC8.unkA = gUnknown_0203CEC8.slotId; gUnknown_0203CEC8.unkA = gUnknown_0203CEC8.slotId;
sub_81B0FCC(GetCursorSelectionMonId(), 0x1); sub_81B0FCC(GetCursorSelectionMonId(), 0x1);
display_pokemon_menu_message(0x5); DisplayPartyMenuStdMessage(5);
gTasks[taskId].func = sub_81B1370; gTasks[taskId].func = sub_81B1370;
} }
@ -47,7 +47,7 @@ void sub_81615A8(u8 taskId)
if(pokemonIndex > 6) if(pokemonIndex > 6)
{ {
gUnknown_0203CEC8.unkB = 0; gUnknown_0203CEC8.unkB = 0;
display_pokemon_menu_message(0x0); DisplayPartyMenuStdMessage(0);
gTasks[taskId].func = sub_81B1370; gTasks[taskId].func = sub_81B1370;
return; return;
} }
@ -73,7 +73,7 @@ static void sub_81616C0(u8 taskId)
{ {
GetMonNickname(&gPlayerParty[gUnknown_0203CEC8.unkA], gStringVar1); GetMonNickname(&gPlayerParty[gUnknown_0203CEC8.unkA], gStringVar1);
StringExpandPlaceholders(gStringVar4, gText_PkmnHPRestoredByVar2); StringExpandPlaceholders(gStringVar4, gText_PkmnHPRestoredByVar2);
sub_81B1B5C(gStringVar4, 0); DisplayPartyMenuMessage(gStringVar4, 0);
schedule_bg_copy_tilemap_to_vram(2); schedule_bg_copy_tilemap_to_vram(2);
gTasks[taskId].func = sub_8161724; gTasks[taskId].func = sub_8161724;
} }
@ -88,7 +88,7 @@ static void sub_8161724(u8 taskId)
sub_81B0FCC(gUnknown_0203CEC8.unkA, 1); sub_81B0FCC(gUnknown_0203CEC8.unkA, 1);
ClearStdWindowAndFrameToTransparent(0x6, FALSE); ClearStdWindowAndFrameToTransparent(0x6, FALSE);
ClearWindowTilemap(0x6); ClearWindowTilemap(0x6);
display_pokemon_menu_message(0); DisplayPartyMenuStdMessage(0);
gTasks[taskId].func = sub_81B1370; gTasks[taskId].func = sub_81B1370;
} }
@ -96,14 +96,14 @@ static void sub_8161784(u8 taskId)
{ {
if(sub_81B1BD4() == 1) if(sub_81B1BD4() == 1)
return; return;
display_pokemon_menu_message(0x5); DisplayPartyMenuStdMessage(5);
gTasks[taskId].func = sub_81B1370; gTasks[taskId].func = sub_81B1370;
} }
static void sub_81617B8(u8 taskId) static void sub_81617B8(u8 taskId)
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
sub_81B1B5C(gText_CantBeUsedOnPkmn, 0); DisplayPartyMenuMessage(gText_CantBeUsedOnPkmn, 0);
schedule_bg_copy_tilemap_to_vram(2); schedule_bg_copy_tilemap_to_vram(2);
gTasks[taskId].func = sub_8161784; gTasks[taskId].func = sub_8161784;
} }

View File

@ -4255,11 +4255,11 @@ void sub_8010FA0(bool32 a0, bool32 a1)
gUnknown_02022B14.unk_00.unk_00_5 = a1; gUnknown_02022B14.unk_00.unk_00_5 = a1;
} }
void sub_8010FCC(u32 a0, u32 a1, u32 a2) void sub_8010FCC(u32 type, u32 species, u32 level)
{ {
gUnknown_02022B14.type = a0; gUnknown_02022B14.type = type;
gUnknown_02022B14.species = a1; gUnknown_02022B14.species = species;
gUnknown_02022B14.level = a2; gUnknown_02022B14.level = level;
} }
u8 sub_801100C(s32 a0) u8 sub_801100C(s32 a0)

File diff suppressed because it is too large Load Diff

View File

@ -2558,31 +2558,24 @@ int GetUnionRoomTradeMessageId(struct UnkLinkRfuStruct_02022B14Substruct a0, str
return UR_TRADE_MSG_NONE; return UR_TRADE_MSG_NONE;
} }
int sub_807A8D0(struct UnkLinkRfuStruct_02022B14Substruct a0, u16 species2, u16 species, u8 isObedientBitSet) int CanRegisterMonForTradingBoard(struct UnkLinkRfuStruct_02022B14Substruct a0, u16 species2, u16 species, u8 isObedientBitSet)
{ {
u8 unk = a0.hasNationalDex; bool8 hasNationalDex = a0.hasNationalDex;
if (IsDeoxysOrMewUntradable(species, isObedientBitSet)) if (IsDeoxysOrMewUntradable(species, isObedientBitSet))
{ return CANT_REGISTER_MON;
return 1;
}
if (unk) if (hasNationalDex)
{ return CAN_REGISTER_MON;
return 0;
}
// Eggs can only be traded if the player has the National Dex
if (species2 == SPECIES_EGG) if (species2 == SPECIES_EGG)
{ return CANT_REGISTER_EGG;
return 2;
}
if (IsSpeciesInHoennDex(species2)) if (IsSpeciesInHoennDex(species2))
{ return CAN_REGISTER_MON;
return 0;
}
return 1; return CANT_REGISTER_MON;
} }
// r6/r7 flip. Ugh. // r6/r7 flip. Ugh.

View File

@ -58,7 +58,7 @@ EWRAM_DATA u32 gFiller_02022C34 = 0;
EWRAM_DATA struct UnkLinkRfuStruct_02022B14Substruct gUnknown_02022C38 = {}; EWRAM_DATA struct UnkLinkRfuStruct_02022B14Substruct gUnknown_02022C38 = {};
EWRAM_DATA u16 gUnionRoomOfferedSpecies = 0; EWRAM_DATA u16 gUnionRoomOfferedSpecies = 0;
EWRAM_DATA u8 gUnionRoomRequestedMonType = 0; EWRAM_DATA u8 gUnionRoomRequestedMonType = 0;
EWRAM_DATA struct TradeUnkStruct gUnknown_02022C40 = {}; static EWRAM_DATA struct UnionRoomTrade sUnionRoomTrade = {};
// IWRAM vars // IWRAM vars
static struct UnkStruct_Leader *gUnknown_03000DA0; static struct UnkStruct_Leader *gUnknown_03000DA0;
@ -96,8 +96,8 @@ void sub_8013BD8(struct UnkStruct_Group *arg0, s32 id);
void sub_80173D4(void); void sub_80173D4(void);
void sub_80177B8(u8 arg0, u8 arg1, u8 arg2, struct UnkStruct_x20 *arg3, u8 arg4, u8 id); void sub_80177B8(u8 arg0, u8 arg1, u8 arg2, struct UnkStruct_x20 *arg3, u8 arg4, u8 id);
bool32 sub_8017678(struct UnkStruct_Shared *arg0, struct UnkStruct_Shared *arg1); bool32 sub_8017678(struct UnkStruct_Shared *arg0, struct UnkStruct_Shared *arg1);
u32 sub_8018120(struct TradeUnkStruct *arg0, u8 multiplayerId); static u32 GetPartyPositionOfRegisteredMon(struct UnionRoomTrade *arg0, u8 multiplayerId);
void sub_801807C(struct TradeUnkStruct *arg0); static void ResetUnionRoomTrade(struct UnionRoomTrade *arg0);
void sub_801AC54(void); void sub_801AC54(void);
void sub_80149D8(void); void sub_80149D8(void);
void MG_DrawTextBorder(u8 windowId); void MG_DrawTextBorder(u8 windowId);
@ -105,8 +105,8 @@ s8 mevent_message_print_and_prompt_yes_no(u8 *textState, u8 *arg1, u8 arg2, cons
bool32 sub_8016F1C(struct UnkLinkRfuStruct_02022B14 *arg0, s16 arg1); bool32 sub_8016F1C(struct UnkLinkRfuStruct_02022B14 *arg0, s16 arg1);
u8 sub_8016DF0(struct UnkStruct_Main4 *arg0, struct UnkStruct_Main4 *arg1, u32 arg2); u8 sub_8016DF0(struct UnkStruct_Main4 *arg0, struct UnkStruct_Main4 *arg1, u32 arg2);
void sub_8019F2C(void); void sub_8019F2C(void);
bool32 sub_80180A0(u32 monId, struct TradeUnkStruct *arg1); static bool32 RegisterTradeMonAndGetIsEgg(u32 monId, struct UnionRoomTrade *trade);
void sub_80180E8(u32 monId, struct TradeUnkStruct *arg1); static void RegisterTradeMon(u32 monId, struct UnionRoomTrade *arg1);
void sub_80181CC(void); void sub_80181CC(void);
bool32 sub_8017940(void); bool32 sub_8017940(void);
u8 sub_8016B00(void); u8 sub_8016B00(void);
@ -122,7 +122,7 @@ void sub_801818C(bool32 arg0);
s32 sub_8017178(u8 *arg0, u8 *arg1, u8 *arg2, const struct WindowTemplate *winTemplate, const struct ListMenuTemplate *menuTemplate); s32 sub_8017178(u8 *arg0, u8 *arg1, u8 *arg2, const struct WindowTemplate *winTemplate, const struct ListMenuTemplate *menuTemplate);
s32 sub_80172A0(u8 *arg0, u8 *arg1, u8 *arg2, u8 *arg3, const struct WindowTemplate *winTemplate, const struct ListMenuTemplate *menuTemplate, struct UnkStruct_Main0 *arg6); s32 sub_80172A0(u8 *arg0, u8 *arg1, u8 *arg2, u8 *arg3, const struct WindowTemplate *winTemplate, const struct ListMenuTemplate *menuTemplate, struct UnkStruct_Main0 *arg6);
s32 sub_8017CB0(struct UnkStruct_x20 * arg, s32 arg1); s32 sub_8017CB0(struct UnkStruct_x20 * arg, s32 arg1);
bool32 sub_8018024(void); bool32 HasAtLeastTwoMonsOfLevel30OrLower(void);
u32 sub_8017984(s32 arg0); u32 sub_8017984(s32 arg0);
void sub_8018220(u8 *unused, struct UnkStruct_URoom *arg1, bool8 arg2); void sub_8018220(u8 *unused, struct UnkStruct_URoom *arg1, bool8 arg2);
void sub_8017D9C(u8 *dst, s32 arg1, u32 playerGender); void sub_8017D9C(u8 *dst, s32 arg1, u32 playerGender);
@ -601,11 +601,11 @@ void sub_8013078(u8 *dst, u8 caseId)
{ {
case 65: case 65:
case 68: case 68:
StringExpandPlaceholders(dst, gUnionRoom_OfferDeclined1); StringExpandPlaceholders(dst, sText_OfferDeclined1);
break; break;
case 69: case 69:
case 72: case 72:
StringExpandPlaceholders(dst, gUnionRoom_OfferDeclined2); StringExpandPlaceholders(dst, sText_OfferDeclined2);
break; break;
} }
} }
@ -1282,7 +1282,7 @@ u8 sub_8013F78(void)
void sub_8013F90(u8 taskId) void sub_8013F90(u8 taskId)
{ {
u32 monId = sub_8018120(&gUnknown_02022C40, GetMultiplayerId()); u32 monId = GetPartyPositionOfRegisteredMon(&sUnionRoomTrade, GetMultiplayerId());
switch (gTasks[taskId].data[0]) switch (gTasks[taskId].data[0])
{ {
@ -1313,7 +1313,7 @@ void sub_8013F90(u8 taskId)
gSelectedTradeMonPositions[TRADE_PARTNER] = PARTY_SIZE; gSelectedTradeMonPositions[TRADE_PARTNER] = PARTY_SIZE;
gMain.savedCallback = CB2_ReturnToField; gMain.savedCallback = CB2_ReturnToField;
SetMainCallback2(sub_807AE50); SetMainCallback2(sub_807AE50);
sub_801807C(&gUnknown_02022C40); ResetUnionRoomTrade(&sUnionRoomTrade);
DestroyTask(taskId); DestroyTask(taskId);
} }
break; break;
@ -2296,7 +2296,7 @@ void sub_80156E0(u8 taskId)
break; break;
case 2: case 2:
sub_8010F84(0x40, 0, 0); sub_8010F84(0x40, 0, 0);
sub_8010FCC(gUnknown_02022C40.type, gUnknown_02022C40.playerSpecies, gUnknown_02022C40.playerLevel); sub_8010FCC(sUnionRoomTrade.type, sUnionRoomTrade.playerSpecies, sUnionRoomTrade.playerLevel);
sub_800B488(); sub_800B488();
OpenLink(); OpenLink();
sub_8011C84(); sub_8011C84();
@ -2307,22 +2307,22 @@ void sub_80156E0(u8 taskId)
data->state = 3; data->state = 3;
break; break;
case 3: case 3:
if ((sub_81B1360() == 8 || sub_81B1360() == 9) && gUnknown_02022C40.field_0 != 0) if ((sub_81B1360() == 8 || sub_81B1360() == 9) && sUnionRoomTrade.field_0 != 0)
{ {
id = GetCursorSelectionMonId(); id = GetCursorSelectionMonId();
switch (gUnknown_02022C40.field_0) switch (sUnionRoomTrade.field_0)
{ {
case 1: case 1:
sub_8011090(0x54, 0, 1); sub_8011090(0x54, 0, 1);
if (id >= PARTY_SIZE) if (id >= PARTY_SIZE)
{ {
sub_801807C(&gUnknown_02022C40); ResetUnionRoomTrade(&sUnionRoomTrade);
sub_8010FCC(0, 0, 0); sub_8010FCC(0, 0, 0);
sub_801568C(gUnknown_082EF4FC); sub_801568C(sText_RegistrationCanceled);
} }
else if (!sub_80180A0(GetCursorSelectionMonId(), &gUnknown_02022C40)) else if (!RegisterTradeMonAndGetIsEgg(GetCursorSelectionMonId(), &sUnionRoomTrade))
{ {
sub_8015664(0x34, gUnknown_082EF47C); sub_8015664(0x34, sText_ChooseRequestedMonType);
} }
else else
{ {
@ -2331,21 +2331,21 @@ void sub_80156E0(u8 taskId)
break; break;
case 2: case 2:
sub_80156C8(data); sub_80156C8(data);
taskData[1] = gUnknown_02022C40.field_8; taskData[1] = sUnionRoomTrade.field_8;
if (id >= PARTY_SIZE) if (id >= PARTY_SIZE)
{ {
sub_801568C(gUnknown_082EF544); sub_801568C(sText_TradeCanceled);
} }
else else
{ {
sub_8011090(0x54, 0, 1); sub_8011090(0x54, 0, 1);
gUnknown_02022C2C = 0x44; gUnknown_02022C2C = 0x44;
sub_80180E8(GetCursorSelectionMonId(), &gUnknown_02022C40); RegisterTradeMon(GetCursorSelectionMonId(), &sUnionRoomTrade);
data->state = 51; data->state = 51;
} }
break; break;
} }
gUnknown_02022C40.field_0 = 0; sUnionRoomTrade.field_0 = 0;
} }
else else
{ {
@ -2453,9 +2453,9 @@ void sub_80156E0(u8 taskId)
case 1: case 1:
case 2: case 2:
if (sub_8011B90() == TRUE) if (sub_8011B90() == TRUE)
sub_801568C(gUnknown_082EE6C8); sub_801568C(sText_TrainerAppearsBusy);
else else
sub_8015664(30, gUnknown_082EE6C8); sub_8015664(30, sText_TrainerAppearsBusy);
gUnknown_02022C2C = 0x40; gUnknown_02022C2C = 0x40;
break; break;
@ -2513,9 +2513,9 @@ void sub_80156E0(u8 taskId)
{ {
gUnknown_02022C2C = var5; gUnknown_02022C2C = var5;
gUnknown_02022C2D = (u32)(var5) >> 8; gUnknown_02022C2D = (u32)(var5) >> 8;
if (gUnknown_02022C2C == 0x41 && !sub_8018024()) if (gUnknown_02022C2C == 0x41 && !HasAtLeastTwoMonsOfLevel30OrLower())
{ {
sub_8015664(5, gUnknown_082EEBD0); sub_8015664(5, sText_NeedTwoMonsOfLevel30OrLower1);
} }
else else
{ {
@ -2528,7 +2528,7 @@ void sub_80156E0(u8 taskId)
} }
break; break;
case 28: case 28:
StringCopy(gStringVar4, gUnknown_082EEB88); StringCopy(gStringVar4, sText_TrainerBattleBusy);
data->state = 36; data->state = 36;
break; break;
case 27: case 27:
@ -2547,15 +2547,15 @@ void sub_80156E0(u8 taskId)
break; break;
case 31: case 31:
data->field_4C[0] = 0x44; data->field_4C[0] = 0x44;
data->field_4C[1] = gUnknown_02022C40.species; data->field_4C[1] = sUnionRoomTrade.species;
data->field_4C[2] = gUnknown_02022C40.level; data->field_4C[2] = sUnionRoomTrade.level;
sub_800FE50(data->field_4C); sub_800FE50(data->field_4C);
data->state = 29; data->state = 29;
break; break;
case 29: case 29:
if (gReceivedRemoteLinkPlayers == 0) if (gReceivedRemoteLinkPlayers == 0)
{ {
StringCopy(gStringVar4, gUnknown_082EEB88); StringCopy(gStringVar4, sText_TrainerBattleBusy);
data->state = 28; data->state = 28;
} }
else else
@ -2603,7 +2603,7 @@ void sub_80156E0(u8 taskId)
{ {
StringCopy(gStringVar1, gLinkPlayers[GetMultiplayerId() ^ 1].name); StringCopy(gStringVar1, gLinkPlayers[GetMultiplayerId() ^ 1].name);
id = sub_800E540(gLinkPlayers[1].trainerId, gLinkPlayers[1].name); id = sub_800E540(gLinkPlayers[1].trainerId, gLinkPlayers[1].name);
StringExpandPlaceholders(gStringVar4, gUnknown_082EE378[id]); StringExpandPlaceholders(gStringVar4, sUnionRoomTexts_AwaitingResponse[id]);
data->state = 33; data->state = 33;
} }
else else
@ -2627,7 +2627,7 @@ void sub_80156E0(u8 taskId)
case 1: case 1:
case -1: case -1:
playerGender = sub_8017CF8(taskData[1], data->field_0); playerGender = sub_8017CF8(taskData[1], data->field_0);
sub_801568C(gUnknown_082EEC9C[playerGender]); sub_801568C(sUnionRoomTexts_DeclineBattle[playerGender]);
break; break;
} }
break; break;
@ -2712,7 +2712,7 @@ void sub_80156E0(u8 taskId)
if (sub_80168DC(data) && gMain.newKeys & B_BUTTON) if (sub_80168DC(data) && gMain.newKeys & B_BUTTON)
{ {
sub_8011DE0(1); sub_8011DE0(1);
StringCopy(gStringVar4, gUnionRoom_ChatEnded); StringCopy(gStringVar4, sText_ChatEnded);
data->state = 36; data->state = 36;
} }
break; break;
@ -2733,12 +2733,12 @@ void sub_80156E0(u8 taskId)
taskData[3] = 0; taskData[3] = 0;
if (gUnknown_02022C2C == 0x41) if (gUnknown_02022C2C == 0x41)
{ {
if (!sub_8018024()) if (!HasAtLeastTwoMonsOfLevel30OrLower())
{ {
data->field_4C[0] = 0x52; data->field_4C[0] = 0x52;
sub_800FE50(data->field_4C); sub_800FE50(data->field_4C);
data->state = 10; data->state = 10;
StringCopy(gStringVar4, gUnknown_082EEC14); StringCopy(gStringVar4, sText_NeedTwoMonsOfLevel30OrLower2);
} }
else else
{ {
@ -2828,19 +2828,19 @@ void sub_80156E0(u8 taskId)
{ {
if (sub_800F7DC()->species == SPECIES_EGG) if (sub_800F7DC()->species == SPECIES_EGG)
{ {
StringCopy(gStringVar4, gUnknown_082EF590); StringCopy(gStringVar4, sText_CancelRegistrationOfEgg);
} }
else else
{ {
StringCopy(gStringVar1, gSpeciesNames[sub_800F7DC()->species]); StringCopy(gStringVar1, gSpeciesNames[sub_800F7DC()->species]);
ConvertIntToDecimalStringN(gStringVar2, sub_800F7DC()->level, STR_CONV_MODE_LEFT_ALIGN, 3); ConvertIntToDecimalStringN(gStringVar2, sub_800F7DC()->level, STR_CONV_MODE_LEFT_ALIGN, 3);
StringExpandPlaceholders(gStringVar4, gUnknown_082EF564); StringExpandPlaceholders(gStringVar4, sText_CancelRegistrationOfMon);
} }
sub_8015664(44, gStringVar4); sub_8015664(44, gStringVar4);
} }
break; break;
case 43: case 43:
if (PrintOnTextbox(&data->textState, gUnknown_082EF20C)) if (PrintOnTextbox(&data->textState, sText_RegisterMonAtTradingBoard))
data->state = 47; data->state = 47;
break; break;
case 47: case 47:
@ -2856,11 +2856,11 @@ void sub_80156E0(u8 taskId)
{ {
switch (var5) switch (var5)
{ {
case 1: case 1: // REGISTER
sub_8015664(53, gUnknown_082EF4C4); sub_8015664(53, sText_WhichMonWillYouOffer);
break; break;
case 2: case 2: // INFO
sub_8015664(47, gUnknown_082EF298); sub_8015664(47, sText_TradingBoardInfo);
break; break;
} }
} }
@ -2873,7 +2873,7 @@ void sub_80156E0(u8 taskId)
case 54: case 54:
if (!gPaletteFade.active) if (!gPaletteFade.active)
{ {
gUnknown_02022C40.field_0 = 1; sUnionRoomTrade.field_0 = 1;
gFieldCallback = sub_80AF128; gFieldCallback = sub_80AF128;
sub_81B8904(8, CB2_ReturnToField); sub_81B8904(8, CB2_ReturnToField);
} }
@ -2886,20 +2886,20 @@ void sub_80156E0(u8 taskId)
{ {
case -2: case -2:
case 18: case 18:
sub_801807C(&gUnknown_02022C40); ResetUnionRoomTrade(&sUnionRoomTrade);
sub_8010FCC(0, 0, 0); sub_8010FCC(0, 0, 0);
sub_801568C(gUnknown_082EF4FC); sub_801568C(sText_RegistrationCanceled);
break; break;
default: default:
gUnknown_02022C40.type = var5; sUnionRoomTrade.type = var5;
data->state = 55; data->state = 55;
break; break;
} }
} }
break; break;
case 55: case 55:
sub_8010FCC(gUnknown_02022C40.type, gUnknown_02022C40.playerSpecies, gUnknown_02022C40.playerLevel); sub_8010FCC(sUnionRoomTrade.type, sUnionRoomTrade.playerSpecies, sUnionRoomTrade.playerLevel);
sub_801568C(gUnknown_082EF520); sub_801568C(sText_RegistraionCompleted);
break; break;
case 44: case 44:
switch (sub_80170B8(&data->textState, FALSE)) switch (sub_80170B8(&data->textState, FALSE))
@ -2915,16 +2915,16 @@ void sub_80156E0(u8 taskId)
} }
break; break;
case 56: case 56:
if (PrintOnTextbox(&data->textState, gUnknown_082EF5B8)) if (PrintOnTextbox(&data->textState, sText_RegistrationCanceled2))
{ {
sub_8010FCC(0, 0, 0); sub_8010FCC(0, 0, 0);
sub_801807C(&gUnknown_02022C40); ResetUnionRoomTrade(&sUnionRoomTrade);
sub_801818C(TRUE); sub_801818C(TRUE);
data->state = 4; data->state = 4;
} }
break; break;
case 45: case 45:
if (PrintOnTextbox(&data->textState, gUnknown_082EF1EC)) if (PrintOnTextbox(&data->textState, sText_XCheckedTradingBoard))
data->state = 46; data->state = 46;
break; break;
case 46: case 46:
@ -2948,18 +2948,18 @@ void sub_80156E0(u8 taskId)
{ {
case 0: case 0:
sub_8018404(gStringVar1, &data->field_0->arr[var5]); sub_8018404(gStringVar1, &data->field_0->arr[var5]);
sub_8015664(49, gUnknown_082EF65C); sub_8015664(49, sText_AskTrainerToMakeTrade);
taskData[1] = var5; taskData[1] = var5;
break; break;
case 1: case 1:
sub_8018404(gStringVar1, &data->field_0->arr[var5]); sub_8018404(gStringVar1, &data->field_0->arr[var5]);
StringCopy(gStringVar2, gTypeNames[data->field_0->arr[var5].unk.field_0.type]); StringCopy(gStringVar2, gTypeNames[data->field_0->arr[var5].unk.field_0.type]);
sub_8015664(46, gUnknown_082EF6E4); sub_8015664(46, sText_DontHaveTypeTrainerWants);
break; break;
case 2: case 2:
sub_8018404(gStringVar1, &data->field_0->arr[var5]); sub_8018404(gStringVar1, &data->field_0->arr[var5]);
StringCopy(gStringVar2, gTypeNames[data->field_0->arr[var5].unk.field_0.type]); StringCopy(gStringVar2, gTypeNames[data->field_0->arr[var5].unk.field_0.type]);
sub_8015664(46, gUnknown_082EF718); sub_8015664(46, sText_DontHaveEggTrainerWants);
break; break;
} }
break; break;
@ -2980,16 +2980,16 @@ void sub_80156E0(u8 taskId)
} }
break; break;
case 50: case 50:
if (PrintOnTextbox(&data->textState, gUnknown_082EF4C4)) if (PrintOnTextbox(&data->textState, sText_WhichMonWillYouOffer))
{ {
gUnknown_02022C40.field_0 = 2; sUnionRoomTrade.field_0 = 2;
memcpy(&gUnknown_02022C38, &data->field_0->arr[taskData[1]].unk.field_0.unk_00, sizeof(gUnknown_02022C38)); memcpy(&gUnknown_02022C38, &data->field_0->arr[taskData[1]].unk.field_0.unk_00, sizeof(gUnknown_02022C38));
gUnionRoomRequestedMonType = data->field_0->arr[taskData[1]].unk.field_0.type; gUnionRoomRequestedMonType = data->field_0->arr[taskData[1]].unk.field_0.type;
gUnionRoomOfferedSpecies = data->field_0->arr[taskData[1]].unk.field_0.species; gUnionRoomOfferedSpecies = data->field_0->arr[taskData[1]].unk.field_0.species;
gFieldCallback = sub_80AF128; gFieldCallback = sub_80AF128;
sub_81B8904(9, CB2_ReturnToField); sub_81B8904(9, CB2_ReturnToField);
sub_80156B0(data); sub_80156B0(data);
gUnknown_02022C40.field_8 = taskData[1]; sUnionRoomTrade.field_8 = taskData[1];
} }
break; break;
case 51: case 51:
@ -3859,7 +3859,7 @@ s32 sub_80179D4(struct UnkStruct_Main0 *arg0, u8 arg1, u8 arg2, u32 playerGender
r2 = sub_800E540(ReadAsU16(r5->unk.field_0.unk_00.playerTrainerId), gStringVar1); r2 = sub_800E540(ReadAsU16(r5->unk.field_0.unk_00.playerTrainerId), gStringVar1);
if (r5->unk.field_0.unk_0a_0 == 0x45) if (r5->unk.field_0.unk_0a_0 == 0x45)
{ {
StringExpandPlaceholders(gStringVar4, gUnknown_082EE6B8[r2][playerGender]); StringExpandPlaceholders(gStringVar4, sUnionRoomTexts_JoinChat[r2][playerGender]);
return 2; return 2;
} }
else else
@ -3881,7 +3881,7 @@ s32 sub_80179D4(struct UnkStruct_Main0 *arg0, u8 arg1, u8 arg2, u32 playerGender
StringExpandPlaceholders(gStringVar4, gUnknown_082EEEAC[playerGender][Random() % 4]); StringExpandPlaceholders(gStringVar4, gUnknown_082EEEAC[playerGender][Random() % 4]);
break; break;
case 4: case 4:
StringExpandPlaceholders(gStringVar4, gUnknown_082EF1CC[playerGender][Random() % 2]); StringExpandPlaceholders(gStringVar4, sUnionRoomTexts_Traded[playerGender][Random() % 2]);
break; break;
case 5: case 5:
StringExpandPlaceholders(gStringVar4, gUnknown_082EF010[playerGender][Random() % 4]); StringExpandPlaceholders(gStringVar4, gUnknown_082EF010[playerGender][Random() % 4]);
@ -3890,7 +3890,7 @@ s32 sub_80179D4(struct UnkStruct_Main0 *arg0, u8 arg1, u8 arg2, u32 playerGender
StringExpandPlaceholders(gStringVar4, gUnknown_082EF100[playerGender][Random() % 2]); StringExpandPlaceholders(gStringVar4, gUnknown_082EF100[playerGender][Random() % 2]);
break; break;
default: default:
StringExpandPlaceholders(gStringVar4, gUnknown_082EE6C8); StringExpandPlaceholders(gStringVar4, sText_TrainerAppearsBusy);
break; break;
} }
return 0; return 0;
@ -3912,7 +3912,7 @@ void sub_8017B3C(u8 arg0, u8 arg1, struct UnkLinkRfuStruct_02022B14 * arg2, cons
sub_80173E0(arg0, 1, str, 8, arg1, arg4); sub_80173E0(arg0, 1, str, 8, arg1, arg4);
if (r8 == SPECIES_EGG) if (r8 == SPECIES_EGG)
{ {
sub_80173E0(arg0, 1, gUnknown_082EF7D0, 0x44, arg1, arg4); sub_80173E0(arg0, 1, sText_EggTrade, 0x44, arg1, arg4);
} }
else else
{ {
@ -4023,7 +4023,7 @@ void sub_8017D9C(u8 *dst, s32 arg1, u32 playerGender)
StringExpandPlaceholders(dst, gUnknown_082EED3C[playerGender]); StringExpandPlaceholders(dst, gUnknown_082EED3C[playerGender]);
break; break;
case 0x44: case 0x44:
StringExpandPlaceholders(dst, gUnknown_082EF7B0); StringExpandPlaceholders(dst, sText_TradeOfferRejected);
break; break;
case 0x48: case 0x48:
StringExpandPlaceholders(dst, gUnknown_082EEB08[playerGender]); StringExpandPlaceholders(dst, gUnknown_082EEB08[playerGender]);
@ -4059,16 +4059,16 @@ s32 sub_8017EA0(u8 *dst, u32 gender, u16 *arg2, struct UnkStruct_URoom *arg3)
switch (arg2[0]) switch (arg2[0])
{ {
case 0x41: case 0x41:
StringExpandPlaceholders(dst, gUnionRoom_BattleChallenge); StringExpandPlaceholders(dst, sText_BattleChallenge);
result = 1; result = 1;
break; break;
case 0x45: case 0x45:
StringExpandPlaceholders(dst, gUnionRoom_ChatInvitation); StringExpandPlaceholders(dst, sText_ChatInvitation);
result = 1; result = 1;
break; break;
case 0x44: case 0x44:
ConvertIntToDecimalStringN(arg3->field_58 + 0x00, gUnknown_02022C40.playerLevel, STR_CONV_MODE_LEFT_ALIGN, 3); ConvertIntToDecimalStringN(arg3->field_58 + 0x00, sUnionRoomTrade.playerLevel, STR_CONV_MODE_LEFT_ALIGN, 3);
StringCopy(arg3->field_58 + 0x10, gSpeciesNames[gUnknown_02022C40.playerSpecies]); StringCopy(arg3->field_58 + 0x10, gSpeciesNames[sUnionRoomTrade.playerSpecies]);
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
if (gUnknown_03007890->unk_14[i].unk_04 == 2) if (gUnknown_03007890->unk_14[i].unk_04 == 2)
@ -4081,7 +4081,7 @@ s32 sub_8017EA0(u8 *dst, u32 gender, u16 *arg2, struct UnkStruct_URoom *arg3)
} }
if (species == SPECIES_EGG) if (species == SPECIES_EGG)
{ {
StringCopy(dst, gUnionRoom_OfferToTradeEgg); StringCopy(dst, sText_OfferToTradeEgg);
} }
else else
{ {
@ -4089,16 +4089,16 @@ s32 sub_8017EA0(u8 *dst, u32 gender, u16 *arg2, struct UnkStruct_URoom *arg3)
{ {
DynamicPlaceholderTextUtil_SetPlaceholderPtr(i, arg3->field_58 + 0x10 * i); DynamicPlaceholderTextUtil_SetPlaceholderPtr(i, arg3->field_58 + 0x10 * i);
} }
DynamicPlaceholderTextUtil_ExpandPlaceholders(dst, gUnionRoom_OfferToTradeMon); DynamicPlaceholderTextUtil_ExpandPlaceholders(dst, sText_OfferToTradeMon);
} }
result = 1; result = 1;
break; break;
case 0x48: case 0x48:
StringExpandPlaceholders(dst, gUnionRoom_ShowTrainerCard); StringExpandPlaceholders(dst, sText_ShowTrainerCard);
result = 1; result = 1;
break; break;
case 0x40: case 0x40:
StringExpandPlaceholders(dst, gUnionRoom_ChatDropped); StringExpandPlaceholders(dst, sText_ChatDropped);
result = 2; result = 2;
break; break;
} }
@ -4131,14 +4131,14 @@ bool32 InUnionRoom(void)
? TRUE : FALSE; ? TRUE : FALSE;
} }
bool32 sub_8018024(void) bool32 HasAtLeastTwoMonsOfLevel30OrLower(void)
{ {
s32 i; s32 i;
s32 count = 0; s32 count = 0;
for (i = 0; i < gPlayerPartyCount; i++) for (i = 0; i < gPlayerPartyCount; i++)
{ {
if ( GetMonData(&gPlayerParty[i], MON_DATA_LEVEL) <= 30 if (GetMonData(&gPlayerParty[i], MON_DATA_LEVEL) <= 30
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_EGG) && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_EGG)
{ {
count++; count++;
@ -4146,16 +4146,12 @@ bool32 sub_8018024(void)
} }
if (count > 1) if (count > 1)
{
return TRUE; return TRUE;
}
else else
{
return FALSE; return FALSE;
}
} }
void sub_801807C(struct TradeUnkStruct *arg0) static void ResetUnionRoomTrade(struct UnionRoomTrade *arg0)
{ {
arg0->field_0 = 0; arg0->field_0 = 0;
arg0->type = 0; arg0->type = 0;
@ -4167,34 +4163,30 @@ void sub_801807C(struct TradeUnkStruct *arg0)
arg0->personality = 0; arg0->personality = 0;
} }
void sub_8018090(void) void Script_ResetUnionRoomTrade(void)
{ {
sub_801807C(&gUnknown_02022C40); ResetUnionRoomTrade(&sUnionRoomTrade);
} }
bool32 sub_80180A0(u32 monId, struct TradeUnkStruct *arg1) static bool32 RegisterTradeMonAndGetIsEgg(u32 monId, struct UnionRoomTrade *trade)
{ {
arg1->playerSpecies = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES2); trade->playerSpecies = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES2);
arg1->playerLevel = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL); trade->playerLevel = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL);
arg1->playerPersonality = GetMonData(&gPlayerParty[monId], MON_DATA_PERSONALITY); trade->playerPersonality = GetMonData(&gPlayerParty[monId], MON_DATA_PERSONALITY);
if (arg1->playerSpecies == SPECIES_EGG) if (trade->playerSpecies == SPECIES_EGG)
{
return TRUE; return TRUE;
}
else else
{
return FALSE; return FALSE;
}
} }
void sub_80180E8(u32 monId, struct TradeUnkStruct *arg1) static void RegisterTradeMon(u32 monId, struct UnionRoomTrade *trade)
{ {
arg1->species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES2); trade->species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES2);
arg1->level = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL); trade->level = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL);
arg1->personality = GetMonData(&gPlayerParty[monId], MON_DATA_PERSONALITY); trade->personality = GetMonData(&gPlayerParty[monId], MON_DATA_PERSONALITY);
} }
u32 sub_8018120(struct TradeUnkStruct *arg0, u8 multiplayerId) static u32 GetPartyPositionOfRegisteredMon(struct UnionRoomTrade *trade, u8 multiplayerId)
{ {
u16 response = 0; u16 response = 0;
u16 species; u16 species;
@ -4203,15 +4195,17 @@ u32 sub_8018120(struct TradeUnkStruct *arg0, u8 multiplayerId)
u16 cur_species; u16 cur_species;
s32 i; s32 i;
// player
if (multiplayerId == 0) if (multiplayerId == 0)
{ {
species = arg0->playerSpecies; species = trade->playerSpecies;
personality = arg0->playerPersonality; personality = trade->playerPersonality;
} }
// partner
else else
{ {
species = arg0->species; species = trade->species;
personality = arg0->personality; personality = trade->personality;
} }
for (i = 0; i < gPlayerPartyCount; i++) for (i = 0; i < gPlayerPartyCount; i++)
@ -4241,7 +4235,7 @@ void sub_801818C(bool32 arg0)
gUnknown_02022C2C = 0; gUnknown_02022C2C = 0;
if (arg0) if (arg0)
{ {
sub_8010FCC(gUnknown_02022C40.type, gUnknown_02022C40.playerSpecies, gUnknown_02022C40.playerLevel); sub_8010FCC(sUnionRoomTrade.type, sUnionRoomTrade.playerSpecies, sUnionRoomTrade.playerLevel);
sub_8011090(0x40, 0, 0); sub_8011090(0x40, 0, 0);
} }
} }