From f519326a505ca7d1e754a2d23c85cc8cfbcb6111 Mon Sep 17 00:00:00 2001 From: DavidJCobb <831497+DavidJCobb@users.noreply.github.com> Date: Thu, 16 Nov 2023 02:12:38 +0100 Subject: [PATCH] Updated Implementing Catch EXP (markdown) --- Implementing-Catch-EXP.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Implementing-Catch-EXP.md b/Implementing-Catch-EXP.md index fa9d603..7085bcb 100644 --- a/Implementing-Catch-EXP.md +++ b/Implementing-Catch-EXP.md @@ -269,11 +269,11 @@ How does leveling up... ...in battle... -It... It's a script command. It's *always* a script command. +It... It's a script command. Battles use tons of scripting; the script commands are always a good first place to look for things. ## Let's look at `drawlvlupbox` -The `BattleScript_LevelUp` script in [`data/battle_scripts_1.s`](https://github.com/pret/pokeemerald/blob/master/data/battle_scripts_1.s) calls the `drawlvlupbox` function whether or not we've leveled up. The `Cmd_drawlvlupbox` function is very similar to `getexp`: it's another one of those commands that runs itself over and over in order to divide its work up across multiple frames. We can see that it sets a bunch of variables that look like `gBattle_BG2_Y`. I guess the battle engine checks these variables on every frame and uses them to decide where the four BG layers should be shifted to. It's probably meant as a way to let move animations easily manipulate graphics on the BG layers. +The `BattleScript_LevelUp` script in [`data/battle_scripts_1.s`](https://github.com/pret/pokeemerald/blob/master/data/battle_scripts_1.s) calls the `drawlvlupbox` function. The `Cmd_drawlvlupbox` function is very similar to `getexp`: it's another one of those commands that runs itself over and over in order to divide its work up across multiple frames. We can see that it sets a bunch of variables that look like `gBattle_BG2_Y`. I guess the battle engine checks these variables on every frame and uses them to decide where the four BG layers should be shifted to. It's probably meant as a way to let move animations easily manipulate graphics on the BG layers. Why is `drawlvlupbox` shifting a BG layer, though, I wonder? Well, PRET left this handy-dandy code comment in `Cmd_drawlvlupbox`: