From 8303897de3c8b37bc1190b7ff17516e4fb6eea03 Mon Sep 17 00:00:00 2001 From: ExpoSeed <43502820+ExpoSeed@users.noreply.github.com> Date: Sat, 13 Jun 2020 01:14:15 -0500 Subject: Updated Infinitely reusable TMs (markdown) --- Infinite-TM-usage.md | 60 ++++++++++++++++++++++++++++++++++++++++++++++ Infinitely-reusable-TMs.md | 60 ---------------------------------------------- 2 files changed, 60 insertions(+), 60 deletions(-) create mode 100644 Infinite-TM-usage.md delete mode 100644 Infinitely-reusable-TMs.md 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! + +![](https://i.imgur.com/KwzzUSm.png) + +Notes: Pokemon will replenish their PP if a TM move is forgotten and relearned. \ No newline at end of file diff --git a/Infinitely-reusable-TMs.md b/Infinitely-reusable-TMs.md deleted file mode 100644 index eb885f0..0000000 --- a/Infinitely-reusable-TMs.md +++ /dev/null @@ -1,60 +0,0 @@ -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! - -![](https://i.imgur.com/KwzzUSm.png) - -Notes: Pokemon will replenish their PP if a TM move is forgotten and relearned. \ No newline at end of file -- cgit v1.2.3