Add more palettes for battle animations - pret/pokecrystal GitHub Wiki

In vanilla Pokémon Crystal, you'll see odd move animations like Sludge using black hues.

Sludge move animation in Gen 2

This is because Generation 2 battle animations use 1 of 8 palettes. Two of them are reserved to be used for the palettes of the enemy's Pokémon and the player's Pokémon.

VRAM Palette View Battle View

We can see that the first two palettes in OBJ0 to OBJ8 correspond to Tentacruel's and Machoke's palettes, respectively. The rest of the palettes correspond to the possible palettes that can be used for move animations.

In this tutorial, you will be able to expand the available palettes to be used for these animations from 6 to 18. If you want to use more than 18 palettes, you can use this tutorial as basis on adding more palettes for move animations.

Contents

  1. Define the palettes to be used
  2. Load the palettes in battle
  3. Make the game use the correct palette when a move is being animated

1. Define the palettes to be used

First, we'll define the constants of the new palettes. Since we'll now be using 18 palettes, and there are already 6 palettes defined, that leaves 12 palettes to be defined in constants/battle_anim_constants.asm.

...

; animation object palettes
-	const_def
-	const PAL_BATTLE_OB_ENEMY  ; 0
-	const PAL_BATTLE_OB_PLAYER ; 1
-	const PAL_BATTLE_OB_GRAY   ; 2
-	const PAL_BATTLE_OB_YELLOW ; 3
-	const PAL_BATTLE_OB_RED    ; 4
-	const PAL_BATTLE_OB_GREEN  ; 5
-	const PAL_BATTLE_OB_BLUE   ; 6
-	const PAL_BATTLE_OB_BROWN  ; 7
+	const PAL_BATTLE_OB_ENEMY      		; 0
+	const PAL_BATTLE_OB_PLAYER    		; 1
+	const PAL_BATTLE_OB_GRAY      		; 2
+	const PAL_BATTLE_OB_YELLOW     		; 3
+	const PAL_BATTLE_OB_RED        		; 4
+	const PAL_BATTLE_OB_GREEN      		; 5
+	const PAL_BATTLE_OB_BLUE       		; 6
+	const PAL_BATTLE_OB_BROWN      		; 7
+	const PAL_BATTLE_OB_POISON     		; 8
+	const PAL_BATTLE_OB_RED_VIOLET 		; 9
+	const PAL_BATTLE_OB_YELLOW_GREEN 	; A
+	const PAL_BATTLE_OB_GHOST    		; B
+	const PAL_BATTLE_OB_FLYING    		; C
+	const PAL_BATTLE_OB_GRAY_2    		; D
+	const PAL_BATTLE_OB_DRAGON    		; E
+	const PAL_BATTLE_OB_PINK		; F
+	const PAL_BATTLE_OB_OTHERS_1		; 10
+	const PAL_BATTLE_OB_OTHERS_2		; 11
+	const PAL_BATTLE_OB_OTHERS_3		; 12
+	const PAL_BATTLE_OB_GRAY_3    		; 13

Then, we'll be making two .pal files: gfx\battle_anims\battle_anims_page_1.pal and gfx\battle_anims\unused_battle_anims_page_2.pal. You may rename gfx\battle_anims\unused_battle_anims.pal to any of the two new .pal files. These files contain the new battle palettes.

Here's the content for gfx\battle_anims\battle_anims_page_1.pal. This will serve as the first new set of animation palettes.

; violet (poison)
	RGB 31, 31, 31
	RGB 30, 09, 18
	RGB 28, 02, 18
	RGB 17, 03, 07
; red-violet (dragon)
	RGB 31, 31, 31
	RGB 30, 09, 18
	RGB 28, 02, 18
	RGB 17, 03, 07
; yellow-green (bug)
	RGB 31, 31, 31
	RGB 31, 31, 01
	RGB 17, 31, 03
	RGB 00, 00, 00
; violet (ghost)
	RGB 31, 31, 31
	RGB 26, 14, 30
	RGB 16, 02, 25
	RGB 09, 04, 15
; sky blue (flying)
	RGB 31, 31, 31
	RGB 17, 26, 30
	RGB 12, 19, 27
	RGB 11, 15, 20
; gray (2)
	RGB 31, 31, 31
	RGB 25, 25, 25
	RGB 13, 13, 13
	RGB 00, 00, 00

The first palette, violet, corresponds to the constant const PAL_BATTLE_OB_POISON; the second palette, yellow-green, corresponds to the constant const PAL_BATTLE_OB_RED_VIOLET; and so on. The gray palette is added because sometimes, you may want to use gray for move animations. The gray will serve as a "universal color" for these move animations. Warning: Do not use palettes from different palette sets in a single move animation, otherwise some of them will not load correctly.

Here's the content for gfx\battle_anims\battle_anims_page_2.pal. This will serve as the second new set of animation palettes, corresponding to the constants const PAL_BATTLE_OB_DRAGON to const PAL_BATTLE_OB_GRAY_3.

; purple (dragon pulse)
	RGB 31, 31, 31
	RGB 28, 11, 30
	RGB 11, 03, 26
	RGB 05, 04, 18
; pink (psychic)
	RGB 31, 31, 31
	RGB 30, 11, 27
	RGB 26, 03, 25
	RGB 17, 04, 18
; red_2 
	RGB 31, 31, 31
	RGB 31, 19, 24
	RGB 31, 08, 09
	RGB 00, 00, 00
; green_2
	RGB 31, 31, 31
	RGB 12, 25, 01
	RGB 08, 17, 00
	RGB 00, 00, 00
; blue_2
	RGB 31, 31, 31
	RGB 08, 12, 31
	RGB 03, 07, 31
	RGB 00, 00, 00
; gray (3)
	RGB 31, 31, 31
	RGB 25, 25, 25
	RGB 13, 13, 13
	RGB 00, 00, 00