summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKDLPro <38602758+KDLPro@users.noreply.github.com>2021-04-14 23:38:53 +0800
committerKDLPro <38602758+KDLPro@users.noreply.github.com>2021-04-14 23:38:53 +0800
commitfc5b21062ffcece570dcfd96810b78701abdb4f0 (patch)
treebeed1faf6b960be7cc837f3c1a1a29641462bbd2
parentd1a529eef9ec674a5f7a52751e2f5d1820ea1ddd (diff)
Updated Add a new battle transition (markdown)
-rw-r--r--Add-a-new-battle-transition.md63
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:
![Screenshot](screenshots/rocket-battle-transition.png)
+## 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!
+
+![Screenshot](https://user-images.githubusercontent.com/38602758/114738211-599d8b00-9d7a-11eb-86c9-92364378ebff.png)
+
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