mirror of
https://github.com/pret/pokemon-reverse-engineering-tools.git
synced 2026-08-09 10:47:24 -05:00
function to check if it's the yes/no prompt
This is the prompt that appears during battles for whether or not to switch pokemon when the other trainer is sending something else out.
This commit is contained in:
parent
4c6a904db1
commit
18449eea21
|
|
@ -55,6 +55,13 @@ class Battle(EmulatorController):
|
|||
"""
|
||||
return self.is_fight_pack_run_menu()
|
||||
|
||||
def is_switch_prompt(self):
|
||||
"""
|
||||
Detects if the battle is waiting for the player to choose whether or
|
||||
not to switch pokemon.
|
||||
"""
|
||||
return self.emulator.is_battle_switch_prompt()
|
||||
|
||||
def is_mandatory_switch(self):
|
||||
"""
|
||||
Detects if the battle is waiting for the player to choose a next
|
||||
|
|
|
|||
|
|
@ -599,6 +599,23 @@ class crystal(object):
|
|||
def is_in_link_battle(self):
|
||||
return self.vba.read_memory_at(0xc2dc) != 0
|
||||
|
||||
def is_battle_switch_prompt(self):
|
||||
"""
|
||||
Checks if the game is currently displaying the yes/no prompt for
|
||||
whether or not to switch pokemon.
|
||||
"""
|
||||
# get on-screen text
|
||||
text = self.get_text()
|
||||
|
||||
requirements = [
|
||||
"YES",
|
||||
"NO",
|
||||
"Will ",
|
||||
"change POKMON?",
|
||||
]
|
||||
|
||||
return all([requirement in text for requirement in requirements])
|
||||
|
||||
def unlock_flypoints(self):
|
||||
"""
|
||||
Unlocks different destinations for flying.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user