diff options
author | Bryan Bishop <kanzure@gmail.com> | 2013-11-11 23:22:09 -0600 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2013-11-11 23:22:09 -0600 |
commit | 4d5696251ce7feac89cb15d2c875e10e6cc8b831 (patch) | |
tree | 2f9f26ae5f8ad65ef910ef8b88b49dc1dfba4b53 | |
parent | 5b35595c7a13792db782f8ebc21dccfcc1b56b9a (diff) |
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.
-rw-r--r-- | pokemontools/vba/battle.py | 32 |
1 files changed, 14 insertions, 18 deletions
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 |