bukinoshita / pokeball-shake

Algorithm to determine how many times pokeball shakes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Algorithm to determine how many times pokeball shakes

License:MIT License


Languages

Language:TypeScript 100.0%