Skip to content

How To Add A New Type

Daniel Harding edited this page Jun 29, 2022 · 12 revisions

This tutorial will go over how to add a new type. As an example, we'll be adding the Dark type.

Contents

  1. Define A Type Constant
  2. Give That Constant A Name
  3. List The Type Matchups
  4. Update Pokemon Types
  5. Update Move Types

1. Define A Type Constant

Edit constants/type_constants.asm:

     ; Elemental types
     NORMAL   EQU $00
     ...
     ICE      EQU $19
     DRAGON   EQU $1A
+    DARK     EQU $1B

2. Give That Constant A Name

Edit data/types/names.asm

     TypeNames:

	     dw .Normal
             ...
	     dw .Dragon
+            dw .Dark

     .Normal:   db "NORMAL@"
     ...
     .Dragon:   db "DRAGON@"
+    .Dark:     db "DARK@"

3. List The Type Matchups

Edit data/types/type_matchups.asm

Format Order: Attacking Type, Defending Type, Type Effectiveness

	...
	db DRAGON,       DRAGON,       SUPER_EFFECTIVE
+       db DARK,         PSYCHIC_TYPE, SUPER_EFFECTIVE
+       db DARK,         GHOST,        SUPER_EFFECTIVE
+       db DARK,         DARK,         NOT_VERY_EFFECTIVE
+       db DARK,         FIGHTING,     NOT_VERY_EFFECTIVE
+       db FIGHTING,     DARK,         SUPER_EFFECTIVE
+       db BUG,          DARK,         SUPER_EFFECTIVE
+       db GHOST,        DARK,         NOT_VERY_EFFECTIVE
+       db PSYCHIC_TYPE, DARK,         NO_EFFECT

4. Update Pokemon Types

Edit data/pokemon/base_stats/gyarados.asm

	db DEX_GYARADOS
	...
	db WATER
-	db FLYING
+	db DARK

5. Update Move Types

Edit data/moves/moves.asm

	move KARATE_CHOP,  NO_ADDITIONAL_EFFECT,        50, NORMAL,   100, 25
	...
-	move BITE,         FLINCH_SIDE_EFFECT1,         60, NORMAL,   100, 25
+	move BITE,         FLINCH_SIDE_EFFECT1,         60, DARK,     100, 25

And that's it! You've added a new type into the game.