shithub: pokecrystal

Download patch

ref: cbec3771e2944a502eea69aeb012bea6cdc4e26b
parent: 21607bdd1fc4950ab711bcc2f507add524d9d07b
author: mid-kid <esteve.varela@gmail.com>
date: Tue Dec 19 16:28:06 EST 2017

Misc fixes for the usage of constants

Several improvements that will make it easier to edit some data
structures for everyone.

--- a/battle/core.asm
+++ b/battle/core.asm
@@ -3454,7 +3454,7 @@
 	ld bc, BASE_DATA_SIZE
 	call AddNTimes
 	ld de, EnemyMonType
-	ld bc, 2
+	ld bc, BASE_CATCH_RATE - BASE_TYPES
 	ld a, BANK(BaseData)
 	call FarCopyBytes
 	ld a, [BattleMonType1]
--- a/battle/effect_commands.asm
+++ b/battle/effect_commands.asm
@@ -3881,11 +3881,11 @@
 	ld de, StringBuffer1
 	call GetMoveData
 
-	ld a, [StringBuffer1 + 2]
+	ld a, [StringBuffer1 + MOVE_POWER]
 	and a
 	ret z
 
-	ld a, [StringBuffer1 + 3]
+	ld a, [StringBuffer1 + MOVE_TYPE]
 	cp SPECIAL
 	ret nc
 
--- a/engine/link.asm
+++ b/engine/link.asm
@@ -740,7 +740,7 @@
 	ld hl, BaseData + BASE_TYPES
 	ld bc, BASE_DATA_SIZE
 	call AddNTimes
-	ld bc, 2
+	ld bc, BASE_CATCH_RATE - BASE_TYPES
 	ld a, BANK(BaseData)
 	call FarCopyBytes
 	pop bc
--- a/engine/stats_screen.asm
+++ b/engine/stats_screen.asm
@@ -377,7 +377,7 @@
 	call .PlaceHPBar
 	xor a
 	ld [hBGMapMode], a
-	ld a, [CurBaseData]
+	ld a, [BaseDexNo]
 	ld [wd265], a
 	ld [CurSpecies], a
 	hlcoord 8, 0
@@ -401,7 +401,7 @@
 	hlcoord 9, 4
 	ld a, "/"
 	ld [hli], a
-	ld a, [CurBaseData]
+	ld a, [BaseDexNo]
 	ld [wd265], a
 	call GetPokemonName
 	call PlaceString