summaryrefslogtreecommitdiff
path: root/pokemontools/vba/battle.py
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2013-11-14 19:57:49 -0600
committerBryan Bishop <kanzure@gmail.com>2013-11-14 19:57:49 -0600
commit05faa7784ad03cb057e9ac478606d211c4cd88eb (patch)
tree40c92b2cbd41a5ae1d3cf3106eb8c81c635cd074 /pokemontools/vba/battle.py
parent038a9d8ec093e7c73f0a596d0cc996e3971d7d0f (diff)
quick check for the evolved screen
This is the message that appears after the pokemon evolved.
Diffstat (limited to 'pokemontools/vba/battle.py')
-rw-r--r--pokemontools/vba/battle.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/pokemontools/vba/battle.py b/pokemontools/vba/battle.py
index b800df0..3339a9f 100644
--- a/pokemontools/vba/battle.py
+++ b/pokemontools/vba/battle.py
@@ -257,6 +257,26 @@ class Battle(EmulatorController):
else:
return True
+ def is_evolved_screen(self):
+ """
+ Checks if the screen is the "evolved into METAPOD!" screen. Note that
+ this only works inside of a battle. This is because there may be other
+ text boxes that have the same text when outside of battle. But within a
+ battle, this is probably the only time the text "evolved into ... !" is
+ seen.
+ """
+ if not self.is_in_battle():
+ return False
+
+ address = 0x4bb1
+ values = [164, 181, 174, 171, 181, 164, 163, 127, 168, 173, 179, 174, 79]
+
+ 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.