The pokémon object
- class poke_env.environment.pokemon.Pokemon(gen: int, *, species: str | None = None, request_pokemon: Dict[str, Any] | None = None, details: str | None = None)
Bases:
object
- property ability: str | None
- Returns:
The pokemon’s ability. None if unknown.
- Return type:
str, optional
- property active: bool | None
- Returns:
Boolean indicating whether the pokemon is active.
- Return type:
bool
- property available_z_moves: List[Move]
Caution: this property is not properly tested yet.
- Returns:
The set of moves that pokemon can use as z-moves.
- Return type:
List[Move]
- property base_species: str
- Returns:
The pokemon’s base species.
- Return type:
str
- property base_stats: Dict[str, int]
- Returns:
The pokemon’s base stats.
- Return type:
Dict[str, int]
- boost(stat: str, amount: int)
- property boosts: Dict[str, int]
- Returns:
The pokemon’s boosts.
- Return type:
Dict[str, int]
- cant_move()
- clear_active()
- clear_boosts()
- clear_negative_boosts()
- clear_positive_boosts()
- cure_status(status: str | None = None)
- property current_hp: int
- Returns:
The pokemon’s current hp. For your pokemons, this is the actual value. For opponent’s pokemon, this value depends on showdown information: it can be on a scale from 0 to 100 or on a pixel scale.
- Return type:
int
- property current_hp_fraction: float
- Returns:
The pokemon’s current remaining hp fraction.
- Return type:
float
- damage(hp_status: str)
- damage_multiplier(type_or_move: PokemonType | Move) float
Returns the damage multiplier associated with a given type or move on this pokemon.
This method is a shortcut for PokemonType.damage_multiplier with relevant types.
- Parameters:
type_or_move (PokemonType or Move) – The type or move of interest.
- Returns:
The damage multiplier associated with given type on the pokemon.
- Return type:
float
- property effects: Dict[Effect, int]
- Returns:
A Dict mapping the effects currently affecting the pokemon and the associated counter.
- Return type:
Dict[Effect, int]
- end_effect(effect_str: str)
- end_item(item: str)
- end_turn()
- faint()
- property fainted: bool
- Returns:
Wheter the pokemon has fainted.
- Return type:
bool
- property first_turn: bool
- Returns:
Wheter this is this pokemon’s first action since its last switch in.
- Return type:
bool
- forme_change(species: str)
- property gender: PokemonGender | None
- Returns:
The pokemon’s gender.
- Return type:
PokemonGender, optional
- heal(hp_status: str)
- property height: float
- Returns:
The pokemon’s height, in meters.
- Return type:
float
- invert_boosts()
- property is_dynamaxed: bool
- Returns:
Whether the pokemon is currently dynamaxed
- Return type:
bool
- property item: str | None
- Returns:
The pokemon’s item.
- Return type:
str | None
- property level: int
- Returns:
The pokemon’s level.
- Return type:
int
- property max_hp: int
- Returns:
The pokemon’s max hp. For your pokemons, this is the actual value. For opponent’s pokemon, this value depends on showdown information: it can be on a scale from 0 to 100 or on a pixel scale.
- Return type:
int
- mega_evolve(stone: str)
- moved(move_id: str, failed: bool = False, use: bool = True)
- property moves: Dict[str, Move]
- Returns:
A dictionary of the pokemon’s known moves.
- Return type:
Dict[str, Move]
- property must_recharge: bool
- Returns:
A boolean indicating whether the pokemon must recharge.
- Return type:
bool
- property pokeball: str | None
- Returns:
The pokeball in which is the pokemon.
- Return type:
str | None
- property possible_abilities: List[str]
- Returns:
The list of possible abilities for this pokemon.
- Return type:
List[str]
- property preparing: bool
- Returns:
Whether this pokemon is preparing a multi-turn move.
- Return type:
bool
- property preparing_move: Move | None
- Returns:
The move being prepared - optional.
- Return type:
Move, optional
- property preparing_target: bool | Pokemon | None
- Returns:
The moves target - optional.
- Return type:
Any
- primal()
- property protect_counter: int
- Returns:
How many protect-like moves where used in a row by this pokemon.
- Return type:
int
- property revealed: bool
- Returns:
Whether this pokemon has appeared in the current battle.
- Return type:
bool
- set_boost(stat: str, amount: int)
- set_hp(hp_status: str)
- set_hp_status(hp_status: str)
- property shiny: bool
- Returns:
Whether this pokemon is shiny.
- Return type:
bool
- property species: str
- Returns:
The pokemon’s species.
- Return type:
str | None
- property stab_multiplier: float
- Returns:
The pokemon’s STAB multiplier.
- Return type:
float
- start_effect(effect_str: str)
- property stats: Dict[str, int | None] | None
- Returns:
The pokemon’s stats, as a dictionary.
- Return type:
Dict[str, int | None]
- property status_counter: int
- Returns:
The pokemon’s status turn count. Only counts TOXIC and SLEEP statuses.
- Return type:
int
- switch_in(details: str | None = None)
- switch_out()
- terastallize(type_: str)
- property terastallized: bool
- Returns:
Whether the pokemon is currently terastallized
- Return type:
bool
- property type_1: PokemonType
- Returns:
The pokemon’s first type.
- Return type:
- property type_2: PokemonType | None
- Returns:
The pokemon’s second type.
- Return type:
Optional[PokemonType]
- property types: Tuple[PokemonType, PokemonType | None]
- Returns:
The pokemon’s types, as a tuple.
- Return type:
Tuple[PokemonType, Optional[PokemonType]]
- update_from_request(request_pokemon: Dict[str, Any])
- used_z_move()
- was_illusioned()
- property weight: float
- Returns:
The pokemon’s weight, in kilograms.
- Return type:
float