Use more wram labels and other constants

This commit is contained in:
xCrystal 2015-07-24 10:49:33 +02:00
parent c34156c5fb
commit bbb86671ea
10 changed files with 65 additions and 59 deletions

View file

@ -26,7 +26,7 @@ GainExperience: ; 5524f (15:524f)
ld d, h
ld e, l
ld hl, wEnemyMonBaseStats
ld c, $5
ld c, NUM_STATS
.gainStatExpLoop
ld a, [hli]
ld b, a ; enemy mon base stat
@ -66,7 +66,7 @@ GainExperience: ; 5524f (15:524f)
ld [H_DIVISOR], a
ld b, 4
call Divide
ld hl, -((wPartyMon1HPExp + 1) - wPartyMon1OTID + 4 * 2)
ld hl, wPartyMon1OTID - (wPartyMon1DVs - 1)
add hl, de
ld b, [hl] ; party mon OTID
inc hl
@ -220,7 +220,7 @@ GainExperience: ; 5524f (15:524f)
add hl, bc
push hl
ld de, wBattleMonLevel
ld bc, $b ; size of stats
ld bc, 1 + NUM_STATS * 2 ; size of stats
call CopyData
pop hl
ld a, [W_PLAYERBATTSTATUS3]
@ -228,7 +228,7 @@ GainExperience: ; 5524f (15:524f)
jr nz, .recalcStatChanges
; the mon is not transformed, so update the unmodified stats
ld de, wPlayerMonUnmodifiedLevel
ld bc, $b
ld bc, 1 + NUM_STATS * 2
call CopyData
.recalcStatChanges
xor a
@ -308,7 +308,7 @@ DivideExpDataByNumMonsGainingExp: ; 5546c (15:546c)
ret c ; return if only one mon is gaining exp
ld [wd11e], a ; store number of mons gaining exp
ld hl, wEnemyMonBaseStats
ld c, $7
ld c, wEnemyMonBaseExp + 1 - wEnemyMonBaseStats
.divideLoop
xor a
ld [H_DIVIDEND], a