shithub: pokecrystal

Download patch

ref: 2172461a60604d4ae1dfbcca9159ba91531cf328
parent: 0cd1d2071fe902fd9a7e579062698271d685e43b
author: yenatch <[email protected]>
date: Tue Dec 24 12:19:39 EST 2013

fleemons are global

--- a/battle/core.asm
+++ b/battle/core.asm
@@ -775,7 +775,7 @@
 
 	ld a, [TempEnemyMonSpecies]
 	ld de, 1
-	ld hl, .Always
+	ld hl, AlwaysFleeMons
 	call IsInArray
 	jr c, .Flee
 
@@ -787,7 +787,7 @@
 	push bc
 	ld a, [TempEnemyMonSpecies]
 	ld de, 1
-	ld hl, .Often
+	ld hl, OftenFleeMons
 	call IsInArray
 	pop bc
 	jr c, .Flee
@@ -798,7 +798,7 @@
 
 	ld a, [TempEnemyMonSpecies]
 	ld de, 1
-	ld hl, .Sometimes
+	ld hl, SometimesFleeMons
 	call IsInArray
 	jr c, .Flee
 
@@ -811,7 +811,9 @@
 	ret
 ; 3c59a
 
-.Sometimes
+FleeMons:
+
+SometimesFleeMons: ; 3c59a
 	db MAGNEMITE
 	db GRIMER
 	db TANGELA
@@ -825,9 +827,9 @@
 	db UNOWN
 	db SNUBBULL
 	db HERACROSS
-	db $ff
+	db -1
 
-.Often
+OftenFleeMons: ; 3c5a8
 	db CUBONE
 	db ARTICUNO
 	db ZAPDOS
@@ -836,13 +838,13 @@
 	db DELIBIRD
 	db PHANPY
 	db TEDDIURSA
-	db $ff
+	db -1
 
-.Always
+AlwaysFleeMons: ; 3c5b1
 	db RAIKOU
 	db ENTEI
 ;	db SUICUNE
-	db $ff
+	db -1
 ; 3c5b4
 
 
--- a/items/item_effects.asm
+++ b/items/item_effects.asm
@@ -803,31 +803,31 @@
 Function_0xed68: ; ed68
 	ld a, [TempEnemyMonSpecies]
 	ld c, a
-	ld hl, $459a
-	ld d, $3
+	ld hl, FleeMons
+	ld d, 3
 
-.asm_ed71
-	ld a, $f
+.loop
+	ld a, BANK(FleeMons)
 	call GetFarByte
 
 	inc hl
-	cp $ff
-	jr z, .asm_ed88
+	cp -1
+	jr z, .next
 	cp c
-	jr nz, .asm_ed88
+	jr nz, .next
 	sla b
-	jr c, .asm_ed85
+	jr c, .max
 
 	sla b
 	ret nc
 
-.asm_ed85
+.max
 	ld b, $ff
 	ret
 
-.asm_ed88
+.next
 	dec d
-	jr nz, .asm_ed71
+	jr nz, .loop
 	ret
 ; ed8c