diff options
author | Bryan Bishop <kanzure@gmail.com> | 2013-11-14 20:04:22 -0600 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2013-11-14 20:04:22 -0600 |
commit | b2785948d16acd06197db5fcffea45d54778bdba (patch) | |
tree | 1a6f030aa311c5c116740de9255ca9860b4cd52e /pokemontools/vba/battle.py | |
parent | 3bf53fa87facc5471ee0b06c496fee6e8eaceefb (diff) |
fast check for the "move to make room for" text
Diffstat (limited to 'pokemontools/vba/battle.py')
-rw-r--r-- | pokemontools/vba/battle.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pokemontools/vba/battle.py b/pokemontools/vba/battle.py index 4b7fb68..f8457c9 100644 --- a/pokemontools/vba/battle.py +++ b/pokemontools/vba/battle.py @@ -277,6 +277,22 @@ class Battle(EmulatorController): else: return True + def is_make_room_for_move_prompt(self): + """ + Detects the prompt that asks whether to make room for a move. + """ + if not self.is_in_battle(): + return False + + address = 0xc5b9 + values = [172, 174, 181, 164, 127, 179, 174, 127, 172, 160, 170, 164, 127, 177, 174, 174, 172] + + for (index, value) in enumerate(values): + if self.emulator.vba.read_memory_at(address + index) != value: + return False + else: + return True + def skip_start_text(self, max_loops=20): """ Skip any initial conversation until the player can select an action. |