Showdown
Pokémon Showdown is an online Pokémon battle simulator. It simulates singles, doubles and triples battles in all the games out so far (Generations 1 through 9). It is a very popular environment for competitive gameplay.
info
For more info, visit Pokémon ShowDown.
Methods
format()
Returns a string with formatted Pokémon data as Showdown's Teambuilder user-friendly export format.
Signature
format(params: FormatParams) => string
Parameter | Type | Required | Description |
---|---|---|---|
params | FormatParams | Yes | Increased stat of nature. |
params.pokemon | PokemonSpecie or string | Yes | The Pokémon name. |
params.level | number | No | The Pokémon level. |
params.gender | number | No | The Pokémon gender. |
params.happiness | number | No | The Pokémon happiness. |
params.shiny | boolean | No | If the Pokémon is shiny or not. |
params.tera | number | No | The Pokémon Tera type. |
params.nickname | string | No | The Pokémon nickname. |
params.item | string | No | The Pokémon's item. |
params.ability | string | No | The Pokémon's ability. |
params.moves | string[] | No | The Pokémon's list of moves. |
params.nature | NatureName | No | The Pokémon's nature. |
params.ivs | object | No | The Pokémon's IVs. |
params.ivs.hp | number | No | The Pokémon's HP IV. |
params.ivs.attack | number | No | The Pokémon's Attack IV. |
params.ivs.defense | number | No | The Pokémon's Defense IV. |
params.ivs.specialAttack | number | No | The Pokémon's Special Attack IV. |
params.ivs.specialDefense | number | No | The Pokémon's Special Defense IV. |
params.ivs.speed | number | No | The Pokémon's Speed IV. |
params.evs | object | No | The Pokémon's EVs. |
params.evs.hp | number | No | The Pokémon's HP EVs. |
params.evs.attack | number | No | The Pokémon's Attack EVs. |
params.evs.defense | number | No | The Pokémon's Defense EVs. |
params.evs.specialAttack | number | No | The Pokémon's Special Attack EVs. |
params.evs.specialDefense | number | No | The Pokémon's Special Defense EVs. |
params.evs.speed | number | No | The Pokémon's Speed EVs. |
Returns
A string.
Example
const pokemon = await pokeapi('pikachu').get();
format({
pokemon,
level: 50,
shiny: true,
tera: PokemonTypeName.FLYING,
ability: 'Static',
item: 'Light Ball',
moves: ['Thunder', 'Nuzzle', 'Surf', 'Charm'],
ivs: {
attack: 0,
},
evs: {
hp: 4,
speed: 252,
specialAttack: 252,
},
});
/*
outputs:
Pikachu @ Light Ball
Ability: Static
Level: 50
Shiny: Yes
Tera Type: Flying
EVs: 4 HP / 252 SpA / 252 Spe
IVs: 0 Atk
- Thunder
- Nuzzle
- Surf
- Charm
*/
Type Definitions
FormatParams
An interface to parse data into a string value with format()
.
Type |
---|
Interface |
Properties
Name | Required | Type |
---|---|---|
pokemon | Yes | PokemonSpecie or string |
level | No | number |
gender | No | enum('male' , 'female' , 'genderless' ) |
happiness | No | number |
shiny | No | boolean |
tera | No | PokemonTypeName |
nickname | No | string |
item | No | string |
ability | No | string |
moves | No | [string, string?, string?, string?] |
nature | No | NatureName |
ivs | No | object |
ivs.hp | No | number |
ivs.attack | No | number |
ivs.defense | No | number |
ivs.specialAttack | No | number |
ivs.specialDefense | No | number |
ivs.speed | No | number |
evs | No | object |
evs.hp | No | number |
evs.attack | No | number |
evs.defense | No | number |
evs.specialAttack | No | number |
evs.specialDefense | No | number |
evs.speed | No | number |