summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rwxr-xr-xengine/battle/core.asm7
-rw-r--r--engine/battle/read_trainer_party.asm12
2 files changed, 11 insertions, 8 deletions
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index 905c649c..04a6de1c 100755
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -1023,10 +1023,11 @@ TrainerBattleVictory: ; 3c696 (f:4696)
ld c, $28
call DelayFrames
call PrintEndBattleText
+; win money
ld hl, MoneyForWinningText
call PrintText
ld de, wPlayerMoney + 2
- ld hl, wd07b
+ ld hl, wAmountMoneyWon + 2
ld c, $3
predef_jump AddBCDPredef
@@ -6959,9 +6960,9 @@ InitBattle_Common: ; 3efeb (f:6feb)
_LoadTrainerPic: ; 3f04b (f:704b)
; wd033-wd034 contain pointer to pic
- ld a, [wd033]
+ ld a, [wTrainerPicPointer] ; wd033
ld e, a
- ld a, [wd034]
+ ld a, [wTrainerPicPointer + 1] ; wd034
ld d, a ; de contains pointer to trainer pic
ld a, [wLinkState]
and a
diff --git a/engine/battle/read_trainer_party.asm b/engine/battle/read_trainer_party.asm
index f1e3aaf1..3cdfb5cb 100644
--- a/engine/battle/read_trainer_party.asm
+++ b/engine/battle/read_trainer_party.asm
@@ -141,9 +141,10 @@ ReadTrainer: ; 39c53 (e:5c53)
.GiveStarterMove
ld a,b
ld [wEnemyMon6Moves + 2],a
-.FinishUp ; XXX this needs documenting
- xor a ; clear D079-D07B
- ld de,wd079
+.FinishUp
+; clear wAmountMoneyWon addresses
+ xor a
+ ld de,wAmountMoneyWon
ld [de],a
inc de
ld [de],a
@@ -152,13 +153,14 @@ ReadTrainer: ; 39c53 (e:5c53)
ld a,[W_CURENEMYLVL]
ld b,a
.LastLoop
+; update wAmountMoneyWon addresses (money to win) based on enemy's level
ld hl,wd047
- ld c,2
+ ld c,2 ; wAmountMoneyWon is a 3-byte number
push bc
predef AddBCDPredef
pop bc
inc de
inc de
dec b
- jr nz,.LastLoop
+ jr nz,.LastLoop ; repeat W_CURENEMYLVL times
ret \ No newline at end of file