Other objects
Effect
This module defines the Effect class, which represents in-game effects.
- class poke_env.environment.effect.Effect(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum
Enumeration, represent an effect a Pokemon can be affected by.
- AFTERMATH = 3
- AFTER_YOU = 2
- AQUA_RING = 4
- AROMATHERAPY = 5
- AROMA_VEIL = 6
- ATTRACT = 7
- AUTOTOMIZE = 8
- BAD_DREAMS = 9
- BANEFUL_BUNKER = 10
- BATTLE_BOND = 11
- BIDE = 12
- BIND = 13
- BURN_UP = 14
- CELEBRATE = 15
- CHARGE = 16
- CLAMP = 17
- CONFUSION = 18
- COURT_CHANGE = 19
- CRAFTY_SHIELD = 20
- CUD_CHEW = 21
- CURSE = 22
- CUSTAP_BERRY = 23
- DANCER = 24
- DESTINY_BOND = 25
- DISABLE = 26
- DISGUISE = 27
- DOOM_DESIRE = 28
- DYNAMAX = 29
- EERIE_SPELL = 30
- ELECTRIC_TERRAIN = 31
- EMBARGO = 32
- EMERGENCY_EXIT = 33
- ENCORE = 34
- ENDURE = 35
- FAIRY_LOCK = 42
- FALLEN = 36
- FALLEN1 = 37
- FALLEN2 = 38
- FALLEN3 = 39
- FALLEN4 = 40
- FALLEN5 = 41
- FEINT = 43
- FICKLE_BEAM = 44
- FIRE_SPIN = 45
- FLASH_FIRE = 46
- FLOWER_VEIL = 47
- FOCUS_BAND = 48
- FOCUS_ENERGY = 49
- FORESIGHT = 50
- FOREWARN = 51
- FUTURE_SIGHT = 52
- GRAVITY = 58
- GRUDGE = 59
- GUARD_SPLIT = 60
- GULP_MISSILE = 61
- G_MAX_CENTIFERNO = 53
- G_MAX_CHI_STRIKE = 54
- G_MAX_ONE_BLOW = 55
- G_MAX_RAPID_FLOW = 56
- G_MAX_SANDBLAST = 57
- HADRON_ENGINE = 62
- HEALER = 65
- HEAL_BELL = 63
- HEAL_BLOCK = 64
- HYDRATION = 66
- HYPERSPACE_FURY = 67
- HYPERSPACE_HOLE = 68
- ICE_FACE = 69
- ILLUSION = 70
- IMMUNITY = 71
- IMPRISON = 72
- INFESTATION = 73
- INGRAIN = 74
- INNARDS_OUT = 75
- INSOMNIA = 76
- IRON_BARBS = 77
- LASER_FOCUS = 78
- LEECH_SEED = 79
- LEPPA_BERRY = 80
- LIGHTNING_ROD = 81
- LIMBER = 82
- LIQUID_OOZE = 83
- LOCK_ON = 84
- MAGMA_STORM = 85
- MAGNET_RISE = 86
- MAGNITUDE = 87
- MAT_BLOCK = 88
- MAX_GUARD = 89
- MIMIC = 90
- MIMICRY = 91
- MIND_READER = 92
- MINIMIZE = 93
- MIRACLE_EYE = 94
- MIST = 95
- MISTY_TERRAIN = 96
- MUMMY = 97
- NEUTRALIZING_GAS = 98
- NIGHTMARE = 99
- NO_RETREAT = 100
- OBLIVIOUS = 101
- OCTOLOCK = 102
- ORICHALCUM_PULSE = 103
- OWN_TEMPO = 104
- PASTEL_VEIL = 105
- PERISH0 = 106
- PERISH1 = 107
- PERISH2 = 108
- PERISH3 = 109
- PHANTOM_FORCE = 110
- POLTERGEIST = 111
- POWDER = 112
- POWER_CONSTRUCT = 113
- POWER_SPLIT = 114
- POWER_TRICK = 115
- PROTECT = 116
- PROTECTIVE_PADS = 117
- PROTOSYNTHESIS = 118
- PROTOSYNTHESISATK = 119
- PROTOSYNTHESISDEF = 120
- PROTOSYNTHESISSPA = 121
- PROTOSYNTHESISSPD = 122
- PROTOSYNTHESISSPE = 123
- PSYCHIC_TERRAIN = 124
- PURSUIT = 125
- QUARKDRIVEATK = 127
- QUARKDRIVEDEF = 128
- QUARKDRIVESPA = 129
- QUARKDRIVESPD = 130
- QUARKDRIVESPE = 131
- QUARK_DRIVE = 126
- QUASH = 132
- QUICK_CLAW = 133
- QUICK_GUARD = 134
- REFLECT = 135
- RIPEN = 136
- ROUGH_SKIN = 137
- SAFEGUARD = 138
- SAFETY_GOGGLES = 139
- SALT_CURE = 140
- SAND_TOMB = 141
- SCREEN_CLEANER = 142
- SHADOW_FORCE = 143
- SHED_SKIN = 144
- SKETCH = 145
- SKILL_SWAP = 146
- SKY_DROP = 147
- SLOW_START = 148
- SMACK_DOWN = 149
- SNAP_TRAP = 150
- SNATCH = 151
- SPEED_SWAP = 152
- SPITE = 153
- STICKY_HOLD = 154
- STICKY_WEB = 155
- STOCKPILE = 156
- STOCKPILE1 = 157
- STOCKPILE2 = 158
- STOCKPILE3 = 159
- STORM_DRAIN = 160
- STRUGGLE = 161
- SUBSTITUTE = 162
- SUCTION_CUPS = 163
- SUPREME_OVERLORD = 164
- SWEET_VEIL = 166
- SYMBIOSIS = 167
- SYNCHRONIZE = 168
- SYRUP_BOMB = 165
- TAR_SHOT = 169
- TAUNT = 170
- TELEKINESIS = 171
- TELEPATHY = 172
- TERA_SHELL = 173
- TERA_SHIFT = 174
- THERMAL_EXCHANGE = 177
- THROAT_CHOP = 178
- THUNDER_CAGE = 179
- TIDY_UP = 175
- TORMENT = 180
- TOXIC_DEBRIS = 176
- TRAPPED = 181
- TRICK = 182
- TYPEADD = 183
- TYPECHANGE = 184
- TYPE_CHANGE = 185
- UNKNOWN = 1
- UPROAR = 186
- VITAL_SPIRIT = 187
- WANDERING_SPIRIT = 188
- WATER_BUBBLE = 189
- WATER_VEIL = 190
- WHIRLPOOL = 191
- WIDE_GUARD = 192
- WIMP_OUT = 193
- WRAP = 194
- YAWN = 195
- ZERO_TO_HERO = 196
- property breaks_protect
- Returns:
Whether this effect breaks protect-like states.
- Return type:
bool
- static from_showdown_message(message: str) Effect
Returns the Effect object corresponding to the message.
- Parameters:
message (str) – The message to convert.
- Returns:
The corresponding Effect object.
- Return type:
- property is_action_countable: bool
- Returns:
Whether it is useful to keep track of the number of times this effect has been activated.
- Return type:
bool
- property is_turn_countable: bool
- Returns:
Whether it is useful to keep track of the number of turns this effect has been active for.
- Return type:
bool
Field
This module defines the Field class, which represents a battle field.
- class poke_env.environment.field.Field(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum
Enumeration, represent a non null field in a battle.
- ELECTRIC_TERRAIN = 2
- GRASSY_TERRAIN = 3
- GRAVITY = 4
- HEAL_BLOCK = 5
- MAGIC_ROOM = 6
- MISTY_TERRAIN = 7
- MUD_SPORT = 8
- MUD_SPOT = 9
- PSYCHIC_TERRAIN = 10
- TRICK_ROOM = 11
- UNKNOWN = 1
- WATER_SPORT = 12
- WONDER_ROOM = 13
- static from_showdown_message(message: str) Field
Returns the Field object corresponding to the message.
- Parameters:
message (str) – The message to convert.
- Returns:
The corresponding Field object.
- Return type:
- property is_terrain: bool
Wheter this field is a terrain.
Move category
This module defines the MoveCategory class, which represents a move category.
Pokemon gender
This module defines the PokemonGender class, which represents the gender of a Pokemon.
- class poke_env.environment.pokemon_gender.PokemonGender(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum
Enumeration, represent a pokemon’s gender.
- FEMALE = 1
- MALE = 2
- NEUTRAL = 3
- static from_request_details(gender: str) PokemonGender
- Returns the PokemonGender object corresponding to the gender received in a
message.
- Parameters:
gender (str) – The received gender to convert.
- Returns:
The corresponding PokemonGenre object.
- Return type:
PokemonGenre
Pokemon Type
This module defines the PokemonType class, which represents a Pokemon type. PokemonTypes are mainly associated with Pokemons and moves.
- class poke_env.environment.pokemon_type.PokemonType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum
A Pokemon type
This enumeration represents pokemon types. Each type is an instance of this class, whose name corresponds to the upper case spelling of its english name (ie. FIRE).
- BUG = 1
- DARK = 2
- DRAGON = 3
- ELECTRIC = 4
- FAIRY = 5
- FIGHTING = 6
- FIRE = 7
- FLYING = 8
- GHOST = 9
- GRASS = 10
- GROUND = 11
- ICE = 12
- NORMAL = 13
- POISON = 14
- PSYCHIC = 15
- ROCK = 16
- STEEL = 17
- STELLAR = 20
- THREE_QUESTION_MARKS = 19
- WATER = 18
- damage_multiplier(type_1: PokemonType, type_2: PokemonType | None = None, *, type_chart: Dict[str, Dict[str, float]]) float
Computes the damage multiplier from this type on a pokemon with types type_1 and, optionally, type_2.
- Parameters:
type_1 (PokemonType) – The first type of the target.
type_2 (PokemonType, optional) – The second type of the target. Defaults to None.
- Returns:
The damage multiplier from this type on a pokemon with types type_1 and, optionally, type_2.
- Return type:
float
- static from_name(name: str) PokemonType
Returns a pokemon type based on its name.
- Parameters:
name (str) – The name of the pokemon type.
- Returns:
The corresponding type object.
- Return type:
Side condition
This module defines the SideCondition class, which represents a in-battle side condition.
- class poke_env.environment.side_condition.SideCondition(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum
Enumeration, represent a in-battle side condition.
- AURORA_VEIL = 2
- FIRE_PLEDGE = 3
- GRASS_PLEDGE = 9
- G_MAX_CANNONADE = 4
- G_MAX_STEELSURGE = 5
- G_MAX_VINE_LASH = 6
- G_MAX_VOLCALITH = 7
- G_MAX_WILDFIRE = 8
- LIGHT_SCREEN = 10
- LUCKY_CHANT = 11
- MIST = 12
- REFLECT = 13
- SAFEGUARD = 14
- SPIKES = 15
- STEALTH_ROCK = 16
- STICKY_WEB = 17
- TAILWIND = 18
- TOXIC_SPIKES = 19
- UNKNOWN = 1
- WATER_PLEDGE = 20
- static from_showdown_message(message: str)
Returns the SideCondition object corresponding to the message.
- Parameters:
message (str) – The message to convert.
- Returns:
The corresponding SideCondition object.
- Return type:
Status
This module defines the Status class, which represents statuses a pokemon can be afflicted with.
Weather
This module defines the Weather class, which represents a in-battle weather.
- class poke_env.environment.weather.Weather(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum
Enumeration, represent a non null weather in a battle.
- DELTASTREAM = 3
- DESOLATELAND = 2
- HAIL = 4
- PRIMORDIALSEA = 5
- RAINDANCE = 6
- SANDSTORM = 7
- SNOW = 8
- SUNNYDAY = 9
- UNKNOWN = 1
Z Crystal
This module contains objects related ot z-crystal management. It should not be used directly.
This module contains utility functions and objects related to stats.
- poke_env.stats.compute_raw_stats(species: str, evs: List[int], ivs: List[int], level: int, nature: str, data: GenData) List[int]
Converts to raw stats :param species: pokemon species :param evs: list of pokemon’s EVs (size 6) :param ivs: list of pokemon’s IVs (size 6) :param level: pokemon level :param nature: pokemon nature :return: the raw stats in order [hp, atk, def, spa, spd, spe]