diff options
author | ExpoSeed <43502820+ExpoSeed@users.noreply.github.com> | 2020-06-13 01:14:15 -0500 |
---|---|---|
committer | ExpoSeed <43502820+ExpoSeed@users.noreply.github.com> | 2020-06-13 01:14:15 -0500 |
commit | 8303897de3c8b37bc1190b7ff17516e4fb6eea03 (patch) | |
tree | ef54cf67b14674299d6162389c394559ea0f948e /Infinite-TM-usage.md | |
parent | 4ded2aea81d8984acc807e8431eabcd3043b939a (diff) |
Updated Infinitely reusable TMs (markdown)
Diffstat (limited to 'Infinite-TM-usage.md')
-rw-r--r-- | Infinite-TM-usage.md | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/Infinite-TM-usage.md b/Infinite-TM-usage.md new file mode 100644 index 0000000..eb885f0 --- /dev/null +++ b/Infinite-TM-usage.md @@ -0,0 +1,60 @@ +Credit to paccy for this tutorial in the Simple Modifications Pokecommunity thread. + +This tutorial will make all TMs infinitely reusable, unholdable by Pokemon, unsellable to shops, and also removes the number from appearing in the Bag. + +## Contents +1. [Don't consume TMs on use](#1-dont-consumes-tms-on-use) +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) +{ + struct Pokemon *mon = &gPlayerParty[gPartyMenu.slotId]; + s16 *move = &gPartyMenu.data1; + u16 item = gSpecialVar_ItemId; + + if (move[1] == 0) + { + AdjustFriendship(mon, FRIENDSHIP_EVENT_LEARN_TMHM); +- if (item < ITEM_HM01_CUT) +- RemoveBagItem(item, 1); + } + GetMonNickname(mon, gStringVar1); + StringCopy(gStringVar2, gMoveNames[move[0]]); + StringExpandPlaceholders(gStringVar4, gText_PkmnLearnedMove3); + DisplayPartyMenuMessage(gStringVar4, TRUE); + schedule_bg_copy_tilemap_to_vram(2); + 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 +`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, or 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 + [ITEM_TM01_FOCUS_PUNCH] = + { + .name = _("TM01"), + .itemId = ITEM_TM01_FOCUS_PUNCH, +- .price = 3000, ++ .price = 0, + .description = sTM01Desc, ++ .importance = 1, + .pocket = POCKET_TM_HM, + .type = 1, + .fieldUseFunc = ItemUseOutOfBattle_TMHM, + .secondaryId = 0, + }, +``` +You will need to repeat the above for every TM. + +And that's it! + + + +Notes: Pokemon will replenish their PP if a TM move is forgotten and relearned.
\ No newline at end of file |