From b1456a53db4995e32e37e8aac26479af856a2d4e Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 18 Jul 2020 14:01:30 +1200 Subject: This was actually introduced LGPE --- Gen-VIII-Style-Bonus-Premier-Balls.md | 43 ----------------------------------- LGPE-Style-Bonus-Premier-Balls.md | 43 +++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 43 deletions(-) delete mode 100644 Gen-VIII-Style-Bonus-Premier-Balls.md create mode 100644 LGPE-Style-Bonus-Premier-Balls.md diff --git a/Gen-VIII-Style-Bonus-Premier-Balls.md b/Gen-VIII-Style-Bonus-Premier-Balls.md deleted file mode 100644 index 7bd6e27..0000000 --- a/Gen-VIII-Style-Bonus-Premier-Balls.md +++ /dev/null @@ -1,43 +0,0 @@ -In Pokémon Sword & Shield, buying Poké Balls in bulk will give the player one Premier Ball for every ten balls purchased (e.g. buying 30 balls at once gives you three free Premier Balls). This also applies to all types of ball, instead of just regular Poké Balls. This tutorial will add this functionality to Emerald. - -First, edit [src/shop.c](../blob/master/src/shop.c): -```diff -static void Task_ReturnToItemListAfterItemPurchase(u8 taskId) -{ - s16 *data = gTasks[taskId].data; - - if (gMain.newKeys & (A_BUTTON | B_BUTTON)) - { - PlaySE(SE_SELECT); -- if (tItemId == ITEM_POKE_BALL && tItemCount > 9 && AddBagItem(ITEM_PREMIER_BALL, 1) == TRUE) -+ if ((ItemId_GetPocket(tItemId) == POCKET_POKE_BALLS) && tItemCount > 9 && AddBagItem(ITEM_PREMIER_BALL, tItemCount / 10) == TRUE) - { -- BuyMenuDisplayMessage(taskId, gText_ThrowInPremierBall, BuyMenuReturnToItemList); -+ if (tItemCount > 19) -+ { -+ BuyMenuDisplayMessage(taskId, gText_ThrowInPremierBalls, BuyMenuReturnToItemList); -+ } -+ else -+ { -+ BuyMenuDisplayMessage(taskId, gText_ThrowInPremierBall, BuyMenuReturnToItemList); -+ } - } - else if((ItemId_GetPocket(tItemId) == POCKET_TM_HM)) - { - RedrawListMenu(tListTaskId); - BuyMenuReturnToItemList(taskId); - } - else - { - BuyMenuReturnToItemList(taskId); - } - } -} -``` -With that done, you'll need a new string so that the clerk says "Premier Balls" instead of "Premier Ball" when giving the player more than one. Add a new string to [src/strings.c](../blob/master/src/strings.c), like so: - -`const u8 gText_ThrowInPremierBalls[] = _("I'll throw in some Premier Balls, too.{PAUSE_UNTIL_PRESS}");` - -Finally, don't forget to declare it in [include/strings.h](../blob/master/include/strings.h): - -`extern const u8 gText_ThrowInPremierBalls[];` \ No newline at end of file diff --git a/LGPE-Style-Bonus-Premier-Balls.md b/LGPE-Style-Bonus-Premier-Balls.md new file mode 100644 index 0000000..7dd7f9f --- /dev/null +++ b/LGPE-Style-Bonus-Premier-Balls.md @@ -0,0 +1,43 @@ +In Pokémon Let's Go Pikachu and Eevee, buying Poké Balls in bulk will give the player one Premier Ball for every ten balls purchased (e.g. buying 30 balls at once gives you three free Premier Balls). This also applies to all types of ball, instead of just regular Poké Balls. This tutorial will add this functionality to Emerald. + +First, edit [src/shop.c](../blob/master/src/shop.c): +```diff +static void Task_ReturnToItemListAfterItemPurchase(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + if (gMain.newKeys & (A_BUTTON | B_BUTTON)) + { + PlaySE(SE_SELECT); +- if (tItemId == ITEM_POKE_BALL && tItemCount > 9 && AddBagItem(ITEM_PREMIER_BALL, 1) == TRUE) ++ if ((ItemId_GetPocket(tItemId) == POCKET_POKE_BALLS) && tItemCount > 9 && AddBagItem(ITEM_PREMIER_BALL, tItemCount / 10) == TRUE) + { +- BuyMenuDisplayMessage(taskId, gText_ThrowInPremierBall, BuyMenuReturnToItemList); ++ if (tItemCount > 19) ++ { ++ BuyMenuDisplayMessage(taskId, gText_ThrowInPremierBalls, BuyMenuReturnToItemList); ++ } ++ else ++ { ++ BuyMenuDisplayMessage(taskId, gText_ThrowInPremierBall, BuyMenuReturnToItemList); ++ } + } + else if((ItemId_GetPocket(tItemId) == POCKET_TM_HM)) + { + RedrawListMenu(tListTaskId); + BuyMenuReturnToItemList(taskId); + } + else + { + BuyMenuReturnToItemList(taskId); + } + } +} +``` +With that done, you'll need a new string so that the clerk says "Premier Balls" instead of "Premier Ball" when giving the player more than one. Add a new string to [src/strings.c](../blob/master/src/strings.c), like so: + +`const u8 gText_ThrowInPremierBalls[] = _("I'll throw in some Premier Balls, too.{PAUSE_UNTIL_PRESS}");` + +Finally, don't forget to declare it in [include/strings.h](../blob/master/include/strings.h): + +`extern const u8 gText_ThrowInPremierBalls[];` \ No newline at end of file -- cgit v1.2.3