From 9f72be1a0f4186ca49e3bf9c6148afbe6477e391 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Mon, 11 Nov 2013 21:54:06 -0600 Subject: handle the yes/no prompt in the battle run loop --- pokemontools/vba/battle.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pokemontools/vba/battle.py') diff --git a/pokemontools/vba/battle.py b/pokemontools/vba/battle.py index a453478..8f4e5eb 100644 --- a/pokemontools/vba/battle.py +++ b/pokemontools/vba/battle.py @@ -143,6 +143,8 @@ class Battle(EmulatorController): if self.is_player_turn(): # battle hook provides input to handle this situation self.handle_turn() + elif self.is_switch_prompt(): + self.handle_switch_prompt() elif self.is_mandatory_switch(): # battle hook provides input to handle this situation too self.handle_mandatory_switch() @@ -160,6 +162,13 @@ class Battle(EmulatorController): """ raise NotImplementedError + def handle_switch_prompt(self): + """ + The trainer is switching pokemon. The game asks yes/no for whether or + not the player would like to switch. + """ + raise NotImplementedError + def handle_turn(self): """ Take actions inside of a battle based on the game state. -- cgit v1.2.3