summaryrefslogtreecommitdiff
path: root/pokemontools/vba/battle.py
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2013-11-11 00:55:54 -0600
committerBryan Bishop <kanzure@gmail.com>2013-11-11 00:55:54 -0600
commit966985411f01b799fa71f4823da7a8cd6d9cc47b (patch)
treebe94d8ec6e86db5e883db5ebe9edffc2bdc951ff /pokemontools/vba/battle.py
parent1d9ecfa00f91d602073b56a64f9aa129b95a8c2e (diff)
detect the "mandatory switch" menuvba-automation
This requires a slightly slower text_wait function. There is probably a way to refactor that function in a way that doesn't cause cancer.
Diffstat (limited to 'pokemontools/vba/battle.py')
-rw-r--r--pokemontools/vba/battle.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pokemontools/vba/battle.py b/pokemontools/vba/battle.py
index 824f27a..87cd7b1 100644
--- a/pokemontools/vba/battle.py
+++ b/pokemontools/vba/battle.py
@@ -67,8 +67,10 @@ class Battle(EmulatorController):
# 1) current pokemon hp is 0
# 2) game is polling for input
- # TODO: detect the mandatory switch menu
- return False
+ if "CANCEL Which ?" in self.emulator.get_text():
+ return True
+ else:
+ return False
def skip_start_text(self, max_loops=20):
"""