diff options
-rw-r--r-- | Add-a-new-Pokémon.md | 66 |
1 files changed, 56 insertions, 10 deletions
diff --git a/Add-a-new-Pokémon.md b/Add-a-new-Pokémon.md index 9204565..b9c5595 100644 --- a/Add-a-new-Pokémon.md +++ b/Add-a-new-Pokémon.md @@ -51,7 +51,7 @@ Edit [constants/pokemon_constants.asm](../blob/master/constants/pokemon_constant ... const CELEBI ; fb + const MUNCHLAX ; fc - NUM_POKEMON EQU const_value + -1 + NUM_POKEMON EQU const_value -1 - const_skip ; fc const EGG ; fd ``` @@ -69,20 +69,24 @@ Edit [data/pokemon/names.asm](../blob/master/data/pokemon/names.asm): ```diff PokemonNames:: + table_width NAME_LENGTH - 1, PokemonNames db "BULBASAUR@" ... db "CELEBI@@@@" -- db "?????@@@@@" + db "MUNCHLAX@@" + assert_table_length NUM_POKEMON +- db "?????@@@@@" db "EGG@@@@@@@" + assert_table_length EGG db "?????@@@@@" db "?????@@@@@" db "?????@@@@@" + assert_table_length $100 ``` All the names are exactly 10 characters long, with "@" as padding. Names that are 10 characters long anyway, like "CHARMELEON", don't have any padding. -(Aside: if you make names lowercase, be careful—going from "FARFETCH'D" to "Farfetch'd" will lower the character count by 1 since `'d` is a single character, so that would need to become `"Farfetch'd@"`.) +(Aside: if you make names lowercase, be careful—going from "FARFETCH'D" to "Farfetch'd" will lower the character count by 1 since `'d` is a single character, so that would need to become `"Farfetch'd@"`.). ## 3. Define its base data @@ -150,10 +154,12 @@ Then edit [data/pokemon/base_stats.asm](../blob/master/data/pokemon/base_stats.a ```diff BaseData:: + table_width BASE_DATA_SIZE, BaseData INCLUDE "data/pokemon/base_stats/bulbasaur.asm" ... INCLUDE "data/pokemon/base_stats/celebi.asm" +INCLUDE "data/pokemon/base_stats/munchlax.asm" + assert_table_length NUM_POKEMON ``` @@ -163,10 +169,12 @@ Edit [data/pokemon/evos_attacks_pointers.asm](../blob/master/data/pokemon/evos_a ```diff EvosAttacksPointers:: + table_width 2, EvosAttacksPointers dw BulbasaurEvosAttacks ... dw CelebiEvosAttacks + dw MunchlaxEvosAttacks + assert_table_length NUM_POKEMON ``` Then edit [data/pokemon/evos_attacks.asm](../blob/master/data/pokemon/evos_attacks.asm): @@ -217,6 +225,7 @@ Edit [data/pokemon/egg_move_pointers.asm](../blob/master/data/pokemon/egg_move_p ```diff EggMovePointers:: + table_width 2, EggMovePointers dw BulbasaurEggMoves ... dw AerodactylEggMoves @@ -226,6 +235,7 @@ Edit [data/pokemon/egg_move_pointers.asm](../blob/master/data/pokemon/egg_move_p ... dw NoEggMoves + dw MunchlaxEggMoves + assert_table_length NUM_POKEMON ``` Then edit [data/pokemon/egg_moves.asm](../blob/master/data/pokemon/egg_moves.asm): @@ -247,14 +257,18 @@ Edit [data/pokemon/cries.asm](../blob/master/data/pokemon/cries.asm): ```diff PokemonCries:: ; entries correspond to constants/pokemon_constants.asm + table_width MON_CRY_LENGTH, PokemonCries mon_cry CRY_BULBASAUR, 128, 129 ; BULBASAUR ... mon_cry CRY_ENTEI, 330, 273 ; CELEBI -- mon_cry CRY_NIDORAN_M, 0, 0 ; 252 + mon_cry CRY_GRIMER, 101, 128 ; MUNCHLAX + assert_table_length NUM_POKEMON +- mon_cry CRY_NIDORAN_M, 0, 0 ; 252 mon_cry CRY_NIDORAN_M, 0, 0 ; 253 mon_cry CRY_NIDORAN_M, 0, 0 ; 254 mon_cry CRY_NIDORAN_M, 0, 0 ; 255 + assert_table_length $ff + ``` The three values passed to `mon_cry` are a cry index, a pitch, and a length. Defining your own cries is similar to writing original music, and well beyond the scope of this tutorial. So just pick a cry from [constants/cry_constants.asm](../blob/master/constants/cry_constants.asm) and tweak the pitch and length until it sounds okay. I simply copied Snorlax's cry for Munchlax, with a slightly higher pitch and shorter length. @@ -266,10 +280,12 @@ Edit [data/pokemon/menu_icons.asm](../blob/master/data/pokemon/menu_icons.asm): ```diff MonMenuIcons: + table_width 1, MonMenuIcons db ICON_BULBASAUR ; BULBASAUR ... db ICON_HUMANSHAPE ; CELEBI + db ICON_SNORLAX ; MUNCHLAX + assert_table_length NUM_POKEMON ``` Valid icons are in [constants/icon_constants.asm](../blob/master/constants/icon_constants.asm). They're used in the party menu and Day-Care. @@ -301,10 +317,12 @@ Edit [data/pokemon/dex_entry_pointers.asm](../blob/master/data/pokemon/dex_entry ```diff PokedexDataPointerTable: ; entries correspond to constants/pokemon_constants.asm + table_width 2, PokedexDataPointerTable dw BulbasaurPokedexEntry ... dw CelebiPokedexEntry + dw MunchlaxPokedexEntry + assert_table_length NUM_POKEMON ``` Then edit [data/pokemon/dex_entries.asm](../blob/master/data/pokemon/dex_entries.asm): @@ -327,6 +345,7 @@ Edit [data/pokemon/dex_order_new.asm](../blob/master/data/pokemon/dex_order_new. ```diff NewPokedexOrder: + table_width 1, NewPokedexOrder db CHIKORITA ... db AERODACTYL @@ -335,12 +354,14 @@ Edit [data/pokemon/dex_order_new.asm](../blob/master/data/pokemon/dex_order_new. db BULBASAUR ... db CELEBI + assert_table_length NUM_POKEMON ``` Then edit [data/pokemon/dex_order_alpha.asm](../blob/master/data/pokemon/dex_order_alpha.asm): ```diff AlphabeticalPokedexOrder: + table_width 1, AlphabeticalPokedexOrder db ABRA ... db MUK @@ -348,6 +369,7 @@ Then edit [data/pokemon/dex_order_alpha.asm](../blob/master/data/pokemon/dex_ord db MURKROW ... db ZUBAT + assert_table_length NUM_POKEMON ``` That's all for the Pokédex. @@ -372,6 +394,7 @@ Then edit [gfx/footprints.asm](../blob/master/gfx/footprints.asm): footprint_bottom EQUS "2 * LEN_1BPP_TILE, 2 * LEN_1BPP_TILE" ; Entries correspond to Pokémon species, two apiece, 8 tops then 8 bottoms + table_width LEN_1BPP_TILE * 4, Footprints ... ; 249-256 top halves @@ -394,6 +417,8 @@ Then edit [gfx/footprints.asm](../blob/master/gfx/footprints.asm): INCBIN "gfx/footprints/254.1bpp", footprint_bottom INCBIN "gfx/footprints/255.1bpp", footprint_bottom INCBIN "gfx/footprints/256.1bpp", footprint_bottom + + assert_table_length $100 ``` Notice how the footprints are broken into top and bottom halves; you may want to [correct this design flaw](../blob/master/docs/design_flaws.md#footprints-are-split-into-top-and-bottom-halves). (It won't have a visible consequence on the game, but it makes for cleaner code and data.) @@ -474,17 +499,20 @@ Edit [data/pokemon/pic_pointers.asm](../blob/master/data/pokemon/pic_pointers.as ```diff PokemonPicPointers:: ; entries correspond to Pokémon species, two apiece + table_width 3 * 2, PokemonPicPointers dba_pic BulbasaurFrontpic dba_pic BulbasaurBackpic ... dba_pic CelebiFrontpic dba_pic CelebiBackpic -- dbw -1, -1 ; unused -- dbw -1, -1 ; unused + dba_pic MunchlaxFrontpic + dba_pic MunchlaxBackpic + assert_table_length NUM_POKEMON +- dbw -1, -1 ; unused +- dbw -1, -1 ; unused dba_pic EggPic dbw -1, -1 ; unused + assert_table_length EGG ``` We have to use `dba_pic` here instead of a standard `dba`—declaring the bank and address of `MunchlaxFrontpic` and `MunchlaxBackpic`—because of [another design flaw](../blob/master/docs/design_flaws.md#pic-banks-are-offset-by-pics_fix). I strongly recommend removing the whole `FixPicBank` routine from [engine/gfx/load_pics.asm](../blob/master/engine/gfx/load_pics.asm), including all four calls to it in that file, and just using `dba` here; then you'll be able to `INCBIN` sprites in arbitrary banks. @@ -515,6 +543,10 @@ Anyway, edit [data/pokemon/palettes.asm](../blob/master/data/pokemon/palettes.as ; only the middle two colors are included, not black or white. ; Shiny palettes are defined directly, not generated. + ; 2 middle palettes, front and shiny, with 2 colors each + table_width PAL_COLOR_SIZE * 2 * 2, PokemonPalettes + + ; 000 RGB 30, 22, 17 RGB 16, 14, 19 @@ -527,6 +559,10 @@ Anyway, edit [data/pokemon/palettes.asm](../blob/master/data/pokemon/palettes.as ... INCBIN "gfx/pokemon/celebi/front.gbcpal", middle_colors INCLUDE "gfx/pokemon/celebi/shiny.pal" ++INCBIN "gfx/pokemon/munchlax/front.gbcpal", middle_colors ++INCLUDE "gfx/pokemon/munchlax/shiny.pal" + + assert_table_length NUM_POKEMON + 1 -; 252 - RGB 30, 26, 11 @@ -534,12 +570,12 @@ Anyway, edit [data/pokemon/palettes.asm](../blob/master/data/pokemon/palettes.as -; 252 shiny - RGB 30, 26, 11 - RGB 23, 16, 00 -+INCBIN "gfx/pokemon/munchlax/front.gbcpal", middle_colors -+INCLUDE "gfx/pokemon/munchlax/shiny.pal" INCBIN "gfx/pokemon/egg/front.gbcpal", middle_colors INCLUDE "gfx/pokemon/egg/shiny.pal" + assert_table_length EGG + 1 + ; 254 RGB 30, 26, 11 RGB 23, 16, 00 @@ -553,6 +589,8 @@ Anyway, edit [data/pokemon/palettes.asm](../blob/master/data/pokemon/palettes.as ; 255 shiny RGB 23, 23, 23 RGB 17, 17, 17 + + assert_table_length $100 ``` (Older versions of pokecrystal would `INCLUDE "normal.pal"` instead of `INCBIN "front.gbcpal"`, as discussed earlier.) @@ -561,16 +599,17 @@ Edit [gfx/pokemon/anim_pointers.asm](../blob/master/gfx/pokemon/anim_pointers.as ```diff AnimationPointers: + table_width 2, AnimationPointers dw BulbasaurAnimation ... dw CelebiAnimation + dw MunchlaxAnimation + assert_table_length NUM_POKEMON ``` Edit [gfx/pokemon/anims.asm](../blob/master/gfx/pokemon/anims.asm): ```diff - PicAnimations: BulbasaurAnimation: INCLUDE "gfx/pokemon/bulbasaur/anim.asm" ... CelebiAnimation: INCLUDE "gfx/pokemon/celebi/anim.asm" @@ -582,10 +621,12 @@ Edit [gfx/pokemon/idle_pointers.asm](../blob/master/gfx/pokemon/idle_pointers.as ```diff AnimationIdlePointers: + table_width 2, AnimationIdlePointers dw BulbasaurAnimationIdle ... dw CelebiAnimationIdle + dw MunchlaxAnimationIdle + assert_table_length NUM_POKEMON ``` Edit [gfx/pokemon/idles.asm](../blob/master/gfx/pokemon/idles.asm): @@ -602,10 +643,12 @@ Edit [gfx/pokemon/bitmask_pointers.asm](../blob/master/gfx/pokemon/bitmask_point ```diff BitmasksPointers: + table_width 2, BitmasksPointers dw BulbasaurBitmasks ... dw CelebiBitmasks + dw MunchlaxBitmasks + assert_table_length NUM_POKEMON ``` Edit [gfx/pokemon/bitmasks.asm](../blob/master/gfx/pokemon/bitmasks.asm): @@ -622,16 +665,19 @@ Edit [gfx/pokemon/frame_pointers.asm](../blob/master/gfx/pokemon/frame_pointers. ```diff FramesPointers: + table_width 2, FramesPointers dw BulbasaurFrames ... dw CelebiFrames + dw MunchlaxFrames + assert_table_length NUM_POKEMON ``` Finally, edit [gfx/pokemon/johto_frames.asm](../blob/master/gfx/pokemon/johto_frames.asm): ```diff - JohtoFrames: + JohtoFrames: ; used only for BANK(JohtoFrames) + ChikoritaFrames: INCLUDE "gfx/pokemon/chikorita/frames.asm" ... CelebiFrames: INCLUDE "gfx/pokemon/celebi/frames.asm" |