summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxCrystal <rgr.crystal@gmail.com>2020-12-15 21:13:15 +0100
committerxCrystal <rgr.crystal@gmail.com>2020-12-15 21:13:15 +0100
commitf13ddf25bf61c79200c56666184fe84b579ad1cc (patch)
tree5a815bfb932621a3a6b1ae20395d2c66742aec34
parent117efe39b6b297dc52c1b5ad4d3012e7b00c8bd7 (diff)
Complete Lure effect functions
-rw-r--r--src/data/effect_commands.asm2
-rw-r--r--src/engine/effect_functions.asm10
2 files changed, 7 insertions, 5 deletions
diff --git a/src/data/effect_commands.asm b/src/data/effect_commands.asm
index 60063ae..9000b7c 100644
--- a/src/data/effect_commands.asm
+++ b/src/data/effect_commands.asm
@@ -64,7 +64,7 @@ VictreebelLureEffectCommands:
dbw EFFECTCMDTYPE_INITIAL_EFFECT_1, Lure_AssertPokemonInBench
dbw EFFECTCMDTYPE_AFTER_DAMAGE, Lure_SwitchDefendingPokemon
dbw EFFECTCMDTYPE_REQUIRE_SELECTION, Lure_SelectSwitchPokemon
- dbw EFFECTCMDTYPE_AI_SELECTION, Func_2c764
+ dbw EFFECTCMDTYPE_AI_SELECTION, Lure_GetBenchPokemonWithLowestHP
db $00
VictreebelAcidEffectCommands:
diff --git a/src/engine/effect_functions.asm b/src/engine/effect_functions.asm
index 7e8db45..965b639 100644
--- a/src/engine/effect_functions.asm
+++ b/src/engine/effect_functions.asm
@@ -463,9 +463,9 @@ DuelistSelectForcedSwitch: ; 2c487 (b:4487)
INCROM $2c4da, $2c564
-; Return in a the PLAY_AREA_* of the non-turn holder's Pokemon card in bench with the lowest HP
+; Return in a the PLAY_AREA_* of the non-turn holder's Pokemon card in bench with the lowest (remaining) HP.
; if multiple cards are tied for the lowest HP, the one with the highest PLAY_AREA_* is returned.
-Func_2c564: ; 2c564 (b:4564)
+GetBenchPokemonWithLowestHP: ; 2c564 (b:4564)
call SwapTurn
ld a, DUELVARS_NUMBER_OF_POKEMON_IN_PLAY_AREA
call GetTurnDuelistVariable
@@ -580,8 +580,10 @@ Lure_SelectSwitchPokemon: ; 2c74b (b:474b)
ret
; 0x2c764
-Func_2c764: ; 2c764 (b:4764)
- call Func_2c564
+; Return in hTemp_ffa0 the PLAY_AREA_* of the non-turn holder's Pokemon card in bench with the lowest (remaining) HP.
+; if multiple cards are tied for the lowest HP, the one with the highest PLAY_AREA_* is returned.
+Lure_GetBenchPokemonWithLowestHP: ; 2c764 (b:4764)
+ call GetBenchPokemonWithLowestHP
ldh [hTemp_ffa0], a
ret
; 0x2c76a