Other objects

Effect

This module defines the Effect class, which represents in-game effects.

class poke_env.battle.effect.Effect(value)

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
BEAK_BLAST = 12
BIDE = 13
BIND = 14
BURNING_BULWARK = 15
BURN_UP = 16
CELEBRATE = 17
CHARGE = 18
CLAMP = 19
COMMANDER = 20
CONFUSION = 21
COURT_CHANGE = 22
CRAFTY_SHIELD = 23
CUD_CHEW = 24
CURSE = 25
CUSTAP_BERRY = 26
DANCER = 27
DEFENSE_CURL = 28
DESTINY_BOND = 29
DISABLE = 30
DISGUISE = 31
DOOM_DESIRE = 32
DRAGON_CHEER = 33
DYNAMAX = 34
EERIE_SPELL = 35
ELECTRIC_TERRAIN = 36
ELECTRIFY = 37
EMBARGO = 38
EMERGENCY_EXIT = 39
ENCORE = 40
ENDURE = 41
FAIRY_LOCK = 48
FALLEN = 42
FALLEN1 = 43
FALLEN2 = 44
FALLEN3 = 45
FALLEN4 = 46
FALLEN5 = 47
FEINT = 49
FICKLE_BEAM = 50
FIRE_SPIN = 51
FLASH_FIRE = 52
FLINCH = 53
FLOWER_VEIL = 54
FOCUS_BAND = 55
FOCUS_ENERGY = 56
FOCUS_PUNCH = 57
FOLLOW_ME = 58
FORESIGHT = 59
FOREWARN = 60
FUTURE_SIGHT = 61
GASTRO_ACID = 62
GLAIVE_RUSH = 63
GRAVITY = 64
GRUDGE = 65
GUARD_DOG = 66
GUARD_SPLIT = 67
GULP_MISSILE = 68
G_MAX_CENTIFERNO = 69
G_MAX_CHI_STRIKE = 70
G_MAX_ONE_BLOW = 71
G_MAX_RAPID_FLOW = 72
G_MAX_SANDBLAST = 73
HADRON_ENGINE = 74
HEALER = 77
HEAL_BELL = 75
HEAL_BLOCK = 76
HELPING_HAND = 78
HYDRATION = 79
HYPERSPACE_FURY = 80
HYPERSPACE_HOLE = 81
ICE_FACE = 82
ILLUSION = 83
IMMUNITY = 84
IMPRISON = 85
INFESTATION = 86
INGRAIN = 87
INNARDS_OUT = 88
INSOMNIA = 89
INSTRUCT = 90
IRON_BARBS = 91
KINGS_SHIELD = 92
LASER_FOCUS = 93
LEECH_SEED = 94
LEPPA_BERRY = 95
LIGHTNING_ROD = 96
LIMBER = 97
LINGERING_AROMA = 98
LIQUID_OOZE = 99
LOCKED_MOVE = 100
LOCK_ON = 101
MAGIC_COAT = 102
MAGMA_STORM = 103
MAGNET_RISE = 104
MAGNITUDE = 105
MAT_BLOCK = 106
MAX_GUARD = 107
MIMIC = 108
MIMICRY = 109
MIND_READER = 110
MINIMIZE = 111
MIRACLE_EYE = 112
MIST = 113
MISTY_TERRAIN = 114
MUMMY = 115
MUST_RECHARGE = 116
NIGHTMARE = 117
NO_RETREAT = 118
OBLIVIOUS = 119
OBSTRUCT = 120
OCTOLOCK = 121
ORICHALCUM_PULSE = 122
OWN_TEMPO = 123
PARTIALLY_TRAPPED = 124
PASTEL_VEIL = 125
PERISH0 = 126
PERISH1 = 127
PERISH2 = 128
PERISH3 = 129
PHANTOM_FORCE = 130
POLTERGEIST = 131
POWDER = 132
POWER_CONSTRUCT = 133
POWER_SHIFT = 134
POWER_SPLIT = 135
POWER_TRICK = 136
PROTECT = 137
PROTECTIVE_PADS = 138
PROTOSYNTHESIS = 139
PROTOSYNTHESISATK = 140
PROTOSYNTHESISDEF = 141
PROTOSYNTHESISSPA = 142
PROTOSYNTHESISSPD = 143
PROTOSYNTHESISSPE = 144
PSYCHIC_TERRAIN = 145
PURSUIT = 146
QUARKDRIVEATK = 148
QUARKDRIVEDEF = 149
QUARKDRIVESPA = 150
QUARKDRIVESPD = 151
QUARKDRIVESPE = 152
QUARK_DRIVE = 147
QUASH = 153
QUICK_CLAW = 154
QUICK_DRAW = 155
QUICK_GUARD = 156
RAGE = 157
RAGE_POWDER = 158
REFLECT = 159
RIPEN = 160
ROOST = 161
ROUGH_SKIN = 162
SAFEGUARD = 163
SAFETY_GOGGLES = 164
SALT_CURE = 165
SAND_TOMB = 166
SCREEN_CLEANER = 167
SHADOW_FORCE = 168
SHED_SKIN = 169
SILK_TRAP = 170
SKETCH = 171
SKILL_SWAP = 172
SKY_DROP = 173
SLOW_START = 174
SMACK_DOWN = 175
SNAP_TRAP = 176
SNATCH = 177
SPARKLING_ARIA = 178
SPEED_SWAP = 179
SPIKY_SHIELD = 180
SPITE = 181
SPOTLIGHT = 182
STICKY_HOLD = 183
STICKY_WEB = 184
STOCKPILE = 185
STOCKPILE1 = 186
STOCKPILE2 = 187
STOCKPILE3 = 188
STORM_DRAIN = 189
STRUGGLE = 190
SUBSTITUTE = 191
SUCTION_CUPS = 192
SUPREME_OVERLORD = 193
SWEET_VEIL = 195
SYMBIOSIS = 196
SYNCHRONIZE = 197
SYRUP_BOMB = 194
TAR_SHOT = 198
TAUNT = 199
TELEKINESIS = 200
TELEPATHY = 201
TERA_SHELL = 202
TERA_SHIFT = 203
THERMAL_EXCHANGE = 206
THROAT_CHOP = 207
THUNDER_CAGE = 208
TIDY_UP = 204
TORMENT = 209
TOXIC_DEBRIS = 205
TRAPPED = 210
TRICK = 211
TYPEADD = 212
TYPECHANGE = 213
UNKNOWN = 1
UPROAR = 214
VITAL_SPIRIT = 215
WANDERING_SPIRIT = 216
WATER_BUBBLE = 217
WATER_VEIL = 218
WHIRLPOOL = 219
WIDE_GUARD = 220
WIMP_OUT = 221
WRAP = 222
YAWN = 223
ZERO_TO_HERO = 224
property breaks_protect
Returns:

