def __init__(self, *args, **kwargs): super(StatusTest, self).__init__(*args, **kwargs) self.stat = Stats(100, 100, 100, 100, 100, 100, ) self.pokemon = Pokemon("Incineroar", [pk.Fire, pk.Dark], "Male", self.stat, {}, [], 80.50, StatusType.Normal, [], None, 50) self.other_pokemon = Pokemon("Incineroar", [pk.Fire, pk.Dark], "Female", self.stat, {}, [], 80.50, StatusType.Normal, [], None, 50)
def testSwitch(self): stats = Stats( 100, 100, 100, 100, 100, 100, ) pokemon1 = Pokemon("Incineroar", [pk.Fire, pk.Dark], "Male", stats, None, None, None, None, None, None, 50) pokemon2 = Pokemon("Kyogre", [pk.Water], "", stats, None, None, None, None, None, None, 50) pokemon3 = Pokemon("Qwilfish", [pk.Water, pk.Poison], "Male", stats, None, None, None, None, None, None, 50) pokemon4 = Pokemon("Gyarados", [pk.Water, pk.Flying], "Male", stats, None, None, None, None, None, None, 50) battleField = BattleFieldSingle(pokemon1, pokemon2, { 1: pokemon1, 2: pokemon4 }, { 1: pokemon2, 2: pokemon3 }) battleField.switch_pokemon(1, 2) self.assertEqual(battleField.active_pokemon_bot, pokemon4) self.assertEqual(battleField.active_selector_side[1], pokemon4) self.assertEqual(battleField.active_pokemon_oppo, pokemon2)
def __init__(self, *args, **kwargs): super(DamageTrackerTest, self).__init__(*args, **kwargs) stats = Stats( 100, 100, 100, 100, 100, 100, ) move1 = SingleMove("Lanciafiamme", 100, 100, MoveCategory.Damage, 10, 0, False, 15, pk.Fire, StatsType.Spa, None, None, StatsType.Spd, 100, None, None) move2 = SingleMove("Idropompa", 100, 100, MoveCategory.Damage, 10, 0, False, 15, pk.Water, StatsType.Spa, None, None, StatsType.Spd, 100, None, None) moves = {1: move1, 2: move2} self.pokemon1 = Pokemon("Incineroar", [pk.Fire, pk.Dark], "Male", stats, moves, None, None, None, None, None, 50) self.pokemon2 = Pokemon("Kyogre", [pk.Water], "", stats, moves, None, None, None, None, None, 50)
class MoveTest(unittest.TestCase): def __init__(self, *args, **kwargs): super(MoveTest, self).__init__(*args, **kwargs) stats = Stats( 100, 100, 100, 100, 100, 100, ) move1 = SingleMove("Lanciafiamme", 100, 100, MoveCategory.Damage, 10, 0, False, 15, pk.Fire, StatsType.Spa, None, None, StatsType.Spd, 100, None, None) move2 = SingleMove("Idropompa", 100, 100, MoveCategory.Damage, 10, 0, False, 15, pk.Water, StatsType.Spa, None, None, StatsType.Spd, 100, None, None) moves = {1: move1, 2: move2} self.pokemon1 = Pokemon("Incineroar", [pk.Fire, pk.Dark], "Male", stats, moves, None, None, None, None, None, 50) self.pokemon2 = Pokemon("Kyogre", [pk.Water], "", stats, moves, None, None, None, None, None, 50) def test_invoke(self): self.pokemon1.use_move(1, self.pokemon2, w.Normal, f.Normal) self.assertNotEqual(self.pokemon2.stats.damage, 0) self.assertEqual(self.pokemon1.moves[1].pp, 9)
class EntrenadorController(): def __init__(self): self.entrenadores = Entrenador() self.pokemones = Pokemon() def create_entrenador(self, entrenador: EntrenadorEntity): self.entrenadores.create(entrenador) self.entrenadores.save_data() # if you want you can remove this line! def find_entrenador(self, id: int): entrenador = self.entrenadores.find(id) if entrenador is not None: entrenador['pokemon'] = self.pokemones.find_all(entrenador['id']) return entrenador def delete_entrenador(self, id: int): self.entrenadores.delete(id) self.entrenadores.save_data() # if you want you can remove this line! def update_entrenador(self, id: int, entrenador: EntrenadorEntity): self.entrenadores.update(id, entrenador) self.entrenadores.save_data() # if you want you can remove this line! def show_data(self): print(self.entrenadores.show_entrenadores())
def __init__(self): self.pokemones = Pokemon()
class PokemonController(): def __init__(self): self.pokemones = Pokemon() def create_pokemon(self, pokemon: PokemonEntity): self.pokemones.create(pokemon) self.pokemones.save_data() # if you want you can remove this line! def find_pokemon(self, id: int): return self.pokemones.find(id) def delete_pokemon(self, id: int): self.pokemones.delete(id) self.pokemones.save_data() # if you want you can remove this line! def update_pokemon(self, id: int, pokemon: PokemonEntity): self.pokemones.update(id, pokemon) self.pokemones.save_data() # if you want you can remove this line! def show_all(self): print(self.pokemones.show_pokemones())
def __init__(self): self.entrenadores = Entrenador() self.pokemones = Pokemon()