diff options
author | Idain <luiscarlosholguinperez@outlook.com> | 2021-04-17 03:08:42 -0400 |
---|---|---|
committer | Idain <luiscarlosholguinperez@outlook.com> | 2021-04-17 03:08:42 -0400 |
commit | 0bcfbf423c23e8d50d27c79c830ceadbf1e4acd1 (patch) | |
tree | 489573af945d219e0033ceb67bfa731a0e1cb325 | |
parent | 2bdc4a24d04d4f63d842d5978eb2b85390e4901a (diff) |
Updating tutorial with changes made in the "Add a new move" one, and other small details.
-rw-r--r-- | Add-a-new-move-effect.md | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Add-a-new-move-effect.md b/Add-a-new-move-effect.md index 20bbee6..568838a 100644 --- a/Add-a-new-move-effect.md +++ b/Add-a-new-move-effect.md @@ -15,7 +15,7 @@ This tutorial is for how to add a new move effect. As an example, we'll add Hex. Hex is an attack from Gen 5 that doubles in power if the target has a status condition. No effect like that existed in Gen 2, so we're going to add one; but first, we have to add the move Hex, following [this tutorial](Add-a-new-move). -Replace `MOVE_OR_ANIM_FC` with `HEX`; give it a name, description, and battle properties (`HEX, EFFECT_HEX, 65, GHOST, 100, 10, 0`); give it an animation (it can share `BattleAnim_Spite`); and add it to Pokémon learnsets (Vulpix, Tentacool/Tentacruel, Gastly/Haunter/Gengar, and Misdreavus by level-up; Vulpix and Dunsparce by breeding). +Add the constant `HEX`; give it a name, description, and battle properties (`HEX, EFFECT_HEX, 65, GHOST, 100, 10, 0`); give it an animation (it can share `BattleAnim_Spite`); and add it to Pokémon learnsets (Vulpix, Tentacool/Tentacruel, Gastly/Haunter/Gengar, and Misdreavus by level-up; Vulpix and Dunsparce by breeding). ## 2. Define an effect constant @@ -31,7 +31,7 @@ Replace `MOVE_OR_ANIM_FC` with `HEX`; give it a name, description, and battle pr + const EFFECT_HEX ``` -If you want to be save space, there are six `UNUSED` effects you can replace, instead of adding `EFFECT_HEX` to the end of the list. +If you want to save space, there are six `UNUSED` effects you can replace, instead of adding `EFFECT_HEX` to the end of the list. ## 3. Update the effect pointer table @@ -112,14 +112,13 @@ Create **engine/battle/move_effects/hex.asm**: ```diff +BattleCommand_Hex: -+; hex -+; get the opponent's status condition ++; Get the opponent's status condition + ld a, BATTLE_VARS_STATUS_OPP + call GetBattleVar -+; return if it's 0 (no condition) ++; Return if it's 0 (no condition) + and a + ret z -+; it's not 0, so double damage ++; It's not 0, so double the damage + jp DoubleDamage ``` @@ -146,7 +145,7 @@ Notice how similar `BattleCommand_Hex` is to `BattleCommand_DoubleFlyingDamage` ## 6. Teach the AI to use the effect well -This step is optional, but if you feel capable of writing new code, it's nice to have the enemy AI use new moves in appropriate situations. +Now that we successfully added Hex, it'd nice to have the enemy AI use the new move in appropriate situations. First, look at the tables of moves and effects in [data/battle/ai](../tree/master/data/battle/ai/). They all have comments at the top explaining what they're for, like "`AI_CAUTIOUS` discourages these moves after the first turn." Consider whether your new move effect should be added to any of these tables. There's nowhere we need to add `HEX` or `EFFECT_HEX`, though. @@ -158,7 +157,7 @@ Next, we'll teach `AI_SMART` to take advantage of `EFFECT_HEX` when the player h ... - .table_386f2 + AI_Smart_EffectHandlers: dbw EFFECT_SLEEP, AI_Smart_Sleep ... dbw EFFECT_FLY, AI_Smart_Fly |