summaryrefslogtreecommitdiff
path: root/engine/battle/experience.asm
diff options
context:
space:
mode:
authordannye <corrnondacqb@yahoo.com>2015-07-26 23:23:05 -0500
committerdannye <corrnondacqb@yahoo.com>2015-07-26 23:23:05 -0500
commitd7c5c8cf22c857830aae4da285c91e5e58c2cc02 (patch)
treee68f0dda79eda3f9bfe8aa69297cd58cc077e14a /engine/battle/experience.asm
parent93255d6d17fbb3702a0f8670d7ecc2ed627af2a7 (diff)
parentbbb86671eaac735fe6ef57da01ef79fd16953238 (diff)
Merge branch 'master' of https://github.com/xCrystal/pokered
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