diff --git a/search/search_index.json b/search/search_index.json index 4f4e8a2..d39b4d4 100755 --- a/search/search_index.json +++ b/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Welcome to the Poketypes Docs!","text":"

This site contains the project documentation for the poketypes project, whose goal is to provide clear, consistent, correct data about Pokemon, using the same base data as Pokemon Showdown.

"},{"location":"#table-of-contents","title":"Table Of Contents","text":"

This package provides two very useful modules for handling Pokemon data:

Based on the needs of your project, you may need one or both of these.

There is also the module protos, which contains the logic for generating the DexClass core Enums used in dex. As an end-user of the typing and data structures in ths package, you don't need to access anything in protos, however, if you want to have data-structure / enum support for more niche showdown mods, contributions to the protos class would be greatly appreciated.

"},{"location":"#project-overview","title":"Project Overview","text":"

Fully type-hinted, consistently labeled, feature rich information about Pokemon.

Modules exported by this package "},{"location":"about/about/","title":"The Core Team","text":""},{"location":"about/changelog/","title":"Changelog","text":"

Changelog will not be 100% accurate until the official 1.0.0 release. Right now each release is a mash-up of various message tweaks, documenation additions, field reworkings, etc..

I'll try to keep a generally accurate log until then mostly for my own benefit, but take it with a grain of salt

"},{"location":"about/changelog/#021","title":"0.2.1","text":""},{"location":"about/changelog/#changed","title":"Changed","text":""},{"location":"about/changelog/#020","title":"0.2.0","text":""},{"location":"about/changelog/#added","title":"Added","text":""},{"location":"about/changelog/#changed_1","title":"Changed","text":""},{"location":"about/changelog/#010","title":"0.1.0","text":""},{"location":"about/changelog/#added_1","title":"Added","text":""},{"location":"about/license/","title":"License","text":"

MIT License

Copyright (c) 2023 Trevor Wieland

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

"},{"location":"dex/","title":"Dex Intro","text":""},{"location":"dex/#5-minute-summary","title":"5-Minute Summary","text":"

In the poketypes package, we include the module dex, which contains two different types of data structures, so-called DexClass Enums, which contain uniquely enumerated labels for everything from pokemon formes to items to moves and more. The other contained data structure is the PokedexClass BaseModel, which are pydantic BaseModels, meant for holding reference material about a specific corresponding DexClass label.

For example, one specific DexClass is the DexPokemon, an Enum which maps every distinct pokemon forme (base, cosmetic, temporary, etc.) to a unique integer. So we have things like DexPokemon.POKEMON_MAGIKARP, which is mapped to the integer 129000. Then, we have the PokedexPokemon BaseModel, whose purpose would be to store all useful information about each specific corresponding DexPokemon id, such as the types of the pokemon (each stored as a DexType), the learnset of the pokemon (stored as DexMove), etc..

This means that if you are building logic for interpretting a pokemon battle, rather than relying on string comparisons which can both be slow and inconsistent, you can instead use included functions such as cast2dex, which can take input strings and a relevant DexClass, and return the correct label to use.

These extra layers of labeling may seem cumbersome to work with at first, but since we provide all of the cleaning functions you could need to transform between them, the trade-off for using just a few extra lines of code is 100% guarunteed label consistency and accuracy, with minimal risk of typos.

For instance, you might care about checking if an opponent pokemon can potentially have the ability levitate. Then you could directly use DexAbility.ABILITY_LEVITATE, checking if this label exists in the corresponding PokedexPokemon.abilities. Since no string comparisons are happening, there's no risk of accidentally spelling levitate wrong since the type hinting will inform you.

Lastly, there is the actual pokedex instances, which are accessed by calling dex.gen(). This returns a pydantic object that has a pre-instantiated dictionary for Pokemon, Moves, and Items, which each map from their corresponding DexClass to their corresponding PokedexClass. For example, dex.gen(5).pokemon[DexPokemon.POKEMON_MAGIKARP] will return the PokedexPokemon object for Magikarp, will all the details already filled out, as it was in generation 5. If you leave out the gen number, it will automatically use the latest generation available.

"},{"location":"dex/#reference-links","title":"Reference Links","text":"

For details on all the different kinds of DexClasses, see the reference page here

For details on all the different kinds of PokedexClasses, see the reference page here

For details on all the different cleaning utilities, see the reference page here

For details on the gen function, see the reference page here

"},{"location":"dex/reference/dex-classes/","title":"The DexClass","text":"

poketypes.dex.dexdata_pb2 OR directly import from poketypes.dex

"},{"location":"dex/reference/dex-classes/#basics","title":"Basics","text":"

Each DexClass is an auto-generated Enum using google's protobuf library, and the poketypes.protos module. In order to use these Enums, you do not need to have the library installed, however if you want to generate your own Enums in this way, or modify how the existing ones are generating, you will need to do so.

Follow the steps in the contributing to get your local environment setup if you want to develop changes for these Enums.

"},{"location":"dex/reference/dex-classes/#reference","title":"Reference","text":"

Generated protocol buffer code.

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexStat","title":"DexStat","text":"

Represents possible stats

Options:

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexGen","title":"DexGen","text":"

Represents supported Generations

Each integer gen is represented as its integer value.

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexMoveCategory","title":"DexMoveCategory","text":"

Represents possible move categories

Options:

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexMoveTarget","title":"DexMoveTarget","text":"

Represents possible move targets

Options:

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexType","title":"DexType","text":"

Auto-Generated by protogen.py Contains data for Gen 9

Represents possible Types

Options:

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexNature","title":"DexNature","text":"

Represents possible Natures

Options:

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexPokemon","title":"DexPokemon","text":"

Represents possible Pokemons

Options:

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexMove","title":"DexMove","text":"

Represents possible Moves

Options:

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexItem","title":"DexItem","text":"

Represents possible Items

Options:

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexStatus","title":"DexStatus","text":"

Represents possible Statuss

Options:

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexWeather","title":"DexWeather","text":"

Represents possible Weathers

Options:

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexCondition","title":"DexCondition","text":"

Represents possible Conditions

Options:

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexAbility","title":"DexAbility","text":"

Represents possible Abilitys

Options:

"},{"location":"dex/reference/pokedex-classes/","title":"The PokedexClass","text":"

poketypes.dex.pokedex OR directly import from poketypes.dex

"},{"location":"dex/reference/pokedex-classes/#basics","title":"Basics","text":"

Each PokedexClass is a pydantic BaseModel, holding every possibly-useful attribute sourced directly from pokemon showdown typescript files as the ground truth.

"},{"location":"dex/reference/pokedex-classes/#reference","title":"Reference","text":"

Provides BaseModels for accessing real information about specific items/pokemon/moves/etc.

All Pokedex{NAME} classes are defined in this module, though you can also import these directly from poketypes.dex.

"},{"location":"dex/reference/pokedex-classes/#poketypes.dex.pokedex.PokedexMove","title":"PokedexMove","text":"

Pokedex class for Move information.

ATTRIBUTE DESCRIPTION name

The friendly string name of this move

TYPE: str

id

The DexMove ID of this move

TYPE: DexMove.ValueType

base_power

The base power of the move

TYPE: int

pp

The pp of this move

TYPE: int

priority

The priority of the move

TYPE: int

crit_ratio

The crit ratio of the move (e.g. 2 = twice the chance to crit)

TYPE: int

category

The move category as a DexMoveCategory

TYPE: DexMoveCategory.ValueType

target

The target type of this move

TYPE: DexMoveTarget.ValueType

mtype

The type of the move

TYPE: DexType.ValueType

breaks_protect

Whether the move breaks target protect

TYPE: bool

ignore_ability

Whether the move ignores target ability

TYPE: bool

ignore_defensive

Whether the move ignores target defensive boosts

TYPE: bool

ignore_evasion

Whether the move ignores target evasion boosts

TYPE: bool

ignore_immunity

Whether the move ignores target immunity to this move type

TYPE: bool

multiaccuracy

Whether the multihit move is all or nothing

TYPE: bool

ohko

Whether the move is a one-hit-ko

TYPE: bool

stalling_move

Whether the move is considered a stalling move

TYPE: bool

will_crit

Whether the move will 100% crit if it lands

TYPE: bool

has_crash_damage

Whether the move does damage to its user on failure

TYPE: bool

has_sheer_force

The move is always boosted by sheer-force without losing benefit

TYPE: bool

selfdestruct_always

Whether this move always causes the user to faint

TYPE: bool

selfdestruct_ifhit

Whether the move causes the user to faint if and only if it hits

TYPE: bool

steals_boosts

Whether the move steals the targets boosts

TYPE: bool

level_damage

Whether the move does damage based on the level of the user

TYPE: bool

force_switch

Whether the move forces the target to switch out

TYPE: bool

mindblown_recoil

Whether the move has special 'Mind Blown' style recoil

TYPE: bool

struggle_recoil

Whether the move has special 'Struggle' style recoil

TYPE: bool

smart_target

Whether the move uses smart targetting

TYPE: bool

thaws_target

Whether the move thaws target as a special effect

TYPE: bool

tracks_target

Whether the move ignores draw-in move/abilities.

TYPE: bool

selfswitch_standard

Whether the move is a typical self-switching move. Teleport/U-Turn/etc

TYPE: bool

selfswitch_volatile

Whether the move is a volatile-keeping self-switching move. Baton Pass

TYPE: bool

selfswitch_shedtail

Whether the move is a substitue creating self-switching move. Shed Tail

TYPE: bool

sleep_usable

Whether the move can be used when sleeping

TYPE: bool

no_metronome

Whether the move can NOT be used as a result of metronome

TYPE: bool

no_sketch

Whether the move can NOT be copied as a result of sketch

TYPE: bool

no_ppboosts

Whether the move can NOT have its pp boosted beyond default

TYPE: bool

accuracy

The accuracy of this move. Optional if the move bypasses accuracy

TYPE: Optional[int]

multihit

The move hits multiple times from slot0 - slot1 times inclusive. Optional

TYPE: Optional[Tuple[int, int]]

drain

The move drains hp: (slot0 / slot1) times damage dealt. Optional

TYPE: Optional[Tuple[int, int]]

heal

The move directly heals hp: (slot0 / slot1) times maximum health. Optional

TYPE: Optional[Tuple[int, int]]

recoil

The move recoils back hp: (slot0 / slot1) times damage dealt. Optional

TYPE: Optional[Tuple[int, int]]

boosts

Any boosts for the target this move provides (100%). Optional

TYPE: Optional[Dict[DexStat.ValueType, int]]

direct_damage

An integer exact amount of damage the move does. Optional

TYPE: Optional[int]

weather

The weather started by this move. Optional

TYPE: Optional[DexWeather.ValueType]

flag_allyanim

MOVE FLAG: allyanim

TYPE: bool

flag_bite

MOVE FLAG: bite

TYPE: bool

flag_bullet

MOVE FLAG: bullet

TYPE: bool

flag_bypasssub

MOVE FLAG: bypasssub

TYPE: bool

flag_cantusetwice

MOVE FLAG: cantusetwice

TYPE: bool

flag_charge

MOVE FLAG: charge

TYPE: bool

flag_contact

MOVE FLAG: contact

TYPE: bool

flag_dance

MOVE FLAG: dance

TYPE: bool

flag_defrost

MOVE FLAG: defrost

TYPE: bool

flag_distance

MOVE FLAG: distance

TYPE: bool

flag_failcopycat

MOVE FLAG: failcopycat

TYPE: bool

flag_failencore

MOVE FLAG: failencore

TYPE: bool

flag_failinstruct

MOVE FLAG: failinstruct

TYPE: bool

flag_failmefirst

MOVE FLAG: failmefirst

TYPE: bool

flag_failmimic

MOVE FLAG: failmimic

TYPE: bool

flag_futuremove

MOVE FLAG: futuremove

TYPE: bool

flag_gravity

MOVE FLAG: gravity

TYPE: bool

flag_heal

MOVE FLAG: heal

TYPE: bool

flag_mirror

MOVE FLAG: mirror

TYPE: bool

flag_mustpressure

MOVE FLAG: mustpressure

TYPE: bool

flag_noassist

MOVE FLAG: noassist

TYPE: bool

flag_nonsky

MOVE FLAG: nonsky

TYPE: bool

flag_noparentalbond

MOVE FLAG: noparentalbond

TYPE: bool

flag_nosleeptalk

MOVE FLAG: nosleeptalk

TYPE: bool

flag_pledgecombo

MOVE FLAG: pledgecombo

TYPE: bool

flag_powder

MOVE FLAG: powder

TYPE: bool

flag_protect

MOVE FLAG: protect

TYPE: bool

flag_pulse

MOVE FLAG: pulse

TYPE: bool

flag_punch

MOVE FLAG: punch

TYPE: bool

flag_recharge

MOVE FLAG: recharge

TYPE: bool

flag_reflectable

MOVE FLAG: reflectable

TYPE: bool

flag_slicing

MOVE FLAG: slicing

TYPE: bool

flag_snatch

MOVE FLAG: snatch

TYPE: bool

flag_sound

MOVE FLAG: sound

TYPE: bool

flag_wind

MOVE FLAG: wind

TYPE: bool

"},{"location":"dex/reference/pokedex-classes/#poketypes.dex.pokedex.PokedexItem","title":"PokedexItem","text":"

Pokedex class for Item information.

ATTRIBUTE DESCRIPTION name

The friendly string name of this item

TYPE: str

id

The DexItem ID of this item

TYPE: DexItem.ValueType

is_gem

Whether the item is a gem or not

TYPE: bool

is_berry

Whether the item is a berry

TYPE: bool

naturalgift_base_power

If this item is usable with Natural Gift, what is the base power

TYPE: Optional[int]

naturalgift_type

If this item is usable with Natural Gift, what is the type

TYPE: Optional[DexType.ValueType]

item_users

A list of intended holders of this item

TYPE: List[DexPokemon.ValueType]

zmove_to

What move this zmove transforms the move into

TYPE: Optional[DexMove.ValueType]

zmove_from

What special move this zmove transforms

TYPE: Optional[DexMove.ValueType]

mega_evolves

Which base-forme pokemon this megastone evolves from. Optional

TYPE: Optional[DexPokemon.ValueType]

mega_forme

Which mega-forme pokemon this megastone evolves into. Optional

TYPE: Optional[DexPokemon.ValueType]

ignore_klutz

Whether the item ignores klutz

TYPE: bool

fling_basepower

The basepower of fling when flinging this item. None if n/a

TYPE: Optional[int]

"},{"location":"dex/reference/pokedex-classes/#poketypes.dex.pokedex.StatBlock","title":"StatBlock","text":"

Helper object for containing base stats information.

ATTRIBUTE DESCRIPTION hp_stat

The base hp of the pokemon

TYPE: int

atk_stat

The base attack of the pokemon

TYPE: int

def_stat

The base defence of the pokemon

TYPE: int

spa_stat

The base special attack of the pokemon

TYPE: int

spd_stat

The base special defence of the pokemon

TYPE: int

spe_stat

The base speed of the pokemon

TYPE: int

"},{"location":"dex/reference/pokedex-classes/#poketypes.dex.pokedex.PokedexPokemon","title":"PokedexPokemon","text":"

Pokedex class for Pokemon information.

ATTRIBUTE DESCRIPTION name

The friendly string name of this pokemon

TYPE: str

id

The DexPokemon ID of this pokemon

TYPE: DexPokemon.ValueType

base_name

The friendly string name of this pokemon's base forme

TYPE: str

base_id

The DexPokemon ID of this pokemon's base forme

TYPE: DexPokemon.ValueType

types

The types of this pokemon

TYPE: List[DexType.ValueType]

base_stats

The base stat block of this pokemon

TYPE: StatBlock

abilities

The list of abilities this pokemon can have

TYPE: List[DexAbility.ValueType]

"},{"location":"dex/reference/utilities/","title":"Utilities","text":"

There are also a few utility functions provided to help the user convert typical string names to the relevant ID for their corresponding Dex Class.

"},{"location":"dex/reference/utilities/#dex-data-utilities","title":"Dex Data Utilities:","text":"

Provides tools for cleaning Dex IDs back and forth from strings, as well as other utility functions.

"},{"location":"dex/reference/utilities/#poketypes.dex.dexdata.cast2dex","title":"cast2dex(name, dex_class)","text":"

Clean and cast name to the corresponding entry in the given dex_class.

EX: Magikarp -> Cleaned to: MAGIKARP -> DexPokemon.POKEMON_MAGIKARP (Which is secretly the int 129000)

