diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-10-27 23:57:10 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-10-27 23:57:10 -0400 |
commit | 77346a9ca1851fb410018288bf46935d4ec7cb54 (patch) | |
tree | cb55df27a3bec9790135f53162ead584b9d68f3d | |
parent | ffbebeb0e5375cd4b29966ca981688351b71da04 (diff) |
Fix <summary>
-rw-r--r-- | Add-a-new-item.md | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Add-a-new-item.md b/Add-a-new-item.md index 3abb682..cfd8c14 100644 --- a/Add-a-new-item.md +++ b/Add-a-new-item.md @@ -498,7 +498,12 @@ In other words, adding an effect for `HELD_EVIOLITE` won't involve updating any Eviolite's effect is pretty similar to Metal Powder, which boosts Ditto's defenses. Searching through the battle engine code for references to `METAL_POWDER` finds that it's implemented as a `DittoMetalPowder` routine, which gets called in two places, one for the player and one for the enemy. (Note that it checks directly for whether the held item is `METAL_POWDER`, not whether the held item's effect is `HELD_METAL_POWDER`. Either check would be okay, though.) <details> -<summary>Anyway, edit [engine/battle/effect_commands.asm](../blob/master/engine/battle/effect_commands.asm): (click to expand)</summary> + +<summary> + +Anyway, edit [engine/battle/effect_commands.asm](../blob/master/engine/battle/effect_commands.asm): (click to expand) + +</summary> ```diff DittoMetalPowder: @@ -590,6 +595,7 @@ Eviolite's effect is pretty similar to Metal Powder, which boosts Ditto's defens and a ret ``` + </details> The implementation of `UnevolvedEviolite` is very similar to `DittoMetalPowder`, except the simple check for whether the species is `DITTO` has been replaced by a check for evolutions, similar to the check in `MoonBallMultiplier` in [engine/items/item_effects.asm](../blob/master/engine/items/item_effects.asm). (Also, instead of checking whether `[hl]` is `EVIOLITE`, we check whether `b` is `HELD_EVIOLITE`; either would be fine, since `GetOpponentItem` returns "the effect of the opponent's item in `bc`, and its id at `hl`", as explained in a comment.) `bc` gets repeatedly saved on the stack with `push` and `pop` because it contains the defense stat, and we don't want the various pre-boost checks to corrupt the original value. |