Ejemplo n.º 1
0
    def test_mega_launcher_boosts_darkpulse(self):

        move = {
            "accuracy": 100,
            "basePower": 80,
            "category": "special",
            "flags": {
                "protect": 1,
                "pulse": 1,
                "mirror": 1,
                "distance": 1
            },
            "id": "darkpulse",
            "name": "Dark Pulse",
            "priority": 0,
            "secondary": {
                "chance": 20,
                "volatileStatus": "flinch"
            },
            "target": "any",
            "type": "dark",
            "pp": 15
        }
        expected_move_power = 120
        pkmn = MagicMock()
        actual_power = ability_modify_attack_being_used(
            self.ability_name, move, pkmn, None, False)[constants.BASE_POWER]

        self.assertEqual(expected_move_power, actual_power)
Ejemplo n.º 2
0
 def test_does_not_boost_damage_when_it_does_not_need_to(self):
     move = {constants.NAME: "cool_move", constants.TYPE: "dark"}
     pkmn = MagicMock()
     pkmn.types = ['ghost', 'flying']
     self.assertEqual(
         move,
         ability_modify_attack_being_used(self.ability_name, move, pkmn,
                                          None, False))
Ejemplo n.º 3
0
    def test_does_not_modify_flying_move(self):
        move = {
            constants.NAME: "cool_move",
            constants.TYPE: "flying",
            constants.BASE_POWER: 100
        }

        expected_move = {
            constants.NAME: "cool_move",
            constants.TYPE: "flying",
            constants.BASE_POWER: 100
        }

        self.assertEqual(
            expected_move,
            ability_modify_attack_being_used(self.ability_name, move, None,
                                             None, False))
Ejemplo n.º 4
0
    def test_boosts_move_and_changes_type_to_flying(self):
        move = {
            constants.NAME: "cool_move",
            constants.TYPE: "normal",
            constants.BASE_POWER: 100
        }

        expected_move = {
            constants.NAME: "cool_move",
            constants.TYPE: "flying",
            constants.BASE_POWER: 130
        }

        self.assertEqual(
            expected_move,
            ability_modify_attack_being_used(self.ability_name, move, None,
                                             None, False))
Ejemplo n.º 5
0
    def test_boosts_damage_when_move_type_is_in_pokemon_types(self):
        move = {
            constants.NAME: "cool_move",
            constants.TYPE: "normal",
            constants.BASE_POWER: 100
        }
        pkmn = MagicMock()
        pkmn.types = ['normal', 'flying']

        expected_move = {
            constants.NAME: "cool_move",
            constants.TYPE: "normal",
            constants.BASE_POWER: int(400 / 3)
        }

        self.assertEqual(
            expected_move,
            ability_modify_attack_being_used(self.ability_name, move, pkmn,
                                             None, False))
Ejemplo n.º 6
0
def update_damage_calc_from_abilities_and_items(attacking_pokemon, defending_pokemon, attacking_move, defending_move, first_move):
    attacking_move = ability_modify_attack_against(
        defending_pokemon.ability,
        attacking_move,
        attacking_pokemon,
        defending_pokemon
    )

    attacking_move = ability_modify_attack_being_used(
        attacking_pokemon.ability,
        attacking_move,
        attacking_pokemon,
        defending_pokemon,
        first_move
    )

    attacking_move = item_modify_attack_being_used(
        attacking_pokemon.item,
        attacking_move,
        attacking_pokemon,
        defending_pokemon
    )

    attacking_move = item_modify_attack_against(
        defending_pokemon.item,
        attacking_move,
        attacking_pokemon,
        defending_pokemon
    )

    attacking_move = modify_attack_being_used(
        attacking_move,
        defending_move,
        attacking_pokemon,
        defending_pokemon,
        first_move
    )

    return attacking_move
Ejemplo n.º 7
0
    def test_mega_launcher_does_not_boost_tackle(self):

        move = {
            "accuracy": 100,
            "basePower": 40,
            "category": "special",
            "flags": {
                "protect": 1,
                "mirror": 1,
                "distance": 1
            },
            "id": "tackle",
            "priority": 0,
            "target": "any",
            "type": "dark",
            "pp": 15
        }
        expected_move_power = 40
        pkmn = MagicMock()
        actual_power = ability_modify_attack_being_used(
            self.ability_name, move, pkmn, None, False)[constants.BASE_POWER]

        self.assertEqual(expected_move_power, actual_power)