summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Add-a-new-battle-transition.md104
-rw-r--r--Tutorials.md1
-rw-r--r--screenshots/rocket-battle-transition.pngbin0 -> 2762 bytes
3 files changed, 105 insertions, 0 deletions
diff --git a/Add-a-new-battle-transition.md b/Add-a-new-battle-transition.md
new file mode 100644
index 0000000..9117cae
--- /dev/null
+++ b/Add-a-new-battle-transition.md
@@ -0,0 +1,104 @@
+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):
+
+```diff
+ StartTrainerBattle_LoadPokeBallGraphics:
+ ...
+
+ call .loadpokeballgfx
+ ...
+
+ .loadpokeballgfx
++ ld de, TeamRocketTransition
+ ld a, [wOtherTrainerClass]
++ cp GRUNTM
++ ret z
++ cp GRUNTF
++ ret z
++ cp EXECUTIVEM
++ ret z
++ cp EXECUTIVEF
++ ret z
++ cp SCIENTIST
++ ret z
+ ld de, PokeBallTransition
+ ret
+
+ PokeBallTransition:
+ ; 16x16 overlay of a Poke Ball
+ pusho
+ opt b.X ; . = 0, X = 1
+ bigdw %......XXXX......
+ bigdw %....XXXXXXXX....
+ bigdw %..XXXX....XXXX..
+ bigdw %..XX........XX..
+ bigdw %.XX..........XX.
+ bigdw %.XX...XXXX...XX.
+ bigdw %XX...XX..XX...XX
+ bigdw %XXXXXX....XXXXXX
+ bigdw %XXXXXX....XXXXXX
+ bigdw %XX...XX..XX...XX
+ bigdw %.XX...XXXX...XX.
+ bigdw %.XX..........XX.
+ bigdw %..XX........XX..
+ bigdw %..XXXX....XXXX..
+ bigdw %....XXXXXXXX....
+ bigdw %......XXXX......
+ popo
+
++TeamRocketTransition:
++pusho
++opt b.X ; . = 0, X = 1
++ bigdw %XXXXXXXXXXXX....
++ bigdw %XXXXXXXXXXXXXX..
++ bigdw %XXXXXXXXXXXXXXX.
++ bigdw %XXXXXXXXXXXXXXX.
++ bigdw %XXXXX.....XXXXXX
++ bigdw %XXXXX......XXXXX
++ bigdw %XXXXX.....XXXXXX
++ bigdw %XXXXXXXXXXXXXXX.
++ bigdw %XXXXXXXXXXXXXXX.
++ bigdw %XXXXXXXXXXXXXX..
++ bigdw %XXXXXXXXXXXXX...
++ bigdw %XXXXX....XXXXX..
++ bigdw %XXXXX....XXXXX..
++ bigdw %XXXXX.....XXXXX.
++ bigdw %XXXXX......XXXXX
++ bigdw %XXXXX......XXXXX
++popo
+```
+
+Older versions of pokecrystal define the `PokeBallTransition` pattern with literal binary numbers:
+
+```
+PokeBallTransition:
+ db %00000011, %11000000
+ db %00001111, %11110000
+ db %00111100, %00111100
+ db %00110000, %00001100
+ db %01100000, %00000110
+ db %01100011, %11000110
+ db %11000110, %01100011
+ db %11111100, %00111111
+ db %11111100, %00111111
+ db %11000110, %01100011
+ db %01100011, %11000110
+ db %01100000, %00000110
+ db %00110000, %00001100
+ db %00111100, %00111100
+ db %00001111, %11110000
+ db %00000011, %11000000
+```
+
+Either way works, but the new method shows the 16x16 tile pattern more clearly.
+
+Notice that `StartTrainerBattle_LoadPokeBallGraphics.loadpokeballgfx` already has the line `ld a, [wOtherTrainerClass]` but doesn't do anything with it. Maybe trainer-based patterns like this were a scrapped feature.
+
+Anyway, that's all it takes to change the overlay pattern:
+
+![Screenshot](screenshots/rocket-battle-transition.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
diff --git a/Tutorials.md b/Tutorials.md
index 820d6b0..2875304 100644
--- a/Tutorials.md
+++ b/Tutorials.md
@@ -29,6 +29,7 @@ Tutorials may use diff syntax to show edits:
- [Wild Pokémon slot](Add-a-new-wild-Pokémon-slot)
- [Unown form](Add-a-new-Unown-form)
- [Fishing rod](Add-a-new-fishing-rod)
+- [Battle transition](Add-a-new-battle-transition)
**How to edit the…**
diff --git a/screenshots/rocket-battle-transition.png b/screenshots/rocket-battle-transition.png
new file mode 100644
index 0000000..f917ad2
--- /dev/null
+++ b/screenshots/rocket-battle-transition.png
Binary files differ