@pkmn/randoms
TypeScript icon, indicating that this package has built-in type declarations

0.9.3 • Public • Published

@pkmn/randoms

Test Status License npm version

An automatically generated extraction of a subset of Pokémon Showdown's "Random Battle" generation logic for use with @pkmn/sim.

Installation

$ npm install @pkmn/randoms

Usage

To generate a random team, get a TeamGenerator for a supported format and call getTeam:

import {TeamGenerators} from '@pkmn/randoms';

const generator = TeamGenerators.getTeamGenerator('gen8randombattle');
const team = generator.getTeam();

@pkmn/randoms is commonly used with @pkmn/sim to set the TeamGenerator factory on its Teams so that Teams.generate will work:

import {Teams} from '@pkmn/sim';
import {TeamGenerators} from '@pkmn/randoms';

Teams.setGeneratorFactory(TeamGenerators);
const team = Teams.generate('gen1randombattle');

Browser

The recommended way of using @pkmn/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.

Readme

Keywords

none

Package Sidebar

Install

npm i @pkmn/randoms

Weekly Downloads

92

Version

0.9.3

License

MIT

Unpacked Size

7.21 MB

Total Files

8

Last publish

Collaborators

  • kjscheibo