diff options
author | LOuroboros <lunosouroboros@gmail.com> | 2022-02-16 09:24:10 -0300 |
---|---|---|
committer | LOuroboros <lunosouroboros@gmail.com> | 2022-02-16 09:24:10 -0300 |
commit | ba884e9c503dc1ac83148157d7ef9284c29b9bc1 (patch) | |
tree | 4246bb8935ce727db6fcf0eb6ed79b1193f76ed6 | |
parent | ce1fae004ba37d1bec971ad892e4c885e1e17a02 (diff) |
May as well take the chance and add a very important note for item_expansion users, since it's relevant to the choice given at the end
-rw-r--r-- | Infinite-TM-usage.md | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Infinite-TM-usage.md b/Infinite-TM-usage.md index f58ffb3..aa5b267 100644 --- a/Infinite-TM-usage.md +++ b/Infinite-TM-usage.md @@ -236,3 +236,36 @@ And that's it! TMs are now reusable just like in Gen 5!  Alternatively, see [this commit](https://github.com/LOuroboros/pokeemerald/commit/6f69765770a52c1a7d6608a117112b78a2afcc22) for an implementation by Karathan that turns TMs and HMs into a bitfield, freeing up some saveblock space. This saves space, but is slightly more complex. + +**[Item_expansion](https://github.com/rh-hideout/pokeemerald-expansion/tree/item_expansion)** users, please keep in mind that if you decide to use the above refactorization of TMs and HMs, you will need to modify the `CanMonLearnTMTutor` function located in `src/party_menu.c` like this: + +```diff +static u8 CanMonLearnTMTutor(struct Pokemon *mon, u16 item, u8 tutor) +{ + u16 move; + + if (GetMonData(mon, MON_DATA_IS_EGG)) + return CANNOT_LEARN_MOVE_IS_EGG; + + if (item >= ITEM_TM01) + { +- if (!CanMonLearnTMHM(mon, item - ITEM_TM01 - ((item > ITEM_TM100) ? 50 : 0))) ++ if (!CanMonLearnTMHM(mon, item - ITEM_TM01)) + return CANNOT_LEARN_MOVE; + else + move = ItemIdToBattleMoveId(item); + } + else + { + if (!CanLearnTutorMove(GetMonData(mon, MON_DATA_SPECIES), tutor)) + return CANNOT_LEARN_MOVE; + else + move = GetTutorMove(tutor); + } + + if (MonKnowsMove(mon, move) == TRUE) + return ALREADY_KNOWS_MOVE; + else + return CAN_LEARN_MOVE; +} +```
\ No newline at end of file |