diff options
author | Chatot4444 <94812895+Chatot4444@users.noreply.github.com> | 2021-11-21 21:35:03 -0500 |
---|---|---|
committer | Chatot4444 <94812895+Chatot4444@users.noreply.github.com> | 2021-11-21 21:35:03 -0500 |
commit | ee7a6d35d17e0c3fee12534f42942a5bc9b7538e (patch) | |
tree | d8c90e3e0d5c7780bf5a7c8331ac44413599e5a6 | |
parent | b0a959583d812ab74ff5336728f1aebf17a35999 (diff) |
Updated Add a new move (markdown)
-rw-r--r-- | Add-a-new-move.md | 89 |
1 files changed, 49 insertions, 40 deletions
diff --git a/Add-a-new-move.md b/Add-a-new-move.md index 4b66303..c015f2d 100644 --- a/Add-a-new-move.md +++ b/Add-a-new-move.md @@ -7,78 +7,87 @@ This tutorial is for how to add new moves to the game. This is a relatively simp - [Define a move constant](#1-define-a-move-constant) - [Give the move a name](#2-give-the-move-a-name) - [Add move data](#3-add-move-data) -- [Add to movesets](#4-add-to-movesets) +- [Add animation](#4-add-animation) +- [Add sound effect](#5-add-sound-effect) +- [Add to movesets](#6-add-to-movesets) ## 1. Define a move constant -The first thing we will do is establish a constant value for our new move. Before doing that, we need to understand something: **MOVES use the same series of constants as their ANIMATIONS.** This is important to know for a couple of reasons. Now, before we do anything, let's make an adjustment to our constants. - -Go to [constants/move_constants.asm](../blob/master/constants/move_constants.asm) and change this: +The first thing we will do is establish a constant value for our new move in [constants/move_constants.asm](../blob/master/constants/move_constants.asm). ```diff const SLASH ; a3 const SUBSTITUTE ; a4 + const STRUGGLE ; a5 + const HEART_STAMP ; a6 ; New move +NUM_ATTACKS EQU const_value - 1 +``` -NUM_ATTACKS EQU const_value + -1 +If you are adding multiple moves, make sure to remember their order in this list, as the data we enter in the next few sections of this tutorial must also follow that order. - const STRUGGLE +## 2. Give the move a name - ; Moves do double duty as animation identifiers. +Next, we will put the text name that will be displayed. Go to [data/moves/names.asm](../blob/master/data/moves/names.asm), which should have the **MoveNames::** label, and add this: - const SHOWPIC_ANIM +```diff + li "SLASH" + li "SUBSTITUTE" + li "STRUGGLE" + li "HEART STAMP" ; Add this ``` -to this: -```diff - const SLASH ; a3 - const SUBSTITUTE ; a4 - const STRUGGLE ; a5 ; < Move this here +"HEART STAMP" is 11 characters long. As a rule of thumb, try not to exceed 12 characters (e.g. "SELFDESTRUCT"). 12 is the limit that will fit on screen w/o causing glitches. -NUM_ATTACKS EQU const_value ; Now implement this here -const_value = STRUGGLE + 1 ; remaining animations constants start after STRUGGLE, like before +## 3. Add move data - ; Moves do double duty as animation identifiers. +Now for the easy part. Go to [data/moves/moves.asm](../blob/master/data/moves/moves.asm), which should have the **Moves:** label. You will see a set of data dedicated to moves and their attributes. Now, as Heart Stamp is effectively a variation of Bite, let's find BITE's data and copy that. Search for BITE, or just copy this: - const SHOWPIC_ANIM +``` + move BITE, FLINCH_SIDE_EFFECT1, 60, NORMAL, 100, 25 +``` +And paste it at the end of the move data, but change the NORMAL to PSYCHIC, and BITE to HEART_STAMP, like so: +``` + move HEART_STAMP, FLINCH_SIDE_EFFECT1, 60, PSYCHIC, 100, 25 ``` -This allows all following constants such as SHOWPIC_ANIM to retain their value, while allowing us to add more moves. Bear in mind that STRUGGLE needs to remain at its current index, so all new moves **SHOULD** follow STRUGGLE. You CAN put new moves before STRUGGLE, providing you remove an existing move to offset what you add. With that out of the way, add this: +## 4. Add animation + +Next, we need to give our move an animation for when it is used in battle. Go to [data/moves/animations.asm](../blob/master/data/moves/animations.asm), and first look at the table labeled **AttackAnimationPointers:**. Add an entry for your move like so: ```diff - const SLASH ; a3 - const SUBSTITUTE ; a4 - const STRUGGLE ; a5 - const HEART_STAMP ; a6 ; New move + dw SlashAnim + dw SubstituteAnim + dw StruggleAnim + dw HeartStampAnim + assert_table_length NUM_ATTACKS ``` -## 2. Give the move a name - -Next, we will put the text name that will be displayed. Go to [data/moves/names.asm](../blob/master/data/moves/names.asm), which should have the **MoveNames::** label, and add this: +Now we need to define this animation. You could create a new animation specific to your move, but that will not be covered in this tutorial. Instead, we will be reusing the animation for another move, in this case Lovely Kiss. Find **LovelyKissAnim:** and add a label in front of it like so: ```diff - db "SLASH@" - db "SUBSTITUTE@" - db "STRUGGLE@" - db "HEART STAMP@" ; Add this +HeartStampAnim: +LovelyKissAnim: + battle_anim LOVELY_KISS, SUBANIM_12, 0, 6 + db -1 ; end ``` -"HEART STAMP" is 11 characters long. As a rule of thumb, try not to exceed 12 characters (e.g. "SELFDESTRUCT"). I may be wrong but I believe 12 is the limit that will fit on screen w/o causing glitches. +Now both moves will use this animation. -## 3. Add move data +## 5. Add sound effect -Now for the easy part. Go to [data/moves/moves.asm](../blob/master/data/moves/moves.asm), which should have the **Moves:** label. You will see a set of data dedicated to moves and their attributes. Now, as Heart Stamp is effectively a variation of Bite, let's find BITE's data and copy that. Search for BITE, or just copy this: +Almost done! Go to [data/moves/sfx.asm](../blob/master/data/moves/sfx.asm). Again we can use Lovely Kiss, just copy its data in the table and paste it at the end. -``` - move BITE, FLINCH_SIDE_EFFECT1, 60, NORMAL, 100, 25 -``` -And paste it at the end of the move data, but change the NORMAL to PSYCHIC, like so: -``` - move BITE, FLINCH_SIDE_EFFECT1, 60, PSYCHIC, 100, 25 ; Heart Stamp (Uses BITE animation) +```diff + db SFX_NOT_VERY_EFFECTIVE, $01, $ff ; SLASH + db SFX_BATTLE_2C, $d8, $04 ; SUBSTITUTE + db SFX_BATTLE_0B, $00, $80 ; STRUGGLE + db SFX_BATTLE_09, $88, $10 ; HEART_STAMP + assert_table_length NUM_ATTACKS ``` -Don't worry about "move BITE". All this means is that it uses BITE's animation. As I said, moves and animations use the same constants. If you don't like this animation, replace BITE with another move constant that is more suitable. With that, our move is officially in the game. Now we just need to add it to a moveset and put it in action. +With that, our move is officially in the game. Now we just need to add it to a moveset and put it in action. -## 4. Add to movesets +## 6. Add to movesets There are multiple ways we can implement the move into the game. For now, I'm going to show you the most simple and easy methods, so that you can see your move in action right away. First, let's set our new move as a starter's first move so we can test it immediately. I am a sucker for Water-type starters, so I'll be using Squirtle. Go to [data/pokemon/base_stats/squirtle.asm](../blob/master/data/pokemon/base_stats/squirtle.asm) and add the move like so: |