diff options
-rw-r--r-- | Add-a-new-battle-transition.md | 63 |
1 files changed, 62 insertions, 1 deletions
diff --git a/Add-a-new-battle-transition.md b/Add-a-new-battle-transition.md index 9117cae..0e0c429 100644 --- a/Add-a-new-battle-transition.md +++ b/Add-a-new-battle-transition.md @@ -1,6 +1,13 @@ This tutorial is for how to add a new battle transition, like the Poké Ball that covers the screen for a trainer battle. As an example, we'll add an "R" for battles with Team Rocket. -Simply edit [engine/battle/battle_transition.asm](../blob/master/engine/battle/battle_transition.asm): +## Contents + +1. [Add a new transition](#1-add-a-new-transition) +2. [Create a custom palette for that transition](#2-create-a-custom-palette-for-that-transition) + +## 1. Add a new transition + +First, edit [engine/battle/battle_transition.asm](../blob/master/engine/battle/battle_transition.asm): ```diff StartTrainerBattle_LoadPokeBallGraphics: @@ -99,6 +106,60 @@ Anyway, that's all it takes to change the overlay pattern:  +## 2. Create a custom palette for that transition + +We can create a custom palette for any transition. Let's try creating a file called `rocket_battle.pal` in [gfx/overworld](../blob/master/gfx/overworld). + +``` + RGB 31, 08, 08 + RGB 31, 07, 06 + RGB 31, 02, 03 + RGB 07, 07, 07 +``` + +Next, edit [engine/battle/battle_transition.asm](../blob/master/engine/battle/battle_transition.asm) again: + +```diff + +cgb + ld hl, .pals ++ ld a, [wOtherTrainerClass] ++ cp GRUNTM ++ jp z, .load_rocket_pals ++ cp GRUNTF ++ jp z, .load_rocket_pals ++ cp EXECUTIVEM ++ jp z, .load_rocket_pals ++ cp EXECUTIVEF ++ jp z, .load_rocket_pals ++ cp SCIENTIST ++ jp z, .load_rocket_pals + ld a, [wTimeOfDayPal] + maskbits NUM_DAYTIMES + cp DARKNESS_F + jr nz, .not_dark + ld hl, .darkpals ++ jp .not_dark ++.load_rocket_pals ++ ld hl, .rocketpals +.not_dark + ldh a, [rSVBK] + +... + +.darkpals: +INCLUDE "gfx/overworld/trainer_battle_dark.pal" + ++.rocketpals: ++INCLUDE "gfx/overworld/rocket_battle.pal" + +.loadpokeballgfx: +``` + +And that's it! Now the overlay colors for the pattern have been changed! + + + Changing the transition animations (the ones that fade, wipe, distort, or otherwise erase the screen to begin a battle) is more complicated. TODO: new transition animation |