summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsurskitty <surskitty@gmail.com>2020-10-31 10:49:03 -0400
committersurskitty <surskitty@gmail.com>2020-10-31 10:49:03 -0400
commit273c0587da4cacf0804dc506696da312cb620b9b (patch)
tree386db1d33015c16f28c54b911d5b665b917976e6
parentd5799c2ea595da0efba5c18ffc39f640dc7aabf2 (diff)
TMs were still rebuyable in the Mauville Game Corner.
-rw-r--r--Infinite-TM-usage.md34
1 files changed, 32 insertions, 2 deletions
diff --git a/Infinite-TM-usage.md b/Infinite-TM-usage.md
index dc52af1..afacb97 100644
--- a/Infinite-TM-usage.md
+++ b/Infinite-TM-usage.md
@@ -1,4 +1,4 @@
-Credit to paccy for this tutorial in the Simple Modifications Pokecommunity thread. The tutorial was modified by ExpoSeed.
+Credit to paccy for this tutorial in the Simple Modifications Pokecommunity thread. The tutorial was modified by ExpoSeed and surskitty.
This tutorial will make all TMs infinitely reusable, unholdable by Pokemon, unsellable to shops, and also removes the number from appearing in the Bag.
@@ -106,7 +106,37 @@ Now to add the code that prevents the rebuying. Edit the `Task_BuyMenu` function
else
{
```
-And that's it!
+
+This prevents rebuying from shops, but there's still the Mauville Game Corner. Let's go to [data/maps/MauvilleCity_GameCorner/scripts.inc](../blob/master/data/maps/MauvilleCity_GameCorner/scripts.inc).
+
+First, let's replace the `MauvilleCity_GameCorner_EventScript_NoRoomForTM` function with `MauvilleCity_GameCorner_EventScript_YouAlreadyHaveThis`. The bag will no longer be full, so let's instead use the same string we used for the shops.
+```diff
+ goto MauvilleCity_GameCorner_EventScript_ReturnToChooseTMPrize
+ end
+
+-MauvilleCity_GameCorner_EventScript_NoRoomForTM::
+- call Common_EventScript_BagIsFull
++MauvilleCity_GameCorner_EventScript_YouAlreadyHaveThis::
++ msgbox gText_YouAlreadyHaveThis, MSGBOX_DEFAULT
+ goto MauvilleCity_GameCorner_EventScript_ReturnToChooseTMPrize
+ end
+```
+
+Next, we need to replace all of the checks to see if there is room with checks for if you have the item. These currently use `checkitemspace`. We can replace them with `checkitem` and exiting the function if the result is true.
+```diff
+ compare VAR_TEMP_2, TM13_COINS
+ goto_if_lt MauvilleCity_GameCorner_EventScript_NotEnoughCoinsForTM
+- checkitemspace ITEM_TM13, 1
+- compare VAR_RESULT, FALSE
+- goto_if_eq MauvilleCity_GameCorner_EventScript_NoRoomForTM
++ checkitem ITEM_TM13, 1
++ compare VAR_RESULT, TRUE
++ goto_if_eq MauvilleCity_GameCorner_EventScript_YouAlreadyHaveThis
+ removecoins TM13_COINS
+ additem ITEM_TM13
+ updatecoinsbox 1, 1```
+
+Repeat for each TM, and that's it!
![](https://i.imgur.com/KwzzUSm.png)
![](https://i.imgur.com/tFDpY8B.png)