def test_removes_pokemon_from_reserve_if_it_is_in_there(self): zoroark = Pokemon('zoroark', 82) self.battle.opponent.active = Pokemon('meloetta', 100) self.battle.opponent.reserve = [zoroark] split_msg = ['', '-replace', 'p2a: Zoroark', 'Zoroark, L82, M'] form_change(self.battle, split_msg) self.assertNotIn(zoroark, self.battle.opponent.reserve)
def test_preserves_base_name_when_form_changes(self): self.battle.opponent.active = Pokemon('meloetta', 100) split_msg = [ '', '-formechange', 'p2a: Meloetta', 'Meloetta - Pirouette', '[msg]' ] form_change(self.battle, split_msg) self.assertEqual('meloetta', self.battle.opponent.active.base_name)
def test_changes_with_formechange_message(self): self.battle.opponent.active = Pokemon('meloetta', 100) split_msg = [ '', '-formechange', 'p2a: Meloetta', 'Meloetta - Pirouette', '[msg]' ] form_change(self.battle, split_msg) self.assertEqual('meloettapirouette', self.battle.opponent.active.name)
def test_preserves_status(self): self.battle.opponent.active = Pokemon('meloetta', 100) self.battle.opponent.active.status = constants.BURN split_msg = [ '', '-formechange', 'p2a: Meloetta', 'Meloetta - Pirouette', '[msg]' ] form_change(self.battle, split_msg) self.assertEqual(constants.BURN, self.battle.opponent.active.status)
def test_preserves_boosts(self): self.battle.opponent.active = Pokemon('meloetta', 100) self.battle.opponent.active.boosts = {constants.ATTACK: 2} split_msg = [ '', '-formechange', 'p2a: Meloetta', 'Meloetta - Pirouette', '[msg]' ] form_change(self.battle, split_msg) self.assertEqual(2, self.battle.opponent.active.boosts[constants.ATTACK])
def test_multiple_forme_changes_does_not_ruin_base_name(self): self.battle.user.active = Pokemon('pikachu', 100) self.battle.opponent.active = Pokemon('pikachu', 100) self.battle.opponent.reserve = [] self.battle.opponent.reserve.append(Pokemon('wishiwashi', 100)) m1 = [ '', 'switch', 'p2a: Wishiwashi', 'Wishiwashi, L100, M', '100/100' ] m2 = [ '', '-formechange', 'p2a: Wishiwashi', 'Wishiwashi-School', '', '[from] ability: Schooling' ] m3 = ['', 'switch', 'p2a: Pikachu', 'Pikachu, L100, M', '100/100'] m4 = [ '', 'switch', 'p2a: Wishiwashi', 'Wishiwashi, L100, M', '100/100' ] m5 = [ '', '-formechange', 'p2a: Wishiwashi', 'Wishiwashi-School', '', '[from] ability: Schooling' ] m6 = ['', 'switch', 'p2a: Pikachu', 'Pikachu, L100, M', '100/100'] m7 = [ '', 'switch', 'p2a: Wishiwashi', 'Wishiwashi, L100, M', '100/100' ] m8 = [ '', '-formechange', 'p2a: Wishiwashi', 'Wishiwashi-School', '', '[from] ability: Schooling' ] switch_or_drag(self.battle, m1) form_change(self.battle, m2) switch_or_drag(self.battle, m3) switch_or_drag(self.battle, m4) form_change(self.battle, m5) switch_or_drag(self.battle, m6) switch_or_drag(self.battle, m7) form_change(self.battle, m8) pkmn = Pokemon("wishiwashischool", 100) self.assertNotIn(pkmn, self.battle.opponent.reserve)
def test_does_not_set_base_name_for_illusion_ending(self): self.battle.opponent.active = Pokemon('meloetta', 100) split_msg = ['', 'replace', 'p2a: Zoroark', 'Zoroark, L84, F'] form_change(self.battle, split_msg) self.assertEqual('zoroark', self.battle.opponent.active.base_name)