Skip to content
Yoann Fievez edited this page Nov 6, 2021 · 12 revisions

This tutorial is for how to add new types for Pokemon or moves. As an example, we'll be adding the Dark type first introduced in Generation II.

Contents

1. Define a type constant

Gen I was before the Physical/Special split, so any types with an index number less than $14 are physical, and anything greater than or equal to it is special. Dark type was classified as a special type in Gen II and III, so we'll include Dark type as Type $1B.

Note that with Physical/Special Split, placement in the list won't matter.

Edit constants/type_constants.asm:

; TypeNames indexes (see data/types/names.asm)
	const_def

PHYSICAL EQU const_value
	const NORMAL       ; $00
	const FIGHTING     ; $01
	const FLYING       ; $02
	const POISON       ; $03
	const GROUND       ; $04
	const ROCK         ; $05
	const BIRD         ; $06
	const BUG          ; $07
	const GHOST        ; $08

	const_next 20

SPECIAL EQU const_value
	const FIRE         ; $14
	const WATER        ; $15
	const GRASS        ; $16
	const ELECTRIC     ; $17
	const PSYCHIC_TYPE ; $18
	const ICE          ; $19
	const DRAGON       ; $1A
+	const DARK         ; $1B

NUM_TYPES EQU const_value

2. Give the type a name

Edit data/types/names.asm:

TypeNames:
	table_width 2, TypeNames

	dw .Normal
	dw .Fighting
	dw .Flying
	dw .Poison
	dw .Ground
	dw .Rock
	dw .Bird
	dw .Bug
	dw .Ghost

REPT FIRE - GHOST - 1
	dw .Normal
ENDR

	dw .Fire
	dw .Water
	dw .Grass
	dw .Electric
	dw .Psychic
	dw .Ice
	dw .Dragon
+       dw .Dark
	assert_table_length NUM_TYPES

 .Normal:   db "NORMAL@"
 .Fighting: db "FIGHTING@"
 .Flying:   db "FLYING@"
 .Poison:   db "POISON@"
 .Fire:     db "FIRE@"
 .Water:    db "WATER@"
 .Grass:    db "GRASS@"
 .Electric: db "ELECTRIC@"
 .Psychic:  db "PSYCHIC@"
 .Ice:      db "ICE@"
 .Ground:   db "GROUND@"
 .Rock:     db "ROCK@"
 .Bird:     db "BIRD@"
 .Bug:      db "BUG@"
 .Ghost:    db "GHOST@"
 .Dragon:   db "DRAGON@"
+.Dark:     db "DARK@"

Repeat this for any move. Make sure the top pointer table is in the same order as the move IDs.

3. List the type matchups

Here, we have a set format. For each non-normal type interaction, there is an entry in this list with the attacker, defender, and then multiplier listed. You'll need to add entries if you want your move to have any special interactions with other types.

Edit data/types/type_matchups.asm:

