From 8e2621934dcdd4d376824ba603bca7017e8cfcc6 Mon Sep 17 00:00:00 2001 From: fakuzatsu Date: Thu, 14 Nov 2024 15:48:08 +0000 Subject: [PATCH 01/19] inital commit (shit very broken still) --- asm/macros/battle_script.inc | 8 ++- data/battle_scripts_2.s | 23 ++++++- include/constants/battle_string_ids.h | 6 +- include/constants/party_menu.h | 1 + src/battle_message.c | 3 + src/battle_script_commands.c | 97 +++++++++++++++++++++++++-- src/party_menu.c | 8 +++ 7 files changed, 138 insertions(+), 8 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 6dbcabe43ec2..f9e04d4b1eb7 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1236,8 +1236,9 @@ .byte 0xe6 .endm - .macro unused4 + .macro tryaddcaughtmontofullparty .byte 0xe7 + .4byte \successInstr .endm .macro settypebasedhalvers failInstr:req @@ -2516,3 +2517,8 @@ printstring STRINGID_EMPTYSTRING3 waitmessage 1 .endm + + .macro jumpiffullparty jumpInstr:req + .byte 0xFD + .4byte \jumpInstr + .endm diff --git a/data/battle_scripts_2.s b/data/battle_scripts_2.s index be6c04e32eb9..df2f2ca62bfd 100644 --- a/data/battle_scripts_2.s +++ b/data/battle_scripts_2.s @@ -175,17 +175,38 @@ BattleScript_TryNicknameCaughtMon:: printstring STRINGID_GIVENICKNAMECAPTURED waitstate setbyte gBattleCommunication, 0 - trygivecaughtmonnick BattleScript_GiveCaughtMonEnd + trygivecaughtmonnick BattleScript_CheckFullPartyThenEnd + jumpiffullparty BattleScript_SendCaughtMonPartyOrBox givecaughtmon printfromtable gCaughtMonStringIds waitmessage B_WAIT_TIME_LONG goto BattleScript_SuccessBallThrowEnd + +BattleScript_CheckFullPartyThenEnd:: + jumpiffullparty BattleScript_SendCaughtMonPartyOrBoxWithNick BattleScript_GiveCaughtMonEnd:: givecaughtmon BattleScript_SuccessBallThrowEnd:: setbyte gBattleOutcome, B_OUTCOME_CAUGHT finishturn +BattleScript_SendCaughtMonPartyOrBox:: + printstring STRINGID_SENDCAUGHTMONPARTYORBOX + waitstate + setbyte gBattleCommunication, 0 + tryaddcaughtmontofullparty BattleScript_GiveCaughtMonEnd + givecaughtmon + printfromtable gCaughtMonStringIds + waitmessage B_WAIT_TIME_LONG + goto BattleScript_SuccessBallThrowEnd + +BattleScript_SendCaughtMonPartyOrBoxWithNick:: + printstring STRINGID_SENDCAUGHTMONPARTYORBOX + waitstate + setbyte gBattleCommunication, 0 + tryaddcaughtmontofullparty BattleScript_GiveCaughtMonEnd + goto BattleScript_GiveCaughtMonEnd + BattleScript_WallyBallThrow:: printstring STRINGID_GOTCHAPKMNCAUGHTWALLY setbyte gBattleOutcome, B_OUTCOME_CAUGHT diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 9fbb70a22397..8b707a2a0a46 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -713,7 +713,11 @@ #define STRINGID_PKMNMADESHELLGLEAM 711 #define STRINGID_FICKLEBEAMDOUBLED 712 -#define BATTLESTRINGS_COUNT 713 +#define STRINGID_EXPANSION_END STRINGID_BLOCKEDBYSLEEPCLAUSE + +#define STRINGID_SENDCAUGHTMONPARTYORBOX (STRINGID_EXPANSION_END + 1) + +#define BATTLESTRINGS_COUNT (STRINGID_SENDCAUGHTMONPARTYORBOX + 1) // This is the string id that gBattleStringsTable starts with. // String ids before this (e.g. STRINGID_INTROMSG) are not in the table, diff --git a/include/constants/party_menu.h b/include/constants/party_menu.h index 1f37f3416c96..799a2f6490b6 100644 --- a/include/constants/party_menu.h +++ b/include/constants/party_menu.h @@ -50,6 +50,7 @@ #define PARTY_ACTION_MINIGAME 13 #define PARTY_ACTION_REUSABLE_ITEM 14 // Unused. The only reusable items are handled separately #define PARTY_ACTION_CHOOSE_FAINTED_MON 15 +#define PARTY_ACTION_SEND_MON_TO_BOX 16 // IDs for DisplayPartyMenuStdMessage, to display the message at the bottom of the party menu #define PARTY_MSG_CHOOSE_MON 0 diff --git a/src/battle_message.c b/src/battle_message.c index 1598c4cef7c4..2165931a29a9 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -496,6 +496,7 @@ static const u8 sText_PkmnSentToPC[] = _("{B_DEF_NAME} was sent to\n{B_PC_CREATO static const u8 sText_Someones[] = _("someone's"); static const u8 sText_Lanettes[] = _("LANETTE's"); static const u8 sText_PkmnDataAddedToDex[] = _("{B_DEF_NAME}'s data was\nadded to the POKéDEX.\p"); +static const u8 sText_SendCaughtMonPartyOrBox[] = _("Add {B_DEF_NAME} to your party?") static const u8 sText_ItIsRaining[] = _("It is raining."); static const u8 sText_SandstormIsRaging[] = _("A sandstorm is raging."); static const u8 sText_BoxIsFull[] = _("The BOX is full!\nYou can't catch any more!\p"); @@ -1553,6 +1554,8 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_ITEMWASUSEDUP - BATTLESTRINGS_TABLE_START] = sText_ItemWasUsedUp, [STRINGID_ATTACKERLOSTITSTYPE - BATTLESTRINGS_TABLE_START] = sText_AttackerLostItsType, [STRINGID_CLOAKEDINAHARSHLIGHT - BATTLESTRINGS_TABLE_START] = sText_PkmnIsCloakedInAHarshLight, + [STRINGID_BLOCKEDBYSLEEPCLAUSE - BATTLESTRINGS_TABLE_START] = sText_BlockedBySleepClause, + [STRINGID_SENDCAUGHTMONPARTYORBOX - BATTLESTRINGS_TABLE_START] = sText_SendCaughtMonPartyOrBox, }; const u16 gTrainerUsedItemStringIds[] = diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 7212560ebda5..c1db7842979b 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -571,7 +571,7 @@ static void Cmd_jumpifhasnohp(void); static void Cmd_jumpifnotcurrentmoveargtype(void); static void Cmd_pickup(void); static void Cmd_unused3(void); -static void Cmd_unused4(void); +static void Cmd_tryaddcaughtmontofullparty(void); static void Cmd_settypebasedhalvers(void); static void Cmd_jumpifsubstituteblocks(void); static void Cmd_tryrecycleitem(void); @@ -593,7 +593,7 @@ static void Cmd_settelekinesis(void); static void Cmd_swapstatstages(void); static void Cmd_averagestats(void); static void Cmd_jumpifoppositegenders(void); -static void Cmd_unused(void); +static void Cmd_jumpiffullparty(void); static void Cmd_tryworryseed(void); static void Cmd_callnative(void); @@ -830,7 +830,7 @@ void (* const gBattleScriptingCommandsTable[])(void) = Cmd_jumpifnotcurrentmoveargtype, //0xE4 Cmd_pickup, //0xE5 Cmd_unused3, //0xE6 - Cmd_unused4, //0xE7 + Cmd_tryaddcaughtmontofullparty, //0xE7 Cmd_settypebasedhalvers, //0xE8 Cmd_jumpifsubstituteblocks, //0xE9 Cmd_tryrecycleitem, //0xEA @@ -852,7 +852,7 @@ void (* const gBattleScriptingCommandsTable[])(void) = Cmd_swapstatstages, //0xFA Cmd_averagestats, //0xFB Cmd_jumpifoppositegenders, //0xFC - Cmd_unused, //0xFD + Cmd_jumpiffullparty, //0xFD Cmd_tryworryseed, //0xFE Cmd_callnative, //0xFF }; @@ -15832,8 +15832,95 @@ static void Cmd_jumpifoppositegenders(void) gBattlescriptCurrInstr = cmd->nextInstr; } -static void Cmd_unused(void) +static void Cmd_jumpiffullparty(void) { + CMD_ARGS(const u8 *jumpInstr); + + for (u32 i = 0; i < PARTY_SIZE; i++) + { + if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL) == SPECIES_NONE) + break; + } + + if (i >= PARTY_SIZE) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; +} + +static void Cmd_tryaddcaughtmontofullparty(void) +{ + CMD_ARGS(const u8 *successInstr); + + switch (gBattleCommunication[MULTIUSE_STATE]) + { + case 0: + HandleBattleWindow(YESNOBOX_X_Y, 0); + BattlePutTextOnWindow(gText_BattleYesNoChoice, B_WIN_YESNO); + gBattleCommunication[MULTIUSE_STATE]++; + gBattleCommunication[CURSOR_POSITION] = 0; + BattleCreateYesNoCursorAt(0); + break; + case 1: + if (JOY_NEW(DPAD_UP) && gBattleCommunication[CURSOR_POSITION] != 0) + { + PlaySE(SE_SELECT); + BattleDestroyYesNoCursorAt(gBattleCommunication[CURSOR_POSITION]); + gBattleCommunication[CURSOR_POSITION] = 0; + BattleCreateYesNoCursorAt(0); + } + if (JOY_NEW(DPAD_DOWN) && gBattleCommunication[CURSOR_POSITION] == 0) + { + PlaySE(SE_SELECT); + BattleDestroyYesNoCursorAt(gBattleCommunication[CURSOR_POSITION]); + gBattleCommunication[CURSOR_POSITION] = 1; + BattleCreateYesNoCursorAt(1); + } + if (JOY_NEW(A_BUTTON)) + { + PlaySE(SE_SELECT); + if (gBattleCommunication[CURSOR_POSITION] == 0) + { + gBattleCommunication[MULTIUSE_STATE]++; + BeginFastPaletteFade(3); + } + else + { + gBattleCommunication[MULTIUSE_STATE] = 4; + } + } + else if (JOY_NEW(B_BUTTON)) + { + PlaySE(SE_SELECT); + gBattleCommunication[MULTIUSE_STATE] = 4; + } + break; + case 2: + BattleStopLowHpSound(); + BeginNormalPaletteFade(PALETTES_ALL, 2, 0, 16, RGB_BLACK); + gBattleCommunication[MULTIUSE_STATE]++; + break; + case 3: + if (!gPaletteFade.active) + { + OpenPartyMenuInBattle(PARTY_ACTION_SEND_MON_TO_BOX); + gBattleCommunication[MULTIUSE_STATE]++; + } + break; + case 4: + if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active) + { + // do the effect + gBattlescriptCurrInstr = cmd->successInstr; + } + break; + case 4: + if (CalculatePlayerPartyCount() == PARTY_SIZE) + gBattlescriptCurrInstr = cmd->nextInstr; + else + gBattlescriptCurrInstr = cmd->successInstr; + break; + } } static void Cmd_tryworryseed(void) diff --git a/src/party_menu.c b/src/party_menu.c index 703834cc0bce..aef3c7284557 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -1521,6 +1521,10 @@ static void HandleChooseMonSelection(u8 taskId, s8 *slotPtr) } break; } + case PARTY_ACTION_SEND_MON_TO_BOX: + PlaySE(SE_SELECT); + TrySendMonToBox((u8)*slotPtr); + break; default: case PARTY_ACTION_ABILITY_PREVENTS: case PARTY_ACTION_SWITCHING: @@ -1558,6 +1562,10 @@ static void HandleChooseMonCancel(u8 taskId, s8 *slotPtr) PlaySE(SE_SELECT); CancelParticipationPrompt(taskId); break; + case PARTY_ACTION_SEND_MON_TO_BOX: + PlaySE(SE_SELECT); + CancelSendingMonToBox(taskId); + break; default: PlaySE(SE_SELECT); if (DisplayCancelChooseMonYesNo(taskId) != TRUE) From 142ffd287c0d73b5ff711c1694974c3ad66ba589 Mon Sep 17 00:00:00 2001 From: fakuzatsu Date: Fri, 15 Nov 2024 11:32:59 +0000 Subject: [PATCH 02/19] fixes for compilation. Should work (not tested) --- asm/macros/battle_script.inc | 2 +- data/battle_scripts_2.s | 9 +++++-- include/constants/battle_string_ids.h | 5 ++-- include/constants/party_menu.h | 3 +-- src/battle_controller_player.c | 3 ++- src/battle_message.c | 4 +++- src/battle_script_commands.c | 34 +++++++++++++++------------ src/party_menu.c | 23 ++++++++++++++---- 8 files changed, 54 insertions(+), 29 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index f9e04d4b1eb7..88895ac045e5 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1236,7 +1236,7 @@ .byte 0xe6 .endm - .macro tryaddcaughtmontofullparty + .macro tryaddcaughtmontofullparty successInstr:req .byte 0xe7 .4byte \successInstr .endm diff --git a/data/battle_scripts_2.s b/data/battle_scripts_2.s index df2f2ca62bfd..1147e03dbd4b 100644 --- a/data/battle_scripts_2.s +++ b/data/battle_scripts_2.s @@ -194,7 +194,7 @@ BattleScript_SendCaughtMonPartyOrBox:: printstring STRINGID_SENDCAUGHTMONPARTYORBOX waitstate setbyte gBattleCommunication, 0 - tryaddcaughtmontofullparty BattleScript_GiveCaughtMonEnd + tryaddcaughtmontofullparty BattleScript_SentMonToBoxToMakeSpace givecaughtmon printfromtable gCaughtMonStringIds waitmessage B_WAIT_TIME_LONG @@ -204,7 +204,12 @@ BattleScript_SendCaughtMonPartyOrBoxWithNick:: printstring STRINGID_SENDCAUGHTMONPARTYORBOX waitstate setbyte gBattleCommunication, 0 - tryaddcaughtmontofullparty BattleScript_GiveCaughtMonEnd + tryaddcaughtmontofullparty BattleScript_SentMonToBoxToMakeSpace + goto BattleScript_GiveCaughtMonEnd + +BattleScript_SentMonToBoxToMakeSpace:: + printstring STRINGID_PKMNSENTTOPCAFTERCATCH + waitmessage B_WAIT_TIME_MED goto BattleScript_GiveCaughtMonEnd BattleScript_WallyBallThrow:: diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 8b707a2a0a46..bad773301c98 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -713,11 +713,12 @@ #define STRINGID_PKMNMADESHELLGLEAM 711 #define STRINGID_FICKLEBEAMDOUBLED 712 -#define STRINGID_EXPANSION_END STRINGID_BLOCKEDBYSLEEPCLAUSE +#define STRINGID_EXPANSION_END STRINGID_FICKLEBEAMDOUBLED #define STRINGID_SENDCAUGHTMONPARTYORBOX (STRINGID_EXPANSION_END + 1) +#define STRINGID_PKMNSENTTOPCAFTERCATCH (STRINGID_EXPANSION_END + 2) -#define BATTLESTRINGS_COUNT (STRINGID_SENDCAUGHTMONPARTYORBOX + 1) +#define BATTLESTRINGS_COUNT (STRINGID_PKMNSENTTOPCAFTERCATCH + 1) // This is the string id that gBattleStringsTable starts with. // String ids before this (e.g. STRINGID_INTROMSG) are not in the table, diff --git a/include/constants/party_menu.h b/include/constants/party_menu.h index 799a2f6490b6..98acff494b3a 100644 --- a/include/constants/party_menu.h +++ b/include/constants/party_menu.h @@ -48,9 +48,8 @@ #define PARTY_ACTION_CHOOSE_AND_CLOSE 11 #define PARTY_ACTION_MOVE_TUTOR 12 #define PARTY_ACTION_MINIGAME 13 -#define PARTY_ACTION_REUSABLE_ITEM 14 // Unused. The only reusable items are handled separately +#define PARTY_ACTION_SEND_MON_TO_BOX 14 // Reused from PARTY_ACTION_REUSABLE_ITEM. The only reusable items are handled separately #define PARTY_ACTION_CHOOSE_FAINTED_MON 15 -#define PARTY_ACTION_SEND_MON_TO_BOX 16 // IDs for DisplayPartyMenuStdMessage, to display the message at the bottom of the party menu #define PARTY_MSG_CHOOSE_MON 0 diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 8907d9473374..c0e987a33c36 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -2142,7 +2142,8 @@ static void PlayerHandleChoosePokemon(u32 battler) gBattlePartyCurrentOrder[i] = gBattleResources->bufferA[battler][4 + i]; if (gBattleTypeFlags & BATTLE_TYPE_ARENA && (gBattleResources->bufferA[battler][1] & 0xF) != PARTY_ACTION_CANT_SWITCH - && (gBattleResources->bufferA[battler][1] & 0xF) != PARTY_ACTION_CHOOSE_FAINTED_MON) + && (gBattleResources->bufferA[battler][1] & 0xF) != PARTY_ACTION_CHOOSE_FAINTED_MON + && (gBattleResources->bufferA[battler][1] & 0xF) != PARTY_ACTION_SEND_MON_TO_BOX) { BtlController_EmitChosenMonReturnValue(battler, BUFFER_B, gBattlerPartyIndexes[battler] + 1, gBattlePartyCurrentOrder); PlayerBufferExecCompleted(battler); diff --git a/src/battle_message.c b/src/battle_message.c index 2165931a29a9..cabe82f9271b 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -496,7 +496,8 @@ static const u8 sText_PkmnSentToPC[] = _("{B_DEF_NAME} was sent to\n{B_PC_CREATO static const u8 sText_Someones[] = _("someone's"); static const u8 sText_Lanettes[] = _("LANETTE's"); static const u8 sText_PkmnDataAddedToDex[] = _("{B_DEF_NAME}'s data was\nadded to the POKéDEX.\p"); -static const u8 sText_SendCaughtMonPartyOrBox[] = _("Add {B_DEF_NAME} to your party?") +static const u8 sText_SendCaughtMonPartyOrBox[] = _("Add {B_DEF_NAME} to your party?"); +static const u8 sText_PkmnSentToPCAfterCatch[] = _("{B_BUFF1} was sent to\n{B_PC_CREATOR_NAME} PC."); static const u8 sText_ItIsRaining[] = _("It is raining."); static const u8 sText_SandstormIsRaging[] = _("A sandstorm is raging."); static const u8 sText_BoxIsFull[] = _("The BOX is full!\nYou can't catch any more!\p"); @@ -1556,6 +1557,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_CLOAKEDINAHARSHLIGHT - BATTLESTRINGS_TABLE_START] = sText_PkmnIsCloakedInAHarshLight, [STRINGID_BLOCKEDBYSLEEPCLAUSE - BATTLESTRINGS_TABLE_START] = sText_BlockedBySleepClause, [STRINGID_SENDCAUGHTMONPARTYORBOX - BATTLESTRINGS_TABLE_START] = sText_SendCaughtMonPartyOrBox, + [STRINGID_PKMNSENTTOPCAFTERCATCH - BATTLESTRINGS_TABLE_START] = sText_PkmnSentToPCAfterCatch, }; const u16 gTrainerUsedItemStringIds[] = diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index c1db7842979b..b4f73d16c981 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -14881,10 +14881,6 @@ static void Cmd_unused3(void) { } -static void Cmd_unused4(void) -{ -} - // Water and Mud Sport static void Cmd_settypebasedhalvers(void) { @@ -15835,8 +15831,9 @@ static void Cmd_jumpifoppositegenders(void) static void Cmd_jumpiffullparty(void) { CMD_ARGS(const u8 *jumpInstr); + u32 i = 0; - for (u32 i = 0; i < PARTY_SIZE; i++) + for (i = 0; i < PARTY_SIZE; i++) { if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL) == SPECIES_NONE) break; @@ -15896,22 +15893,29 @@ static void Cmd_tryaddcaughtmontofullparty(void) } break; case 2: - BattleStopLowHpSound(); - BeginNormalPaletteFade(PALETTES_ALL, 2, 0, 16, RGB_BLACK); - gBattleCommunication[MULTIUSE_STATE]++; - break; - case 3: if (!gPaletteFade.active) { - OpenPartyMenuInBattle(PARTY_ACTION_SEND_MON_TO_BOX); + BtlController_EmitChoosePokemon(gBattlerAttacker, BUFFER_A, PARTY_ACTION_SEND_MON_TO_BOX, PARTY_SIZE, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gBattlerAttacker]); + MarkBattlerForControllerExec(gBattlerAttacker); gBattleCommunication[MULTIUSE_STATE]++; } break; - case 4: - if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active) + case 3: + if (gSelectedMonPartyId != PARTY_SIZE) { - // do the effect - gBattlescriptCurrInstr = cmd->successInstr; + MarkBattlerForControllerExec(gBattlerAttacker); + PREPARE_SPECIES_BUFFER(gBattleTextBuff1, GetMonData(&gPlayerParty[gSelectedMonPartyId], MON_DATA_SPECIES)); + + // Choosing Pokemon was cancelled if = PARTY_SIZE + 1 + if (gSelectedMonPartyId != PARTY_SIZE + 1) + { + u8 state = CopyMonToPC(&gPlayerParty[gSelectedMonPartyId]); + if (state == MON_GIVEN_TO_PC) + ZeroMonData(&gPlayerParty[gSelectedMonPartyId]); + } + + gSelectedMonPartyId = PARTY_SIZE; + gBattleCommunication[MULTIUSE_STATE]++; } break; case 4: diff --git a/src/party_menu.c b/src/party_menu.c index aef3c7284557..07041b4bb38c 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -1522,9 +1522,22 @@ static void HandleChooseMonSelection(u8 taskId, s8 *slotPtr) break; } case PARTY_ACTION_SEND_MON_TO_BOX: - PlaySE(SE_SELECT); - TrySendMonToBox((u8)*slotPtr); + { + u8 partyId = GetPartyIdFromBattleSlot((u8)*slotPtr); + if (partyId == 0 || ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && partyId == 2) + || ((gBattleTypeFlags & BATTLE_TYPE_MULTI) && partyId >= (PARTY_SIZE / 2))) + { + // Can't select if mon is currently on the field, or doesn't belong to you + PlaySE(SE_FAILURE); + } + else + { + PlaySE(SE_SELECT); + gSelectedMonPartyId = partyId; + Task_ClosePartyMenu(taskId); + } break; + } default: case PARTY_ACTION_ABILITY_PREVENTS: case PARTY_ACTION_SWITCHING: @@ -1564,7 +1577,8 @@ static void HandleChooseMonCancel(u8 taskId, s8 *slotPtr) break; case PARTY_ACTION_SEND_MON_TO_BOX: PlaySE(SE_SELECT); - CancelSendingMonToBox(taskId); + gSelectedMonPartyId = PARTY_SIZE + 1; + Task_ClosePartyMenu(taskId); break; default: PlaySE(SE_SELECT); @@ -4667,8 +4681,7 @@ void ItemUseCB_Medicine(u8 taskId, TaskFunc task) if (!IsItemFlute(item)) { PlaySE(SE_USE_ITEM); - if (gPartyMenu.action != PARTY_ACTION_REUSABLE_ITEM) - RemoveBagItem(item, 1); + RemoveBagItem(item, 1); } else { From dff741acaecfde76d7c446891595789098bc74d0 Mon Sep 17 00:00:00 2001 From: fakuzatsu Date: Fri, 15 Nov 2024 18:37:42 +0000 Subject: [PATCH 03/19] stop fading since EmitChoosePokemon already fades --- src/battle_script_commands.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index b4f73d16c981..8cd8cf87e489 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -15879,7 +15879,6 @@ static void Cmd_tryaddcaughtmontofullparty(void) if (gBattleCommunication[CURSOR_POSITION] == 0) { gBattleCommunication[MULTIUSE_STATE]++; - BeginFastPaletteFade(3); } else { @@ -15893,12 +15892,9 @@ static void Cmd_tryaddcaughtmontofullparty(void) } break; case 2: - if (!gPaletteFade.active) - { - BtlController_EmitChoosePokemon(gBattlerAttacker, BUFFER_A, PARTY_ACTION_SEND_MON_TO_BOX, PARTY_SIZE, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gBattlerAttacker]); - MarkBattlerForControllerExec(gBattlerAttacker); - gBattleCommunication[MULTIUSE_STATE]++; - } + BtlController_EmitChoosePokemon(gBattlerAttacker, BUFFER_A, PARTY_ACTION_SEND_MON_TO_BOX, PARTY_SIZE, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gBattlerAttacker]); + MarkBattlerForControllerExec(gBattlerAttacker); + gBattleCommunication[MULTIUSE_STATE]++; break; case 3: if (gSelectedMonPartyId != PARTY_SIZE) From ada9759d64871f44bf718c7d54c4ceeee7da8542 Mon Sep 17 00:00:00 2001 From: fakuzatsu Date: Fri, 15 Nov 2024 20:11:02 +0000 Subject: [PATCH 04/19] convert tryaddcaughtmontofullparty to callnative --- asm/macros/battle_script.inc | 8 +- src/battle_message.c | 3 +- src/battle_script_commands.c | 171 +++++++++++++++++++---------------- 3 files changed, 99 insertions(+), 83 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 88895ac045e5..0c455600c6ac 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1236,9 +1236,8 @@ .byte 0xe6 .endm - .macro tryaddcaughtmontofullparty successInstr:req + .macro unused4 successInstr:req .byte 0xe7 - .4byte \successInstr .endm .macro settypebasedhalvers failInstr:req @@ -1695,6 +1694,11 @@ callnative BS_SetMagicCoatTarget .endm + .macro tryaddcaughtmontofullparty successInstr:req + callnative BS_tryaddcaughtmontofullparty + .4byte \successInstr + .endm + @ various command changed to more readable macros .macro cancelmultiturnmoves battler:req various \battler, VARIOUS_CANCEL_MULTI_TURN_MOVES diff --git a/src/battle_message.c b/src/battle_message.c index cabe82f9271b..e4bec2f9bf2c 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -497,7 +497,8 @@ static const u8 sText_Someones[] = _("someone's"); static const u8 sText_Lanettes[] = _("LANETTE's"); static const u8 sText_PkmnDataAddedToDex[] = _("{B_DEF_NAME}'s data was\nadded to the POKéDEX.\p"); static const u8 sText_SendCaughtMonPartyOrBox[] = _("Add {B_DEF_NAME} to your party?"); -static const u8 sText_PkmnSentToPCAfterCatch[] = _("{B_BUFF1} was sent to\n{B_PC_CREATOR_NAME} PC."); +static const u8 sText_PkmnSentToPCAfterCatch[] = _("{B_BUFF1} was sent to\n{B_PC_CREATOR_NAME} PC.\pIt was placed in \nBOX “{B_BUFF2}”."); + static const u8 sText_ItIsRaining[] = _("It is raining."); static const u8 sText_SandstormIsRaging[] = _("A sandstorm is raging."); static const u8 sText_BoxIsFull[] = _("The BOX is full!\nYou can't catch any more!\p"); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 8cd8cf87e489..5340db004643 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -571,7 +571,7 @@ static void Cmd_jumpifhasnohp(void); static void Cmd_jumpifnotcurrentmoveargtype(void); static void Cmd_pickup(void); static void Cmd_unused3(void); -static void Cmd_tryaddcaughtmontofullparty(void); +static void Cmd_unused4(void); static void Cmd_settypebasedhalvers(void); static void Cmd_jumpifsubstituteblocks(void); static void Cmd_tryrecycleitem(void); @@ -830,7 +830,7 @@ void (* const gBattleScriptingCommandsTable[])(void) = Cmd_jumpifnotcurrentmoveargtype, //0xE4 Cmd_pickup, //0xE5 Cmd_unused3, //0xE6 - Cmd_tryaddcaughtmontofullparty, //0xE7 + Cmd_unused4, //0xE7 Cmd_settypebasedhalvers, //0xE8 Cmd_jumpifsubstituteblocks, //0xE9 Cmd_tryrecycleitem, //0xEA @@ -14881,6 +14881,10 @@ static void Cmd_unused3(void) { } +static void Cmd_unused4(void) +{ +} + // Water and Mud Sport static void Cmd_settypebasedhalvers(void) { @@ -15845,84 +15849,6 @@ static void Cmd_jumpiffullparty(void) gBattlescriptCurrInstr = cmd->nextInstr; } -static void Cmd_tryaddcaughtmontofullparty(void) -{ - CMD_ARGS(const u8 *successInstr); - - switch (gBattleCommunication[MULTIUSE_STATE]) - { - case 0: - HandleBattleWindow(YESNOBOX_X_Y, 0); - BattlePutTextOnWindow(gText_BattleYesNoChoice, B_WIN_YESNO); - gBattleCommunication[MULTIUSE_STATE]++; - gBattleCommunication[CURSOR_POSITION] = 0; - BattleCreateYesNoCursorAt(0); - break; - case 1: - if (JOY_NEW(DPAD_UP) && gBattleCommunication[CURSOR_POSITION] != 0) - { - PlaySE(SE_SELECT); - BattleDestroyYesNoCursorAt(gBattleCommunication[CURSOR_POSITION]); - gBattleCommunication[CURSOR_POSITION] = 0; - BattleCreateYesNoCursorAt(0); - } - if (JOY_NEW(DPAD_DOWN) && gBattleCommunication[CURSOR_POSITION] == 0) - { - PlaySE(SE_SELECT); - BattleDestroyYesNoCursorAt(gBattleCommunication[CURSOR_POSITION]); - gBattleCommunication[CURSOR_POSITION] = 1; - BattleCreateYesNoCursorAt(1); - } - if (JOY_NEW(A_BUTTON)) - { - PlaySE(SE_SELECT); - if (gBattleCommunication[CURSOR_POSITION] == 0) - { - gBattleCommunication[MULTIUSE_STATE]++; - } - else - { - gBattleCommunication[MULTIUSE_STATE] = 4; - } - } - else if (JOY_NEW(B_BUTTON)) - { - PlaySE(SE_SELECT); - gBattleCommunication[MULTIUSE_STATE] = 4; - } - break; - case 2: - BtlController_EmitChoosePokemon(gBattlerAttacker, BUFFER_A, PARTY_ACTION_SEND_MON_TO_BOX, PARTY_SIZE, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gBattlerAttacker]); - MarkBattlerForControllerExec(gBattlerAttacker); - gBattleCommunication[MULTIUSE_STATE]++; - break; - case 3: - if (gSelectedMonPartyId != PARTY_SIZE) - { - MarkBattlerForControllerExec(gBattlerAttacker); - PREPARE_SPECIES_BUFFER(gBattleTextBuff1, GetMonData(&gPlayerParty[gSelectedMonPartyId], MON_DATA_SPECIES)); - - // Choosing Pokemon was cancelled if = PARTY_SIZE + 1 - if (gSelectedMonPartyId != PARTY_SIZE + 1) - { - u8 state = CopyMonToPC(&gPlayerParty[gSelectedMonPartyId]); - if (state == MON_GIVEN_TO_PC) - ZeroMonData(&gPlayerParty[gSelectedMonPartyId]); - } - - gSelectedMonPartyId = PARTY_SIZE; - gBattleCommunication[MULTIUSE_STATE]++; - } - break; - case 4: - if (CalculatePlayerPartyCount() == PARTY_SIZE) - gBattlescriptCurrInstr = cmd->nextInstr; - else - gBattlescriptCurrInstr = cmd->successInstr; - break; - } -} - static void Cmd_tryworryseed(void) { CMD_ARGS(const u8 *failInstr); @@ -17443,3 +17369,88 @@ void BS_SetMagicCoatTarget(void) gBattlescriptCurrInstr = cmd->nextInstr; } + +void BS_tryaddcaughtmontofullparty(void) +{ + NATIVE_ARGS(const u8 *successInstr); + + switch (gBattleCommunication[MULTIUSE_STATE]) + { + case 0: + HandleBattleWindow(YESNOBOX_X_Y, 0); + BattlePutTextOnWindow(gText_BattleYesNoChoice, B_WIN_YESNO); + gBattleCommunication[MULTIUSE_STATE]++; + gBattleCommunication[CURSOR_POSITION] = 0; + BattleCreateYesNoCursorAt(0); + break; + case 1: + if (JOY_NEW(DPAD_UP) && gBattleCommunication[CURSOR_POSITION] != 0) + { + PlaySE(SE_SELECT); + BattleDestroyYesNoCursorAt(gBattleCommunication[CURSOR_POSITION]); + gBattleCommunication[CURSOR_POSITION] = 0; + BattleCreateYesNoCursorAt(0); + } + if (JOY_NEW(DPAD_DOWN) && gBattleCommunication[CURSOR_POSITION] == 0) + { + PlaySE(SE_SELECT); + BattleDestroyYesNoCursorAt(gBattleCommunication[CURSOR_POSITION]); + gBattleCommunication[CURSOR_POSITION] = 1; + BattleCreateYesNoCursorAt(1); + } + if (JOY_NEW(A_BUTTON)) + { + PlaySE(SE_SELECT); + if (gBattleCommunication[CURSOR_POSITION] == 0) + { + gBattleCommunication[MULTIUSE_STATE]++; + } + else + { + gBattleCommunication[MULTIUSE_STATE] = 3; + } + } + else if (JOY_NEW(B_BUTTON)) + { + PlaySE(SE_SELECT); + gBattleCommunication[MULTIUSE_STATE] = 3; + } + break; + case 2: + if (gSelectedMonPartyId != PARTY_SIZE) + { + MarkBattlerForControllerExec(gBattlerAttacker); + GetMonNickname(&gPlayerParty[gSelectedMonPartyId], gBattleTextBuff1); + + // Choosing Pokemon was cancelled if = PARTY_SIZE + 1 + if (gSelectedMonPartyId != PARTY_SIZE + 1) + { + u8 state = CopyMonToPC(&gPlayerParty[gSelectedMonPartyId]); + if (state == MON_GIVEN_TO_PC) + { + StringCopy(gBattleTextBuff2, GetBoxNamePtr(GetPCBoxToSendMon())); + ZeroMonData(&gPlayerParty[gSelectedMonPartyId]); + } + } + + gSelectedMonPartyId = PARTY_SIZE; + gBattleCommunication[MULTIUSE_STATE]++; + } + else + { + BtlController_EmitChoosePokemon(gBattlerAttacker, BUFFER_A, PARTY_ACTION_SEND_MON_TO_BOX, PARTY_SIZE, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gBattlerAttacker]); + MarkBattlerForControllerExec(gBattlerAttacker); + } + break; + case 3: + if (CalculatePlayerPartyCount() == PARTY_SIZE) + { + gBattlescriptCurrInstr = cmd->nextInstr; + } + else + { + gBattlescriptCurrInstr = cmd->successInstr; + } + break; + } +} \ No newline at end of file From 9adc2027f14ad7df15ddbda44b8d636c83d9b45d Mon Sep 17 00:00:00 2001 From: fakuzatsu Date: Fri, 15 Nov 2024 21:22:28 +0000 Subject: [PATCH 05/19] fix party menu appearing twice --- src/battle_script_commands.c | 52 ++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 5340db004643..053cd1305918 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -17407,50 +17407,50 @@ void BS_tryaddcaughtmontofullparty(void) } else { - gBattleCommunication[MULTIUSE_STATE] = 3; + gBattleCommunication[MULTIUSE_STATE] = 4; } } else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); - gBattleCommunication[MULTIUSE_STATE] = 3; + gBattleCommunication[MULTIUSE_STATE] = 4; } break; case 2: + BtlController_EmitChoosePokemon(gBattlerAttacker, BUFFER_A, PARTY_ACTION_SEND_MON_TO_BOX, PARTY_SIZE, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gBattlerAttacker]); + MarkBattlerForControllerExec(gBattlerAttacker); + gBattleCommunication[MULTIUSE_STATE]++; + break; + case 3: if (gSelectedMonPartyId != PARTY_SIZE) { - MarkBattlerForControllerExec(gBattlerAttacker); - GetMonNickname(&gPlayerParty[gSelectedMonPartyId], gBattleTextBuff1); - - // Choosing Pokemon was cancelled if = PARTY_SIZE + 1 - if (gSelectedMonPartyId != PARTY_SIZE + 1) + if (gSelectedMonPartyId > PARTY_SIZE) { - u8 state = CopyMonToPC(&gPlayerParty[gSelectedMonPartyId]); - if (state == MON_GIVEN_TO_PC) + // Choosing Pokemon was cancelled + gSelectedMonPartyId = PARTY_SIZE; + gBattleCommunication[MULTIUSE_STATE]++; + } + else + { + // Mon chosen, try to put it in the PC + if (CopyMonToPC(&gPlayerParty[gSelectedMonPartyId]) == MON_GIVEN_TO_PC) { + GetMonNickname(&gPlayerParty[gSelectedMonPartyId], gBattleTextBuff1); StringCopy(gBattleTextBuff2, GetBoxNamePtr(GetPCBoxToSendMon())); ZeroMonData(&gPlayerParty[gSelectedMonPartyId]); + gSelectedMonPartyId = PARTY_SIZE; + gBattlescriptCurrInstr = cmd->successInstr; + } + else + { + gSelectedMonPartyId = PARTY_SIZE; + gBattleCommunication[MULTIUSE_STATE]++; } } - - gSelectedMonPartyId = PARTY_SIZE; - gBattleCommunication[MULTIUSE_STATE]++; - } - else - { - BtlController_EmitChoosePokemon(gBattlerAttacker, BUFFER_A, PARTY_ACTION_SEND_MON_TO_BOX, PARTY_SIZE, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gBattlerAttacker]); - MarkBattlerForControllerExec(gBattlerAttacker); } break; - case 3: - if (CalculatePlayerPartyCount() == PARTY_SIZE) - { - gBattlescriptCurrInstr = cmd->nextInstr; - } - else - { - gBattlescriptCurrInstr = cmd->successInstr; - } + case 4: + gBattlescriptCurrInstr = cmd->nextInstr; break; } } \ No newline at end of file From dbe9b797f917ef0c50c4fc61073686e588e9ecfd Mon Sep 17 00:00:00 2001 From: fakuzatsu Date: Fri, 15 Nov 2024 22:57:10 +0000 Subject: [PATCH 06/19] revert jumpiffullparty and begin naming screen --- asm/macros/battle_script.inc | 10 -- data/battle_scripts_2.s | 28 +-- include/constants/battle_string_ids.h | 9 +- src/battle_message.c | 1 + src/battle_script_commands.c | 246 +++++++++++++------------- src/naming_screen.c | 31 +++- 6 files changed, 157 insertions(+), 168 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 0c455600c6ac..c595e26f95b1 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1694,11 +1694,6 @@ callnative BS_SetMagicCoatTarget .endm - .macro tryaddcaughtmontofullparty successInstr:req - callnative BS_tryaddcaughtmontofullparty - .4byte \successInstr - .endm - @ various command changed to more readable macros .macro cancelmultiturnmoves battler:req various \battler, VARIOUS_CANCEL_MULTI_TURN_MOVES @@ -2521,8 +2516,3 @@ printstring STRINGID_EMPTYSTRING3 waitmessage 1 .endm - - .macro jumpiffullparty jumpInstr:req - .byte 0xFD - .4byte \jumpInstr - .endm diff --git a/data/battle_scripts_2.s b/data/battle_scripts_2.s index 1147e03dbd4b..be6c04e32eb9 100644 --- a/data/battle_scripts_2.s +++ b/data/battle_scripts_2.s @@ -175,43 +175,17 @@ BattleScript_TryNicknameCaughtMon:: printstring STRINGID_GIVENICKNAMECAPTURED waitstate setbyte gBattleCommunication, 0 - trygivecaughtmonnick BattleScript_CheckFullPartyThenEnd - jumpiffullparty BattleScript_SendCaughtMonPartyOrBox + trygivecaughtmonnick BattleScript_GiveCaughtMonEnd givecaughtmon printfromtable gCaughtMonStringIds waitmessage B_WAIT_TIME_LONG goto BattleScript_SuccessBallThrowEnd - -BattleScript_CheckFullPartyThenEnd:: - jumpiffullparty BattleScript_SendCaughtMonPartyOrBoxWithNick BattleScript_GiveCaughtMonEnd:: givecaughtmon BattleScript_SuccessBallThrowEnd:: setbyte gBattleOutcome, B_OUTCOME_CAUGHT finishturn -BattleScript_SendCaughtMonPartyOrBox:: - printstring STRINGID_SENDCAUGHTMONPARTYORBOX - waitstate - setbyte gBattleCommunication, 0 - tryaddcaughtmontofullparty BattleScript_SentMonToBoxToMakeSpace - givecaughtmon - printfromtable gCaughtMonStringIds - waitmessage B_WAIT_TIME_LONG - goto BattleScript_SuccessBallThrowEnd - -BattleScript_SendCaughtMonPartyOrBoxWithNick:: - printstring STRINGID_SENDCAUGHTMONPARTYORBOX - waitstate - setbyte gBattleCommunication, 0 - tryaddcaughtmontofullparty BattleScript_SentMonToBoxToMakeSpace - goto BattleScript_GiveCaughtMonEnd - -BattleScript_SentMonToBoxToMakeSpace:: - printstring STRINGID_PKMNSENTTOPCAFTERCATCH - waitmessage B_WAIT_TIME_MED - goto BattleScript_GiveCaughtMonEnd - BattleScript_WallyBallThrow:: printstring STRINGID_GOTCHAPKMNCAUGHTWALLY setbyte gBattleOutcome, B_OUTCOME_CAUGHT diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index bad773301c98..de89e4d14397 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -871,10 +871,11 @@ #define B_MSG_WEAKEN_FIRE 1 // gCaughtMonStringIds -#define B_MSG_SENT_SOMEONES_PC 0 -#define B_MSG_SENT_LANETTES_PC 1 -#define B_MSG_SOMEONES_BOX_FULL 2 -#define B_MSG_LANETTES_BOX_FULL 3 +#define B_MSG_SENT_SOMEONES_PC 0 +#define B_MSG_SENT_LANETTES_PC 1 +#define B_MSG_SOMEONES_BOX_FULL 2 +#define B_MSG_LANETTES_BOX_FULL 3 +#define B_MSG_SWAPPED_INTO_PARTY 4 // gPrimalWeatherBlocksStringIds #define B_MSG_PRIMAL_WEATHER_FIZZLED_BY_RAIN 0 diff --git a/src/battle_message.c b/src/battle_message.c index e4bec2f9bf2c..2fa72b521e2c 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -2032,6 +2032,7 @@ const u16 gCaughtMonStringIds[] = [B_MSG_SENT_LANETTES_PC] = STRINGID_PKMNTRANSFERREDLANETTESPC, [B_MSG_SOMEONES_BOX_FULL] = STRINGID_PKMNBOXSOMEONESPCFULL, [B_MSG_LANETTES_BOX_FULL] = STRINGID_PKMNBOXLANETTESPCFULL, + [B_MSG_SWAPPED_INTO_PARTY] = STRINGID_PKMNSENTTOPCAFTERCATCH, }; const u16 gRoomsStringIds[] = diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 053cd1305918..3692b1ecd492 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -593,7 +593,7 @@ static void Cmd_settelekinesis(void); static void Cmd_swapstatstages(void); static void Cmd_averagestats(void); static void Cmd_jumpifoppositegenders(void); -static void Cmd_jumpiffullparty(void); +static void Cmd_unused(void); static void Cmd_tryworryseed(void); static void Cmd_callnative(void); @@ -852,7 +852,7 @@ void (* const gBattleScriptingCommandsTable[])(void) = Cmd_swapstatstages, //0xFA Cmd_averagestats, //0xFB Cmd_jumpifoppositegenders, //0xFC - Cmd_jumpiffullparty, //0xFD + Cmd_unused, //0xFD Cmd_tryworryseed, //0xFE Cmd_callnative, //0xFF }; @@ -15453,39 +15453,132 @@ static void Cmd_givecaughtmon(void) { CMD_ARGS(); - if (B_RESTORE_HELD_BATTLE_ITEMS >= GEN_9) - { - u16 lostItem = gBattleStruct->itemLost[B_SIDE_OPPONENT][gBattlerPartyIndexes[GetCatchingBattler()]].originalItem; - if (lostItem != ITEM_NONE && ItemId_GetPocket(lostItem) != POCKET_BERRIES) - SetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_HELD_ITEM, &lostItem); // Restore non-berry items - } - - if (GiveMonToPlayer(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]]) != MON_GIVEN_TO_PARTY) + switch (gBattleCommunication[MULTIUSE_STATE]) { - if (!ShouldShowBoxWasFullMessage()) + case 0: + if (CalculatePlayerPartyCount() == PARTY_SIZE) { - gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SENT_SOMEONES_PC; - StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_PC_BOX_TO_SEND_MON))); - GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_NICKNAME, gStringVar2); + PrepareStringBattle(STRINGID_SENDCAUGHTMONPARTYORBOX, gBattlerAttacker); + gBattleCommunication[MSG_DISPLAY] = 1; + gBattleCommunication[MULTIUSE_STATE]++; } else { - StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_PC_BOX_TO_SEND_MON))); // box the mon was sent to - GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_NICKNAME, gStringVar2); - StringCopy(gStringVar3, GetBoxNamePtr(GetPCBoxToSendMon())); //box the mon was going to be sent to - gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SOMEONES_BOX_FULL; + gBattleCommunication[MULTIUSE_STATE] = 5; + } + break; + case 1: + HandleBattleWindow(YESNOBOX_X_Y, 0); + BattlePutTextOnWindow(gText_BattleYesNoChoice, B_WIN_YESNO); + gBattleCommunication[MULTIUSE_STATE]++; + gBattleCommunication[CURSOR_POSITION] = 0; + BattleCreateYesNoCursorAt(0); + break; + case 2: + if (JOY_NEW(DPAD_UP) && gBattleCommunication[CURSOR_POSITION] != 0) + { + PlaySE(SE_SELECT); + BattleDestroyYesNoCursorAt(gBattleCommunication[CURSOR_POSITION]); + gBattleCommunication[CURSOR_POSITION] = 0; + BattleCreateYesNoCursorAt(0); + } + if (JOY_NEW(DPAD_DOWN) && gBattleCommunication[CURSOR_POSITION] == 0) + { + PlaySE(SE_SELECT); + BattleDestroyYesNoCursorAt(gBattleCommunication[CURSOR_POSITION]); + gBattleCommunication[CURSOR_POSITION] = 1; + BattleCreateYesNoCursorAt(1); + } + if (JOY_NEW(A_BUTTON)) + { + PlaySE(SE_SELECT); + if (gBattleCommunication[CURSOR_POSITION] == 0) + { + gBattleCommunication[MULTIUSE_STATE]++; + } + else + { + gBattleCommunication[MULTIUSE_STATE] = 5; + } + } + else if (JOY_NEW(B_BUTTON)) + { + PlaySE(SE_SELECT); + gBattleCommunication[MULTIUSE_STATE] = 5; + } + break; + case 3: + BtlController_EmitChoosePokemon(gBattlerAttacker, BUFFER_A, PARTY_ACTION_SEND_MON_TO_BOX, PARTY_SIZE, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gBattlerAttacker]); + MarkBattlerForControllerExec(gBattlerAttacker); + gBattleCommunication[MULTIUSE_STATE]++; + break; + case 4: + if (gSelectedMonPartyId != PARTY_SIZE) + { + if (gSelectedMonPartyId > PARTY_SIZE) + { + // Choosing Pokemon was cancelled + gSelectedMonPartyId = PARTY_SIZE; + gBattleCommunication[MULTIUSE_STATE]++; + } + else + { + // Mon chosen, try to put it in the PC + if (CopyMonToPC(&gPlayerParty[gSelectedMonPartyId]) == MON_GIVEN_TO_PC) + { + GetMonNickname(&gPlayerParty[gSelectedMonPartyId], gBattleTextBuff1); + StringCopy(gBattleTextBuff2, GetBoxNamePtr(GetPCBoxToSendMon())); + ZeroMonData(&gPlayerParty[gSelectedMonPartyId]); + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWAPPED_INTO_PARTY; + gSelectedMonPartyId = PARTY_SIZE; + gBattleCommunication[MULTIUSE_STATE]++; + } + else + { + gSelectedMonPartyId = PARTY_SIZE; + gBattleCommunication[MULTIUSE_STATE]++; + } + } + } + break; + case 5: + if (B_RESTORE_HELD_BATTLE_ITEMS >= GEN_9) + { + u16 lostItem = gBattleStruct->itemLost[B_SIDE_OPPONENT][gBattlerPartyIndexes[GetCatchingBattler()]].originalItem; + if (lostItem != ITEM_NONE && ItemId_GetPocket(lostItem) != POCKET_BERRIES) + SetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_HELD_ITEM, &lostItem); // Restore non-berry items } - // Change to B_MSG_SENT_LANETTES_PC or B_MSG_LANETTES_BOX_FULL - if (FlagGet(FLAG_SYS_PC_LANETTE)) - gBattleCommunication[MULTISTRING_CHOOSER]++; - } + if (GiveMonToPlayer(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]]) != MON_GIVEN_TO_PARTY + && gBattleCommunication[MULTISTRING_CHOOSER] != B_MSG_SWAPPED_INTO_PARTY) + { + if (!ShouldShowBoxWasFullMessage()) + { + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SENT_SOMEONES_PC; + StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_PC_BOX_TO_SEND_MON))); + GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_NICKNAME, gStringVar2); + } + else + { + StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_PC_BOX_TO_SEND_MON))); // box the mon was sent to + GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_NICKNAME, gStringVar2); + StringCopy(gStringVar3, GetBoxNamePtr(GetPCBoxToSendMon())); //box the mon was going to be sent to + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SOMEONES_BOX_FULL; + } - gBattleResults.caughtMonSpecies = GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_SPECIES, NULL); - GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_NICKNAME, gBattleResults.caughtMonNick); - gBattleResults.caughtMonBall = GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_POKEBALL, NULL); + // Change to B_MSG_SENT_LANETTES_PC or B_MSG_LANETTES_BOX_FULL + if (FlagGet(FLAG_SYS_PC_LANETTE)) + gBattleCommunication[MULTISTRING_CHOOSER]++; + } - gBattlescriptCurrInstr = cmd->nextInstr; + gBattleResults.caughtMonSpecies = GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_SPECIES, NULL); + GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_NICKNAME, gBattleResults.caughtMonNick); + gBattleResults.caughtMonBall = GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_POKEBALL, NULL); + + gBattleCommunication[MULTIUSE_STATE] = 0; + gBattlescriptCurrInstr = cmd->nextInstr; + break; + } } static void Cmd_trysetcaughtmondexflags(void) @@ -15696,6 +15789,7 @@ static void Cmd_trygivecaughtmonnick(void) } break; case 4: + gBattleCommunication[MULTIUSE_STATE] = 0; if (CalculatePlayerPartyCount() == PARTY_SIZE) gBattlescriptCurrInstr = cmd->nextInstr; else @@ -15832,21 +15926,8 @@ static void Cmd_jumpifoppositegenders(void) gBattlescriptCurrInstr = cmd->nextInstr; } -static void Cmd_jumpiffullparty(void) +static void Cmd_unused(void) { - CMD_ARGS(const u8 *jumpInstr); - u32 i = 0; - - for (i = 0; i < PARTY_SIZE; i++) - { - if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL) == SPECIES_NONE) - break; - } - - if (i >= PARTY_SIZE) - gBattlescriptCurrInstr = cmd->jumpInstr; - else - gBattlescriptCurrInstr = cmd->nextInstr; } static void Cmd_tryworryseed(void) @@ -17369,88 +17450,3 @@ void BS_SetMagicCoatTarget(void) gBattlescriptCurrInstr = cmd->nextInstr; } - -void BS_tryaddcaughtmontofullparty(void) -{ - NATIVE_ARGS(const u8 *successInstr); - - switch (gBattleCommunication[MULTIUSE_STATE]) - { - case 0: - HandleBattleWindow(YESNOBOX_X_Y, 0); - BattlePutTextOnWindow(gText_BattleYesNoChoice, B_WIN_YESNO); - gBattleCommunication[MULTIUSE_STATE]++; - gBattleCommunication[CURSOR_POSITION] = 0; - BattleCreateYesNoCursorAt(0); - break; - case 1: - if (JOY_NEW(DPAD_UP) && gBattleCommunication[CURSOR_POSITION] != 0) - { - PlaySE(SE_SELECT); - BattleDestroyYesNoCursorAt(gBattleCommunication[CURSOR_POSITION]); - gBattleCommunication[CURSOR_POSITION] = 0; - BattleCreateYesNoCursorAt(0); - } - if (JOY_NEW(DPAD_DOWN) && gBattleCommunication[CURSOR_POSITION] == 0) - { - PlaySE(SE_SELECT); - BattleDestroyYesNoCursorAt(gBattleCommunication[CURSOR_POSITION]); - gBattleCommunication[CURSOR_POSITION] = 1; - BattleCreateYesNoCursorAt(1); - } - if (JOY_NEW(A_BUTTON)) - { - PlaySE(SE_SELECT); - if (gBattleCommunication[CURSOR_POSITION] == 0) - { - gBattleCommunication[MULTIUSE_STATE]++; - } - else - { - gBattleCommunication[MULTIUSE_STATE] = 4; - } - } - else if (JOY_NEW(B_BUTTON)) - { - PlaySE(SE_SELECT); - gBattleCommunication[MULTIUSE_STATE] = 4; - } - break; - case 2: - BtlController_EmitChoosePokemon(gBattlerAttacker, BUFFER_A, PARTY_ACTION_SEND_MON_TO_BOX, PARTY_SIZE, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gBattlerAttacker]); - MarkBattlerForControllerExec(gBattlerAttacker); - gBattleCommunication[MULTIUSE_STATE]++; - break; - case 3: - if (gSelectedMonPartyId != PARTY_SIZE) - { - if (gSelectedMonPartyId > PARTY_SIZE) - { - // Choosing Pokemon was cancelled - gSelectedMonPartyId = PARTY_SIZE; - gBattleCommunication[MULTIUSE_STATE]++; - } - else - { - // Mon chosen, try to put it in the PC - if (CopyMonToPC(&gPlayerParty[gSelectedMonPartyId]) == MON_GIVEN_TO_PC) - { - GetMonNickname(&gPlayerParty[gSelectedMonPartyId], gBattleTextBuff1); - StringCopy(gBattleTextBuff2, GetBoxNamePtr(GetPCBoxToSendMon())); - ZeroMonData(&gPlayerParty[gSelectedMonPartyId]); - gSelectedMonPartyId = PARTY_SIZE; - gBattlescriptCurrInstr = cmd->successInstr; - } - else - { - gSelectedMonPartyId = PARTY_SIZE; - gBattleCommunication[MULTIUSE_STATE]++; - } - } - } - break; - case 4: - gBattlescriptCurrInstr = cmd->nextInstr; - break; - } -} \ No newline at end of file diff --git a/src/naming_screen.c b/src/naming_screen.c index 118d91cfb416..bca6a8ba067c 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -128,6 +128,7 @@ enum { STATE_WAIT_PAGE_SWAP, STATE_PRESSED_OK, STATE_WAIT_SENT_TO_PC_MESSAGE, + STATE_ASK_ADD_MON_TO_PARTY, STATE_FADE_OUT, STATE_EXIT, }; @@ -340,7 +341,9 @@ static bool8 MainState_PressedOKButton(void); static bool8 MainState_FadeOut(void); static bool8 MainState_Exit(void); static void DisplaySentToPCMessage(void); +static void AskAddMonToParty(void); static bool8 MainState_WaitSentToPCMessage(void); +static bool8 MainState_WaitAddMonToPartyResponse(void); static bool8 MainState_StartPageSwap(void); static bool8 MainState_WaitPageSwap(void); static void StartPageSwapAnim(void); @@ -571,6 +574,9 @@ static void Task_NamingScreen(u8 taskId) case STATE_WAIT_SENT_TO_PC_MESSAGE: MainState_WaitSentToPCMessage(); break; + case STATE_ASK_ADD_MON_TO_PARTY: + MainState_WaitAddMonToPartyResponse(); + break; case STATE_FADE_OUT: MainState_FadeOut(); break; @@ -675,8 +681,8 @@ static bool8 MainState_PressedOKButton(void) if (sNamingScreen->templateNum == NAMING_SCREEN_CAUGHT_MON && CalculatePlayerPartyCount() >= PARTY_SIZE) { - DisplaySentToPCMessage(); - sNamingScreen->state = STATE_WAIT_SENT_TO_PC_MESSAGE; + AskAddMonToParty(); + sNamingScreen->state = STATE_ASK_ADD_MON_TO_PARTY; return FALSE; } else @@ -734,6 +740,18 @@ static void DisplaySentToPCMessage(void) CopyWindowToVram(0, COPYWIN_FULL); } +static const u8 sText_SendCaughtMonPartyOrBox[] = _("Add {STR_VAR_2} to your party?"); + +static void AskAddMonToParty(void) +{ + StringCopy(gStringVar2, sNamingScreen->destBuffer); + StringExpandPlaceholders(gStringVar4, sText_SendCaughtMonPartyOrBox); + DrawDialogueFrame(0, FALSE); + gTextFlags.canABSpeedUpPrint = TRUE; + AddTextPrinterParameterized2(0, FONT_NORMAL, gStringVar4, GetPlayerTextSpeedDelay(), 0, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY); + CopyWindowToVram(0, COPYWIN_FULL); +} + static bool8 MainState_WaitSentToPCMessage(void) { RunTextPrinters(); @@ -743,6 +761,15 @@ static bool8 MainState_WaitSentToPCMessage(void) return FALSE; } +static bool8 MainState_WaitAddMonToPartyResponse(void) +{ + RunTextPrinters(); + if (!IsTextPrinterActive(0) && JOY_NEW(A_BUTTON)) + sNamingScreen->state = STATE_FADE_OUT; + + return FALSE; +} + static bool8 MainState_StartPageSwap(void) { SetInputState(INPUT_STATE_DISABLED); From 2942cc999366e13e207bed1c514c1f9afe7f3080 Mon Sep 17 00:00:00 2001 From: fakuzatsu Date: Sat, 16 Nov 2024 14:20:17 +0000 Subject: [PATCH 07/19] all works but no message after naming screen --- asm/macros/battle_script.inc | 3 ++- data/battle_scripts_2.s | 4 +-- include/naming_screen.h | 2 ++ src/battle_script_commands.c | 35 ++++++++++++++++++-------- src/naming_screen.c | 49 ++++++------------------------------ 5 files changed, 38 insertions(+), 55 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index c595e26f95b1..1e921a3647fc 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1277,8 +1277,9 @@ .byte 0xef .endm - .macro givecaughtmon + .macro givecaughtmon passInstr:req .byte 0xf0 + .4byte \passInstr .endm .macro trysetcaughtmondexflags failInstr:req diff --git a/data/battle_scripts_2.s b/data/battle_scripts_2.s index be6c04e32eb9..b088836aeb3c 100644 --- a/data/battle_scripts_2.s +++ b/data/battle_scripts_2.s @@ -176,12 +176,12 @@ BattleScript_TryNicknameCaughtMon:: waitstate setbyte gBattleCommunication, 0 trygivecaughtmonnick BattleScript_GiveCaughtMonEnd - givecaughtmon + givecaughtmon BattleScript_SuccessBallThrowEnd printfromtable gCaughtMonStringIds waitmessage B_WAIT_TIME_LONG goto BattleScript_SuccessBallThrowEnd BattleScript_GiveCaughtMonEnd:: - givecaughtmon + givecaughtmon BattleScript_SuccessBallThrowEnd BattleScript_SuccessBallThrowEnd:: setbyte gBattleOutcome, B_OUTCOME_CAUGHT finishturn diff --git a/include/naming_screen.h b/include/naming_screen.h index 93527640e562..b49081fdcd4d 100644 --- a/include/naming_screen.h +++ b/include/naming_screen.h @@ -11,6 +11,8 @@ enum { NAMING_SCREEN_WALDA, }; +extern void BattleMainCB2(void); + void DoNamingScreen(u8 templateNum, u8 *destBuffer, u16 monSpecies, u16 monGender, u32 monPersonality, MainCallback returnCallback); #endif // GUARD_NAMING_SCREEN_H diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 3692b1ecd492..76cd795a8c8d 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -15451,7 +15451,7 @@ static void Cmd_handleballthrow(void) static void Cmd_givecaughtmon(void) { - CMD_ARGS(); + CMD_ARGS(const u8 *passInstr); switch (gBattleCommunication[MULTIUSE_STATE]) { @@ -15464,6 +15464,7 @@ static void Cmd_givecaughtmon(void) } else { + gSelectedMonPartyId = PARTY_SIZE + 1; gBattleCommunication[MULTIUSE_STATE] = 5; } break; @@ -15508,9 +15509,12 @@ static void Cmd_givecaughtmon(void) } break; case 3: - BtlController_EmitChoosePokemon(gBattlerAttacker, BUFFER_A, PARTY_ACTION_SEND_MON_TO_BOX, PARTY_SIZE, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gBattlerAttacker]); - MarkBattlerForControllerExec(gBattlerAttacker); - gBattleCommunication[MULTIUSE_STATE]++; + if (!gPaletteFade.active) + { + BtlController_EmitChoosePokemon(gBattlerAttacker, BUFFER_A, PARTY_ACTION_SEND_MON_TO_BOX, PARTY_SIZE, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gBattlerAttacker]); + MarkBattlerForControllerExec(gBattlerAttacker); + gBattleCommunication[MULTIUSE_STATE]++; + } break; case 4: if (gSelectedMonPartyId != PARTY_SIZE) @@ -15575,8 +15579,12 @@ static void Cmd_givecaughtmon(void) GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_NICKNAME, gBattleResults.caughtMonNick); gBattleResults.caughtMonBall = GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_POKEBALL, NULL); + if (gSelectedMonPartyId > PARTY_SIZE) + gBattlescriptCurrInstr = cmd->passInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; + gSelectedMonPartyId = PARTY_SIZE; gBattleCommunication[MULTIUSE_STATE] = 0; - gBattlescriptCurrInstr = cmd->nextInstr; break; } } @@ -15776,7 +15784,7 @@ static void Cmd_trygivecaughtmonnick(void) GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_SPECIES), GetMonGender(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]]), GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_PERSONALITY, NULL), - BattleMainCB2); + ReshowBattleScreenAfterMenu); gBattleCommunication[MULTIUSE_STATE]++; } @@ -15785,15 +15793,20 @@ static void Cmd_trygivecaughtmonnick(void) if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active) { SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_NICKNAME, gBattleStruct->caughtMonNick); - gBattlescriptCurrInstr = cmd->successInstr; + if (CalculatePlayerPartyCount() <= PARTY_SIZE) + { + gBattleCommunication[MULTIUSE_STATE] = 0; + gBattlescriptCurrInstr = cmd->successInstr; + } + else + { + gBattleCommunication[MULTIUSE_STATE]++; + } } break; case 4: gBattleCommunication[MULTIUSE_STATE] = 0; - if (CalculatePlayerPartyCount() == PARTY_SIZE) - gBattlescriptCurrInstr = cmd->nextInstr; - else - gBattlescriptCurrInstr = cmd->successInstr; + gBattlescriptCurrInstr = cmd->nextInstr; break; } } diff --git a/src/naming_screen.c b/src/naming_screen.c index bca6a8ba067c..42dc4301ee08 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -128,7 +128,6 @@ enum { STATE_WAIT_PAGE_SWAP, STATE_PRESSED_OK, STATE_WAIT_SENT_TO_PC_MESSAGE, - STATE_ASK_ADD_MON_TO_PARTY, STATE_FADE_OUT, STATE_EXIT, }; @@ -341,9 +340,7 @@ static bool8 MainState_PressedOKButton(void); static bool8 MainState_FadeOut(void); static bool8 MainState_Exit(void); static void DisplaySentToPCMessage(void); -static void AskAddMonToParty(void); static bool8 MainState_WaitSentToPCMessage(void); -static bool8 MainState_WaitAddMonToPartyResponse(void); static bool8 MainState_StartPageSwap(void); static bool8 MainState_WaitPageSwap(void); static void StartPageSwapAnim(void); @@ -574,9 +571,6 @@ static void Task_NamingScreen(u8 taskId) case STATE_WAIT_SENT_TO_PC_MESSAGE: MainState_WaitSentToPCMessage(); break; - case STATE_ASK_ADD_MON_TO_PARTY: - MainState_WaitAddMonToPartyResponse(); - break; case STATE_FADE_OUT: MainState_FadeOut(); break; @@ -678,18 +672,8 @@ static bool8 MainState_PressedOKButton(void) SetInputState(INPUT_STATE_DISABLED); SetCursorFlashing(FALSE); TryStartButtonFlash(BUTTON_COUNT, FALSE, TRUE); - if (sNamingScreen->templateNum == NAMING_SCREEN_CAUGHT_MON - && CalculatePlayerPartyCount() >= PARTY_SIZE) - { - AskAddMonToParty(); - sNamingScreen->state = STATE_ASK_ADD_MON_TO_PARTY; - return FALSE; - } - else - { - sNamingScreen->state = STATE_FADE_OUT; - return TRUE; - } + sNamingScreen->state = STATE_FADE_OUT; + return TRUE; } static bool8 MainState_FadeOut(void) @@ -705,7 +689,11 @@ static bool8 MainState_Exit(void) { if (sNamingScreen->templateNum == NAMING_SCREEN_PLAYER) SeedRngAndSetTrainerId(); - SetMainCallback2(sNamingScreen->returnCallback); + if (sNamingScreen->templateNum == NAMING_SCREEN_CAUGHT_MON + && CalculatePlayerPartyCount() < PARTY_SIZE) + SetMainCallback2(BattleMainCB2); + else + SetMainCallback2(sNamingScreen->returnCallback); DestroyTask(FindTaskIdByFunc(Task_NamingScreen)); FreeAllWindowBuffers(); FREE_AND_SET_NULL(sNamingScreen); @@ -713,7 +701,7 @@ static bool8 MainState_Exit(void) return FALSE; } -static void DisplaySentToPCMessage(void) +static UNUSED void DisplaySentToPCMessage(void) { u8 stringToDisplay = 0; @@ -740,18 +728,6 @@ static void DisplaySentToPCMessage(void) CopyWindowToVram(0, COPYWIN_FULL); } -static const u8 sText_SendCaughtMonPartyOrBox[] = _("Add {STR_VAR_2} to your party?"); - -static void AskAddMonToParty(void) -{ - StringCopy(gStringVar2, sNamingScreen->destBuffer); - StringExpandPlaceholders(gStringVar4, sText_SendCaughtMonPartyOrBox); - DrawDialogueFrame(0, FALSE); - gTextFlags.canABSpeedUpPrint = TRUE; - AddTextPrinterParameterized2(0, FONT_NORMAL, gStringVar4, GetPlayerTextSpeedDelay(), 0, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY); - CopyWindowToVram(0, COPYWIN_FULL); -} - static bool8 MainState_WaitSentToPCMessage(void) { RunTextPrinters(); @@ -761,15 +737,6 @@ static bool8 MainState_WaitSentToPCMessage(void) return FALSE; } -static bool8 MainState_WaitAddMonToPartyResponse(void) -{ - RunTextPrinters(); - if (!IsTextPrinterActive(0) && JOY_NEW(A_BUTTON)) - sNamingScreen->state = STATE_FADE_OUT; - - return FALSE; -} - static bool8 MainState_StartPageSwap(void) { SetInputState(INPUT_STATE_DISABLED); From 45c3c491380d0fcc94e6d8577164eb715180e076 Mon Sep 17 00:00:00 2001 From: fakuzatsu Date: Sat, 16 Nov 2024 16:24:47 +0000 Subject: [PATCH 08/19] refactor how the battle message is shown --- asm/macros/battle_script.inc | 3 +-- data/battle_scripts_2.s | 2 +- data/text/pc_transfer.inc | 6 ++++++ include/constants/battle_string_ids.h | 11 ++++++----- include/strings.h | 1 + src/battle_message.c | 5 ++--- src/battle_script_commands.c | 25 +++++++++---------------- 7 files changed, 26 insertions(+), 27 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 1e921a3647fc..9b6f605ee433 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1291,9 +1291,8 @@ .byte 0xf2 .endm - .macro trygivecaughtmonnick successInstr:req + .macro trygivecaughtmonnick .byte 0xf3 - .4byte \successInstr .endm .macro subattackerhpbydmg diff --git a/data/battle_scripts_2.s b/data/battle_scripts_2.s index b088836aeb3c..47861c732778 100644 --- a/data/battle_scripts_2.s +++ b/data/battle_scripts_2.s @@ -175,7 +175,7 @@ BattleScript_TryNicknameCaughtMon:: printstring STRINGID_GIVENICKNAMECAPTURED waitstate setbyte gBattleCommunication, 0 - trygivecaughtmonnick BattleScript_GiveCaughtMonEnd + trygivecaughtmonnick givecaughtmon BattleScript_SuccessBallThrowEnd printfromtable gCaughtMonStringIds waitmessage B_WAIT_TIME_LONG diff --git a/data/text/pc_transfer.inc b/data/text/pc_transfer.inc index 3fa255340b8b..b6995d1111c4 100644 --- a/data/text/pc_transfer.inc +++ b/data/text/pc_transfer.inc @@ -22,6 +22,12 @@ gText_PkmnTransferredLanettesPCBoxFull:: .string "{STR_VAR_2} was transferred to\n" .string "BOX “{STR_VAR_1}.”$" +gText_PkmnSentToPCAfterCatch:: + .string "{STR_VAR_2} was sent to\n" + .string "{B_PC_CREATOR_NAME} PC.\p" + .string "It was placed in \n" + .string "BOX “{STR_VAR_1}”.$" + gText_NoMoreRoomForPokemon:: .string "There's no more room for POKéMON!\p" .string "The POKéMON BOXES are full and\n" diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index de89e4d14397..8efa699202ab 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -871,11 +871,12 @@ #define B_MSG_WEAKEN_FIRE 1 // gCaughtMonStringIds -#define B_MSG_SENT_SOMEONES_PC 0 -#define B_MSG_SENT_LANETTES_PC 1 -#define B_MSG_SOMEONES_BOX_FULL 2 -#define B_MSG_LANETTES_BOX_FULL 3 -#define B_MSG_SWAPPED_INTO_PARTY 4 +#define B_MSG_NO_MESSSAGE_SKIP 0 +#define B_MSG_SENT_SOMEONES_PC 1 +#define B_MSG_SENT_LANETTES_PC 2 +#define B_MSG_SOMEONES_BOX_FULL 3 +#define B_MSG_LANETTES_BOX_FULL 4 +#define B_MSG_SWAPPED_INTO_PARTY 5 // gPrimalWeatherBlocksStringIds #define B_MSG_PRIMAL_WEATHER_FIZZLED_BY_RAIN 0 diff --git a/include/strings.h b/include/strings.h index 2963eb96d15c..dc0184efcaee 100644 --- a/include/strings.h +++ b/include/strings.h @@ -2091,6 +2091,7 @@ extern const u8 gText_PkmnTransferredSomeonesPCBoxFull[]; extern const u8 gText_PkmnTransferredLanettesPCBoxFull[]; extern const u8 gText_PkmnTransferredSomeonesPC[]; extern const u8 gText_PkmnTransferredLanettesPC[]; +extern const u8 gText_PkmnSentToPCAfterCatch[]; // hall of fame extern const u8 gText_LeagueChamp[]; diff --git a/src/battle_message.c b/src/battle_message.c index 2fa72b521e2c..c32770fdc2ef 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -497,7 +497,6 @@ static const u8 sText_Someones[] = _("someone's"); static const u8 sText_Lanettes[] = _("LANETTE's"); static const u8 sText_PkmnDataAddedToDex[] = _("{B_DEF_NAME}'s data was\nadded to the POKéDEX.\p"); static const u8 sText_SendCaughtMonPartyOrBox[] = _("Add {B_DEF_NAME} to your party?"); -static const u8 sText_PkmnSentToPCAfterCatch[] = _("{B_BUFF1} was sent to\n{B_PC_CREATOR_NAME} PC.\pIt was placed in \nBOX “{B_BUFF2}”."); static const u8 sText_ItIsRaining[] = _("It is raining."); static const u8 sText_SandstormIsRaging[] = _("A sandstorm is raging."); @@ -1375,6 +1374,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_PKMNTRANSFERREDLANETTESPC - BATTLESTRINGS_TABLE_START] = gText_PkmnTransferredLanettesPC, [STRINGID_PKMNBOXSOMEONESPCFULL - BATTLESTRINGS_TABLE_START] = gText_PkmnTransferredSomeonesPCBoxFull, [STRINGID_PKMNBOXLANETTESPCFULL - BATTLESTRINGS_TABLE_START] = gText_PkmnTransferredLanettesPCBoxFull, + [STRINGID_PKMNSENTTOPCAFTERCATCH - BATTLESTRINGS_TABLE_START] = gText_PkmnSentToPCAfterCatch, [STRINGID_TRAINER1WINTEXT - BATTLESTRINGS_TABLE_START] = sText_Trainer1WinText, [STRINGID_TRAINER2WINTEXT - BATTLESTRINGS_TABLE_START] = sText_Trainer2WinText, [STRINGID_ENDUREDSTURDY - BATTLESTRINGS_TABLE_START] = sText_EnduredViaSturdy, @@ -1557,8 +1557,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_ATTACKERLOSTITSTYPE - BATTLESTRINGS_TABLE_START] = sText_AttackerLostItsType, [STRINGID_CLOAKEDINAHARSHLIGHT - BATTLESTRINGS_TABLE_START] = sText_PkmnIsCloakedInAHarshLight, [STRINGID_BLOCKEDBYSLEEPCLAUSE - BATTLESTRINGS_TABLE_START] = sText_BlockedBySleepClause, - [STRINGID_SENDCAUGHTMONPARTYORBOX - BATTLESTRINGS_TABLE_START] = sText_SendCaughtMonPartyOrBox, - [STRINGID_PKMNSENTTOPCAFTERCATCH - BATTLESTRINGS_TABLE_START] = sText_PkmnSentToPCAfterCatch, + [STRINGID_SENDCAUGHTMONPARTYORBOX - BATTLESTRINGS_TABLE_START] = sText_AddCaughtMonToFullParty, }; const u16 gTrainerUsedItemStringIds[] = diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 76cd795a8c8d..bc6329253041 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -15464,7 +15464,7 @@ static void Cmd_givecaughtmon(void) } else { - gSelectedMonPartyId = PARTY_SIZE + 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_NO_MESSSAGE_SKIP; gBattleCommunication[MULTIUSE_STATE] = 5; } break; @@ -15530,8 +15530,8 @@ static void Cmd_givecaughtmon(void) // Mon chosen, try to put it in the PC if (CopyMonToPC(&gPlayerParty[gSelectedMonPartyId]) == MON_GIVEN_TO_PC) { - GetMonNickname(&gPlayerParty[gSelectedMonPartyId], gBattleTextBuff1); - StringCopy(gBattleTextBuff2, GetBoxNamePtr(GetPCBoxToSendMon())); + GetMonNickname(&gPlayerParty[gSelectedMonPartyId], gStringVar2); + StringCopy(gStringVar1, GetBoxNamePtr(GetPCBoxToSendMon())); ZeroMonData(&gPlayerParty[gSelectedMonPartyId]); gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWAPPED_INTO_PARTY; gSelectedMonPartyId = PARTY_SIZE; @@ -15579,12 +15579,13 @@ static void Cmd_givecaughtmon(void) GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_NICKNAME, gBattleResults.caughtMonNick); gBattleResults.caughtMonBall = GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_POKEBALL, NULL); - if (gSelectedMonPartyId > PARTY_SIZE) + gSelectedMonPartyId = PARTY_SIZE; + gBattleCommunication[MULTIUSE_STATE] = 0; + + if (gBattleCommunication[MULTISTRING_CHOOSER] == B_MSG_NO_MESSSAGE_SKIP) gBattlescriptCurrInstr = cmd->passInstr; else gBattlescriptCurrInstr = cmd->nextInstr; - gSelectedMonPartyId = PARTY_SIZE; - gBattleCommunication[MULTIUSE_STATE] = 0; break; } } @@ -15729,7 +15730,7 @@ void BattleDestroyYesNoCursorAt(u8 cursorPosition) static void Cmd_trygivecaughtmonnick(void) { - CMD_ARGS(const u8 *successInstr); + CMD_ARGS(); switch (gBattleCommunication[MULTIUSE_STATE]) { @@ -15793,15 +15794,7 @@ static void Cmd_trygivecaughtmonnick(void) if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active) { SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_NICKNAME, gBattleStruct->caughtMonNick); - if (CalculatePlayerPartyCount() <= PARTY_SIZE) - { - gBattleCommunication[MULTIUSE_STATE] = 0; - gBattlescriptCurrInstr = cmd->successInstr; - } - else - { - gBattleCommunication[MULTIUSE_STATE]++; - } + gBattleCommunication[MULTIUSE_STATE]++; } break; case 4: From 5aa30595831563ea573bc089c36aed1cda197e58 Mon Sep 17 00:00:00 2001 From: fakuzatsu Date: Sat, 16 Nov 2024 16:28:56 +0000 Subject: [PATCH 09/19] small cleanup --- asm/macros/battle_script.inc | 2 +- src/battle_message.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 9b6f605ee433..91aab0ef68a6 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1236,7 +1236,7 @@ .byte 0xe6 .endm - .macro unused4 successInstr:req + .macro unused4 .byte 0xe7 .endm diff --git a/src/battle_message.c b/src/battle_message.c index c32770fdc2ef..7f1bad8f834d 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -2027,10 +2027,10 @@ const u16 gFlashFireStringIds[] = const u16 gCaughtMonStringIds[] = { - [B_MSG_SENT_SOMEONES_PC] = STRINGID_PKMNTRANSFERREDSOMEONESPC, - [B_MSG_SENT_LANETTES_PC] = STRINGID_PKMNTRANSFERREDLANETTESPC, - [B_MSG_SOMEONES_BOX_FULL] = STRINGID_PKMNBOXSOMEONESPCFULL, - [B_MSG_LANETTES_BOX_FULL] = STRINGID_PKMNBOXLANETTESPCFULL, + [B_MSG_SENT_SOMEONES_PC] = STRINGID_PKMNTRANSFERREDSOMEONESPC, + [B_MSG_SENT_LANETTES_PC] = STRINGID_PKMNTRANSFERREDLANETTESPC, + [B_MSG_SOMEONES_BOX_FULL] = STRINGID_PKMNBOXSOMEONESPCFULL, + [B_MSG_LANETTES_BOX_FULL] = STRINGID_PKMNBOXLANETTESPCFULL, [B_MSG_SWAPPED_INTO_PARTY] = STRINGID_PKMNSENTTOPCAFTERCATCH, }; From 76a457e1276903748c9ea7ad335893d887f652ff Mon Sep 17 00:00:00 2001 From: fakuzatsu Date: Sat, 16 Nov 2024 16:55:01 +0000 Subject: [PATCH 10/19] add unique message for party menu when swapping --- include/constants/party_menu.h | 6 ++++++ include/strings.h | 1 + src/data/party_menu.h | 2 ++ src/party_menu.c | 9 ++++++++- src/strings.c | 1 + 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/include/constants/party_menu.h b/include/constants/party_menu.h index 98acff494b3a..2516356f8e83 100644 --- a/include/constants/party_menu.h +++ b/include/constants/party_menu.h @@ -81,6 +81,12 @@ #define PARTY_MSG_ALREADY_HOLDING_ONE 26 #define PARTY_MSG_WHICH_APPLIANCE 27 #define PARTY_MSG_CHOOSE_SECOND_FUSION 28 + +#define PARTY_MSG_LAST_EXPANSION PARTY_MSG_CHOOSE_SECOND_FUSION + +#define PARTY_MSG_MON_NOT_FOLLOWING (PARTY_MSG_LAST_EXPANSION + 1) +#define PARTY_MSG_CHOOSE_MON_FOR_BOX (PARTY_MSG_LAST_EXPANSION + 2) + #define PARTY_MSG_NONE 127 // IDs for DisplayPartyPokemonDescriptionText, to display a message in the party pokemon's box diff --git a/include/strings.h b/include/strings.h index dc0184efcaee..bd6620a200b0 100644 --- a/include/strings.h +++ b/include/strings.h @@ -2125,6 +2125,7 @@ extern const u8 gDaycareText_PlayOther[]; extern const u8 gText_ChoosePokemon[]; extern const u8 gText_ChoosePokemonCancel[]; extern const u8 gText_ChoosePokemonConfirm[]; +extern const u8 gText_SendWhichMonToPC[]; extern const u8 gText_MoveToWhere[]; extern const u8 gText_TeachWhichPokemon[]; extern const u8 gText_UseOnWhichPokemon[]; diff --git a/src/data/party_menu.h b/src/data/party_menu.h index 99488d4ebe9d..fa716292ecc5 100644 --- a/src/data/party_menu.h +++ b/src/data/party_menu.h @@ -659,6 +659,8 @@ static const u8 *const sActionStringTable[] = [PARTY_MSG_ALREADY_HOLDING_ONE] = gText_AlreadyHoldingOne, [PARTY_MSG_WHICH_APPLIANCE] = gText_WhichAppliance, [PARTY_MSG_CHOOSE_SECOND_FUSION] = gText_NextFusionMon, + [PARTY_MSG_MON_NOT_FOLLOWING] = gText_MonNotFollowing, + [PARTY_MSG_CHOOSE_MON_FOR_BOX] = gText_SendWhichMonToPC, }; static const u8 *const sDescriptionStringTable[] = diff --git a/src/party_menu.c b/src/party_menu.c index 07041b4bb38c..de9007d11085 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -7134,7 +7134,14 @@ static u8 GetPartyLayoutFromBattleType(void) void OpenPartyMenuInBattle(u8 partyAction) { - InitPartyMenu(PARTY_MENU_TYPE_IN_BATTLE, GetPartyLayoutFromBattleType(), partyAction, FALSE, PARTY_MSG_CHOOSE_MON, Task_HandleChooseMonInput, CB2_SetUpReshowBattleScreenAfterMenu); + u8 partyMessage; + + if (partyAction == PARTY_ACTION_SEND_MON_TO_BOX) + partyMessage = PARTY_MSG_CHOOSE_MON_FOR_BOX; + else + partyMessage = PARTY_MSG_CHOOSE_MON; + + InitPartyMenu(PARTY_MENU_TYPE_IN_BATTLE, GetPartyLayoutFromBattleType(), partyAction, FALSE, partyMessage, Task_HandleChooseMonInput, CB2_SetUpReshowBattleScreenAfterMenu); ReshowBattleScreenDummy(); UpdatePartyToBattleOrder(); } diff --git a/src/strings.c b/src/strings.c index 4c342d0934fe..eb61521e7676 100644 --- a/src/strings.c +++ b/src/strings.c @@ -460,6 +460,7 @@ const u8 gText_CurrentIsTooFast[] = _("The current is much too fast!"); const u8 gText_DoWhatWithMail[] = _("Do what with the MAIL?"); const u8 gText_ChoosePokemonCancel[] = _("Choose POKéMON or CANCEL."); const u8 gText_ChoosePokemonConfirm[] = _("Choose POKéMON and confirm."); +const u8 gText_SendWhichMonToPC[] = _("Send which POKéMON to the PC?"); const u8 gText_EnjoyCycling[] = _("Let's enjoy cycling!"); const u8 gText_InUseAlready_PM[] = _("This is in use already."); const u8 gText_AlreadyHoldingOne[] = _("{STR_VAR_1} is already holding\none {STR_VAR_2}."); From 263125fbe1de16048bb723013cd965aaac353cdf Mon Sep 17 00:00:00 2001 From: fakuzatsu Date: Sun, 17 Nov 2024 10:21:02 +0000 Subject: [PATCH 11/19] clean up accidental additions --- src/battle_message.c | 1 - src/data/party_menu.h | 1 - 2 files changed, 2 deletions(-) diff --git a/src/battle_message.c b/src/battle_message.c index 7f1bad8f834d..5c66b63ff075 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -1556,7 +1556,6 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_ITEMWASUSEDUP - BATTLESTRINGS_TABLE_START] = sText_ItemWasUsedUp, [STRINGID_ATTACKERLOSTITSTYPE - BATTLESTRINGS_TABLE_START] = sText_AttackerLostItsType, [STRINGID_CLOAKEDINAHARSHLIGHT - BATTLESTRINGS_TABLE_START] = sText_PkmnIsCloakedInAHarshLight, - [STRINGID_BLOCKEDBYSLEEPCLAUSE - BATTLESTRINGS_TABLE_START] = sText_BlockedBySleepClause, [STRINGID_SENDCAUGHTMONPARTYORBOX - BATTLESTRINGS_TABLE_START] = sText_AddCaughtMonToFullParty, }; diff --git a/src/data/party_menu.h b/src/data/party_menu.h index fa716292ecc5..94d855b43f6c 100644 --- a/src/data/party_menu.h +++ b/src/data/party_menu.h @@ -659,7 +659,6 @@ static const u8 *const sActionStringTable[] = [PARTY_MSG_ALREADY_HOLDING_ONE] = gText_AlreadyHoldingOne, [PARTY_MSG_WHICH_APPLIANCE] = gText_WhichAppliance, [PARTY_MSG_CHOOSE_SECOND_FUSION] = gText_NextFusionMon, - [PARTY_MSG_MON_NOT_FOLLOWING] = gText_MonNotFollowing, [PARTY_MSG_CHOOSE_MON_FOR_BOX] = gText_SendWhichMonToPC, }; From d2802a26f78fbd185dec642ec1cdbb1a339a3b9d Mon Sep 17 00:00:00 2001 From: fakuzatsu Date: Sun, 17 Nov 2024 10:26:34 +0000 Subject: [PATCH 12/19] change incorrectly named string --- src/battle_message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_message.c b/src/battle_message.c index 5c66b63ff075..6cd78ffea64f 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -496,7 +496,7 @@ static const u8 sText_PkmnSentToPC[] = _("{B_DEF_NAME} was sent to\n{B_PC_CREATO static const u8 sText_Someones[] = _("someone's"); static const u8 sText_Lanettes[] = _("LANETTE's"); static const u8 sText_PkmnDataAddedToDex[] = _("{B_DEF_NAME}'s data was\nadded to the POKéDEX.\p"); -static const u8 sText_SendCaughtMonPartyOrBox[] = _("Add {B_DEF_NAME} to your party?"); +static const u8 sText_AddCaughtMonToFullParty[] = _("Add {B_DEF_NAME} to your party?"); static const u8 sText_ItIsRaining[] = _("It is raining."); static const u8 sText_SandstormIsRaging[] = _("A sandstorm is raging."); From ee7d7c85b6af54b43ac4595ea2ac009e929d2cd7 Mon Sep 17 00:00:00 2001 From: fakuzatsu Date: Mon, 20 Jan 2025 11:37:53 +0000 Subject: [PATCH 13/19] fix item duplication due to restoration config --- src/battle_script_commands.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index bc6329253041..ab77f431cddd 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -15533,6 +15533,7 @@ static void Cmd_givecaughtmon(void) GetMonNickname(&gPlayerParty[gSelectedMonPartyId], gStringVar2); StringCopy(gStringVar1, GetBoxNamePtr(GetPCBoxToSendMon())); ZeroMonData(&gPlayerParty[gSelectedMonPartyId]); + gBattleStruct->itemLost[B_SIDE_PLAYER][gSelectedMonPartyId].originalItem = ITEM_NONE; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWAPPED_INTO_PARTY; gSelectedMonPartyId = PARTY_SIZE; gBattleCommunication[MULTIUSE_STATE]++; From 9b5e9b2750caa07498d4100843f2de0fbcf1e61a Mon Sep 17 00:00:00 2001 From: Zatsu <118256341+fakuzatsu@users.noreply.github.com> Date: Mon, 20 Jan 2025 12:12:55 +0000 Subject: [PATCH 14/19] Remove incorrectly added string definition --- include/constants/party_menu.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/constants/party_menu.h b/include/constants/party_menu.h index c8564c840355..033da2954f97 100644 --- a/include/constants/party_menu.h +++ b/include/constants/party_menu.h @@ -82,8 +82,7 @@ #define PARTY_MSG_WHICH_APPLIANCE 27 #define PARTY_MSG_CHOOSE_SECOND_FUSION 28 #define PARTY_MSG_NO_POKEMON 29 -#define PARTY_MSG_MON_NOT_FOLLOWING 30 -#define PARTY_MSG_CHOOSE_MON_FOR_BOX 31 +#define PARTY_MSG_CHOOSE_MON_FOR_BOX 30 #define PARTY_MSG_NONE 127 From 24895b00079d328414012392a6e42cb1349622ed Mon Sep 17 00:00:00 2001 From: Zatsu <118256341+fakuzatsu@users.noreply.github.com> Date: Mon, 20 Jan 2025 13:00:50 +0000 Subject: [PATCH 15/19] Add missing battle message string --- src/battle_message.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/battle_message.c b/src/battle_message.c index ace3918f02fa..cc387c361bb8 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -886,6 +886,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_NOTVERYEFFECTIVETWOFOES] = COMPOUND_STRING("It's not very effective on {B_DEF_NAME_WITH_PREFIX2} and {B_DEF_PARTNER_NAME}!"), [STRINGID_ITDOESNTAFFECTTWOFOES] = COMPOUND_STRING("It doesn't affect {B_DEF_NAME_WITH_PREFIX2} and {B_DEF_PARTNER_NAME}…"), [STRINGID_SENDCAUGHTMONPARTYORBOX] = COMPOUND_STRING("Add {B_DEF_NAME} to your party?"), + [STRINGID_PKMNSENTTOPCAFTERCATCH] = gText_PkmnSentToPCAfterCatch, }; const u16 gTrainerUsedItemStringIds[] = From b2e6d6e8078d9d126ce51819a3c53aa81a448f82 Mon Sep 17 00:00:00 2001 From: fakuzatsu Date: Fri, 24 Jan 2025 20:09:32 +0000 Subject: [PATCH 16/19] add toggle for swap into party + add case enum --- include/config/battle.h | 1 + src/battle_script_commands.c | 44 ++++++++++++++++++++++-------------- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/include/config/battle.h b/include/config/battle.h index 40e2e4277054..2b4179b0cb38 100644 --- a/include/config/battle.h +++ b/include/config/battle.h @@ -242,6 +242,7 @@ #define B_WAIT_TIME_MULTIPLIER 16 // This determines how long text pauses in battle last. Vanilla is 16. Lower values result in faster battles. #define B_QUICK_MOVE_CURSOR_TO_RUN FALSE // If set to TRUE, pushing B in the battle options against a wild encounter will move the cursor to the run option #define B_MOVE_DESCRIPTION_BUTTON L_BUTTON // If set to a button other than B_LAST_USED_BALL_BUTTON, pressing this button will open the move description menu +#define B_CATCH_SWAP_INTO_PARTY FALSE // If set to TRUE, the option to swap the caught wild mon to the party will appear, allowing you to send a different mon to the box. // Catching settings #define B_SEMI_INVULNERABLE_CATCH GEN_LATEST // In Gen4+, you cannot throw a ball against a Pokemon that is in a semi-invulnerable state (dig/fly/etc) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 8db63228590e..9251dbfca910 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -306,6 +306,16 @@ static const u16 sBadgeFlags[8] = { static const u16 sWhiteOutBadgeMoney[9] = { 8, 16, 24, 36, 48, 64, 80, 100, 120 }; +enum +{ + GIVEMON_CHECK_PARTY_SIZE = 0, + GIVEMON_ASK_ADD_TO_PARTY, + GIVEMON_HANDLE_INPUT, + GIVEMON_DO_CHOOSE_MON, + GIVEMON_HANDLE_CHOSEN_MON, + GIVEMON_GIVE_AND_SHOW_MSG, +}; + #define STAT_CHANGE_WORKED 0 #define STAT_CHANGE_DIDNT_WORK 1 @@ -15795,27 +15805,27 @@ static void Cmd_givecaughtmon(void) switch (gBattleCommunication[MULTIUSE_STATE]) { - case 0: - if (CalculatePlayerPartyCount() == PARTY_SIZE) + case GIVEMON_CHECK_PARTY_SIZE: + if (CalculatePlayerPartyCount() == PARTY_SIZE && B_CATCH_SWAP_INTO_PARTY) { PrepareStringBattle(STRINGID_SENDCAUGHTMONPARTYORBOX, gBattlerAttacker); gBattleCommunication[MSG_DISPLAY] = 1; - gBattleCommunication[MULTIUSE_STATE]++; + gBattleCommunication[MULTIUSE_STATE] = GIVEMON_ASK_ADD_TO_PARTY; } else { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_NO_MESSSAGE_SKIP; - gBattleCommunication[MULTIUSE_STATE] = 5; + gBattleCommunication[MULTIUSE_STATE] = GIVEMON_GIVE_AND_SHOW_MSG; } break; - case 1: + case GIVEMON_ASK_ADD_TO_PARTY: HandleBattleWindow(YESNOBOX_X_Y, 0); BattlePutTextOnWindow(gText_BattleYesNoChoice, B_WIN_YESNO); - gBattleCommunication[MULTIUSE_STATE]++; + gBattleCommunication[MULTIUSE_STATE] = GIVEMON_HANDLE_INPUT; gBattleCommunication[CURSOR_POSITION] = 0; BattleCreateYesNoCursorAt(0); break; - case 2: + case GIVEMON_HANDLE_INPUT: if (JOY_NEW(DPAD_UP) && gBattleCommunication[CURSOR_POSITION] != 0) { PlaySE(SE_SELECT); @@ -15835,35 +15845,35 @@ static void Cmd_givecaughtmon(void) PlaySE(SE_SELECT); if (gBattleCommunication[CURSOR_POSITION] == 0) { - gBattleCommunication[MULTIUSE_STATE]++; + gBattleCommunication[MULTIUSE_STATE] = GIVEMON_DO_CHOOSE_MON; } else { - gBattleCommunication[MULTIUSE_STATE] = 5; + gBattleCommunication[MULTIUSE_STATE] = GIVEMON_GIVE_AND_SHOW_MSG; } } else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); - gBattleCommunication[MULTIUSE_STATE] = 5; + gBattleCommunication[MULTIUSE_STATE] = GIVEMON_GIVE_AND_SHOW_MSG; } break; - case 3: + case GIVEMON_DO_CHOOSE_MON: if (!gPaletteFade.active) { BtlController_EmitChoosePokemon(gBattlerAttacker, BUFFER_A, PARTY_ACTION_SEND_MON_TO_BOX, PARTY_SIZE, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gBattlerAttacker]); MarkBattlerForControllerExec(gBattlerAttacker); - gBattleCommunication[MULTIUSE_STATE]++; + gBattleCommunication[MULTIUSE_STATE] = GIVEMON_HANDLE_CHOSEN_MON; } break; - case 4: + case GIVEMON_HANDLE_CHOSEN_MON: if (gSelectedMonPartyId != PARTY_SIZE) { if (gSelectedMonPartyId > PARTY_SIZE) { // Choosing Pokemon was cancelled gSelectedMonPartyId = PARTY_SIZE; - gBattleCommunication[MULTIUSE_STATE]++; + gBattleCommunication[MULTIUSE_STATE] = GIVEMON_GIVE_AND_SHOW_MSG; } else { @@ -15876,17 +15886,17 @@ static void Cmd_givecaughtmon(void) gBattleStruct->itemLost[B_SIDE_PLAYER][gSelectedMonPartyId].originalItem = ITEM_NONE; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWAPPED_INTO_PARTY; gSelectedMonPartyId = PARTY_SIZE; - gBattleCommunication[MULTIUSE_STATE]++; + gBattleCommunication[MULTIUSE_STATE] = GIVEMON_GIVE_AND_SHOW_MSG; } else { gSelectedMonPartyId = PARTY_SIZE; - gBattleCommunication[MULTIUSE_STATE]++; + gBattleCommunication[MULTIUSE_STATE] = GIVEMON_GIVE_AND_SHOW_MSG; } } } break; - case 5: + case GIVEMON_GIVE_AND_SHOW_MSG: if (B_RESTORE_HELD_BATTLE_ITEMS >= GEN_9) { u16 lostItem = gBattleStruct->itemLost[B_SIDE_OPPONENT][gBattlerPartyIndexes[GetCatchingBattler()]].originalItem; From 81d1852cdfa76ea1b814710a3aa6b35ced5097b5 Mon Sep 17 00:00:00 2001 From: fakuzatsu Date: Sat, 25 Jan 2025 18:05:29 +0000 Subject: [PATCH 17/19] add enum name and use enum for switch case --- src/battle_script_commands.c | 51 ++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 9251dbfca910..9faa9c9ae3d4 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -306,14 +306,14 @@ static const u16 sBadgeFlags[8] = { static const u16 sWhiteOutBadgeMoney[9] = { 8, 16, 24, 36, 48, 64, 80, 100, 120 }; -enum -{ - GIVEMON_CHECK_PARTY_SIZE = 0, - GIVEMON_ASK_ADD_TO_PARTY, - GIVEMON_HANDLE_INPUT, - GIVEMON_DO_CHOOSE_MON, - GIVEMON_HANDLE_CHOSEN_MON, - GIVEMON_GIVE_AND_SHOW_MSG, +enum GiveCaughtMonStates +{ + GIVECAUGHTMON_CHECK_PARTY_SIZE = 0, + GIVECAUGHTMON_ASK_ADD_TO_PARTY, + GIVECAUGHTMON_HANDLE_INPUT, + GIVECAUGHTMON_DO_CHOOSE_MON, + GIVECAUGHTMON_HANDLE_CHOSEN_MON, + GIVECAUGHTMON_GIVE_AND_SHOW_MSG, }; #define STAT_CHANGE_WORKED 0 @@ -15802,30 +15802,31 @@ static void Cmd_handleballthrow(void) static void Cmd_givecaughtmon(void) { CMD_ARGS(const u8 *passInstr); + enum GiveCaughtMonStates state = gBattleCommunication[MULTIUSE_STATE]; - switch (gBattleCommunication[MULTIUSE_STATE]) + switch (state) { - case GIVEMON_CHECK_PARTY_SIZE: + case GIVECAUGHTMON_CHECK_PARTY_SIZE: if (CalculatePlayerPartyCount() == PARTY_SIZE && B_CATCH_SWAP_INTO_PARTY) { PrepareStringBattle(STRINGID_SENDCAUGHTMONPARTYORBOX, gBattlerAttacker); gBattleCommunication[MSG_DISPLAY] = 1; - gBattleCommunication[MULTIUSE_STATE] = GIVEMON_ASK_ADD_TO_PARTY; + gBattleCommunication[MULTIUSE_STATE] = GIVECAUGHTMON_ASK_ADD_TO_PARTY; } else { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_NO_MESSSAGE_SKIP; - gBattleCommunication[MULTIUSE_STATE] = GIVEMON_GIVE_AND_SHOW_MSG; + gBattleCommunication[MULTIUSE_STATE] = GIVECAUGHTMON_GIVE_AND_SHOW_MSG; } break; - case GIVEMON_ASK_ADD_TO_PARTY: + case GIVECAUGHTMON_ASK_ADD_TO_PARTY: HandleBattleWindow(YESNOBOX_X_Y, 0); BattlePutTextOnWindow(gText_BattleYesNoChoice, B_WIN_YESNO); - gBattleCommunication[MULTIUSE_STATE] = GIVEMON_HANDLE_INPUT; + gBattleCommunication[MULTIUSE_STATE] = GIVECAUGHTMON_HANDLE_INPUT; gBattleCommunication[CURSOR_POSITION] = 0; BattleCreateYesNoCursorAt(0); break; - case GIVEMON_HANDLE_INPUT: + case GIVECAUGHTMON_HANDLE_INPUT: if (JOY_NEW(DPAD_UP) && gBattleCommunication[CURSOR_POSITION] != 0) { PlaySE(SE_SELECT); @@ -15845,35 +15846,35 @@ static void Cmd_givecaughtmon(void) PlaySE(SE_SELECT); if (gBattleCommunication[CURSOR_POSITION] == 0) { - gBattleCommunication[MULTIUSE_STATE] = GIVEMON_DO_CHOOSE_MON; + gBattleCommunication[MULTIUSE_STATE] = GIVECAUGHTMON_DO_CHOOSE_MON; } else { - gBattleCommunication[MULTIUSE_STATE] = GIVEMON_GIVE_AND_SHOW_MSG; + gBattleCommunication[MULTIUSE_STATE] = GIVECAUGHTMON_GIVE_AND_SHOW_MSG; } } else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); - gBattleCommunication[MULTIUSE_STATE] = GIVEMON_GIVE_AND_SHOW_MSG; + gBattleCommunication[MULTIUSE_STATE] = GIVECAUGHTMON_GIVE_AND_SHOW_MSG; } break; - case GIVEMON_DO_CHOOSE_MON: + case GIVECAUGHTMON_DO_CHOOSE_MON: if (!gPaletteFade.active) { BtlController_EmitChoosePokemon(gBattlerAttacker, BUFFER_A, PARTY_ACTION_SEND_MON_TO_BOX, PARTY_SIZE, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gBattlerAttacker]); MarkBattlerForControllerExec(gBattlerAttacker); - gBattleCommunication[MULTIUSE_STATE] = GIVEMON_HANDLE_CHOSEN_MON; + gBattleCommunication[MULTIUSE_STATE] = GIVECAUGHTMON_HANDLE_CHOSEN_MON; } break; - case GIVEMON_HANDLE_CHOSEN_MON: + case GIVECAUGHTMON_HANDLE_CHOSEN_MON: if (gSelectedMonPartyId != PARTY_SIZE) { if (gSelectedMonPartyId > PARTY_SIZE) { // Choosing Pokemon was cancelled gSelectedMonPartyId = PARTY_SIZE; - gBattleCommunication[MULTIUSE_STATE] = GIVEMON_GIVE_AND_SHOW_MSG; + gBattleCommunication[MULTIUSE_STATE] = GIVECAUGHTMON_GIVE_AND_SHOW_MSG; } else { @@ -15886,17 +15887,17 @@ static void Cmd_givecaughtmon(void) gBattleStruct->itemLost[B_SIDE_PLAYER][gSelectedMonPartyId].originalItem = ITEM_NONE; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWAPPED_INTO_PARTY; gSelectedMonPartyId = PARTY_SIZE; - gBattleCommunication[MULTIUSE_STATE] = GIVEMON_GIVE_AND_SHOW_MSG; + gBattleCommunication[MULTIUSE_STATE] = GIVECAUGHTMON_GIVE_AND_SHOW_MSG; } else { gSelectedMonPartyId = PARTY_SIZE; - gBattleCommunication[MULTIUSE_STATE] = GIVEMON_GIVE_AND_SHOW_MSG; + gBattleCommunication[MULTIUSE_STATE] = GIVECAUGHTMON_GIVE_AND_SHOW_MSG; } } } break; - case GIVEMON_GIVE_AND_SHOW_MSG: + case GIVECAUGHTMON_GIVE_AND_SHOW_MSG: if (B_RESTORE_HELD_BATTLE_ITEMS >= GEN_9) { u16 lostItem = gBattleStruct->itemLost[B_SIDE_OPPONENT][gBattlerPartyIndexes[GetCatchingBattler()]].originalItem; From 9a691a826433c9824967161687cc350387394ffa Mon Sep 17 00:00:00 2001 From: fakuzatsu Date: Sun, 26 Jan 2025 16:18:52 +0000 Subject: [PATCH 18/19] add generational config and remove manual decl --- include/config/battle.h | 2 +- src/battle_script_commands.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/config/battle.h b/include/config/battle.h index 2b4179b0cb38..8843de49f4a4 100644 --- a/include/config/battle.h +++ b/include/config/battle.h @@ -242,7 +242,6 @@ #define B_WAIT_TIME_MULTIPLIER 16 // This determines how long text pauses in battle last. Vanilla is 16. Lower values result in faster battles. #define B_QUICK_MOVE_CURSOR_TO_RUN FALSE // If set to TRUE, pushing B in the battle options against a wild encounter will move the cursor to the run option #define B_MOVE_DESCRIPTION_BUTTON L_BUTTON // If set to a button other than B_LAST_USED_BALL_BUTTON, pressing this button will open the move description menu -#define B_CATCH_SWAP_INTO_PARTY FALSE // If set to TRUE, the option to swap the caught wild mon to the party will appear, allowing you to send a different mon to the box. // Catching settings #define B_SEMI_INVULNERABLE_CATCH GEN_LATEST // In Gen4+, you cannot throw a ball against a Pokemon that is in a semi-invulnerable state (dig/fly/etc) @@ -251,6 +250,7 @@ #define B_LAST_USED_BALL TRUE // If TRUE, the "last used ball" feature from Gen 7 will be implemented #define B_LAST_USED_BALL_BUTTON R_BUTTON // If last used ball is implemented, this button (or button combo) will trigger throwing the last used ball. #define B_LAST_USED_BALL_CYCLE TRUE // If TRUE, then holding B_LAST_USED_BALL_BUTTON while pressing the D-Pad cycles through the balls +#define B_CATCH_SWAP_INTO_PARTY GEN_LATEST // In Gen 7+, the option to swap the caught wild mon to the party will appear, allowing you to send a different mon to the box. // Other settings #define B_DOUBLE_WILD_CHANCE 0 // % chance of encountering two Pokémon in a Wild Encounter. diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 9faa9c9ae3d4..228dee60dca5 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -308,7 +308,7 @@ static const u16 sWhiteOutBadgeMoney[9] = { 8, 16, 24, 36, 48, 64, 80, 100, 120 enum GiveCaughtMonStates { - GIVECAUGHTMON_CHECK_PARTY_SIZE = 0, + GIVECAUGHTMON_CHECK_PARTY_SIZE, GIVECAUGHTMON_ASK_ADD_TO_PARTY, GIVECAUGHTMON_HANDLE_INPUT, GIVECAUGHTMON_DO_CHOOSE_MON, @@ -15807,7 +15807,7 @@ static void Cmd_givecaughtmon(void) switch (state) { case GIVECAUGHTMON_CHECK_PARTY_SIZE: - if (CalculatePlayerPartyCount() == PARTY_SIZE && B_CATCH_SWAP_INTO_PARTY) + if (CalculatePlayerPartyCount() == PARTY_SIZE && B_CATCH_SWAP_INTO_PARTY >= GEN_7) { PrepareStringBattle(STRINGID_SENDCAUGHTMONPARTYORBOX, gBattlerAttacker); gBattleCommunication[MSG_DISPLAY] = 1; From 36bb97790e351e34aeedec157d4851dadc5fe7d4 Mon Sep 17 00:00:00 2001 From: fakuzatsu Date: Thu, 30 Jan 2025 11:18:46 +0000 Subject: [PATCH 19/19] prevent sending mon to box if it knows a HM --- include/config/battle.h | 1 + include/strings.h | 3 +++ src/party_menu.c | 40 +++++++++++++++++++++++++++++++++++++++- src/strings.c | 1 + 4 files changed, 44 insertions(+), 1 deletion(-) diff --git a/include/config/battle.h b/include/config/battle.h index 8843de49f4a4..46841f0683f8 100644 --- a/include/config/battle.h +++ b/include/config/battle.h @@ -251,6 +251,7 @@ #define B_LAST_USED_BALL_BUTTON R_BUTTON // If last used ball is implemented, this button (or button combo) will trigger throwing the last used ball. #define B_LAST_USED_BALL_CYCLE TRUE // If TRUE, then holding B_LAST_USED_BALL_BUTTON while pressing the D-Pad cycles through the balls #define B_CATCH_SWAP_INTO_PARTY GEN_LATEST // In Gen 7+, the option to swap the caught wild mon to the party will appear, allowing you to send a different mon to the box. +#define B_CATCH_SWAP_CHECK_HMS TRUE // If TRUE, the catch swap feature above will prevent returning mons to the box if they know HMs. // Other settings #define B_DOUBLE_WILD_CHANCE 0 // % chance of encountering two Pokémon in a Wild Encounter. diff --git a/include/strings.h b/include/strings.h index eca13256f766..5cd49994e060 100644 --- a/include/strings.h +++ b/include/strings.h @@ -2431,4 +2431,7 @@ extern const u8 gText_PlayerScurriedBackHome[]; extern const u8 gText_Relearn[]; // move relearner from summary screen extern const u8 gText_Rename[]; // change nickname from summary screen +// Switch Caught Mon into Party +extern const u8 gText_CannotSendMonToBoxHM[]; + #endif // GUARD_STRINGS_H diff --git a/src/party_menu.c b/src/party_menu.c index c1652eab72c8..784f13acdd38 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -174,6 +174,14 @@ enum { #define MENU_DIR_RIGHT 2 #define MENU_DIR_LEFT -2 +#define HM_MOVES_END 0xFFFF + +static const u16 sHMMoves[] = +{ + MOVE_CUT, MOVE_FLY, MOVE_SURF, MOVE_STRENGTH, MOVE_FLASH, + MOVE_ROCK_SMASH, MOVE_WATERFALL, MOVE_DIVE, HM_MOVES_END +}; + enum { CAN_LEARN_MOVE, CANNOT_LEARN_MOVE, @@ -320,6 +328,7 @@ static void HandleChooseMonSelection(u8, s8 *); static u16 PartyMenuButtonHandler(s8 *); static s8 *GetCurrentPartySlotPtr(void); static bool8 IsSelectedMonNotEgg(u8 *); +static bool8 DoesSelectedMonKnowHM(u8 *); static void PartyMenuRemoveWindow(u8 *); static void CB2_SetUpExitToBattleScreen(void); static void Task_ClosePartyMenuAfterText(u8); @@ -1533,6 +1542,13 @@ static void HandleChooseMonSelection(u8 taskId, s8 *slotPtr) // Can't select if mon is currently on the field, or doesn't belong to you PlaySE(SE_FAILURE); } + else if (DoesSelectedMonKnowHM((u8 *)slotPtr)) + { + PlaySE(SE_FAILURE); + DisplayPartyMenuMessage(gText_CannotSendMonToBoxHM, FALSE); + ScheduleBgCopyTilemapToVram(2); + gTasks[taskId].func = Task_ReturnToChooseMonAfterText; + } else { PlaySE(SE_SELECT); @@ -1561,6 +1577,25 @@ static bool8 IsSelectedMonNotEgg(u8 *slotPtr) return TRUE; } +static bool8 DoesSelectedMonKnowHM(u8 *slotPtr) +{ + if (B_CATCH_SWAP_CHECK_HMS == FALSE) + return FALSE; + + for (u32 i = 0; i < MAX_MON_MOVES; i++) + { + u32 j = 0; + u16 move = GetMonData(&gPlayerParty[*slotPtr], MON_DATA_MOVE1 + i); + + while (sHMMoves[j] != HM_MOVES_END) + { + if (sHMMoves[j++] == move) + return TRUE; + } + } + return FALSE; +} + static void HandleChooseMonCancel(u8 taskId, s8 *slotPtr) { switch (gPartyMenu.action) @@ -1946,7 +1981,10 @@ static void Task_ReturnToChooseMonAfterText(u8 taskId) } else { - DisplayPartyMenuStdMessage(PARTY_MSG_CHOOSE_MON); + if (gPartyMenu.action == PARTY_ACTION_SEND_MON_TO_BOX) + DisplayPartyMenuStdMessage(PARTY_MSG_CHOOSE_MON_FOR_BOX); + else + DisplayPartyMenuStdMessage(PARTY_MSG_CHOOSE_MON); gTasks[taskId].func = Task_HandleChooseMonInput; } } diff --git a/src/strings.c b/src/strings.c index 1e9b03acea9d..c112db461678 100644 --- a/src/strings.c +++ b/src/strings.c @@ -1294,3 +1294,4 @@ const u8 gText_AM[] = _("AM"); const u8 gText_PM[] = _("PM"); const u8 gText_Relearn[] = _("{START_BUTTON} RELEARN"); // future note: don't decap this, because it mimics the summary screen BG graphics which will not get decapped const u8 gText_Rename[] = _("RENAME"); +const u8 gText_CannotSendMonToBoxHM[] = _("Cannot send that mon to the box,\nbecause it knows a HM move.{PAUSE_UNTIL_PRESS}");