ref: 620d5c09c70d85a07bc9c55875db971ac3cd7097
parent: f2185cd0e4ef38a84fd8b49104843b8e84f37aba
author: yenatch <[email protected]>
date: Mon Apr 29 11:42:31 EDT 2013
More labels in LoadEnemyMon
--- a/constants.asm
+++ b/constants.asm
@@ -2339,6 +2339,7 @@
EVOLVE_HAPPINESS EQU 4
EVOLVE_STAT EQU 5
+BASE_HAPPINESS EQU 70
; happiness evolution triggers
HAPPINESS_TO_EVOLVE EQU 220
TR_ANYTIME EQU 1
--- a/main.asm
+++ b/main.asm
@@ -3549,7 +3549,7 @@
.end
; Replace Pokedex # with species
ld a, [CurSpecies]
- ld [CurBaseData], a
+ ld [BaseDexNo], a
pop af
rst Bankswitch
@@ -6716,7 +6716,7 @@
; Clear the whole EnemyMon struct
xor a
ld hl, EnemyMonSpecies
- ld bc, $0027
+ ld bc, EnemyMonEnd - EnemyMon
call ByteFill
; We don't need to be here if we're in a link battle
@@ -6760,7 +6760,7 @@
; Used for Ho-Oh, Lugia and Snorlax encounters
ld a, [BattleType]
cp BATTLETYPE_FORCEITEM
- ld a, [$d241] ; BufferMonItem1
+ ld a, [BaseItems]
jr z, .UpdateItem
; Failing that, it's all up to chance
@@ -6795,7 +6795,7 @@
jr z, .InitDVs
; ????
- ld a, [$c671]
+ ld a, [EnemySubStatus5]
bit 3, a
jr z, .InitDVs
@@ -6982,7 +6982,7 @@
.Happiness
; Set happiness
- ld a, 70 ; BASE_HAPPINESS
+ ld a, BASE_HAPPINESS
ld [EnemyMonHappiness], a
; Set level
ld a, [CurPartyLevel]
@@ -7077,8 +7077,8 @@
.Moves
; ????
- ld hl, $d23d
- ld de, $d224
+ ld hl, BaseType1
+ ld de, EnemyMonType1
ld a, [hli]
ld [de], a
inc de
@@ -7137,11 +7137,10 @@
call CopyBytes
.Finish
-; ????
- ld hl, $d237
- ld de, $d226
- ld b, 5 ; # bytes to copy
-; Copy $d237-a to $d226-9
+; Only the first five base stats are copied...
+ ld hl, BaseStats
+ ld de, EnemyMonBaseStats
+ ld b, BaseSpecialDefense - BaseStats
.loop
ld a, [hli]
ld [de], a
@@ -7148,13 +7147,14 @@
inc de
dec b
jr nz, .loop
-; Copy $d23f to $d22a
- ld a, [$d23f]
+
+ ld a, [BaseCatchRate]
ld [de], a
inc de
-; Copy $d240 to $d22b
- ld a, [$d240]
+
+ ld a, [BaseExp]
ld [de], a
+
; copy TempEnemyMonSpecies to $d265
ld a, [TempEnemyMonSpecies]
ld [$d265], a
@@ -8963,7 +8963,7 @@
push bc
ld a, [CurPartySpecies]
dec a
- ld hl, BaseData + 13 ; BASE_GENDER
+ ld hl, BaseData + BaseGender - CurBaseData
ld bc, BaseData1 - BaseData
call AddNTimes
pop bc
--- a/wram.asm
+++ b/wram.asm
@@ -1043,17 +1043,16 @@
Buffer2: ; d1eb
ds 1
-SECTION "prng2",BSS[$d1fa]
+SECTION "BattleMons2",BSS[$d1fa]
LinkBattleRNs: ; d1fa
ds 10
-SECTION "BattleMons2",BSS[$d204]
-
TempEnemyMonSpecies: ; d204
ds 1
TempBattleMonSpecies: ; d205
ds 1
-
+
+EnemyMon:
EnemyMonSpecies: ; d206
ds 1
EnemyMonItem: ; d207
@@ -1121,9 +1120,17 @@
EnemyMonType2: ; d225
ds 1
+EnemyMonBaseStats: ; d226
+ ds 5
-SECTION "Battle",BSS[$d22d]
+EnemyMonCatchRate: ; d22b
+ ds 1
+EnemyMonBaseExp: ; d22c
+ ds 1
+EnemyMonEnd
+
+
IsInBattle: ; d22d
; 0: overworld
; 1: wild battle
@@ -1182,7 +1189,10 @@
BaseSpecialDefense: ; d23c
ds 1
BaseType: ; d23d
- ds 2
+BaseType1: ; d23d
+ ds 1
+BaseType2: ; d23e
+ ds 1
BaseCatchRate: ; d23f
ds 1
BaseExp: ; d240