Skip to content

Algorithm to determine how many times pokeball shakes

License

Notifications You must be signed in to change notification settings

bukinoshita/pokeball-shake

Repository files navigation

pokeball-shake Build Status

Algorithm to determine how many times pokeball shakes

Install

$ yarn add pokeball-shake

Usage

const pokeballShake = require('pokeball-shake')
const pokemonF = require('pokemon-f')

const f = await pokemonF(35, 'greatball', 29)

pokeballShake(163, 'greatball', f)
// => Pokeball shaked `2` time before pokemon goes free.

API

pokeballShake(catchRate, pokeball, f, [statusAilment])

catchRate

Type: number
Required

Pokemon's catch rate

pokeball

Type: string
Options: pokeball, greatball, ultraball and safariball
Required

Pokeball's name

f

Type: number
Required

Algorithm to calculate f
Use pokemon-f to calculate f.

statusAilment

Type: number
Default: 0
Options:

  • 12 if poisoned, burned, or paralyzed
  • 25 if frozen or asleep

Related

License

MIT © Bu Kinoshita