summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2022-01-08 14:02:54 -0500
committerRangi <remy.oukaour+rangi42@gmail.com>2022-01-08 14:02:54 -0500
commit944d0e5303d64203d7a7fa157dc61178868bcbbf (patch)
tree9953afc40f6593ef3be1fae44e5fa46c7469e49b
parent309c94b4014b5789a983de84d3facb332b09bf9a (diff)
Identify why five of six enemy mon base stats are copied
-rw-r--r--engine/battle/core.asm9
1 files changed, 6 insertions, 3 deletions
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index cce9a688..890b81fb 100644
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -3752,9 +3752,11 @@ InitEnemyMon:
inc de
ld a, [hl]
ld [de], a
+ ; The enemy mon's base Sp. Def isn't needed since its base
+ ; Sp. Atk is also used to calculate Sp. Def stat experience.
ld hl, wBaseStats
ld de, wEnemyMonBaseStats
- ld b, 5
+ ld b, NUM_STATS - 1
.loop
ld a, [hli]
ld [de], a
@@ -6138,10 +6140,11 @@ LoadEnemyMon:
call CopyBytes
.Finish:
-; Only the first five base stats are copied..
+; Copy the first five base stats (the enemy mon's base Sp. Atk
+; is also used to calculate Sp. Def stat experience)
ld hl, wBaseStats
ld de, wEnemyMonBaseStats
- ld b, wBaseSpecialDefense - wBaseStats
+ ld b, NUM_STATS - 1
.loop
ld a, [hli]
ld [de], a