From 2172461a60604d4ae1dfbcca9159ba91531cf328 Mon Sep 17 00:00:00 2001 From: yenatch Date: Tue, 24 Dec 2013 17:19:39 -0500 Subject: [PATCH] fleemons are global --- battle/core.asm | 20 +++++++++++--------- items/item_effects.asm | 22 +++++++++++----------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/battle/core.asm b/battle/core.asm index d8c87b0f8..728d5e5bf 100644 --- a/battle/core.asm +++ b/battle/core.asm @@ -775,7 +775,7 @@ Function3c543: ; 3c543 ld a, [TempEnemyMonSpecies] ld de, 1 - ld hl, .Always + ld hl, AlwaysFleeMons call IsInArray jr c, .Flee @@ -787,7 +787,7 @@ Function3c543: ; 3c543 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 @@ Function3c543: ; 3c543 ld a, [TempEnemyMonSpecies] ld de, 1 - ld hl, .Sometimes + ld hl, SometimesFleeMons call IsInArray jr c, .Flee @@ -811,7 +811,9 @@ Function3c543: ; 3c543 ret ; 3c59a -.Sometimes +FleeMons: + +SometimesFleeMons: ; 3c59a db MAGNEMITE db GRIMER db TANGELA @@ -825,9 +827,9 @@ Function3c543: ; 3c543 db UNOWN db SNUBBULL db HERACROSS - db $ff + db -1 -.Often +OftenFleeMons: ; 3c5a8 db CUBONE db ARTICUNO db ZAPDOS @@ -836,13 +838,13 @@ Function3c543: ; 3c543 db DELIBIRD db PHANPY db TEDDIURSA - db $ff + db -1 -.Always +AlwaysFleeMons: ; 3c5b1 db RAIKOU db ENTEI ; db SUICUNE - db $ff + db -1 ; 3c5b4 diff --git a/items/item_effects.asm b/items/item_effects.asm index aa7d2b8f4..9a0fba8c2 100644 --- a/items/item_effects.asm +++ b/items/item_effects.asm @@ -803,31 +803,31 @@ Function_0xed12: ; ed12 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