summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorExpoSeed <43502820+ExpoSeed@users.noreply.github.com>2020-06-13 01:11:23 -0500
committerExpoSeed <43502820+ExpoSeed@users.noreply.github.com>2020-06-13 01:11:23 -0500
commit3961ad70abfbd4c536f73937466cc266b8564e78 (patch)
tree8dbf25394f05d6ae0978f1eff4e1248482938d37
parent4e6508e1124a84f34ce90fbbbcfbd37b650d57a6 (diff)
add some explanations and fix an oversight
-rw-r--r--Infinitely-reusable-TMs.md9
1 files changed, 6 insertions, 3 deletions
diff --git a/Infinitely-reusable-TMs.md b/Infinitely-reusable-TMs.md
index 6294b18..da54ecb 100644
--- a/Infinitely-reusable-TMs.md
+++ b/Infinitely-reusable-TMs.md
@@ -7,6 +7,8 @@ This tutorial will make all TMs infinitely reusable, unholdable by Pokemon, unse
2. [Treat TMs as HMs in the bag](#2-treat-tms-as-hms-in-the-bag)
## 1. Don't consume TMs on use
+Normally, the game checks if the item used was a TM or an HM, and consumes the item if it was a TM. We can just simply remove this check.
+
Edit [src/party_menu.c](../blob/master/src/party_menu.c):
```diff
static void Task_LearnedMove(u8 taskId)
@@ -29,9 +31,9 @@ static void Task_LearnedMove(u8 taskId)
gTasks[taskId].func = Task_DoLearnedMoveFanfareAfterText;
}
```
-
+If you were to stop here, TMs can still be given to Pokemon and you can still see the number in the bag. The next step will address this.
## 2. Treat TMs as HMs in the bag
-This will mean TMs in the bag cannot be held and will not display the quantity next to the name.
+`struct Item` has a field `importance`. If this field has a nonzero value, then the item is treated like a key item, and cannot be held, tossed, deposited in the PC, and it will not display an item count in the bag. Furthermore, items with a price of 0 cannot be sold.
Edit [src/data/items.h](../blob/master/src/data/items.h):
```diff
@@ -39,7 +41,8 @@ Edit [src/data/items.h](../blob/master/src/data/items.h):
{
.name = _("TM01"),
.itemId = ITEM_TM01_FOCUS_PUNCH,
- .price = 3000,
+- .price = 3000,
++ .price = 0,
.description = sTM01Desc,
+ .importance = 1,
.pocket = POCKET_TM_HM,