TypeEffects:
	;  attacker,     defender,     *=
	db WATER,        FIRE,         SUPER_EFFECTIVE
	db FIRE,         GRASS,        SUPER_EFFECTIVE
	db FIRE,         ICE,          SUPER_EFFECTIVE
	db GRASS,        WATER,        SUPER_EFFECTIVE
	db ELECTRIC,     WATER,        SUPER_EFFECTIVE
	db WATER,        ROCK,         SUPER_EFFECTIVE
	db GROUND,       FLYING,       NO_EFFECT
	db WATER,        WATER,        NOT_VERY_EFFECTIVE
	db FIRE,         FIRE,         NOT_VERY_EFFECTIVE
	db ELECTRIC,     ELECTRIC,     NOT_VERY_EFFECTIVE
	db ICE,          ICE,          NOT_VERY_EFFECTIVE
	db GRASS,        GRASS,        NOT_VERY_EFFECTIVE
	db PSYCHIC_TYPE, PSYCHIC_TYPE, NOT_VERY_EFFECTIVE
	db FIRE,         WATER,        NOT_VERY_EFFECTIVE
	db GRASS,        FIRE,         NOT_VERY_EFFECTIVE
	db WATER,        GRASS,        NOT_VERY_EFFECTIVE
	db ELECTRIC,     GRASS,        NOT_VERY_EFFECTIVE
	db NORMAL,       ROCK,         NOT_VERY_EFFECTIVE
	db NORMAL,       GHOST,        NO_EFFECT
	db GHOST,        GHOST,        SUPER_EFFECTIVE
	db FIRE,         BUG,          SUPER_EFFECTIVE
	db FIRE,         ROCK,         NOT_VERY_EFFECTIVE
	db WATER,        GROUND,       SUPER_EFFECTIVE
	db ELECTRIC,     GROUND,       NO_EFFECT
	db ELECTRIC,     FLYING,       SUPER_EFFECTIVE
	db GRASS,        GROUND,       SUPER_EFFECTIVE
	db GRASS,        BUG,          NOT_VERY_EFFECTIVE
	db GRASS,        POISON,       NOT_VERY_EFFECTIVE
	db GRASS,        ROCK,         SUPER_EFFECTIVE
	db GRASS,        FLYING,       NOT_VERY_EFFECTIVE
	db ICE,          WATER,        NOT_VERY_EFFECTIVE
	db ICE,          GRASS,        SUPER_EFFECTIVE
	db ICE,          GROUND,       SUPER_EFFECTIVE
	db ICE,          FLYING,       SUPER_EFFECTIVE
	db FIGHTING,     NORMAL,       SUPER_EFFECTIVE
	db FIGHTING,     POISON,       NOT_VERY_EFFECTIVE
	db FIGHTING,     FLYING,       NOT_VERY_EFFECTIVE
	db FIGHTING,     PSYCHIC_TYPE, NOT_VERY_EFFECTIVE
	db FIGHTING,     BUG,          NOT_VERY_EFFECTIVE
	db FIGHTING,     ROCK,         SUPER_EFFECTIVE
	db FIGHTING,     ICE,          SUPER_EFFECTIVE
	db FIGHTING,     GHOST,        NO_EFFECT
	db POISON,       GRASS,        SUPER_EFFECTIVE
	db POISON,       POISON,       NOT_VERY_EFFECTIVE
	db POISON,       GROUND,       NOT_VERY_EFFECTIVE
	db POISON,       BUG,          SUPER_EFFECTIVE
	db POISON,       ROCK,         NOT_VERY_EFFECTIVE
	db POISON,       GHOST,        NOT_VERY_EFFECTIVE
	db GROUND,       FIRE,         SUPER_EFFECTIVE
	db GROUND,       ELECTRIC,     SUPER_EFFECTIVE
	db GROUND,       GRASS,        NOT_VERY_EFFECTIVE
	db GROUND,       BUG,          NOT_VERY_EFFECTIVE
	db GROUND,       ROCK,         SUPER_EFFECTIVE
	db GROUND,       POISON,       SUPER_EFFECTIVE
	db FLYING,       ELECTRIC,     NOT_VERY_EFFECTIVE
	db FLYING,       FIGHTING,     SUPER_EFFECTIVE
	db FLYING,       BUG,          SUPER_EFFECTIVE
	db FLYING,       GRASS,        SUPER_EFFECTIVE
	db FLYING,       ROCK,         NOT_VERY_EFFECTIVE
	db PSYCHIC_TYPE, FIGHTING,     SUPER_EFFECTIVE
	db PSYCHIC_TYPE, POISON,       SUPER_EFFECTIVE
	db BUG,          FIRE,         NOT_VERY_EFFECTIVE
	db BUG,          GRASS,        SUPER_EFFECTIVE
	db BUG,          FIGHTING,     NOT_VERY_EFFECTIVE
	db BUG,          FLYING,       NOT_VERY_EFFECTIVE
	db BUG,          PSYCHIC_TYPE, SUPER_EFFECTIVE
	db BUG,          GHOST,        NOT_VERY_EFFECTIVE
	db BUG,          POISON,       SUPER_EFFECTIVE
	db ROCK,         FIRE,         SUPER_EFFECTIVE
	db ROCK,         FIGHTING,     NOT_VERY_EFFECTIVE
	db ROCK,         GROUND,       NOT_VERY_EFFECTIVE
	db ROCK,         FLYING,       SUPER_EFFECTIVE
	db ROCK,         BUG,          SUPER_EFFECTIVE
	db ROCK,         ICE,          SUPER_EFFECTIVE
	db GHOST,        NORMAL,       NO_EFFECT
	db GHOST,        PSYCHIC_TYPE, NO_EFFECT
	db FIRE,         DRAGON,       NOT_VERY_EFFECTIVE
	db WATER,        DRAGON,       NOT_VERY_EFFECTIVE
	db ELECTRIC,     DRAGON,       NOT_VERY_EFFECTIVE
	db GRASS,        DRAGON,       NOT_VERY_EFFECTIVE
	db ICE,          DRAGON,       SUPER_EFFECTIVE
	db DRAGON,       DRAGON,       SUPER_EFFECTIVE
