Updated Implementing Catch EXP (markdown)

DavidJCobb 2023-11-16 02:12:38 +01:00
parent e9e6db003c
commit f519326a50
1 changed files with 2 additions and 2 deletions

@ -269,11 +269,11 @@ How does leveling up...
...in battle... ...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` ## 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`: Why is `drawlvlupbox` shifting a BG layer, though, I wonder? Well, PRET left this handy-dandy code comment in `Cmd_drawlvlupbox`: