0.0.1 • Published 7 years ago

catch-pokemon v0.0.1

Weekly downloads
7
License
MIT
Repository
github
Last release
7 years ago

catch-pokemon Build Status

Algorithm to catch a pokemon

Install

$ npm install --save catch-pokemon

Usage

const catchPokemon = require('catch-pokemon')

catchPokemon('Pikachu', 'masterball')
// => All right! Pikachu was caught!

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