Ejemplo n.º 1
0
    def _update_from_pokedex(self, species: str) -> None:
        dex_entry = POKEDEX[to_id_str(species)]
        self._base_stats = dex_entry["baseStats"]

        self._type_1 = PokemonType.from_name(dex_entry["types"][0])
        if len(dex_entry["types"]) == 1:
            self._type_2 = None
        else:
            self._type_1 = PokemonType.from_name(dex_entry["types"][1])

        self._possible_abilities = dex_entry["abilities"]
        self._heightm = dex_entry["heightm"]
        self._weightkg = dex_entry["weightkg"]
Ejemplo n.º 2
0
    def _update_from_pokedex(self, species: str, store_species: bool = True) -> None:
        species = to_id_str(species)
        dex_entry = POKEDEX[species]
        if store_species:
            self._species = species
        self._base_stats = dex_entry["baseStats"]

        self._type_1 = PokemonType.from_name(dex_entry["types"][0])
        if len(dex_entry["types"]) == 1:
            self._type_2 = None
        else:
            self._type_2 = PokemonType.from_name(dex_entry["types"][1])

        self._possible_abilities = dex_entry["abilities"]
        self._heightm = dex_entry["heightm"]
        self._weightkg = dex_entry["weightkg"]
        self._dexnum = dex_entry["num"]
Ejemplo n.º 3
0
    def _update_from_pokedex(self,
                             species: str,
                             store_species: bool = True) -> None:
        species = to_id_str(species)
        dex_entry = self._POKEDEX_DICT[species]
        if store_species:
            self._species = species
        self._base_stats = dex_entry["baseStats"]

        self._type_1 = PokemonType.from_name(dex_entry["types"][0])
        if len(dex_entry["types"]) == 1:
            self._type_2 = None
        else:
            self._type_2 = PokemonType.from_name(dex_entry["types"][1])

        self._possible_abilities = [
            to_id_str(ability) for ability in dex_entry["abilities"].values()
        ]

        if len(self._possible_abilities) == 1:
            self.ability = self._possible_abilities[0]

        self._heightm = dex_entry["heightm"]
        self._weightkg = dex_entry["weightkg"]
    def _move_details(self, mon, opponent, move):
        move_multiplier = 1
        if mon.ability == "pixilate" and move.type.name == "NORMAL":
            #treat it as a fairy move
            move_multiplier = 1.3 * 1.5  #STAB + pixilate boost-- assume we have stab (sylveon)
            move_multiplier *= opponent.damage_multiplier(
                PokemonType.from_name("FAIRY"))
            #TODO: Make this work for Sylveon targeting Dragapult with HV
        elif "levitate" in opponent.possible_abilities and move.type.name == "GROUND":
            move_multiplier = 0
        elif "flashfire" in opponent.possible_abilities and move.type.name == "FIRE":
            move_multiplier = 0
        elif "sapsipper" in opponent.possible_abilities and move.type.name == "GRASS":
            move_multiplier = 0
        elif "stormdrain" in opponent.possible_abilities and move.type.name == "WATER":
            move_multiplier = 0

        return move_multiplier