summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorJimB16 <f1@jimb.de>2015-08-31 14:31:13 +0200
committerJimB16 <f1@jimb.de>2015-08-31 14:31:13 +0200
commitbcc11712a578f1a0020fb0ab4543205324ec018d (patch)
tree83a3d34c07526382e9b0e11f95d9431d9b03a4dc /data
parent051d9e416d0ab267065f2e9e23daab43527e827c (diff)
added 'wBT_OTTempCopy'-label and the data structure that comes after
Diffstat (limited to 'data')
-rw-r--r--data/battle_tower.asm18
1 files changed, 13 insertions, 5 deletions
diff --git a/data/battle_tower.asm b/data/battle_tower.asm
index f6d7b95de..dc96b3822 100644
--- a/data/battle_tower.asm
+++ b/data/battle_tower.asm
@@ -35,9 +35,11 @@ ELSE
ENDC
jr nc, .asm_1f8022
ld b, a
+
ld a, BANK(sbe46)
call GetSRAMBank
- ld c, $7
+
+ ld c, BATTLETOWER_NROFTRAINERS
ld hl, sBTTrainers
.asm_1f803a
ld a, [hli]
@@ -45,6 +47,7 @@ ENDC
jr z, .asm_1f8022
dec c
jr nz, .asm_1f803a ; c <= 7 initialise all 7 trainers?
+
ld hl, sBTTrainers
ld a, [sbe46]
ld c, a
@@ -53,18 +56,22 @@ ENDC
add hl, bc
ld [hl], a
call CloseSRAM
+
push af
+; Copy name (10 bytes) and class (1 byte) of trainer
ld hl, BattleTowerTrainers
ld bc, 11
call AddNTimes
ld bc, 11
call CopyBytes
+
call Function_LoadRandomBattleTowerPkmn
pop af
+
ld hl, BattleTowerTrainerData
- ld bc, $0024
+ ld bc, BATTLETOWER_TRAINERDATALENGTH
call AddNTimes
- ld bc, $0024
+ ld bc, BATTLETOWER_TRAINERDATALENGTH
.asm_1f8070
ld a, BANK(BattleTowerTrainerData)
call GetFarByte
@@ -78,10 +85,9 @@ ENDC
pop af
ld [rSVBK], a
ret
-; 1f8081
Function_LoadRandomBattleTowerPkmn: ; 1f8081
- ld c, $3
+ ld c, BATTLETOWER_NROFPKMNS
.loop
push bc
ld a, BANK(sBTPkmnPrevTrainer1)
@@ -156,6 +162,7 @@ Function_LoadRandomBattleTowerPkmn: ; 1f8081
ld bc, $3b
call CopyBytes
+
ld a, [wd265]
push af
push de
@@ -172,6 +179,7 @@ Function_LoadRandomBattleTowerPkmn: ; 1f8081
pop de
ld bc, PKMN_NAME_LENGTH
call CopyBytes
+
pop de
pop af
ld [wd265], a