EX: Scizor-Mega -> Cleaned to: SCIZORMEGA -> DexPokemon.POKEMON_SCIZORMEGA (Which is secretly the int 208001)

Parameters:

Name Type Description Default name str

The name of the entry.

required dex_class AnyDex

Which Dex Enum to use in labeling. Must be a valid Dex{NAME} class.

required

Returns:

Name Type Description int int

The corresponding value for this cleaned entry.

Source code in poketypes\\dex\\dexdata.py
def cast2dex(name: str, dex_class: AnyDex) -> int:\n    \"\"\"Clean and cast name to the corresponding entry in the given dex_class.\n\n    EX:\n    Magikarp -> Cleaned to: MAGIKARP -> DexPokemon.POKEMON_MAGIKARP (Which is secretly the int 129000)\n\n    EX:\n    Scizor-Mega -> Cleaned to: SCIZORMEGA -> DexPokemon.POKEMON_SCIZORMEGA (Which is secretly the int 208001)\n\n    Args:\n        name (str): The name of the entry.\n        dex_class (AnyDex): Which Dex Enum to use in labeling. Must be a valid Dex{NAME} class.\n\n    Returns:\n        int: The corresponding value for this cleaned entry.\n    \"\"\"\n    clean_id = clean_name(name)\n\n    if clean_id is None:\n        return clean_id\n\n    if dex_class == DexAbility:\n        return DexAbility.Value(f\"ABILITY_{clean_id}\")\n    elif dex_class == DexCondition:\n        return DexCondition.Value(f\"CONDITION_{clean_id}\")\n    elif dex_class == DexGen:\n        return DexGen.Value(f\"GEN_{clean_id}\")\n    elif dex_class == DexItem:\n        return DexItem.Value(f\"ITEM_{clean_id}\")\n    elif dex_class == DexMove:\n        return DexMove.Value(f\"MOVE_{clean_id}\")\n    elif dex_class == DexMoveCategory:\n        return DexMoveCategory.Value(f\"MOVECATEGORY_{clean_id}\")\n    elif dex_class == DexMoveTarget:\n        return DexMoveTarget.Value(f\"MOVETARGET_{clean_id}\")\n    elif dex_class == DexNature:\n        return DexNature.Value(f\"NATURE_{clean_id}\")\n    elif dex_class == DexPokemon:\n        return DexPokemon.Value(f\"POKEMON_{clean_id}\")\n    elif dex_class == DexStat:\n        return DexStat.Value(f\"STAT_{clean_id}\")\n    elif dex_class == DexStatus:\n        return DexStatus.Value(f\"STATUS_{clean_id}\")\n    elif dex_class == DexType:\n        return DexType.Value(f\"TYPE_{clean_id}\")\n    elif dex_class == DexWeather:\n        return DexWeather.Value(f\"WEATHER_{clean_id}\")\n
"},{"location":"dex/reference/utilities/#poketypes.dex.dexdata.clean_forme","title":"clean_forme(species)","text":"

Transform a pokemon species (DexPokemon) into the string name of it's base forme.

Makes use of the fact that DexPokemon are of the form {dex_number}{3-digit forme number}, and that the base forme is always forme-number 000. If this changes, this function will no longer work.

Parameters:

Name Type Description Default species ValueType

The input species to clean to base forme.

required

Returns:

Type Description ValueType

DexPokemon.ValueType: The corresponding ID of the base forme species.

Source code in poketypes\\dex\\dexdata.py
def clean_forme(species: DexPokemon.ValueType) -> DexPokemon.ValueType:\n    \"\"\"Transform a pokemon species (DexPokemon) into the string name of it's base forme.\n\n    Makes use of the fact that DexPokemon are of the form {dex_number}{3-digit forme number},\n    and that the base forme is always forme-number `000`.\n    If this changes, this function will no longer work.\n\n    Args:\n        species (DexPokemon.ValueType): The input species to clean to base forme.\n\n    Returns:\n        DexPokemon.ValueType: The corresponding ID of the base forme species.\n    \"\"\"\n    clean_species = (species // 1000) * 1000\n    return clean_species\n
"},{"location":"dex/reference/utilities/#poketypes.dex.dexdata.clean_name","title":"clean_name(name)","text":"

Format a given uncleaned string name as the format needed for searching the corresponding Enum.

Parameters:

Name Type Description Default name Optional[str]

An optional name to clean. If None is given, we immediately return None.

required

Returns:

Type Description Optional[str]

Optional[str]: The clean-form of the input name, if it wasn't None or blank.

Source code in poketypes\\dex\\dexdata.py
def clean_name(name: Optional[str]) -> Optional[str]:\n    \"\"\"Format a given uncleaned string name as the format needed for searching the corresponding Enum.\n\n    Args:\n        name (Optional[str]): An optional name to clean. If None is given, we immediately return None.\n\n    Returns:\n        Optional[str]: The clean-form of the input name, if it wasn't None or blank.\n    \"\"\"\n    if name is None or name == \"\":\n        return None\n\n    clean_id = (\n        unicodedata.normalize(\n            \"NFKD\",\n            name.upper()\n            .replace(\"-\", \"\")\n            .replace(\"\u2019\", \"\")\n            .replace(\"'\", \"\")\n            .replace(\" \", \"\")\n            .replace(\"*\", \"\")\n            .replace(\":\", \"\")\n            .replace(\"%\", \"\")\n            .replace(\".\", \"\")\n            .replace(\")\", \"\")\n            .replace(\"(\", \"\"),\n        )\n        .encode(\"ASCII\", \"ignore\")\n        .decode(\"ASCII\")\n    )\n    return clean_id\n
"},{"location":"showdown/","title":"Showdown Intro","text":""},{"location":"showdown/#5-minute-summary","title":"5-Minute Summary","text":"

In the poketypes package, we include the module showdown, which contains pydantic BaseModel subclasses for General and Battle Message formats. This allows for a smoother communication process with Pokemon Showdown, as rather than needing to build a message parser yourself, relying on relatively limited documentation from Showdown directly, you can instead build logic to take as input either Message or BattleMessage objects, which will come pre-parsed, with full type-hinting and data validation built in.

To start, you can import both from the module showdown like so:

from poketypes.showdown import Message, BattleMessage\n

Both Message and BattleMessage are subclasses of pydantic.BaseModel, and both also have an additional function called from_message, which takes as input a string, and returns an initialized and parsed object from the input string message.

