Clearer Battle Tower code

This commit is contained in:
Remy Oukaour
2018-01-09 16:55:11 -05:00
parent 11556196ba
commit ce50d1b2cb
4 changed files with 93 additions and 86 deletions

View File

@@ -27,12 +27,11 @@ Function_LoadOpponentTrainerAndPokemons: ; 1f8000
add b
ld b, a ; b contains the nr of the trainer
if DEF(CRYSTAL11)
and (1 << 7) - 1
cp 70
and $7f
else
and (1 << 5) - 1
cp 21
and $1f
endc
cp (BattleTowerTrainersEnd - BattleTowerTrainers) / NAME_LENGTH
jr nc, .resample
ld b, a
@@ -114,7 +113,7 @@ Function_LoadRandomBattleTowerPkmn: ; 1f8081
add b
ld b, a
and $1f
cp BATTLETOWER_NRMONSPERLEVELBRACKET
cp BATTLETOWER_NROFPKMNS * BATTLETOWER_NROFTRAINERS
jr nc, .resample
; in register 'a' is the chosen Pkmn of the LevelGroup
@@ -207,4 +206,6 @@ Function_LoadRandomBattleTowerPkmn: ; 1f8081
ret
; 1f814e
INCLUDE "data/battle_tower/classes.asm"
INCLUDE "data/battle_tower/parties.asm"