catch-pokemon
Algorithm to catch a pokemon
Install
$ npm install --save catch-pokemon
Usage
const catchPokemon = require('catch-pokemon')
catchPokemon('Pikachu', 'masterball')
API
catchPokemon(pokemon, pokeball, [options])
returns a promise
pokemon
Type: string
Required
Pokemon's name
pokeball
Type: string
Options: pokeball
, masterball
, greatball
, ultraball
and safariball
Required
Pokeball's name
options
Type: object
hp
Type: integer
Pokemon's hp
catchRate
Type: integer
Pokemon's catch rate
asleep
Type: boolean
Default: false
Determine if pokemon is asleep
frozen
Type: boolean
Default: false
Determine if pokemon is frozen
paralyzed
Type: boolean
Default: false
Determine if pokemon is paralyzed
burned
Type: boolean
Default: false
Determine if pokemon is burned
poisoned
Type: boolean
Default: false
Determine if pokemon is poisoned
If hp
and catchRate
are passed it won't look up for these information on API (faster). Otherwise, it will try to find the Pokemon on the API.
Related
License
MIT © Bu Kinoshita