summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBuffelSaft <buffalojuice@gmail.com>2020-07-06 21:18:49 +1200
committerBuffelSaft <buffalojuice@gmail.com>2020-07-06 21:18:49 +1200
commite56c84edbd410fc5f81fbdcd9a8911effd901b34 (patch)
treeef62daad5419bcc4ebaaaa02cc366cd2c68881a5
parentbb42970a5141bd81c3e5f2dd97940c91b5e77bbd (diff)
Created Gen VIII Style Bonus Premier Balls (markdown)
-rw-r--r--Gen-VIII-Style-Bonus-Premier-Balls.md43
1 files changed, 43 insertions, 0 deletions
diff --git a/Gen-VIII-Style-Bonus-Premier-Balls.md b/Gen-VIII-Style-Bonus-Premier-Balls.md
new file mode 100644
index 0000000..7bd6e27
--- /dev/null
+++ b/Gen-VIII-Style-Bonus-Premier-Balls.md
@@ -0,0 +1,43 @@
+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