@nxpkmn/randoms
v0.6.4
Published
Random team generation logic for Pokémon Showdown's Random Battle formats
Downloads
2
Readme
@nxpkmn/randoms
An automatically generated extraction of a subset of Pokémon Showdown's "Random Battle" generation
logic for use with @nxpkmn/sim
.
Installation
$ npm install @nxpkmn/randoms
Usage
To generate a random team, get a TeamGenerator
for a supported format and call getTeam
:
import {TeamGenerators} from '@nxpkmn/randoms';
const generator = TeamGenerators.getTeamGenerator('gen8randombattle');
const team = generator.getTeam();
@nxpkmn/randoms
is commonly used with @nxpkmn/sim
to set the TeamGenerator
factory on
its Teams
so that Teams.generate
will work:
import {Teams} from '@nxpkmn/sim';
import {TeamGenerators} from '@nxpkmn/randoms';
Teams.setGeneratorFactory(TeamGenerators);
const team = Teams.generate('gen1randombattle');
Browser
The recommended way of using @nxpkmn/randoms
in a web browser is to configure your bundler
(Webpack, Rollup,
Parcel, etc) to minimize it and package it with the rest of your
application.
License
Substantial amounts of the code in this package have been either derived or generated from portions of Pokémon Showdown code which are distributed under the MIT License.