Whether this effect breaks protect-like states.

Return type:

bool

property ends_on_move: bool
Returns:

Whether this effect ends when a pokemon moves.

Return type:

bool

property ends_on_switch: bool
Returns:

Whether this effect ends when the pokemon switches out.

Return type:

bool

property ends_on_turn: bool
Returns:

Whether this effect ends at the end of the turn.

Return type:

bool

static from_data(message: str) Effect

Returns the Effect object corresponding to the string in static data.

Parameters:

message (str) – The message to convert.

Returns:

The corresponding Effect object.

Return type:

Effect

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:

Effect

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_from_ability: bool
Returns:

Whether this effect is a result of an ability

Return type:

bool

property is_from_item: bool
Returns:

Whether this effect is a result of an item

Return type:

bool

property is_from_move: bool
Returns:

Whether this effect is a result of a move

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

property is_volatile_status: bool
Returns:

Whether the effect is a volatile status, brought by a move

Return type:

bool

Field

This module defines the Field class, which represents a battle field.

class poke_env.battle.field.Field(value)

Bases: Enum

Enumeration, represent a non null field in a battle.

ELECTRIC_TERRAIN = 2
FAIRY_LOCK = 3
GRASSY_TERRAIN = 4
GRAVITY = 5
HEAL_BLOCK = 6
MAGIC_ROOM = 7
MISTY_TERRAIN = 8
MUD_SPORT = 9
MUD_SPOT = 10
NEUTRALIZING_GAS = 11
PSYCHIC_TERRAIN = 12
TRICK_ROOM = 13
UNKNOWN = 1
WATER_SPORT = 14
WONDER_ROOM = 15
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:

Field

property is_terrain: bool

Wheter this field is a terrain.

Move category

This module defines the MoveCategory class, which represents a move category.

class poke_env.battle.move_category.MoveCategory(value)

Bases: Enum

Enumeration, represent a move category.

PHYSICAL = 1
SPECIAL = 2
STATUS = 3

Pokemon gender

This module defines the PokemonGender class, which represents the gender of a Pokemon.

class poke_env.battle.pokemon_gender.PokemonGender(value)

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.battle.pokemon_type.PokemonType(value)

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:

PokemonType

Side condition

This module defines the SideCondition class, which represents a in-battle side condition.

class poke_env.battle.side_condition.SideCondition(value)

Bases: Enum

Enumeration, represent a in-battle side condition.

AURORA_VEIL = 2
CRAFTY_SHIELD = 3
FIRE_PLEDGE = 4
GRASS_PLEDGE = 10
G_MAX_CANNONADE = 5
G_MAX_STEELSURGE = 6
G_MAX_VINE_LASH = 7
G_MAX_VOLCALITH = 8
G_MAX_WILDFIRE = 9
LIGHT_SCREEN = 11
LUCKY_CHANT = 12
MATBLOCK = 13
MIST = 14
QUICK_GUARD = 15
REFLECT = 16
SAFEGUARD = 17
SPIKES = 18
STEALTH_ROCK = 19
STICKY_WEB = 20
TAILWIND = 21
TOXIC_SPIKES = 22
UNKNOWN = 1
WATER_PLEDGE = 23
WIDE_GUARD = 24
static from_data(message: str)

Returns the SideCondition object corresponding to the string in static data.

Parameters:

message (str) – The message to convert.

Returns:

The corresponding SideCondition object.

Return type:

SideCondition

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:

SideCondition

Status

This module defines the Status class, which represents statuses a pokemon can be afflicted with.

class poke_env.battle.status.Status(value)

Bases: Enum

Enumeration, represent a status a pokemon can be afflicted with.

BRN = 1
FNT = 2
FRZ = 3
PAR = 4
PSN = 5
SLP = 6
TOX = 7

Weather

This module defines the Weather class, which represents a in-battle weather.

class poke_env.battle.weather.Weather(value)

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
SNOWSCAPE = 8
SUNNYDAY = 9
UNKNOWN = 1
static from_showdown_message(message: str)

Returns the Weather object corresponding to the message.

Parameters:

message (str) – The message to convert.

Returns:

The corresponding Weather object.

Return type:

Weather

Z Crystal

This module contains objects related ot z-crystal management. It should not be used directly.