Add a new move - pret/pokered GitHub Wiki

This tutorial is for how to add new moves to the game. This is a relatively simple copy/paste job that should give you a basic idea of how move data is used in the game, and as such, we won't be making any new animations here. Also, if you want to have more than 255 moves in your hack, you will need to extend the move index to 2 bytes, which will also not be covered here. For this example, we'll be adding Heart Stamp, a move introduced in Generation V, as it is, more or less, a clone of Bite.

DISCLAIMER: Always backup your disassembly before editing anything. Neither I (RetroKoH), or anyone in the community, are responsible for anything going awry. Always take care and be sure to report any issues or ask any questions if you are unsure. ALSO: This guide assumes you are using the latest build of pokered. Older versions may have Labels and/or data in other files or folders. When in doubt, search through your disassembly or ask for help. ONE OTHER THING: If you're using this guide, the practical limit for moves is 218. If you want to add more than that, you're going to have to do some things that are out of the scope of this tutorial.

Contents

1. Define a move constant

The first thing we will do is establish a constant value for our new move in constants/move_constants.asm. We must place our constant so that struggle is still the last move in the list, otherwise it will cause issues with the move metronome.

    const SLASH        ; a3
    const SUBSTITUTE   ; a4
+   const HEART_STAMP  ; a5
-   const STRUGGLE     ; a5
+   const STRUGGLE     ; a6
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.

2. Give the move a name

Next, we will put the text name that will be displayed. Go to data/moves/names.asm, which should have the MoveNames:: label, and add this:

    li "SLASH"
    li "SUBSTITUTE"
+   li "HEART STAMP
    li "STRUGGLE"

"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.

3. Add move data

Now for the easy part. Go to 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:

    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

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, and first look at the table labeled AttackAnimationPointers:. Add an entry for your move like so:

	dw SlashAnim
	dw SubstituteAnim
+	dw HeartStampAnim
	dw StruggleAnim
	assert_table_length NUM_ATTACKS

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:

HeartStampAnim:
LovelyKissAnim:
	battle_anim LOVELY_KISS, SUBANIM_0_HEART_1_MUSIC, 0, 6
	db -1 ; end

Now both moves will use this animation.

5. Add sound effect

Almost done! Go to data/moves/sfx.asm. Again we can use Lovely Kiss, just copy its data in the table and paste it at the end.

	db SFX_NOT_VERY_EFFECTIVE, $01, $ff ; SLASH
	db SFX_BATTLE_2C,          $d8, $04 ; SUBSTITUTE
+	db SFX_BATTLE_09,          $88, $10 ; HEART_STAMP
	db SFX_BATTLE_0B,          $00, $80 ; STRUGGLE
	assert_table_length NUM_ATTACKS

With that, our move is officially in the game. Now we just need to add it to a moveset and put it in action.

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 and add the move like so:

db TACKLE, TAIL_WHIP, HEART_STAMP, NO_MOVE ; level 1 learnset

When you start a new game, your Squirtle (or whichever inferior starter you chose) will have the new move right away, and it should work sufficiently. With that, let's go ahead and add it to Jynx, since it is actually Jynx's move. Go to data/pokemon/evos_moves.asm, search for JynxEvosMoves:, and add the move like so:

JynxEvosMoves:
; Evolutions
	db 0
; Learnset
	db 18, LICK
	db 23, DOUBLESLAP
	db 31, ICE_PUNCH
	db 35, HEART_STAMP ; Why not? You can place it wherever you want
	db 39, BODY_SLAM
	db 47, THRASH
	db 58, BLIZZARD
	db 0

This allows Jynx to learn the move at Level 35. You can modify this as you see fit, but follow two rules:

  1. Keep the levels in order. Meaning that if you change HEART_STAMP to be learnt at Level 9, place it at the top of the list, as 9 comes before the others.
  2. Don't put two moves at the same level. It is possible to manipulate your engine to be able to allow for multiple moves at the same level. If you have implemented such a change, disregard this rule. Otherwise, adhere to it.

There you have it! That's the simplest method for adding new moves to your ROM hack. Find me on the pret Discord server if you have any issues or if I've made any mistakes. Everything should be good to go though, and you're free to now add more moves as you see fit.