From ce50d1b2cb4eebf8484cf12e6280c441ec94ae39 Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Tue, 9 Jan 2018 16:55:11 -0500 Subject: Clearer Battle Tower code --- engine/events/battle_tower/load_trainer.asm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'engine') diff --git a/engine/events/battle_tower/load_trainer.asm b/engine/events/battle_tower/load_trainer.asm index 5d8c06166..5389f3f2e 100644 --- a/engine/events/battle_tower/load_trainer.asm +++ b/engine/events/battle_tower/load_trainer.asm @@ -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" -- cgit v1.2.3