message = BattleMessage.from_string(\"|poke|p1|Metagross, L80|item\")\n

At this point, message will automatically be identified as a poke battle message, and will be an instance of the class poketypes.showdown.battlemessage.BattleMessage_poke. Rather than checking with isinstance, however, we recommend instead checking the message.BMTYPE (or message.MTYPE for general messages), which is of the type poketypes.showdown.BMType, an Enum of all the different battle message types you can receive. For type hinting purposes, such as in the signature of a function that would process a given BattleMessage subclass, you would do the following:

def process_bm_poke(message: poketypes.showdown.battlemessage.BattleMessage_poke):\n

This will ensure that your IDE will have type hinting support as you process the message, and in the specific example of BattleMessage_poke, will give support in directly accessing the data fields like message.PLAYER that are unique to this BattleMessage subclass.

Check out the Guides in this section for some common use-cases of this module, eith step-by-step instructions on each part of the process. Or if you prefer to learn by reading docs, check out the Reference links below or on the sidebar to familiarize yourself with some of the different categories of messages.

"},{"location":"showdown/#reference-links","title":"Reference Links","text":"

For details on all the different kinds of Message subclasses, see the reference page here

For details on all the different kinds of BattleMessage subclasses, see the reference page here

"},{"location":"showdown/explanations/","title":"Why Two Classes?","text":"

Once you've started using the showdown message classes, you might start wondering why there is even a split between Message and BattleMessage classes at all, why not just have one class called Message which works for both?

The answer is really from a convenience standpoint, rather than any technical limitation.

In theory, we could absolutely just have one larger Message class that encompasses both of our current message classes, however in practice we don't use the two that we have today in the same way at all. With Pokemon Showdown's webclient, battle messages are actually a special type of room-message, sent with a chunk formatting that looks something like:

\"\"\">battle-BATTLEID\n|init|battle\n|title|colress-gpt-test1 vs. colress-gpt-test2\n|j|\u2606colress-gpt-test1\n\"\"\"\n

Already, in order to process this in a parser, we will need special handling to identify that a certain message chunk is related to some specific room/battle, and then process each remaining line in the chunk as a message pertaining to that room. Since we're already checking for room information with the \">\" at the start, we may as well just check for \">battle\" instead, and parse everything that follows as though it is specific to a battle.

It is theoretically possible that in the future we may decide that simplifying our two class structure into just a single Message class may make sense, but considering that other than some benefits in terms of code organization, there really isn't much reason to do so either. The Message and BattleMessage classes are complex enough as they are now, so if we tried to merge them into one we would really need to consider a different file formatting structure for writing subclasses, compared to our current solution of one file for Message and one file for BattleMessage.

"},{"location":"showdown/guides/basic-parser/","title":"Building a Replay Log Parser","text":""},{"location":"showdown/guides/basic-parser/#introduction","title":"Introduction","text":"

This tutorial will guide usage of poketypes.showdown to create a simple replay log parser, which can read any arbitrary Pokemon Showdown replay file, and turn it into a list of BattleMessage subclass objects, that you could then proceed to do some sort of analysis or transformation on.

Since we'll be processing a Replay log in this example, we will only be using poketypes.showdown.BattleMessage, but similar concepts can be applied for processing any message sent by showdown, so long as you make the distinction between general messages and message chunks that target a specific battle.

"},{"location":"showdown/guides/basic-parser/#prerequisites","title":"Prerequisites","text":"

Make sure that you have poketypes installed to your virtual environment, which you can do with:

pip install poketypes\n

Additionally, go ahead and download the replay file here. If you click the Download button on this page, it should download a .html file called 'OUMonotype-2014-01-29-kdarewolf-onox.html', which we will use as an example, but any replay file should work.

"},{"location":"showdown/guides/basic-parser/#step-1-extracting-the-battle-log","title":"Step 1: Extracting the Battle Log","text":"

Replay files are stored in html files, which means we need to extract the text log that we want to parse first.

To do that, since we only need very basic html extraction, we can

"},{"location":"showdown/reference/battle-messages/","title":"The Showdown Battle Message","text":""},{"location":"showdown/reference/battle-messages/#the-battlemessage-object","title":"The BattleMessage object","text":"

The base class for all specific BattleMessage subclasses to be built from.

When parsing a string battle message, you should directly use this class's from_message function, which will auto-identify which subclass (if any) the given string belongs to.

Across all BattleMessages, you will be able to access both BMTYPE and BATTLE_MESSAGE, though you shouldn't need to access BATTLE_MESSAGE directly. (If you do, then we must be missing some data that exists in the raw string)

ATTRIBUTE DESCRIPTION BMTYPE

The message type of this battle message. Must be a vaild showdown battle message.

TYPE: BMType

BATTLE_MESSAGE

The raw message line as sent from showdown. Shouldn't need to be used but worth keeping.

TYPE: str

ERR_STATE

The error type of this battle message if it failed to parse

TYPE: Optional[Literal['UNKNOWN_BMTYPE', 'MISSING_DICT_CLASS', 'IMPLEMENTATION_NOT_READY', 'PARSE_ERROR']]

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage.from_message","title":"from_message(battle_message) staticmethod","text":"

Create a specific BattleMessage object from a raw message.

For example, given a message '|faint|p2a: Umbreon', this will create a new BattleMessage_faint with fields extracted from the text properly.

"},{"location":"showdown/reference/battle-messages/#battlemessage-subclasses","title":"BattleMessage Subclasses","text":"

Contains BaseModels for BattleMessage parsing and processing.

Remember to use BattleMessage.from_message directly, unless you are building test cases where you want to assert that a given message leads to a certain subclass of BattleMessage. from_message will auto-detect which BMType the given message corresponds to, and return the associated subclass (or an error detailing what went wrong) for you.

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_player","title":"BattleMessage_player","text":"

Message containing player information.

ATTRIBUTE DESCRIPTION PLAYER

The player id of this player

TYPE: str

USERNAME

The username of the player

TYPE: str

AVATAR

Either a number id of the user's avatar or a custom value

TYPE: Union[int, str]

RATING

The elo of the player in the current format, if applicable

TYPE: Optional[int]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_teamsize","title":"BattleMessage_teamsize","text":"

Message containing teamsize information.

ATTRIBUTE DESCRIPTION PLAYER

The player id of this player

TYPE: str

NUMBER

The number of pokemon your opponent has.

TYPE: int

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_gametype","title":"BattleMessage_gametype","text":"

Message containing gametype information.

ATTRIBUTE DESCRIPTION GAMETYPE

The gametype of this format

TYPE: Literal['singles', 'doubles', 'triples', 'multi', 'freeforall']

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_gen","title":"BattleMessage_gen","text":"

Message containing gen information.

ATTRIBUTE DESCRIPTION GENNUM

The integer generation number of this format

TYPE: DexGen.ValueType

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_tier","title":"BattleMessage_tier","text":"

Message containing format information.

ATTRIBUTE DESCRIPTION FORMATNAME

The game format of this match

TYPE: str

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_rated","title":"BattleMessage_rated","text":"

Message containing rating information.

ATTRIBUTE DESCRIPTION MESSAGE

An optional message used in tournaments

TYPE: Optional[str]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_rule","title":"BattleMessage_rule","text":"

Message containing extra rule information.

ATTRIBUTE DESCRIPTION RULE

The name of the rule

TYPE: str

DESCRIPTION

A description of this rule

TYPE: str

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_clearpoke","title":"BattleMessage_clearpoke","text":"

Message containing a clearpoke notification.

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_poke","title":"BattleMessage_poke","text":"

Message containing base-forme-only information about a pokemon, presented in teampreview.

ATTRIBUTE DESCRIPTION PLAYER

The player id of this player

TYPE: str

SPECIES

The forme-less species for this pokemon

TYPE: DexPokemon.ValueType

LEVEL

The level of this pokemon

TYPE: int

GENDER

The gender of this pokemon

TYPE: Optional[Literal['M', 'F']]

SHINY

Whether the pokemon is shiny or not

TYPE: bool

TERA

If this pokemon is teratyped, the string type of the new type. Else None.

TYPE: Optional[DexType.ValueType]

HAS_ITEM

Whether or not the pokemon is holding an item

TYPE: bool

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_start","title":"BattleMessage_start","text":"

Message signaling the start of a battle.

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_teampreview","title":"BattleMessage_teampreview","text":"

Message signaling to make a teampreview team-order decision.

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_empty","title":"BattleMessage_empty","text":"

Completely blank message.

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_request","title":"BattleMessage_request","text":"

Message communicating options the user has in an upcoming choice.

ATTRIBUTE DESCRIPTION REQUEST_TYPE

Which type of request this request is between TEAMPREVIEW, ACTIVE, and FORCESWITCH

TYPE: Literal['TEAMPREVIEW', 'ACTIVE', 'FORCESWITCH', 'WAIT']

USERNAME

The player's username

TYPE: str

PLAYER

The player id of this player

TYPE: str

RQID

The id number of this request, for the purpose of an undo function

TYPE: Optional[int]

POKEMON

The pokemon details for each pokemon in this player's side

TYPE: List[RequestPoke]

ACTIVE_OPTIONS

A list of actions available for each active pokemon. Will be None if switch/teampreview

TYPE: Optional[List[ActiveOption]]

FORCESWITCH_SLOTS

A list of bool for each slot whether they are being forced to switch

TYPE: Optional[List[bool]]

Use Case(s) Message Format(s) Input Example(s) Tips

This does not necessarily mean it is time for the user to respond to a choice, as teampreview and move requests are sent before the details of the previous turn are sent, and thus you should wait until it is the correct time to send your decision.

For FORCESWITCH requests, however, a decision should be sent once you receive this message.

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_inactive","title":"BattleMessage_inactive","text":"

Message communicating that the inactivity timer has been set.

ATTRIBUTE DESCRIPTION MESSAGE

A message related to the battle timer notification

TYPE: str

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_inactiveoff","title":"BattleMessage_inactiveoff","text":"

Message communicating that the inactivity timer has been turned off.

ATTRIBUTE DESCRIPTION MESSAGE

A message related to the battle timer notification

TYPE: str

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_upkeep","title":"BattleMessage_upkeep","text":"

Message communicating upkeep notice.

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_turn","title":"BattleMessage_turn","text":"

Message communicating that a turn has begun, and that move choices should be made.

ATTRIBUTE DESCRIPTION NUMBER

The current turn number

TYPE: int

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_win","title":"BattleMessage_win","text":"

Message communicating that a player has won the battle.

ATTRIBUTE DESCRIPTION USERNAME

The username of the winning player

TYPE: str

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_tie","title":"BattleMessage_tie","text":"

Message communicating that neither player has won the battle.

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_expire","title":"BattleMessage_expire","text":"

Message communicating that the battle has ended due to mutual inactivity.

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_t","title":"BattleMessage_t","text":"

Message communicating the current timestamp.

ATTRIBUTE DESCRIPTION TIMESTAMP

The time of this turn as a datetime (conv from unix seconds)

TYPE: datetime

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_move","title":"BattleMessage_move","text":"

Message communicating that a pokemon successfully used a move.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon using the move

TYPE: PokemonIdentifier

MOVE

The name of the move used

TYPE: str

TARGET

The primary target of this move. This can be None when applicable

TYPE: Optional[PokemonIdentifier]

EFFECT

An optional effect that the move is taken from (Magic bounce, Sleep Talk, etc)

TYPE: Optional[Effect]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_switch","title":"BattleMessage_switch","text":"

Message communicating that a pokemon has switched in.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon swapping in, potentially replacing the slot

TYPE: PokemonIdentifier

SPECIES

The species for this pokemon, including forme

TYPE: DexPokemon.ValueType

LEVEL

The level of this pokemon

TYPE: int

GENDER

The gender of this pokemon

TYPE: Optional[Literal['M', 'F']]

SHINY

Whether the pokemon is shiny or not

TYPE: bool

TERA

If this pokemon is teratyped, the string type of the new type. Else None.

TYPE: Optional[str]

CUR_HP

The current HP of the pokemon

TYPE: int

MAX_HP

The maximum HP of the pokemon

TYPE: int

STATUS

The status of the pokemon. Can be None if there is no status

TYPE: Optional[str]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_drag","title":"BattleMessage_drag","text":"

Message communicating that a pokemon has switched in.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon being dragged in

TYPE: PokemonIdentifier

SPECIES

The species for this pokemon, including forme

TYPE: DexPokemon.ValueType

LEVEL

The level of this pokemon

TYPE: int

GENDER

The gender of this pokemon

TYPE: Optional[Literal['M', 'F']]

SHINY

Whether the pokemon is shiny or not

TYPE: bool

TERA

If this pokemon is teratyped, the string type of the new type. Else None.

TYPE: Optional[str]

CUR_HP

The current HP of the pokemon

TYPE: int

MAX_HP

The maximum HP of the pokemon

TYPE: int

STATUS

The status of the pokemon. Can be None if there is no status

TYPE: Optional[str]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_detailschange","title":"BattleMessage_detailschange","text":"

Message communicating that a pokemon has changed formes in a permanent way.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon changing formes

TYPE: PokemonIdentifier

SPECIES

The species for this pokemon, including forme

TYPE: DexPokemon.ValueType

LEVEL

The level of this pokemon

TYPE: int

GENDER

The gender of this pokemon

TYPE: Optional[Literal['M', 'F']]

SHINY

Whether the pokemon is shiny or not

TYPE: bool

TERA

If this pokemon is teratyped, the string type of the new type. Else None.

TYPE: Optional[str]

CUR_HP

The current HP of the pokemon

TYPE: Optional[str]

MAX_HP

The maximum HP of the pokemon

TYPE: Optional[str]

STATUS

The status of the pokemon. Can be None if there is no status

TYPE: Optional[str]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_replace","title":"BattleMessage_replace","text":"

Message communicating that a pokemon has been replaced (Zoroark illusion ability).

ATTRIBUTE DESCRIPTION POKEMON

The pokemon being revealed (Zoroark)

TYPE: PokemonIdentifier

SPECIES

The species for this pokemon, including forme

TYPE: DexPokemon.ValueType

LEVEL

The level of this pokemon

TYPE: int

GENDER

The gender of this pokemon

TYPE: Optional[Literal['M', 'F']]

SHINY

Whether the pokemon is shiny or not

TYPE: bool

TERA

If this pokemon is teratyped, the string type of the new type. Else None.

TYPE: Optional[str]

CUR_HP

The current HP of the pokemon

TYPE: Optional[str]

MAX_HP

The maximum HP of the pokemon

TYPE: Optional[str]

STATUS

The status of the pokemon. Can be None if there is no status

TYPE: Optional[str]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_swap","title":"BattleMessage_swap","text":"

Message communicating that a certain active slot has had its pokemon swapped with another.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon being swapped before swapping

TYPE: PokemonIdentifier

POSITION

The slot that this Pokemon is being swapped to, as an integer

TYPE: int

EFFECT

An optional effect explaining what caused the swapping

TYPE: Optional[Effect]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_cant","title":"BattleMessage_cant","text":"

Message communicating that a pokemon was unable to do something.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that was unable to act

TYPE: PokemonIdentifier

REASON

The reason that the pokemon was unable to do what it was trying to do

TYPE: str

MOVE

The move being used that was unable to be used. None if not applicable

TYPE: Optional[str]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_faint","title":"BattleMessage_faint","text":"

Message communicating that a pokemon has fainted.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that fainted

TYPE: PokemonIdentifier

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_fail","title":"BattleMessage_fail","text":"

Message communicating that a pokemon has failed to do something.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that failed to do something

TYPE: PokemonIdentifier

EFFECT

The effect causing/explaining the fail. Is Optional since sometimes it fails with no explanation

TYPE: Optional[Effect]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_block","title":"BattleMessage_block","text":"

Message communicating that a pokemon has blocked an opposing action.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that was targeted but blocked something

TYPE: PokemonIdentifier

EFFECT

The reason this was able to be blocked

TYPE: Effect

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_notarget","title":"BattleMessage_notarget","text":"

Message communicating that no target was available at move-use time.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that had no target available

TYPE: PokemonIdentifier

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_miss","title":"BattleMessage_miss","text":"

Message communicating that a given source pokemon missed its action.

ATTRIBUTE DESCRIPTION SOURCE

The pokemon missing the attack

TYPE: PokemonIdentifier

TARGET

The pokemon evading (If applicable, can be None)

TYPE: Optional[PokemonIdentifier]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_damage","title":"BattleMessage_damage","text":"

Message communicating that a pokemon has taken damage.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon being hurt

TYPE: PokemonIdentifier

CUR_HP

The current HP of the pokemon

TYPE: int

MAX_HP

The maximum HP of the pokemon. None if the pokemon is fainted

TYPE: Optional[int]

STATUS

The status of the pokemon. Can be None if there is no status

TYPE: Optional[str]

EFFECT

The reason this damage was dealt, if not from a move

TYPE: Optional[Effect]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_heal","title":"BattleMessage_heal","text":"

Message communicating that a pokemon has healed some health.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon being healed

TYPE: PokemonIdentifier

CUR_HP

The current HP of the pokemon

TYPE: int

MAX_HP

The maximum HP of the pokemon

TYPE: int

STATUS

The status of the pokemon. Can be None if there is no status

TYPE: Optional[str]

EFFECT

The reason this health was healed, if not from a move

TYPE: Optional[Effect]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_sethp","title":"BattleMessage_sethp","text":"

Message communicating that a pokemon has an exact hp amount.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon getting the HP set

TYPE: PokemonIdentifier

CUR_HP

The current HP of the pokemon

TYPE: int

MAX_HP

The maximum HP of the pokemon

TYPE: int

STATUS

The status of the pokemon. Can be None if there is no status

TYPE: Optional[str]

EFFECT

The reason this health was healed

TYPE: Optional[Effect]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_status","title":"BattleMessage_status","text":"

Message communicating that a pokemon has gained a status.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon gaining the status

TYPE: PokemonIdentifier

STATUS

The status being gained

TYPE: DexStatus.ValueType

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_curestatus","title":"BattleMessage_curestatus","text":"

Message communicating that a pokemon has lost a status.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon losing the status

TYPE: PokemonIdentifier

STATUS

The status being lost

TYPE: DexStatus.ValueType

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_cureteam","title":"BattleMessage_cureteam","text":"

Message communicating that a team has been cured of all status conditions.

ATTRIBUTE DESCRIPTION EFFECT

The effect causing the team to be healed

TYPE: Effect

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_boost","title":"BattleMessage_boost","text":"

Message communicating that a pokemon has gained some stat boost.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon getting the boost

TYPE: PokemonIdentifier

STAT

Which stat is being boosted

TYPE: PokeStat

AMOUNT

By how much this stat is being boosted, as an integer. Can be 0 if at cap

TYPE: int

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_unboost","title":"BattleMessage_unboost","text":"

Message communicating that a pokemon has had some stat lowered.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon getting the boost

TYPE: PokemonIdentifier

STAT

Which stat is being boosted

TYPE: PokeStat

AMOUNT

By how much this stat is being unboosted, as an integer. Can be 0 if at cap

TYPE: int

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_setboost","title":"BattleMessage_setboost","text":"

Message communicating that a pokemon has had some stat set to a certain boost value.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon getting the boost

TYPE: PokemonIdentifier

STAT

Which stat is being boosted

TYPE: PokeStat

AMOUNT

The new value being assigned for this stat boost

TYPE: int

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_swapboost","title":"BattleMessage_swapboost","text":"

Message communicating that two specific pokemon have had their stat boosts switched.

Warning

Not yet implemented!

ATTRIBUTE DESCRIPTION POKEMON

The pokemon getting the boost

TYPE: str

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_invertboost","title":"BattleMessage_invertboost","text":"

Message communicating that a pokemon has had its stat boosts inverted.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon getting the boost inverted

TYPE: PokemonIdentifier

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_clearboost","title":"BattleMessage_clearboost","text":"

Message communicating that a pokemon has had its stat boosts cleared.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that had its stat boosts cleared.

TYPE: PokemonIdentifier

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_clearallboost","title":"BattleMessage_clearallboost","text":"

Message communicating that all pokemon have had their stat boosts cleared.

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_clearpositiveboost","title":"BattleMessage_clearpositiveboost","text":"

Message communicating that a pokemon has had its positive stat boosts cleared.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that had its positive stat boosts cleared.

TYPE: PokemonIdentifier

EFFECT

The effect causing this positive boost clearance

TYPE: Effect

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_clearnegativeboost","title":"BattleMessage_clearnegativeboost","text":"

Message communicating that a pokemon has had its negative stat boosts cleared.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that had its negative stat boosts cleared.

TYPE: PokemonIdentifier

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_copyboost","title":"BattleMessage_copyboost","text":"

Message communicating that a pokemon has had its stat boosts copied.

Warning

Not yet implemented!

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that had its stat boosts copied.

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_weather","title":"BattleMessage_weather","text":"

Message communicating that the weather has changed.

ATTRIBUTE DESCRIPTION WEATHER

The weather being set

TYPE: DexWeather.ValueType

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_fieldstart","title":"BattleMessage_fieldstart","text":"

Message communicating that a field condition has started.

ATTRIBUTE DESCRIPTION EFFECT

The effect starting for the field.

TYPE: Effect

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_fieldend","title":"BattleMessage_fieldend","text":"

Message communicating that a field condition has ended.

ATTRIBUTE DESCRIPTION EFFECT

The effect ending for the field.

TYPE: Effect

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_sidestart","title":"BattleMessage_sidestart","text":"

Message communicating that a side condition has started.

ATTRIBUTE DESCRIPTION PLAYER

The player id of the impacted player

TYPE: str

CONDITION

The field condition starting

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_sideend","title":"BattleMessage_sideend","text":"

Message communicating that a side condition has ended.

ATTRIBUTE DESCRIPTION PLAYER

The player id of the impacted player

TYPE: str

CONDITION

The field condition starting

TYPE: str

EFFECT

The effect that is causing the conditon to end

TYPE: Optional[Effect]

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_swapsideconditions","title":"BattleMessage_swapsideconditions","text":"

Message communicating that a side condition has been swapped.

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_volstart","title":"BattleMessage_volstart","text":"

Message communicating that a volatile effect has started.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon this volatile effect is started for

TYPE: PokemonIdentifier

EFFECT

The effect that caused this volatile status

TYPE: Optional[Effect]

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_volend","title":"BattleMessage_volend","text":"

Message communicating that a volatile effect has ended.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon this volatile effect is ended for

TYPE: PokemonIdentifier

EFFECT

The effect that caused this volatile status

TYPE: Effect

SILENT

Whether this message is silent or not

TYPE: bool

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_crit","title":"BattleMessage_crit","text":"

Message communicating that a pokemon has had a critical hit.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that had a critical hit

TYPE: PokemonIdentifier

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_supereffective","title":"BattleMessage_supereffective","text":"

Message communicating that a pokemon has been hit super effectively.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that was hit super effectively

TYPE: PokemonIdentifier

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_resisted","title":"BattleMessage_resisted","text":"

Message communicating that a pokemon has resisted an attack.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that resisted the attack

TYPE: PokemonIdentifier

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_immune","title":"BattleMessage_immune","text":"

Message communicating that a pokemon has been immune to an attack.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that was immune to the attack

TYPE: PokemonIdentifier

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_item","title":"BattleMessage_item","text":"

Message communicating that a pokemon has had its item revealed.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon whose item is revealed

TYPE: PokemonIdentifier

ITEM

The item being revealed

TYPE: str

EFFECT

The effect that revealed the item, if applicable. Not used when auto-revealed (air balloon)

TYPE: Optional[Effect]

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_enditem","title":"BattleMessage_enditem","text":"

Message communicating that a pokemon has had its item destroyed.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon whose item is destroyed

TYPE: PokemonIdentifier

ITEM

The item being destroyed

TYPE: str

EFFECT

The effect that destroyed the item, if applicable.

TYPE: Optional[Effect]

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_ability","title":"BattleMessage_ability","text":"

Message communicating that a pokemon has had its ability revealed.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon whose ability is revealed

TYPE: PokemonIdentifier

ABILITY

The ability being revealed

TYPE: DexAbility.ValueType

EFFECT

The effect that revealed the ability, if applicable.

TYPE: Optional[Effect]

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_endability","title":"BattleMessage_endability","text":"

Message communicating that a pokemon has had its ability suppressed.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon whose ability is suppressed

TYPE: PokemonIdentifier

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_transform","title":"BattleMessage_transform","text":"

Message communicating that a pokemon has transformed into another pokemon.

ATTRIBUTE DESCRIPTION SOURCE

The pokemon transforming

TYPE: PokemonIdentifier

TARGET

The pokemon it's transforming into

TYPE: PokemonIdentifier

EFFECT

The optional effect explaining the transformation

TYPE: Optional[Effect]

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_mega","title":"BattleMessage_mega","text":"

Message communicating that a pokemon has mega evolved.

Warning

Not implemented yet.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that mega evolved

TYPE: PokemonIdentifier

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_primal","title":"BattleMessage_primal","text":"

Message communicating that a pokemon has gone primal.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon going primal

TYPE: PokemonIdentifier

ITEM

The held item that is being used

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_burst","title":"BattleMessage_burst","text":"

Message communicating that a pokemon has burst.

Warning

Not implemented yet.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that burst

TYPE: PokemonIdentifier

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_zpower","title":"BattleMessage_zpower","text":"

Message communicating that a pokemon has used a Z move.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon using the Z move

TYPE: PokemonIdentifier

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_zbroken","title":"BattleMessage_zbroken","text":"

Message communicating that a pokemon's Z move is over.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon whose Z move is over

TYPE: PokemonIdentifier

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_activate","title":"BattleMessage_activate","text":"

Message communicating that a pokemon has activated an effect.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon activating the effect

TYPE: PokemonIdentifier

EFFECT

The effect being activated

TYPE: Effect

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_hint","title":"BattleMessage_hint","text":"

Message communicating that a hint has been sent to the player.

ATTRIBUTE DESCRIPTION MESSAGE

The message sent to you as a hint

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_center","title":"BattleMessage_center","text":"

Message communicating that the pokemon in a triple battle have been centered.

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_message","title":"BattleMessage_message","text":"

Message communicating that a message has been sent.

ATTRIBUTE DESCRIPTION MESSAGE

The message sent as part of this notification

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_combine","title":"BattleMessage_combine","text":"

Message communicating that two moves have been combined.

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_waiting","title":"BattleMessage_waiting","text":"

Message communicating that a pokemon is waiting for the target.

Warning

Not implemented yet.

ATTRIBUTE DESCRIPTION POKEMON

The main pokemon identifier relevant

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_prepare","title":"BattleMessage_prepare","text":"

Message communicating that a pokemon is preparing a move.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon preparing the move

TYPE: PokemonIdentifier

MOVE

The move being prepared

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_mustrecharge","title":"BattleMessage_mustrecharge","text":"

Message communicating that a pokemon must recharge.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that must recharge

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_nothing","title":"BattleMessage_nothing","text":"

Message communicating that nothing happened.

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_hitcount","title":"BattleMessage_hitcount","text":"

Message communicating that a pokemon has been hit multiple times.

ATTRIBUTE DESCRIPTION POKEMON

The Pokemon being hit multiple times. Can be slotless

TYPE: PokemonIdentifier

NUM

The number of hits as an integer

TYPE: int

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_singlemove","title":"BattleMessage_singlemove","text":"

Message communicating that a pokemon has used a single move.

ATTRIBUTE DESCRIPTION POKEMON

The Pokemon using this single move

TYPE: PokemonIdentifier

MOVE

The move being used

TYPE: DexMove.ValueType

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_singleturn","title":"BattleMessage_singleturn","text":"

Message communicating that a pokemon has used a single turn move.

ATTRIBUTE DESCRIPTION POKEMON

The Pokemon using this single move

TYPE: PokemonIdentifier

MOVE

The move being used

TYPE: DexMove.ValueType

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_formechange","title":"BattleMessage_formechange","text":"

Message communicating that a pokemon has changed formes.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon changing formes in some temporary way

TYPE: PokemonIdentifier

SPECIES

The species for this pokemon, including forme

TYPE: DexPokemon.ValueType

EFFECT

Optionally, what caused the formechange

TYPE: Optional[Effect]

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_terastallize","title":"BattleMessage_terastallize","text":"

Message communicating that a pokemon has terastallized.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon doing the terastallization

TYPE: PokemonIdentifier

TYPE

The type being terastallized

TYPE: DexType.ValueType

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_fieldactivate","title":"BattleMessage_fieldactivate","text":"

Message communicating that a field effect has been activated.

ATTRIBUTE DESCRIPTION EFFECT

The effect causing the field activation

TYPE: Effect

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_error","title":"BattleMessage_error","text":"

Message communicating that an error has occurred.

ATTRIBUTE DESCRIPTION MESSAGE

The error message sent by showdown

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_bigerror","title":"BattleMessage_bigerror","text":"

Message communicating that a big error has occurred.

ATTRIBUTE DESCRIPTION MESSAGE

The error message sent by showdown

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_init","title":"BattleMessage_init","text":"

Message communicating that a battle has been initialized.

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_deinit","title":"BattleMessage_deinit","text":"

Message communicating that a battle has been deinitialized.

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_title","title":"BattleMessage_title","text":"

Message communicating that a title has been sent for this battle.

ATTRIBUTE DESCRIPTION TITLE

The title of this match as shown on pokemon showdown

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_join","title":"BattleMessage_join","text":"

Message communicating that a player has joined the battle.

ATTRIBUTE DESCRIPTION USERNAME

The username of the joining player

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_leave","title":"BattleMessage_leave","text":"

Message communicating that a player has left the battle.

ATTRIBUTE DESCRIPTION USERNAME

The username of the leaving player

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_raw","title":"BattleMessage_raw","text":"

Message communicating that a raw message has been sent.

ATTRIBUTE DESCRIPTION MESSAGE

The raw message from Showdown. Typically used for rating changes.

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_anim","title":"BattleMessage_anim","text":"

Message communicating that an override animation has been sent.

Warning

This has not been fully implemented / tested on large data yet.

ATTRIBUTE DESCRIPTION SOURCE

The pokemon using the move

TYPE: PokemonIdentifier

TARGET

The pokemon being targeted by the move. If there is no target then this will instead be slotless

TYPE: PokemonIdentifier

MOVE

The move being used

TYPE: DexMove.ValueType

NO_TARGET

Whether the move is labeled as notarget or not

TYPE: bool

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#message-utility-classes","title":"Message Utility Classes","text":"

Contains BaseModels for BattleMessage parsing and processing.

Remember to use BattleMessage.from_message directly, unless you are building test cases where you want to assert that a given message leads to a certain subclass of BattleMessage. from_message will auto-detect which BMType the given message corresponds to, and return the associated subclass (or an error detailing what went wrong) for you.

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BMType","title":"BMType","text":"

String-Enum for holding all unique categories of Showdown Battle Messages.

See https://github.com/smogon/pokemon-showdown/blob/master/sim/SIM-PROTOCOL.md for the full list of battle messages

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.PokeStat","title":"PokeStat","text":"

Helper enum for identifying valid stats.

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.PokemonIdentifier","title":"PokemonIdentifier","text":"

A BaseModel giving details about which Pokemon is being talked about.

Attributes:

Name Type Description IDENTITY str

The unique identifier for a pokemon. Looks like ARCANINE if the input is p1: Arcanine

PLAYER str

The player this pokemon belongs to

SLOT Optional[str]

Optionally, the slot this pokemon is in. Will be None if slot info isn't given in the message

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.PokemonIdentifier.from_ident_string","title":"from_ident_string(ident) staticmethod","text":"

Create a new PokemonIdentifier from an identifier string without slot information.

Parameters:

Name Type Description Default ident str

An input string to extract field information from. Looks like \"p1: Arcanine\"

required

Returns:

Name Type Description PokemonIdentifier PokemonIdentifier

A newly created PokemonIdentifier object from this string

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.PokemonIdentifier.from_slot_string","title":"from_slot_string(slot) staticmethod","text":"

Create a new PokemonIdentifier from an identifier string with slot information.

Parameters:

Name Type Description Default slot str

An input string to extract field information from. Looks like \"p1a: Arcanine\"

required

Returns:

Name Type Description PokemonIdentifier PokemonIdentifier

A newly created PokemonIdentifier object from this string

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.PokemonIdentifier.from_string","title":"from_string(string) staticmethod","text":"

Auto-Create a new PokemonIdentifier based on which type of identity string is given.

Parameters:

Name Type Description Default string str

An input string to extract field information from. Looks like \"p1a: Arcanine\"

required

Returns:

Name Type Description PokemonIdentifier PokemonIdentifier

A newly created PokemonIdentifier object from this string

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.EffectType","title":"EffectType","text":"

Helper class to identify which category of effect is being activated.

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.Effect","title":"Effect","text":"

A helper class for many Battle Message types that rely on something happening to cause the message effect.

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.RequestPoke","title":"RequestPoke","text":"

A helper class to contain details about a pokemon held in the side data of a request.

Attributes:

Name Type Description IDENT PokemonIdentifier

The string pokemon identifier (without slot information)

SPECIES DexPokemon.ValueType

The species for this pokemon, including forme

LEVEL int

The level of this pokemon

GENDER Optional[Literal['M', 'F']]

The gender of this pokemon

SHINY bool

Whether the pokemon is shiny or not

TERA Optional[DexType.ValueType]

If this pokemon is teratyped, the DexType of the new type. Else None.

CUR_HP int

The current HP of the pokemon

MAX_HP Optional[int]

The maximum HP of the pokemon, None if the pokemon is fainted

STATUS Optional[DexStatus.ValueType]

The status of the pokemon. Can be None if there is no status

ACTIVE bool

Whether the pokemon is active or not

STATS Dict[PokeStat, int]

A dictionary of stat->values for each stat of this pokemon (before modifiers)

MOVES List[DexMove.ValueType]

The list of moves this pokemon knows, without pp information

BASE_ABILITY DexAbility.ValueType

The base ability of this pokemon, ignoring any ability switching shenanigans

ABILITY Optional[DexAbility.ValueType]

The current ability of this pokemon. Only used in certain gens, can be None

ITEM Optional[DexItem.ValueType]

The held item of this pokemon. None if no item is held

POKEBALL str

Which pokeball this pokemon is contained in

COMMANDING Optional[bool]

Tatsugiri commander mechanic. True if active, false if not, None if older gen

REVIVING Optional[bool]

Revival Blessing flag (I think?)

TERATYPE Optional[DexType.ValueType]

The type that this pokemon can teratype into

TERASTALLIZED Optional[DexType.ValueType]

The type that this pokemon is teratyped into. None if not applicable

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.MoveData","title":"MoveData","text":"

A helper class to contain details about a move held in the active data for a request.

Attributes:

Name Type Description NAME str

The friendly name of the move

ID DexMove.ValueType

The id of the move

CUR_PP Optional[int]

The integer amount of times this move can still be used. None if Trapped

MAX_PP Optional[int]

The integer amount of times this move can ever be used. None if Trapped

TARGET Optional[DexMoveTarget.ValueType]

The targetting type of this move. None if Trapped

DISABLED Optional[bool]

Whether this move is disabled or not. None if Trapped

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.ActiveOption","title":"ActiveOption","text":"

A helper class to contain details about all moves available for an active pokemon in a request.

Attributes:

Name Type Description MOVES List[MoveData]

A list of available moves for this slot

CAN_MEGA bool

Whether the pokemon can mega evolve

CAN_ZMOVE bool

Whether the pokemon can zmove

CAN_DYNA bool

Whether the pokemon can dynamax

CAN_TERA bool

Whether the pokemon can teratype

TRAPPED bool

Whether the user is trapped

"},{"location":"showdown/reference/standard-messages/","title":"The Standard Showdown Message","text":""},{"location":"showdown/reference/standard-messages/#the-message-object","title":"The Message object","text":"

The base class for all specific Message subclasses to be built from.

When parsing a string message, you should directly use this class's from_message function, which will auto-identify which subclass (if any) the given string belongs to.

Across all Messages, you will be able to access both MTYPE and MESSAGE, though you shouldn't need to access MESSAGE directly. (If you do, then we must be missing some data that exists in the raw string)

ATTRIBUTE DESCRIPTION MTYPE

The message type of this message. Must be a vaild showdown general message.

TYPE: MType

MESSAGE

The raw message line as sent from showdown. Shouldn't need to be used but worth keeping.

TYPE: str

"},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.Message.from_message","title":"from_message(message) staticmethod","text":"

Create a specific Message object from a raw string message.

This is used for general Showdown Messages, compared to the BattleMessage class meant for battle details.

PARAMETER DESCRIPTION message

The newline-stripped single string message as sent by the server.

TYPE: str

RETURNS DESCRIPTION Message

An initialized subclass of Message, for the corresponding class for this message type.

TYPE: 'Message'

"},{"location":"showdown/reference/standard-messages/#message-subclasses","title":"Message Subclasses","text":"

Contains BaseModels for Message parsing and processing.

Remember to use Message.from_message directly, unless you are building test cases where you want to assert that a given message leads to a certain subclass of Message. from_message will auto-detect which MType the given message corresponds to, and return the associated subclass (or an error detailing what went wrong) for you.

"},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.Message_challstr","title":"Message_challstr","text":"

Message containing a login challenge string.

ATTRIBUTE DESCRIPTION CHALLSTR

The string challenge string

TYPE: str

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.Message_customgroups","title":"Message_customgroups","text":"

Message containing info about server custom groups.

ATTRIBUTE DESCRIPTION CUSTOM_GROUPS

The list of custom groups

TYPE: List[CustomGroup]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.Message_formats","title":"Message_formats","text":"

Message containing info about server enabled formats.

ATTRIBUTE DESCRIPTION FORMATS

The list of formats

TYPE: List[str]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.Message_init","title":"Message_init","text":"

Message notifying about a battle starting.

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.Message_join","title":"Message_join","text":"

Message containing info about a joining user.

ATTRIBUTE DESCRIPTION USERNAME

The username of the joining player

TYPE: str

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.Message_leave","title":"Message_leave","text":"

Message containing info about a leaving user.

ATTRIBUTE DESCRIPTION USERNAME

The username of the leaving player

TYPE: str

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.Message_pm","title":"Message_pm","text":"

Message containing a PM to/from the user.

ATTRIBUTE DESCRIPTION SOURCE

The username of the user who sent the pm

TYPE: str

TARGET

The username of the user who received the pm

TYPE: str

PM

The message. Newlines are denoted with |

TYPE: str

IS_CHALLENGE

Whether this PM is a challenge to a battle

TYPE: bool

CHALLENGE_FORMAT

The format of the challenge if it is a challenge

TYPE: Optional[str]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.Message_title","title":"Message_title","text":"

Message notifying about the title of a room.

ATTRIBUTE DESCRIPTION TITLE

The title of this match as shown on pokemon showdown

TYPE: str

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.Message_updatechallenges","title":"Message_updatechallenges","text":"

Message containing a current challenge searches, if any.

ATTRIBUTE DESCRIPTION OUTGOING

A dictionary of username->format for each outgoing challenge

TYPE: Dict[str, str]

INCOMING

A dictionary of username->format for each incoming challenge

TYPE: Dict[str, str]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.Message_updatesearch","title":"Message_updatesearch","text":"

Message containing a current ladder searches, if any.

ATTRIBUTE DESCRIPTION SEARCHING

A list of formats currently searching for a ladder match

TYPE: List[str]

GAMES

A optional dictionary of game-id->format of currently ongoing games

TYPE: Optional[Dict[str, str]]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.Message_updateuser","title":"Message_updateuser","text":"

Message containing info about your user settings / login information.

ATTRIBUTE DESCRIPTION USERNAME

The username of your current login

TYPE: str

NAMED

Whether you are currently logged in or not

TYPE: bool

AVATAR

Either a number id of the user's avatar or a custom value

TYPE: Union[int, str]

SETTINGS

The user settings for your current user session

TYPE: UserSettings

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/standard-messages/#message-utility-classes","title":"Message Utility Classes","text":"

Contains BaseModels for Message parsing and processing.

Remember to use Message.from_message directly, unless you are building test cases where you want to assert that a given message leads to a certain subclass of Message. from_message will auto-detect which MType the given message corresponds to, and return the associated subclass (or an error detailing what went wrong) for you.

"},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.CustomGroup","title":"CustomGroup","text":"

A helper class to contain information about server custom groups.

"},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.MType","title":"MType","text":"

String-Enum for holding all unique categories of Showdown Generic Messages.

See https://github.com/smogon/pokemon-showdown/blob/master/PROTOCOL.md for the (partial) list of message types

"},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.UserSettings","title":"UserSettings","text":"

A helper class to contain information about user settings.

Attributes:

Name Type Description BLOCK_CHALLENGES bool

Whether you are currently blocking challenges

BLOCK_PMS bool

Whether you are currently blocking PMs

IGNORE_TICKETS bool

Whether you are currently ignoring tickets

HIDE_BATTLES bool

Whether you are currently hiding battles on your trainer card

BLOCK_INVITES bool

Whether you are currently blocking invites

DO_NOT_DISTURB bool

Your current do not disturb setting

BLOCK_FRIEND_REQUESTS bool

Whether you are currently blocking friend requests

ALLOW_FRIEND_NOTIFICATIONS bool

Whether you are currently allowing friend notifications

DISPLAY_BATTLES bool

Whether you are currently displaying battles to friends

HIDE_LOGINS bool

Whether you are currently hiding logins

HIDDEN_NEXT_BATTLE bool

Whether you are hiding your next battle or not

INVITE_ONLY_NEXT_BATTLE bool

Whether you are limiting your next battle to invite only or not

LANGUAGE Optional[str]

The language set by your user

"}]} \ No newline at end of file +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Welcome to the Poketypes Docs!","text":"

This site contains the project documentation for the poketypes project, whose goal is to provide clear, consistent, correct data about Pokemon, using the same base data as Pokemon Showdown.

"},{"location":"#table-of-contents","title":"Table Of Contents","text":"

This package provides two very useful modules for handling Pokemon data:

Based on the needs of your project, you may need one or both of these.

There is also the module protos, which contains the logic for generating the DexClass core Enums used in dex. As an end-user of the typing and data structures in ths package, you don't need to access anything in protos, however, if you want to have data-structure / enum support for more niche showdown mods, contributions to the protos class would be greatly appreciated.

"},{"location":"#project-overview","title":"Project Overview","text":"

Fully type-hinted, consistently labeled, feature rich information about Pokemon.

Modules exported by this package "},{"location":"about/about/","title":"The Core Team","text":""},{"location":"about/changelog/","title":"Changelog","text":"

Changelog will not be 100% accurate until the official 1.0.0 release. Right now each release is a mash-up of various message tweaks, documenation additions, field reworkings, etc..

I'll try to keep a generally accurate log until then mostly for my own benefit, but take it with a grain of salt

"},{"location":"about/changelog/#021","title":"0.2.1","text":""},{"location":"about/changelog/#changed","title":"Changed","text":""},{"location":"about/changelog/#020","title":"0.2.0","text":""},{"location":"about/changelog/#added","title":"Added","text":""},{"location":"about/changelog/#changed_1","title":"Changed","text":""},{"location":"about/changelog/#010","title":"0.1.0","text":""},{"location":"about/changelog/#added_1","title":"Added","text":""},{"location":"about/license/","title":"License","text":"

MIT License

Copyright (c) 2023 Trevor Wieland

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

"},{"location":"dex/","title":"Dex Intro","text":""},{"location":"dex/#5-minute-summary","title":"5-Minute Summary","text":"

In the poketypes package, we include the module dex, which contains two different types of data structures, so-called DexClass Enums, which contain uniquely enumerated labels for everything from pokemon formes to items to moves and more. The other contained data structure is the PokedexClass BaseModel, which are pydantic BaseModels, meant for holding reference material about a specific corresponding DexClass label.

For example, one specific DexClass is the DexPokemon, an Enum which maps every distinct pokemon forme (base, cosmetic, temporary, etc.) to a unique integer. So we have things like DexPokemon.POKEMON_MAGIKARP, which is mapped to the integer 129000. Then, we have the PokedexPokemon BaseModel, whose purpose would be to store all useful information about each specific corresponding DexPokemon id, such as the types of the pokemon (each stored as a DexType), the learnset of the pokemon (stored as DexMove), etc..

This means that if you are building logic for interpretting a pokemon battle, rather than relying on string comparisons which can both be slow and inconsistent, you can instead use included functions such as cast2dex, which can take input strings and a relevant DexClass, and return the correct label to use.

These extra layers of labeling may seem cumbersome to work with at first, but since we provide all of the cleaning functions you could need to transform between them, the trade-off for using just a few extra lines of code is 100% guarunteed label consistency and accuracy, with minimal risk of typos.

For instance, you might care about checking if an opponent pokemon can potentially have the ability levitate. Then you could directly use DexAbility.ABILITY_LEVITATE, checking if this label exists in the corresponding PokedexPokemon.abilities. Since no string comparisons are happening, there's no risk of accidentally spelling levitate wrong since the type hinting will inform you.

Lastly, there is the actual pokedex instances, which are accessed by calling dex.gen(). This returns a pydantic object that has a pre-instantiated dictionary for Pokemon, Moves, and Items, which each map from their corresponding DexClass to their corresponding PokedexClass. For example, dex.gen(5).pokemon[DexPokemon.POKEMON_MAGIKARP] will return the PokedexPokemon object for Magikarp, will all the details already filled out, as it was in generation 5. If you leave out the gen number, it will automatically use the latest generation available.

"},{"location":"dex/#reference-links","title":"Reference Links","text":"

For details on all the different kinds of DexClasses, see the reference page here

For details on all the different kinds of PokedexClasses, see the reference page here

For details on all the different cleaning utilities, see the reference page here

For details on the gen function, see the reference page here

"},{"location":"dex/reference/dex-classes/","title":"The DexClass","text":"

poketypes.dex.dexdata_pb2 OR directly import from poketypes.dex

"},{"location":"dex/reference/dex-classes/#basics","title":"Basics","text":"

Each DexClass is an auto-generated Enum using google's protobuf library, and the poketypes.protos module. In order to use these Enums, you do not need to have the library installed, however if you want to generate your own Enums in this way, or modify how the existing ones are generating, you will need to do so.

Follow the steps in the contributing to get your local environment setup if you want to develop changes for these Enums.

"},{"location":"dex/reference/dex-classes/#reference","title":"Reference","text":"

Generated protocol buffer code.

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexStat","title":"DexStat","text":"

Represents possible stats

Options:

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexGen","title":"DexGen","text":"

Represents supported Generations

Each integer gen is represented as its integer value.

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexMoveCategory","title":"DexMoveCategory","text":"

Represents possible move categories

Options:

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexMoveTarget","title":"DexMoveTarget","text":"

Represents possible move targets

Options:

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexType","title":"DexType","text":"

Auto-Generated by protogen.py Contains data for Gen 9

Represents possible Types

Options:

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexNature","title":"DexNature","text":"

Represents possible Natures

Options:

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexPokemon","title":"DexPokemon","text":"

Represents possible Pokemons

Options:

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexMove","title":"DexMove","text":"

Represents possible Moves

Options:

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexItem","title":"DexItem","text":"

Represents possible Items

Options:

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexStatus","title":"DexStatus","text":"

Represents possible Statuss

Options:

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexWeather","title":"DexWeather","text":"

Represents possible Weathers

Options:

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexCondition","title":"DexCondition","text":"

Represents possible Conditions

Options:

"},{"location":"dex/reference/dex-classes/#poketypes.dex.dexdata_pb2.DexAbility","title":"DexAbility","text":"

Represents possible Abilitys

Options:

"},{"location":"dex/reference/pokedex-classes/","title":"The PokedexClass","text":"

poketypes.dex.pokedex OR directly import from poketypes.dex

"},{"location":"dex/reference/pokedex-classes/#basics","title":"Basics","text":"

Each PokedexClass is a pydantic BaseModel, holding every possibly-useful attribute sourced directly from pokemon showdown typescript files as the ground truth.

"},{"location":"dex/reference/pokedex-classes/#reference","title":"Reference","text":"

Provides BaseModels for accessing real information about specific items/pokemon/moves/etc.

All Pokedex{NAME} classes are defined in this module, though you can also import these directly from poketypes.dex.

"},{"location":"dex/reference/pokedex-classes/#poketypes.dex.pokedex.PokedexMove","title":"PokedexMove","text":"

Pokedex class for Move information.

ATTRIBUTE DESCRIPTION name

The friendly string name of this move

TYPE: str

id

The DexMove ID of this move

TYPE: DexMove.ValueType

base_power

The base power of the move

TYPE: int

pp

The pp of this move

TYPE: int

priority

The priority of the move

TYPE: int

crit_ratio

The crit ratio of the move (e.g. 2 = twice the chance to crit)

TYPE: int

category

The move category as a DexMoveCategory

TYPE: DexMoveCategory.ValueType

target

The target type of this move

TYPE: DexMoveTarget.ValueType

mtype

The type of the move

TYPE: DexType.ValueType

breaks_protect

Whether the move breaks target protect

TYPE: bool

ignore_ability

Whether the move ignores target ability

TYPE: bool

ignore_defensive

Whether the move ignores target defensive boosts

TYPE: bool

ignore_evasion

Whether the move ignores target evasion boosts

TYPE: bool

ignore_immunity

Whether the move ignores target immunity to this move type

TYPE: bool

multiaccuracy

Whether the multihit move is all or nothing

TYPE: bool

ohko

Whether the move is a one-hit-ko

TYPE: bool

stalling_move

Whether the move is considered a stalling move

TYPE: bool

will_crit

Whether the move will 100% crit if it lands

TYPE: bool

has_crash_damage

Whether the move does damage to its user on failure

TYPE: bool

has_sheer_force

The move is always boosted by sheer-force without losing benefit

TYPE: bool

selfdestruct_always

Whether this move always causes the user to faint

TYPE: bool

selfdestruct_ifhit

Whether the move causes the user to faint if and only if it hits

TYPE: bool

steals_boosts

Whether the move steals the targets boosts

TYPE: bool

level_damage

Whether the move does damage based on the level of the user

TYPE: bool

force_switch

Whether the move forces the target to switch out

TYPE: bool

mindblown_recoil

Whether the move has special 'Mind Blown' style recoil

TYPE: bool

struggle_recoil

Whether the move has special 'Struggle' style recoil

TYPE: bool

smart_target

Whether the move uses smart targetting

TYPE: bool

thaws_target

Whether the move thaws target as a special effect

TYPE: bool

tracks_target

Whether the move ignores draw-in move/abilities.

TYPE: bool

selfswitch_standard

Whether the move is a typical self-switching move. Teleport/U-Turn/etc

TYPE: bool

selfswitch_volatile

Whether the move is a volatile-keeping self-switching move. Baton Pass

TYPE: bool

selfswitch_shedtail

Whether the move is a substitue creating self-switching move. Shed Tail

TYPE: bool

sleep_usable

Whether the move can be used when sleeping

TYPE: bool

no_metronome

Whether the move can NOT be used as a result of metronome

TYPE: bool

no_sketch

Whether the move can NOT be copied as a result of sketch

TYPE: bool

no_ppboosts

Whether the move can NOT have its pp boosted beyond default

TYPE: bool

accuracy

The accuracy of this move. Optional if the move bypasses accuracy

TYPE: Optional[int]

multihit

The move hits multiple times from slot0 - slot1 times inclusive. Optional

TYPE: Optional[Tuple[int, int]]

drain

The move drains hp: (slot0 / slot1) times damage dealt. Optional

TYPE: Optional[Tuple[int, int]]

heal

The move directly heals hp: (slot0 / slot1) times maximum health. Optional

TYPE: Optional[Tuple[int, int]]

recoil

The move recoils back hp: (slot0 / slot1) times damage dealt. Optional

TYPE: Optional[Tuple[int, int]]

boosts

Any boosts for the target this move provides (100%). Optional

TYPE: Optional[Dict[DexStat.ValueType, int]]

direct_damage

An integer exact amount of damage the move does. Optional

TYPE: Optional[int]

weather

The weather started by this move. Optional

TYPE: Optional[DexWeather.ValueType]

flag_allyanim

MOVE FLAG: allyanim

TYPE: bool

flag_bite

MOVE FLAG: bite

TYPE: bool

flag_bullet

MOVE FLAG: bullet

TYPE: bool

flag_bypasssub

MOVE FLAG: bypasssub

TYPE: bool

flag_cantusetwice

MOVE FLAG: cantusetwice

TYPE: bool

flag_charge

MOVE FLAG: charge

TYPE: bool

flag_contact

MOVE FLAG: contact

TYPE: bool

flag_dance

MOVE FLAG: dance

TYPE: bool

flag_defrost

MOVE FLAG: defrost

TYPE: bool

flag_distance

MOVE FLAG: distance

TYPE: bool

flag_failcopycat

MOVE FLAG: failcopycat

TYPE: bool

flag_failencore

MOVE FLAG: failencore

TYPE: bool

flag_failinstruct

MOVE FLAG: failinstruct

TYPE: bool

flag_failmefirst

MOVE FLAG: failmefirst

TYPE: bool

flag_failmimic

MOVE FLAG: failmimic

TYPE: bool

flag_futuremove

MOVE FLAG: futuremove

TYPE: bool

flag_gravity

MOVE FLAG: gravity

TYPE: bool

flag_heal

MOVE FLAG: heal

TYPE: bool

flag_mirror

MOVE FLAG: mirror

TYPE: bool

flag_mustpressure

MOVE FLAG: mustpressure

TYPE: bool

flag_noassist

MOVE FLAG: noassist

TYPE: bool

flag_nonsky

MOVE FLAG: nonsky

TYPE: bool

flag_noparentalbond

MOVE FLAG: noparentalbond

TYPE: bool

flag_nosleeptalk

MOVE FLAG: nosleeptalk

TYPE: bool

flag_pledgecombo

MOVE FLAG: pledgecombo

TYPE: bool

flag_powder

MOVE FLAG: powder

TYPE: bool

flag_protect

MOVE FLAG: protect

TYPE: bool

flag_pulse

MOVE FLAG: pulse

TYPE: bool

flag_punch

MOVE FLAG: punch

TYPE: bool

flag_recharge

MOVE FLAG: recharge

TYPE: bool

flag_reflectable

MOVE FLAG: reflectable

TYPE: bool

flag_slicing

MOVE FLAG: slicing

TYPE: bool

flag_snatch

MOVE FLAG: snatch

TYPE: bool

flag_sound

MOVE FLAG: sound

TYPE: bool

flag_wind

MOVE FLAG: wind

TYPE: bool

"},{"location":"dex/reference/pokedex-classes/#poketypes.dex.pokedex.PokedexItem","title":"PokedexItem","text":"

Pokedex class for Item information.

ATTRIBUTE DESCRIPTION name

The friendly string name of this item

TYPE: str

id

The DexItem ID of this item

TYPE: DexItem.ValueType

is_gem

Whether the item is a gem or not

TYPE: bool

is_berry

Whether the item is a berry

TYPE: bool

naturalgift_base_power

If this item is usable with Natural Gift, what is the base power

TYPE: Optional[int]

naturalgift_type

If this item is usable with Natural Gift, what is the type

TYPE: Optional[DexType.ValueType]

item_users

A list of intended holders of this item

TYPE: List[DexPokemon.ValueType]

zmove_to

What move this zmove transforms the move into

TYPE: Optional[DexMove.ValueType]

zmove_from

What special move this zmove transforms

TYPE: Optional[DexMove.ValueType]

mega_evolves

Which base-forme pokemon this megastone evolves from. Optional

TYPE: Optional[DexPokemon.ValueType]

mega_forme

Which mega-forme pokemon this megastone evolves into. Optional

TYPE: Optional[DexPokemon.ValueType]

ignore_klutz

Whether the item ignores klutz

TYPE: bool

fling_basepower

The basepower of fling when flinging this item. None if n/a

TYPE: Optional[int]

"},{"location":"dex/reference/pokedex-classes/#poketypes.dex.pokedex.StatBlock","title":"StatBlock","text":"

Helper object for containing base stats information.

ATTRIBUTE DESCRIPTION hp_stat

The base hp of the pokemon

TYPE: int

atk_stat

The base attack of the pokemon

TYPE: int

def_stat

The base defence of the pokemon

TYPE: int

spa_stat

The base special attack of the pokemon

TYPE: int

spd_stat

The base special defence of the pokemon

TYPE: int

spe_stat

The base speed of the pokemon

TYPE: int

"},{"location":"dex/reference/pokedex-classes/#poketypes.dex.pokedex.PokedexPokemon","title":"PokedexPokemon","text":"

Pokedex class for Pokemon information.

ATTRIBUTE DESCRIPTION name

The friendly string name of this pokemon

TYPE: str

id

The DexPokemon ID of this pokemon

TYPE: DexPokemon.ValueType

base_name

The friendly string name of this pokemon's base forme

TYPE: str

base_id

The DexPokemon ID of this pokemon's base forme

TYPE: DexPokemon.ValueType

types

The types of this pokemon

TYPE: List[DexType.ValueType]

base_stats

The base stat block of this pokemon

TYPE: StatBlock

abilities

The list of abilities this pokemon can have

TYPE: List[DexAbility.ValueType]

"},{"location":"dex/reference/utilities/","title":"Utilities","text":"

There are also a few utility functions provided to help the user convert typical string names to the relevant ID for their corresponding Dex Class.

"},{"location":"dex/reference/utilities/#dex-data-utilities","title":"Dex Data Utilities:","text":"

Provides tools for cleaning Dex IDs back and forth from strings, as well as other utility functions.

"},{"location":"dex/reference/utilities/#poketypes.dex.dexdata.cast2dex","title":"cast2dex(name, dex_class)","text":"

Clean and cast name to the corresponding entry in the given dex_class.

EX: Magikarp -> Cleaned to: MAGIKARP -> DexPokemon.POKEMON_MAGIKARP (Which is secretly the int 129000)

EX: Scizor-Mega -> Cleaned to: SCIZORMEGA -> DexPokemon.POKEMON_SCIZORMEGA (Which is secretly the int 208001)

Parameters:

Name Type Description Default name str

The name of the entry.

required dex_class AnyDex

Which Dex Enum to use in labeling. Must be a valid Dex{NAME} class.

required

Returns:

Name Type Description int int

The corresponding value for this cleaned entry.

Source code in poketypes\\dex\\dexdata.py
def cast2dex(name: str, dex_class: AnyDex) -> int:\n    \"\"\"Clean and cast name to the corresponding entry in the given dex_class.\n\n    EX:\n    Magikarp -> Cleaned to: MAGIKARP -> DexPokemon.POKEMON_MAGIKARP (Which is secretly the int 129000)\n\n    EX:\n    Scizor-Mega -> Cleaned to: SCIZORMEGA -> DexPokemon.POKEMON_SCIZORMEGA (Which is secretly the int 208001)\n\n    Args:\n        name (str): The name of the entry.\n        dex_class (AnyDex): Which Dex Enum to use in labeling. Must be a valid Dex{NAME} class.\n\n    Returns:\n        int: The corresponding value for this cleaned entry.\n    \"\"\"\n    clean_id = clean_name(name)\n\n    if clean_id is None:\n        return clean_id\n\n    if dex_class == DexAbility:\n        return DexAbility.Value(f\"ABILITY_{clean_id}\")\n    elif dex_class == DexCondition:\n        return DexCondition.Value(f\"CONDITION_{clean_id}\")\n    elif dex_class == DexGen:\n        return DexGen.Value(f\"GEN_{clean_id}\")\n    elif dex_class == DexItem:\n        return DexItem.Value(f\"ITEM_{clean_id}\")\n    elif dex_class == DexMove:\n        return DexMove.Value(f\"MOVE_{clean_id}\")\n    elif dex_class == DexMoveCategory:\n        return DexMoveCategory.Value(f\"MOVECATEGORY_{clean_id}\")\n    elif dex_class == DexMoveTarget:\n        return DexMoveTarget.Value(f\"MOVETARGET_{clean_id}\")\n    elif dex_class == DexNature:\n        return DexNature.Value(f\"NATURE_{clean_id}\")\n    elif dex_class == DexPokemon:\n        return DexPokemon.Value(f\"POKEMON_{clean_id}\")\n    elif dex_class == DexStat:\n        return DexStat.Value(f\"STAT_{clean_id}\")\n    elif dex_class == DexStatus:\n        return DexStatus.Value(f\"STATUS_{clean_id}\")\n    elif dex_class == DexType:\n        return DexType.Value(f\"TYPE_{clean_id}\")\n    elif dex_class == DexWeather:\n        return DexWeather.Value(f\"WEATHER_{clean_id}\")\n
"},{"location":"dex/reference/utilities/#poketypes.dex.dexdata.clean_forme","title":"clean_forme(species)","text":"

Transform a pokemon species (DexPokemon) into the string name of it's base forme.

Makes use of the fact that DexPokemon are of the form {dex_number}{3-digit forme number}, and that the base forme is always forme-number 000. If this changes, this function will no longer work.

Parameters:

Name Type Description Default species ValueType

The input species to clean to base forme.

required

Returns:

Type Description ValueType

DexPokemon.ValueType: The corresponding ID of the base forme species.

Source code in poketypes\\dex\\dexdata.py
def clean_forme(species: DexPokemon.ValueType) -> DexPokemon.ValueType:\n    \"\"\"Transform a pokemon species (DexPokemon) into the string name of it's base forme.\n\n    Makes use of the fact that DexPokemon are of the form {dex_number}{3-digit forme number},\n    and that the base forme is always forme-number `000`.\n    If this changes, this function will no longer work.\n\n    Args:\n        species (DexPokemon.ValueType): The input species to clean to base forme.\n\n    Returns:\n        DexPokemon.ValueType: The corresponding ID of the base forme species.\n    \"\"\"\n    clean_species = (species // 1000) * 1000\n    return clean_species\n
"},{"location":"dex/reference/utilities/#poketypes.dex.dexdata.clean_name","title":"clean_name(name)","text":"

Format a given uncleaned string name as the format needed for searching the corresponding Enum.

Parameters:

Name Type Description Default name Optional[str]

An optional name to clean. If None is given, we immediately return None.

required

Returns:

Type Description Optional[str]

Optional[str]: The clean-form of the input name, if it wasn't None or blank.

Source code in poketypes\\dex\\dexdata.py
def clean_name(name: Optional[str]) -> Optional[str]:\n    \"\"\"Format a given uncleaned string name as the format needed for searching the corresponding Enum.\n\n    Args:\n        name (Optional[str]): An optional name to clean. If None is given, we immediately return None.\n\n    Returns:\n        Optional[str]: The clean-form of the input name, if it wasn't None or blank.\n    \"\"\"\n    if name is None or name == \"\":\n        return None\n\n    clean_id = (\n        unicodedata.normalize(\n            \"NFKD\",\n            name.upper()\n            .replace(\"-\", \"\")\n            .replace(\"\u2019\", \"\")\n            .replace(\"'\", \"\")\n            .replace(\" \", \"\")\n            .replace(\"*\", \"\")\n            .replace(\":\", \"\")\n            .replace(\"%\", \"\")\n            .replace(\".\", \"\")\n            .replace(\")\", \"\")\n            .replace(\"(\", \"\"),\n        )\n        .encode(\"ASCII\", \"ignore\")\n        .decode(\"ASCII\")\n    )\n    return clean_id\n
"},{"location":"showdown/","title":"Showdown Intro","text":""},{"location":"showdown/#5-minute-summary","title":"5-Minute Summary","text":"

In the poketypes package, we include the module showdown, which contains pydantic BaseModel subclasses for General and Battle Message formats. This allows for a smoother communication process with Pokemon Showdown, as rather than needing to build a message parser yourself, relying on relatively limited documentation from Showdown directly, you can instead build logic to take as input either Message or BattleMessage objects, which will come pre-parsed, with full type-hinting and data validation built in.

To start, you can import both from the module showdown like so:

from poketypes.showdown import Message, BattleMessage\n

Both Message and BattleMessage are subclasses of pydantic.BaseModel, and both also have an additional function called from_message, which takes as input a string, and returns an initialized and parsed object from the input string message.

message = BattleMessage.from_string(\"|poke|p1|Metagross, L80|item\")\n

At this point, message will automatically be identified as a poke battle message, and will be an instance of the class poketypes.showdown.battlemessage.BattleMessage_poke. Rather than checking with isinstance, however, we recommend instead checking the message.BMTYPE (or message.MTYPE for general messages), which is of the type poketypes.showdown.BMType, an Enum of all the different battle message types you can receive. For type hinting purposes, such as in the signature of a function that would process a given BattleMessage subclass, you would do the following:

def process_bm_poke(message: poketypes.showdown.battlemessage.BattleMessage_poke):\n

This will ensure that your IDE will have type hinting support as you process the message, and in the specific example of BattleMessage_poke, will give support in directly accessing the data fields like message.PLAYER that are unique to this BattleMessage subclass.

Check out the Guides in this section for some common use-cases of this module, eith step-by-step instructions on each part of the process. Or if you prefer to learn by reading docs, check out the Reference links below or on the sidebar to familiarize yourself with some of the different categories of messages.

"},{"location":"showdown/#reference-links","title":"Reference Links","text":"

For details on all the different kinds of Message subclasses, see the reference page here

For details on all the different kinds of BattleMessage subclasses, see the reference page here

"},{"location":"showdown/explanations/","title":"Why Two Classes?","text":"

Once you've started using the showdown message classes, you might start wondering why there is even a split between Message and BattleMessage classes at all, why not just have one class called Message which works for both?

The answer is really from a convenience standpoint, rather than any technical limitation.

In theory, we could absolutely just have one larger Message class that encompasses both of our current message classes, however in practice we don't use the two that we have today in the same way at all. With Pokemon Showdown's webclient, battle messages are actually a special type of room-message, sent with a chunk formatting that looks something like:

\"\"\">battle-BATTLEID\n|init|battle\n|title|colress-gpt-test1 vs. colress-gpt-test2\n|j|\u2606colress-gpt-test1\n\"\"\"\n

Already, in order to process this in a parser, we will need special handling to identify that a certain message chunk is related to some specific room/battle, and then process each remaining line in the chunk as a message pertaining to that room. Since we're already checking for room information with the \">\" at the start, we may as well just check for \">battle\" instead, and parse everything that follows as though it is specific to a battle.

It is theoretically possible that in the future we may decide that simplifying our two class structure into just a single Message class may make sense, but considering that other than some benefits in terms of code organization, there really isn't much reason to do so either. The Message and BattleMessage classes are complex enough as they are now, so if we tried to merge them into one we would really need to consider a different file formatting structure for writing subclasses, compared to our current solution of one file for Message and one file for BattleMessage.

"},{"location":"showdown/guides/basic-parser/","title":"Building a Replay Log Parser","text":""},{"location":"showdown/guides/basic-parser/#introduction","title":"Introduction","text":"

This tutorial will guide usage of poketypes.showdown to create a simple replay log parser, which can read any arbitrary Pokemon Showdown replay file, and turn it into a list of BattleMessage subclass objects, that you could then proceed to do some sort of analysis or transformation on.

Since we'll be processing a Replay log in this example, we will only be using poketypes.showdown.BattleMessage, but similar concepts can be applied for processing any message sent by showdown, so long as you make the distinction between general messages and message chunks that target a specific battle.

"},{"location":"showdown/guides/basic-parser/#prerequisites","title":"Prerequisites","text":"

Make sure that you have poketypes installed to your virtual environment, which you can do with:

pip install poketypes\n

Additionally, go ahead and download the replay file here. If you click the Download button on this page, it should download a .html file called 'OUMonotype-2014-01-29-kdarewolf-onox.html', which we will use as an example, but any replay file should work.

"},{"location":"showdown/guides/basic-parser/#step-1-extracting-the-battle-log","title":"Step 1: Extracting the Battle Log","text":"

Replay files are stored in html files, which means we need to extract the text log that we want to parse first.

To do that, since we only need very basic html extraction, we can

"},{"location":"showdown/reference/battle-messages/","title":"The Showdown Battle Message","text":""},{"location":"showdown/reference/battle-messages/#the-battlemessage-object","title":"The BattleMessage object","text":"

The base class for all specific BattleMessage subclasses to be built from.

When parsing a string battle message, you should directly use this class's from_message function, which will auto-identify which subclass (if any) the given string belongs to.

Across all BattleMessages, you will be able to access both BMTYPE and BATTLE_MESSAGE, though you shouldn't need to access BATTLE_MESSAGE directly. (If you do, then we must be missing some data that exists in the raw string)

ATTRIBUTE DESCRIPTION BMTYPE

The message type of this battle message. Must be a vaild showdown battle message.

TYPE: BMType

BATTLE_MESSAGE

The raw message line as sent from showdown. Shouldn't need to be used but worth keeping.

TYPE: str

ERR_STATE

The error type of this battle message if it failed to parse

TYPE: Optional[Literal['UNKNOWN_BMTYPE', 'MISSING_DICT_CLASS', 'IMPLEMENTATION_NOT_READY', 'PARSE_ERROR']]

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage.from_message","title":"from_message(battle_message) staticmethod","text":"

Create a specific BattleMessage object from a raw message.

For example, given a message '|faint|p2a: Umbreon', this will create a new BattleMessage_faint with fields extracted from the text properly.

"},{"location":"showdown/reference/battle-messages/#battlemessage-subclasses","title":"BattleMessage Subclasses","text":"

Contains BaseModels for BattleMessage parsing and processing.

Remember to use BattleMessage.from_message directly, unless you are building test cases where you want to assert that a given message leads to a certain subclass of BattleMessage. from_message will auto-detect which BMType the given message corresponds to, and return the associated subclass (or an error detailing what went wrong) for you.

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_player","title":"BattleMessage_player","text":"

Message containing player information.

ATTRIBUTE DESCRIPTION PLAYER

The player id of this player

TYPE: str

USERNAME

The username of the player

TYPE: str

AVATAR

Either a number id of the user's avatar or a custom value

TYPE: Union[int, str]

RATING

The elo of the player in the current format, if applicable

TYPE: Optional[int]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_teamsize","title":"BattleMessage_teamsize","text":"

Message containing teamsize information.

ATTRIBUTE DESCRIPTION PLAYER

The player id of this player

TYPE: str

NUMBER

The number of pokemon your opponent has.

TYPE: int

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_gametype","title":"BattleMessage_gametype","text":"

Message containing gametype information.

ATTRIBUTE DESCRIPTION GAMETYPE

The gametype of this format

TYPE: Literal['singles', 'doubles', 'triples', 'multi', 'freeforall']

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_gen","title":"BattleMessage_gen","text":"

Message containing gen information.

ATTRIBUTE DESCRIPTION GENNUM

The integer generation number of this format

TYPE: DexGen.ValueType

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_tier","title":"BattleMessage_tier","text":"

Message containing format information.

ATTRIBUTE DESCRIPTION FORMATNAME

The game format of this match

TYPE: str

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_rated","title":"BattleMessage_rated","text":"

Message containing rating information.

ATTRIBUTE DESCRIPTION MESSAGE

An optional message used in tournaments

TYPE: Optional[str]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_rule","title":"BattleMessage_rule","text":"

Message containing extra rule information.

ATTRIBUTE DESCRIPTION RULE

The name of the rule

TYPE: str

DESCRIPTION

A description of this rule

TYPE: str

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_clearpoke","title":"BattleMessage_clearpoke","text":"

Message containing a clearpoke notification.

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_poke","title":"BattleMessage_poke","text":"

Message containing base-forme-only information about a pokemon, presented in teampreview.

ATTRIBUTE DESCRIPTION PLAYER

The player id of this player

TYPE: str

SPECIES

The forme-less species for this pokemon

TYPE: DexPokemon.ValueType

LEVEL

The level of this pokemon

TYPE: int

GENDER

The gender of this pokemon

TYPE: Optional[Literal['M', 'F']]

SHINY

Whether the pokemon is shiny or not

TYPE: bool

TERA

If this pokemon is teratyped, the string type of the new type. Else None.

TYPE: Optional[DexType.ValueType]

HAS_ITEM

Whether or not the pokemon is holding an item

TYPE: bool

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_start","title":"BattleMessage_start","text":"

Message signaling the start of a battle.

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_teampreview","title":"BattleMessage_teampreview","text":"

Message signaling to make a teampreview team-order decision.

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_empty","title":"BattleMessage_empty","text":"

Completely blank message.

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_request","title":"BattleMessage_request","text":"

Message communicating options the user has in an upcoming choice.

ATTRIBUTE DESCRIPTION REQUEST_TYPE

Which type of request this request is between TEAMPREVIEW, ACTIVE, and FORCESWITCH

TYPE: Literal['TEAMPREVIEW', 'ACTIVE', 'FORCESWITCH', 'WAIT']

USERNAME

The player's username

TYPE: str

PLAYER

The player id of this player

TYPE: str

RQID

The id number of this request, for the purpose of an undo function

TYPE: Optional[int]

POKEMON

The pokemon details for each pokemon in this player's side

TYPE: List[RequestPoke]

ACTIVE_OPTIONS

A list of actions available for each active pokemon. Will be None if switch/teampreview

TYPE: Optional[List[ActiveOption]]

FORCESWITCH_SLOTS

A list of bool for each slot whether they are being forced to switch

TYPE: Optional[List[bool]]

Use Case(s) Message Format(s) Input Example(s) Tips

This does not necessarily mean it is time for the user to respond to a choice, as teampreview and move requests are sent before the details of the previous turn are sent, and thus you should wait until it is the correct time to send your decision.

For FORCESWITCH requests, however, a decision should be sent once you receive this message.

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_inactive","title":"BattleMessage_inactive","text":"

Message communicating that the inactivity timer has been set.

ATTRIBUTE DESCRIPTION MESSAGE

A message related to the battle timer notification

TYPE: str

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_inactiveoff","title":"BattleMessage_inactiveoff","text":"

Message communicating that the inactivity timer has been turned off.

ATTRIBUTE DESCRIPTION MESSAGE

A message related to the battle timer notification

TYPE: str

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_upkeep","title":"BattleMessage_upkeep","text":"

Message communicating upkeep notice.

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_turn","title":"BattleMessage_turn","text":"

Message communicating that a turn has begun, and that move choices should be made.

ATTRIBUTE DESCRIPTION NUMBER

The current turn number

TYPE: int

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_win","title":"BattleMessage_win","text":"

Message communicating that a player has won the battle.

ATTRIBUTE DESCRIPTION USERNAME

The username of the winning player

TYPE: str

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_tie","title":"BattleMessage_tie","text":"

Message communicating that neither player has won the battle.

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_expire","title":"BattleMessage_expire","text":"

Message communicating that the battle has ended due to mutual inactivity.

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_t","title":"BattleMessage_t","text":"

Message communicating the current timestamp.

ATTRIBUTE DESCRIPTION TIMESTAMP

The time of this turn as a datetime (conv from unix seconds)

TYPE: datetime

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_move","title":"BattleMessage_move","text":"

Message communicating that a pokemon successfully used a move.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon using the move

TYPE: PokemonIdentifier

MOVE

The name of the move used

TYPE: DexMove.ValueType

TARGET

The primary target of this move. This can be None when applicable

TYPE: Optional[PokemonIdentifier]

EFFECT

An optional effect that the move is taken from (Magic bounce, Sleep Talk, etc)

TYPE: Optional[Effect]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_switch","title":"BattleMessage_switch","text":"

Message communicating that a pokemon has switched in.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon swapping in, potentially replacing the slot

TYPE: PokemonIdentifier

SPECIES

The species for this pokemon, including forme

TYPE: DexPokemon.ValueType

LEVEL

The level of this pokemon

TYPE: int

GENDER

The gender of this pokemon

TYPE: Optional[Literal['M', 'F']]

SHINY

Whether the pokemon is shiny or not

TYPE: bool

TERA

If this pokemon is teratyped, the string type of the new type. Else None.

TYPE: Optional[str]

CUR_HP

The current HP of the pokemon

TYPE: int

MAX_HP

The maximum HP of the pokemon

TYPE: int

STATUS

The status of the pokemon. Can be None if there is no status

TYPE: Optional[str]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_drag","title":"BattleMessage_drag","text":"

Message communicating that a pokemon has switched in.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon being dragged in

TYPE: PokemonIdentifier

SPECIES

The species for this pokemon, including forme

TYPE: DexPokemon.ValueType

LEVEL

The level of this pokemon

TYPE: int

GENDER

The gender of this pokemon

TYPE: Optional[Literal['M', 'F']]

SHINY

Whether the pokemon is shiny or not

TYPE: bool

TERA

If this pokemon is teratyped, the string type of the new type. Else None.

TYPE: Optional[str]

CUR_HP

The current HP of the pokemon

TYPE: int

MAX_HP

The maximum HP of the pokemon

TYPE: int

STATUS

The status of the pokemon. Can be None if there is no status

TYPE: Optional[str]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_detailschange","title":"BattleMessage_detailschange","text":"

Message communicating that a pokemon has changed formes in a permanent way.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon changing formes

TYPE: PokemonIdentifier

SPECIES

The species for this pokemon, including forme

TYPE: DexPokemon.ValueType

LEVEL

The level of this pokemon

TYPE: int

GENDER

The gender of this pokemon

TYPE: Optional[Literal['M', 'F']]

SHINY

Whether the pokemon is shiny or not

TYPE: bool

TERA

If this pokemon is teratyped, the string type of the new type. Else None.

TYPE: Optional[str]

CUR_HP

The current HP of the pokemon

TYPE: Optional[str]

MAX_HP

The maximum HP of the pokemon

TYPE: Optional[str]

STATUS

The status of the pokemon. Can be None if there is no status

TYPE: Optional[str]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_replace","title":"BattleMessage_replace","text":"

Message communicating that a pokemon has been replaced (Zoroark illusion ability).

ATTRIBUTE DESCRIPTION POKEMON

The pokemon being revealed (Zoroark)

TYPE: PokemonIdentifier

SPECIES

The species for this pokemon, including forme

TYPE: DexPokemon.ValueType

LEVEL

The level of this pokemon

TYPE: int

GENDER

The gender of this pokemon

TYPE: Optional[Literal['M', 'F']]

SHINY

Whether the pokemon is shiny or not

TYPE: bool

TERA

If this pokemon is teratyped, the string type of the new type. Else None.

TYPE: Optional[str]

CUR_HP

The current HP of the pokemon

TYPE: Optional[str]

MAX_HP

The maximum HP of the pokemon

TYPE: Optional[str]

STATUS

The status of the pokemon. Can be None if there is no status

TYPE: Optional[str]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_swap","title":"BattleMessage_swap","text":"

Message communicating that a certain active slot has had its pokemon swapped with another.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon being swapped before swapping

TYPE: PokemonIdentifier

POSITION

The slot that this Pokemon is being swapped to, as an integer

TYPE: int

EFFECT

An optional effect explaining what caused the swapping

TYPE: Optional[Effect]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_cant","title":"BattleMessage_cant","text":"

Message communicating that a pokemon was unable to do something.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that was unable to act

TYPE: PokemonIdentifier

REASON

The reason that the pokemon was unable to do what it was trying to do

TYPE: str

MOVE

The move being used that was unable to be used. None if not applicable

TYPE: Optional[str]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_faint","title":"BattleMessage_faint","text":"

Message communicating that a pokemon has fainted.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that fainted

TYPE: PokemonIdentifier

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_fail","title":"BattleMessage_fail","text":"

Message communicating that a pokemon has failed to do something.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that failed to do something

TYPE: PokemonIdentifier

EFFECT

The effect causing/explaining the fail. Is Optional since sometimes it fails with no explanation

TYPE: Optional[Effect]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_block","title":"BattleMessage_block","text":"

Message communicating that a pokemon has blocked an opposing action.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that was targeted but blocked something

TYPE: PokemonIdentifier

EFFECT

The reason this was able to be blocked

TYPE: Effect

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_notarget","title":"BattleMessage_notarget","text":"

Message communicating that no target was available at move-use time.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that had no target available.

TYPE: Optional[PokemonIdentifier]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_miss","title":"BattleMessage_miss","text":"

Message communicating that a given source pokemon missed its action.

ATTRIBUTE DESCRIPTION SOURCE

The pokemon missing the attack

TYPE: PokemonIdentifier

TARGET

The pokemon evading (If applicable, can be None)

TYPE: Optional[PokemonIdentifier]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_damage","title":"BattleMessage_damage","text":"

Message communicating that a pokemon has taken damage.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon being hurt

TYPE: PokemonIdentifier

CUR_HP

The current HP of the pokemon

TYPE: int

MAX_HP

The maximum HP of the pokemon. None if the pokemon is fainted

TYPE: Optional[int]

STATUS

The status of the pokemon. Can be None if there is no status

TYPE: Optional[str]

EFFECT

The reason this damage was dealt, if not from a move

TYPE: Optional[Effect]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_heal","title":"BattleMessage_heal","text":"

Message communicating that a pokemon has healed some health.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon being healed

TYPE: PokemonIdentifier

CUR_HP

The current HP of the pokemon

TYPE: int

MAX_HP

The maximum HP of the pokemon

TYPE: int

STATUS

The status of the pokemon. Can be None if there is no status

TYPE: Optional[str]

EFFECT

The reason this health was healed, if not from a move

TYPE: Optional[Effect]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_sethp","title":"BattleMessage_sethp","text":"

Message communicating that a pokemon has an exact hp amount.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon getting the HP set

TYPE: PokemonIdentifier

CUR_HP

The current HP of the pokemon

TYPE: int

MAX_HP

The maximum HP of the pokemon

TYPE: int

STATUS

The status of the pokemon. Can be None if there is no status

TYPE: Optional[str]

EFFECT

The reason this health was healed

TYPE: Optional[Effect]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_status","title":"BattleMessage_status","text":"

Message communicating that a pokemon has gained a status.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon gaining the status

TYPE: PokemonIdentifier

STATUS

The status being gained

TYPE: DexStatus.ValueType

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_curestatus","title":"BattleMessage_curestatus","text":"

Message communicating that a pokemon has lost a status.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon losing the status

TYPE: PokemonIdentifier

STATUS

The status being lost

TYPE: DexStatus.ValueType

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_cureteam","title":"BattleMessage_cureteam","text":"

Message communicating that a team has been cured of all status conditions.

ATTRIBUTE DESCRIPTION EFFECT

The effect causing the team to be healed

TYPE: Effect

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_boost","title":"BattleMessage_boost","text":"

Message communicating that a pokemon has gained some stat boost.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon getting the boost

TYPE: PokemonIdentifier

STAT

Which stat is being boosted

TYPE: PokeStat

AMOUNT

By how much this stat is being boosted, as an integer. Can be 0 if at cap

TYPE: int

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_unboost","title":"BattleMessage_unboost","text":"

Message communicating that a pokemon has had some stat lowered.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon getting the boost

TYPE: PokemonIdentifier

STAT

Which stat is being boosted

TYPE: PokeStat

AMOUNT

By how much this stat is being unboosted, as an integer. Can be 0 if at cap

TYPE: int

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_setboost","title":"BattleMessage_setboost","text":"

Message communicating that a pokemon has had some stat set to a certain boost value.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon getting the boost

TYPE: PokemonIdentifier

STAT

Which stat is being boosted

TYPE: PokeStat

AMOUNT

The new value being assigned for this stat boost

TYPE: int

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_swapboost","title":"BattleMessage_swapboost","text":"

Message communicating that two specific pokemon have had their stat boosts switched.

Warning

Not yet implemented!

ATTRIBUTE DESCRIPTION POKEMON

The pokemon getting the boost

TYPE: str

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_invertboost","title":"BattleMessage_invertboost","text":"

Message communicating that a pokemon has had its stat boosts inverted.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon getting the boost inverted

TYPE: PokemonIdentifier

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_clearboost","title":"BattleMessage_clearboost","text":"

Message communicating that a pokemon has had its stat boosts cleared.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that had its stat boosts cleared.

TYPE: PokemonIdentifier

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_clearallboost","title":"BattleMessage_clearallboost","text":"

Message communicating that all pokemon have had their stat boosts cleared.

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_clearpositiveboost","title":"BattleMessage_clearpositiveboost","text":"

Message communicating that a pokemon has had its positive stat boosts cleared.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that had its positive stat boosts cleared.

TYPE: PokemonIdentifier

EFFECT

The effect causing this positive boost clearance

TYPE: Effect

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_clearnegativeboost","title":"BattleMessage_clearnegativeboost","text":"

Message communicating that a pokemon has had its negative stat boosts cleared.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that had its negative stat boosts cleared.

TYPE: PokemonIdentifier

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_copyboost","title":"BattleMessage_copyboost","text":"

Message communicating that a pokemon has had its stat boosts copied.

Warning

Not yet implemented!

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that had its stat boosts copied.

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_weather","title":"BattleMessage_weather","text":"

Message communicating that the weather has changed.

ATTRIBUTE DESCRIPTION WEATHER

The weather being set

TYPE: DexWeather.ValueType

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_fieldstart","title":"BattleMessage_fieldstart","text":"

Message communicating that a field condition has started.

ATTRIBUTE DESCRIPTION EFFECT

The effect starting for the field.

TYPE: Effect

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_fieldend","title":"BattleMessage_fieldend","text":"

Message communicating that a field condition has ended.

ATTRIBUTE DESCRIPTION EFFECT

The effect ending for the field.

TYPE: Effect

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_sidestart","title":"BattleMessage_sidestart","text":"

Message communicating that a side condition has started.

ATTRIBUTE DESCRIPTION PLAYER

The player id of the impacted player

TYPE: str

CONDITION

The field condition starting

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_sideend","title":"BattleMessage_sideend","text":"

Message communicating that a side condition has ended.

ATTRIBUTE DESCRIPTION PLAYER

The player id of the impacted player

TYPE: str

CONDITION

The field condition starting

TYPE: str

EFFECT

The effect that is causing the conditon to end

TYPE: Optional[Effect]

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_swapsideconditions","title":"BattleMessage_swapsideconditions","text":"

Message communicating that a side condition has been swapped.

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_volstart","title":"BattleMessage_volstart","text":"

Message communicating that a volatile effect has started.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon this volatile effect is started for

TYPE: PokemonIdentifier

EFFECT

The effect that caused this volatile status

TYPE: Optional[Effect]

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_volend","title":"BattleMessage_volend","text":"

Message communicating that a volatile effect has ended.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon this volatile effect is ended for

TYPE: PokemonIdentifier

EFFECT

The effect that caused this volatile status

TYPE: Effect

SILENT

Whether this message is silent or not

TYPE: bool

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_crit","title":"BattleMessage_crit","text":"

Message communicating that a pokemon has had a critical hit.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that had a critical hit

TYPE: PokemonIdentifier

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_supereffective","title":"BattleMessage_supereffective","text":"

Message communicating that a pokemon has been hit super effectively.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that was hit super effectively

TYPE: PokemonIdentifier

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_resisted","title":"BattleMessage_resisted","text":"

Message communicating that a pokemon has resisted an attack.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that resisted the attack

TYPE: PokemonIdentifier

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_immune","title":"BattleMessage_immune","text":"

Message communicating that a pokemon has been immune to an attack.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that was immune to the attack

TYPE: PokemonIdentifier

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_item","title":"BattleMessage_item","text":"

Message communicating that a pokemon has had its item revealed.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon whose item is revealed

TYPE: PokemonIdentifier

ITEM

The item being revealed

TYPE: DexItem.ValueType

EFFECT

The effect that revealed the item, if applicable. Not used when auto-revealed (air balloon)

TYPE: Optional[Effect]

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_enditem","title":"BattleMessage_enditem","text":"

Message communicating that a pokemon has had its item destroyed.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon whose item is destroyed

TYPE: PokemonIdentifier

ITEM

The item being destroyed

TYPE: DexItem.ValueType

EFFECT

The effect that destroyed the item, if applicable.

TYPE: Optional[Effect]

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_ability","title":"BattleMessage_ability","text":"

Message communicating that a pokemon has had its ability revealed.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon whose ability is revealed

TYPE: PokemonIdentifier

ABILITY

The ability being revealed

TYPE: DexAbility.ValueType

EFFECT

The effect that revealed the ability, if applicable.

TYPE: Optional[Effect]

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_endability","title":"BattleMessage_endability","text":"

Message communicating that a pokemon has had its ability suppressed.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon whose ability is suppressed

TYPE: PokemonIdentifier

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_transform","title":"BattleMessage_transform","text":"

Message communicating that a pokemon has transformed into another pokemon.

ATTRIBUTE DESCRIPTION SOURCE

The pokemon transforming

TYPE: PokemonIdentifier

TARGET

The pokemon it's transforming into

TYPE: PokemonIdentifier

EFFECT

The optional effect explaining the transformation

TYPE: Optional[Effect]

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_mega","title":"BattleMessage_mega","text":"

Message communicating that a pokemon has mega evolved.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that mega evolved

TYPE: PokemonIdentifier

BASE_SPECIES

The base species of the pokemon that is mega evolving

TYPE: DexPokemon.ValueType

MEGA_STONE

The mega stone that is being used

TYPE: DexItem.ValueType

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_primal","title":"BattleMessage_primal","text":"

Message communicating that a pokemon has gone primal.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon going primal

TYPE: PokemonIdentifier

ITEM

The held item that is being used

TYPE: DexItem.ValueType

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_burst","title":"BattleMessage_burst","text":"

Message communicating that a pokemon has burst.

Warning

Not implemented yet.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that burst

TYPE: PokemonIdentifier

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_zpower","title":"BattleMessage_zpower","text":"

Message communicating that a pokemon has used a Z move.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon using the Z move

TYPE: PokemonIdentifier

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_zbroken","title":"BattleMessage_zbroken","text":"

Message communicating that a pokemon's Z move is over.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon whose Z move is over

TYPE: PokemonIdentifier

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_activate","title":"BattleMessage_activate","text":"

Message communicating that a pokemon has activated an effect.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon activating the effect

TYPE: PokemonIdentifier

EFFECT

The effect being activated

TYPE: Effect

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_hint","title":"BattleMessage_hint","text":"

Message communicating that a hint has been sent to the player.

ATTRIBUTE DESCRIPTION MESSAGE

The message sent to you as a hint

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_center","title":"BattleMessage_center","text":"

Message communicating that the pokemon in a triple battle have been centered.

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_message","title":"BattleMessage_message","text":"

Message communicating that a message has been sent.

ATTRIBUTE DESCRIPTION MESSAGE

The message sent as part of this notification

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_combine","title":"BattleMessage_combine","text":"

Message communicating that two moves have been combined.

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_waiting","title":"BattleMessage_waiting","text":"

Message communicating that a pokemon is waiting for the target.

Warning

Not implemented yet.

ATTRIBUTE DESCRIPTION POKEMON

The main pokemon identifier relevant

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_prepare","title":"BattleMessage_prepare","text":"

Message communicating that a pokemon is preparing a move.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon preparing the move

TYPE: PokemonIdentifier

MOVE

The move being prepared

TYPE: DexMove.ValueType

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_mustrecharge","title":"BattleMessage_mustrecharge","text":"

Message communicating that a pokemon must recharge.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon that must recharge

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_nothing","title":"BattleMessage_nothing","text":"

Message communicating that nothing happened.

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_hitcount","title":"BattleMessage_hitcount","text":"

Message communicating that a pokemon has been hit multiple times.

ATTRIBUTE DESCRIPTION POKEMON

The Pokemon being hit multiple times. Can be slotless

TYPE: PokemonIdentifier

NUM

The number of hits as an integer

TYPE: int

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_singlemove","title":"BattleMessage_singlemove","text":"

Message communicating that a pokemon has used a single move.

ATTRIBUTE DESCRIPTION POKEMON

The Pokemon using this single move

TYPE: PokemonIdentifier

MOVE

The move being used

TYPE: DexMove.ValueType

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_singleturn","title":"BattleMessage_singleturn","text":"

Message communicating that a pokemon has used a single turn move.

ATTRIBUTE DESCRIPTION POKEMON

The Pokemon using this single move

TYPE: PokemonIdentifier

MOVE

The move being used

TYPE: DexMove.ValueType

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_formechange","title":"BattleMessage_formechange","text":"

Message communicating that a pokemon has changed formes.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon changing formes in some temporary way

TYPE: PokemonIdentifier

SPECIES

The species for this pokemon, including forme

TYPE: DexPokemon.ValueType

EFFECT

Optionally, what caused the formechange

TYPE: Optional[Effect]

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_terastallize","title":"BattleMessage_terastallize","text":"

Message communicating that a pokemon has terastallized.

ATTRIBUTE DESCRIPTION POKEMON

The pokemon doing the terastallization

TYPE: PokemonIdentifier

TYPE

The type being terastallized

TYPE: DexType.ValueType

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_fieldactivate","title":"BattleMessage_fieldactivate","text":"

Message communicating that a field effect has been activated.

ATTRIBUTE DESCRIPTION EFFECT

The effect causing the field activation

TYPE: Effect

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_error","title":"BattleMessage_error","text":"

Message communicating that an error has occurred.

ATTRIBUTE DESCRIPTION MESSAGE

The error message sent by showdown

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_bigerror","title":"BattleMessage_bigerror","text":"

Message communicating that a big error has occurred.

ATTRIBUTE DESCRIPTION MESSAGE

The error message sent by showdown

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_init","title":"BattleMessage_init","text":"

Message communicating that a battle has been initialized.

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_deinit","title":"BattleMessage_deinit","text":"

Message communicating that a battle has been deinitialized.

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_title","title":"BattleMessage_title","text":"

Message communicating that a title has been sent for this battle.

ATTRIBUTE DESCRIPTION TITLE

The title of this match as shown on pokemon showdown

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_join","title":"BattleMessage_join","text":"

Message communicating that a player has joined the battle.

ATTRIBUTE DESCRIPTION USERNAME

The username of the joining player

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_leave","title":"BattleMessage_leave","text":"

Message communicating that a player has left the battle.

ATTRIBUTE DESCRIPTION USERNAME

The username of the leaving player

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_raw","title":"BattleMessage_raw","text":"

Message communicating that a raw message has been sent.

ATTRIBUTE DESCRIPTION MESSAGE

The raw message from Showdown. Typically used for rating changes.

TYPE: str

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BattleMessage_anim","title":"BattleMessage_anim","text":"

Message communicating that an override animation has been sent.

Warning

This has not been fully implemented / tested on large data yet.

ATTRIBUTE DESCRIPTION SOURCE

The pokemon using the move

TYPE: PokemonIdentifier

TARGET

The pokemon being targeted by the move. If there is no target then this will instead be slotless

TYPE: PokemonIdentifier

MOVE

The move being used

TYPE: DexMove.ValueType

NO_TARGET

Whether the move is labeled as notarget or not

TYPE: bool

Use Case(s): Message Format(s): Input Example(s) "},{"location":"showdown/reference/battle-messages/#message-utility-classes","title":"Message Utility Classes","text":"

Contains BaseModels for BattleMessage parsing and processing.

Remember to use BattleMessage.from_message directly, unless you are building test cases where you want to assert that a given message leads to a certain subclass of BattleMessage. from_message will auto-detect which BMType the given message corresponds to, and return the associated subclass (or an error detailing what went wrong) for you.

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.BMType","title":"BMType","text":"

String-Enum for holding all unique categories of Showdown Battle Messages.

See https://github.com/smogon/pokemon-showdown/blob/master/sim/SIM-PROTOCOL.md for the full list of battle messages

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.PokeStat","title":"PokeStat","text":"

Helper enum for identifying valid stats.

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.PokemonIdentifier","title":"PokemonIdentifier","text":"

A BaseModel giving details about which Pokemon is being talked about.

Attributes:

Name Type Description IDENTITY str

The unique identifier for a pokemon. Looks like ARCANINE if the input is p1: Arcanine

PLAYER str

The player this pokemon belongs to

SLOT Optional[str]

Optionally, the slot this pokemon is in. Will be None if slot info isn't given in the message

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.PokemonIdentifier.from_ident_string","title":"from_ident_string(ident) staticmethod","text":"

Create a new PokemonIdentifier from an identifier string without slot information.

Parameters:

Name Type Description Default ident str

An input string to extract field information from. Looks like \"p1: Arcanine\"

required

Returns:

Name Type Description PokemonIdentifier PokemonIdentifier

A newly created PokemonIdentifier object from this string

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.PokemonIdentifier.from_slot_string","title":"from_slot_string(slot) staticmethod","text":"

Create a new PokemonIdentifier from an identifier string with slot information.

Parameters:

Name Type Description Default slot str

An input string to extract field information from. Looks like \"p1a: Arcanine\"

required

Returns:

Name Type Description PokemonIdentifier PokemonIdentifier

A newly created PokemonIdentifier object from this string

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.PokemonIdentifier.from_string","title":"from_string(string) staticmethod","text":"

Auto-Create a new PokemonIdentifier based on which type of identity string is given.

Parameters:

Name Type Description Default string str

An input string to extract field information from. Looks like \"p1a: Arcanine\"

required

Returns:

Name Type Description PokemonIdentifier PokemonIdentifier

A newly created PokemonIdentifier object from this string

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.EffectType","title":"EffectType","text":"

Helper class to identify which category of effect is being activated.

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.Effect","title":"Effect","text":"

A helper class for many Battle Message types that rely on something happening to cause the message effect.

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.RequestPoke","title":"RequestPoke","text":"

A helper class to contain details about a pokemon held in the side data of a request.

Attributes:

Name Type Description IDENT PokemonIdentifier

The string pokemon identifier (without slot information)

SPECIES DexPokemon.ValueType

The species for this pokemon, including forme

LEVEL int

The level of this pokemon

GENDER Optional[Literal['M', 'F']]

The gender of this pokemon

SHINY bool

Whether the pokemon is shiny or not

TERA Optional[DexType.ValueType]

If this pokemon is teratyped, the DexType of the new type. Else None.

CUR_HP int

The current HP of the pokemon

MAX_HP Optional[int]

The maximum HP of the pokemon, None if the pokemon is fainted

STATUS Optional[DexStatus.ValueType]

The status of the pokemon. Can be None if there is no status

ACTIVE bool

Whether the pokemon is active or not

STATS Dict[PokeStat, int]

A dictionary of stat->values for each stat of this pokemon (before modifiers)

MOVES List[DexMove.ValueType]

The list of moves this pokemon knows, without pp information

BASE_ABILITY DexAbility.ValueType

The base ability of this pokemon, ignoring any ability switching shenanigans

ABILITY Optional[DexAbility.ValueType]

The current ability of this pokemon. Only used in certain gens, can be None

ITEM Optional[DexItem.ValueType]

The held item of this pokemon. None if no item is held

POKEBALL str

Which pokeball this pokemon is contained in

COMMANDING Optional[bool]

Tatsugiri commander mechanic. True if active, false if not, None if older gen

REVIVING Optional[bool]

Revival Blessing flag (I think?)

TERATYPE Optional[DexType.ValueType]

The type that this pokemon can teratype into

TERASTALLIZED Optional[DexType.ValueType]

The type that this pokemon is teratyped into. None if not applicable

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.MoveData","title":"MoveData","text":"

A helper class to contain details about a move held in the active data for a request.

Attributes:

Name Type Description NAME str

The friendly name of the move

ID DexMove.ValueType

The id of the move

CUR_PP Optional[int]

The integer amount of times this move can still be used. None if Trapped

MAX_PP Optional[int]

The integer amount of times this move can ever be used. None if Trapped

TARGET Optional[DexMoveTarget.ValueType]

The targetting type of this move. None if Trapped

DISABLED Optional[bool]

Whether this move is disabled or not. None if Trapped

"},{"location":"showdown/reference/battle-messages/#poketypes.showdown.battlemessage.ActiveOption","title":"ActiveOption","text":"

A helper class to contain details about all moves available for an active pokemon in a request.

Attributes:

Name Type Description MOVES List[MoveData]

A list of available moves for this slot

CAN_MEGA bool

Whether the pokemon can mega evolve

CAN_ZMOVE bool

Whether the pokemon can zmove

CAN_DYNA bool

Whether the pokemon can dynamax

CAN_TERA bool

Whether the pokemon can teratype

TRAPPED bool

Whether the user is trapped

"},{"location":"showdown/reference/standard-messages/","title":"The Standard Showdown Message","text":""},{"location":"showdown/reference/standard-messages/#the-message-object","title":"The Message object","text":"

The base class for all specific Message subclasses to be built from.

When parsing a string message, you should directly use this class's from_message function, which will auto-identify which subclass (if any) the given string belongs to.

Across all Messages, you will be able to access both MTYPE and MESSAGE, though you shouldn't need to access MESSAGE directly. (If you do, then we must be missing some data that exists in the raw string)

ATTRIBUTE DESCRIPTION MTYPE

The message type of this message. Must be a vaild showdown general message.

TYPE: MType

MESSAGE

The raw message line as sent from showdown. Shouldn't need to be used but worth keeping.

TYPE: str

"},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.Message.from_message","title":"from_message(message) staticmethod","text":"

Create a specific Message object from a raw string message.

This is used for general Showdown Messages, compared to the BattleMessage class meant for battle details.

PARAMETER DESCRIPTION message

The newline-stripped single string message as sent by the server.

TYPE: str

RETURNS DESCRIPTION Message

An initialized subclass of Message, for the corresponding class for this message type.

TYPE: 'Message'

"},{"location":"showdown/reference/standard-messages/#message-subclasses","title":"Message Subclasses","text":"

Contains BaseModels for Message parsing and processing.

Remember to use Message.from_message directly, unless you are building test cases where you want to assert that a given message leads to a certain subclass of Message. from_message will auto-detect which MType the given message corresponds to, and return the associated subclass (or an error detailing what went wrong) for you.

"},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.Message_challstr","title":"Message_challstr","text":"

Message containing a login challenge string.

ATTRIBUTE DESCRIPTION CHALLSTR

The string challenge string

TYPE: str

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.Message_customgroups","title":"Message_customgroups","text":"

Message containing info about server custom groups.

ATTRIBUTE DESCRIPTION CUSTOM_GROUPS

The list of custom groups

TYPE: List[CustomGroup]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.Message_formats","title":"Message_formats","text":"

Message containing info about server enabled formats.

ATTRIBUTE DESCRIPTION FORMATS

The list of formats

TYPE: List[str]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.Message_init","title":"Message_init","text":"

Message notifying about a battle starting.

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.Message_join","title":"Message_join","text":"

Message containing info about a joining user.

ATTRIBUTE DESCRIPTION USERNAME

The username of the joining player

TYPE: str

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.Message_leave","title":"Message_leave","text":"

Message containing info about a leaving user.

ATTRIBUTE DESCRIPTION USERNAME

The username of the leaving player

TYPE: str

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.Message_pm","title":"Message_pm","text":"

Message containing a PM to/from the user.

ATTRIBUTE DESCRIPTION SOURCE

The username of the user who sent the pm

TYPE: str

TARGET

The username of the user who received the pm

TYPE: str

PM

The message. Newlines are denoted with |

TYPE: str

IS_CHALLENGE

Whether this PM is a challenge to a battle

TYPE: bool

CHALLENGE_FORMAT

The format of the challenge if it is a challenge

TYPE: Optional[str]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.Message_title","title":"Message_title","text":"

Message notifying about the title of a room.

ATTRIBUTE DESCRIPTION TITLE

The title of this match as shown on pokemon showdown

TYPE: str

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.Message_updatechallenges","title":"Message_updatechallenges","text":"

Message containing a current challenge searches, if any.

ATTRIBUTE DESCRIPTION OUTGOING

A dictionary of username->format for each outgoing challenge

TYPE: Dict[str, str]

INCOMING

A dictionary of username->format for each incoming challenge

TYPE: Dict[str, str]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.Message_updatesearch","title":"Message_updatesearch","text":"

Message containing a current ladder searches, if any.

ATTRIBUTE DESCRIPTION SEARCHING

A list of formats currently searching for a ladder match

TYPE: List[str]

GAMES

A optional dictionary of game-id->format of currently ongoing games

TYPE: Optional[Dict[str, str]]

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.Message_updateuser","title":"Message_updateuser","text":"

Message containing info about your user settings / login information.

ATTRIBUTE DESCRIPTION USERNAME

The username of your current login

TYPE: str

NAMED

Whether you are currently logged in or not

TYPE: bool

AVATAR

Either a number id of the user's avatar or a custom value

TYPE: Union[int, str]

SETTINGS

The user settings for your current user session

TYPE: UserSettings

Use Case(s) Message Format(s) Input Example(s) "},{"location":"showdown/reference/standard-messages/#message-utility-classes","title":"Message Utility Classes","text":"

Contains BaseModels for Message parsing and processing.

Remember to use Message.from_message directly, unless you are building test cases where you want to assert that a given message leads to a certain subclass of Message. from_message will auto-detect which MType the given message corresponds to, and return the associated subclass (or an error detailing what went wrong) for you.

"},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.CustomGroup","title":"CustomGroup","text":"

A helper class to contain information about server custom groups.

"},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.MType","title":"MType","text":"

String-Enum for holding all unique categories of Showdown Generic Messages.

See https://github.com/smogon/pokemon-showdown/blob/master/PROTOCOL.md for the (partial) list of message types

"},{"location":"showdown/reference/standard-messages/#poketypes.showdown.showdownmessage.UserSettings","title":"UserSettings","text":"

A helper class to contain information about user settings.

Attributes:

Name Type Description BLOCK_CHALLENGES bool

Whether you are currently blocking challenges

BLOCK_PMS bool

Whether you are currently blocking PMs

IGNORE_TICKETS bool

Whether you are currently ignoring tickets

HIDE_BATTLES bool

Whether you are currently hiding battles on your trainer card

BLOCK_INVITES bool

Whether you are currently blocking invites

DO_NOT_DISTURB bool

Your current do not disturb setting

BLOCK_FRIEND_REQUESTS bool

Whether you are currently blocking friend requests

ALLOW_FRIEND_NOTIFICATIONS bool

Whether you are currently allowing friend notifications

DISPLAY_BATTLES bool

Whether you are currently displaying battles to friends

HIDE_LOGINS bool

Whether you are currently hiding logins

HIDDEN_NEXT_BATTLE bool

Whether you are hiding your next battle or not

INVITE_ONLY_NEXT_BATTLE bool

Whether you are limiting your next battle to invite only or not

LANGUAGE Optional[str]

The language set by your user

"}]} \ No newline at end of file diff --git a/showdown/reference/battle-messages/index.html b/showdown/reference/battle-messages/index.html index 2b97551..77186b7 100755 --- a/showdown/reference/battle-messages/index.html +++ b/showdown/reference/battle-messages/index.html @@ -4951,7 +4951,7 @@

TYPE: - str + DexMove.ValueType

@@ -6345,12 +6345,12 @@

-

The pokemon that had no target available

+

The pokemon that had no target available.

TYPE: - PokemonIdentifier + Optional[PokemonIdentifier]

@@ -6368,6 +6368,7 @@

@@ -9211,7 +9212,7 @@

TYPE: - str + DexItem.ValueType

@@ -9323,7 +9324,7 @@

TYPE: - str + DexItem.ValueType

@@ -9710,10 +9711,6 @@

- Warning -

Not implemented yet.

- @@ -9738,6 +9735,34 @@

+
+

The base species of the pokemon that is mega evolving

+
+

+ + TYPE: + DexPokemon.ValueType + +

+ + +

+ + +
MEGA_STONE +
+

The mega stone that is being used

+
+

+ + TYPE: + DexItem.ValueType + +

+
@@ -9750,13 +9775,13 @@

Message Format(s):
Input Example(s)
@@ -9830,7 +9855,7 @@

TYPE: - str + DexItem.ValueType

@@ -10646,7 +10671,7 @@

TYPE: - str + DexMove.ValueType

diff --git a/sitemap.xml.gz b/sitemap.xml.gz index 9c6ffa5..853b4ed 100755 Binary files a/sitemap.xml.gz and b/sitemap.xml.gz differ