summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rw-r--r--engine/events/battle_tower/load_trainer.asm11
1 files changed, 6 insertions, 5 deletions
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"