+	db DARK,         GHOST,        SUPER_EFFECTIVE
+	db DARK,         PSYCHIC,      SUPER_EFFECTIVE
+	db DARK,         DARK,         NOT_VERY_EFFECTIVE
+	db DARK,         FIGHTING,     NOT_VERY_EFFECTIVE
+	db GHOST,        DARK,         NOT_VERY_EFFECTIVE
+	db BUG,          DARK,         SUPER_EFFECTIVE
+	db FIGHTING,     DARK,         SUPER_EFFECTIVE
+	db PSYCHIC,      DARK,         NO_EFFECT
	db -1 ; end

4. Update Pokemon Types

Technically, no Gen I Pokemon in their base form had the Dark type retrofitted onto them. So, as an example, we'll give it to Gyarados, who has it in its Mega Evolution. Edit the following in data/pokemon/base_stats/:

DEX_GYARADOS ; pokedex id
...
db  95, 125,  79,  81, 100
;   hp  atk  def  spd  spc

+  db WATER, DARK ; type
-  db WATER, FLYING ; type
...
db 0 ; padding

5. Update the move types

Luckily, one move in Gen I did get retrofitted to be Dark type in Gen II onwards. That move is Bite. So, edit the type column in data/moves/moves.asm:

 move: macro
	 db \1 ; animation (interchangeable with move id)
	 db \2 ; effect
	 db \3 ; power
	 db \4 ; type
	 db \5 percent ; accuracy
	 db \6 ; pp
ENDM

Moves:
; Characteristics of each move.
	 table_width MOVE_LENGTH, Moves
	 move POUND,        NO_ADDITIONAL_EFFECT,        40, NORMAL,   100, 35
    ...
 	move PIN_MISSILE,  TWO_TO_FIVE_ATTACKS_EFFECT,  14, BUG,       85, 20
	move LEER,         DEFENSE_DOWN1_EFFECT,         0, NORMAL,   100, 30
+	move BITE,         FLINCH_SIDE_EFFECT1,         60, DARK,     100, 25
-	move BITE,         FLINCH_SIDE_EFFECT1,         60, NORMAL,   100, 25
    ...
 	move STRUGGLE,     RECOIL_EFFECT,               50, NORMAL,   100, 10
 	assert_table_length NUM_ATTACKS

As of now, we have added all that is needed for the Dark type to function. I'd recommend adding some Dark-type Pokemon and moves in order to truly create a polished Dark type. For adding the Steel and Fairy types, the same steps are done as above, but instead of what changes you made above, you would make the changes that apply to your type.

Clone this wiki locally