summaryrefslogtreecommitdiff
path: root/engine/battle/experience.asm
diff options
context:
space:
mode:
authorxCrystal <rgr.crystal@gmail.com>2015-07-24 10:49:33 +0200
committerxCrystal <rgr.crystal@gmail.com>2015-07-24 10:49:33 +0200
commitbbb86671eaac735fe6ef57da01ef79fd16953238 (patch)
tree1a4d51999c926bd705b151b7953a4fc77092d843 /engine/battle/experience.asm
parentc34156c5fb333864c1ae85036ea587c9f615a65a (diff)
Use more wram labels and other constants
Diffstat (limited to 'engine/battle/experience.asm')
-rw-r--r--engine/battle/experience.asm10
1 files changed, 5 insertions, 5 deletions
diff --git a/engine/battle/experience.asm b/engine/battle/experience.asm
index 6f479ea3..edee81b1 100644
--- a/engine/battle/experience.asm
+++ b/engine/battle/experience.asm
@@ -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