From 4d5696251ce7feac89cb15d2c875e10e6cc8b831 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Mon, 11 Nov 2013 23:22:09 -0600 Subject: make a class that shows off the handler methods It doesn't do anything except show some of the methods that need to be implemented. --- pokemontools/vba/battle.py | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) (limited to 'pokemontools/vba/battle.py') diff --git a/pokemontools/vba/battle.py b/pokemontools/vba/battle.py index c0c886e..5d05d8c 100644 --- a/pokemontools/vba/battle.py +++ b/pokemontools/vba/battle.py @@ -202,35 +202,31 @@ class Battle(EmulatorController): class BattleStrategy(Battle): """ - Throw a pokeball until everyone dies. + This class shows the relevant methods to make a battle handler. """ def handle_mandatory_switch(self): """ Something fainted, pick the next mon. """ - for pokemon in self.emulator.party: - if pokemon.hp > 0: - break - else: - # the game failed to do a blackout.. not sure what to do now. - raise BattleException("No partymons left. wtf?") - - return pokemon.id + raise NotImplementedError - def handle_turn(self): + def handle_trainer_switch_prompt(self): """ - Take actions inside of a battle based on the game state. + The trainer is switching pokemon. The game asks yes/no for whether or + not the player would like to switch. """ - self.throw_pokeball() + raise NotImplementedError -class SimpleBattleStrategy(BattleStrategy): - """ - Attack the enemy with the first move. - """ + def handle_wild_switch_prompt(self): + """ + The wild pokemon defeated the party pokemon. This is the yes/no box for + whether to switch pokemon or not. + """ + raise NotImplementedError def handle_turn(self): """ - Always attack the enemy with the first move. + Take actions inside of a battle based on the game state. """ - self.attack(self.battle.party[0].moves[0].name) + raise NotImplementedError -- cgit v1.2.3