diff options
| author | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-10-28 00:01:56 -0400 |
|---|---|---|
| committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-10-28 00:01:56 -0400 |
| commit | cb1cbc6ac383e8a919039815060c167b0dfce855 (patch) | |
| tree | 8d596fc2b85b0c02a42d904d39500e1fd72020e7 /Add-a-new-item.md | |
| parent | 77346a9ca1851fb410018288bf46935d4ec7cb54 (diff) | |
Remove <details>
Diffstat (limited to 'Add-a-new-item.md')
| -rw-r--r-- | Add-a-new-item.md | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/Add-a-new-item.md b/Add-a-new-item.md index cfd8c14..3ce09a9 100644 --- a/Add-a-new-item.md +++ b/Add-a-new-item.md @@ -497,13 +497,7 @@ 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> +Anyway, edit [engine/battle/effect_commands.asm](../blob/master/engine/battle/effect_commands.asm): ```diff DittoMetalPowder: @@ -596,8 +590,6 @@ Anyway, edit [engine/battle/effect_commands.asm](../blob/master/engine/battle/ef 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. In general, if you're implementing a custom held item effect, think about which items have similar effects, and which other code might already do something like what you want. |
