Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bukinoshita/pokeball-shake
Algorithm to determine how many times pokeball shakes
https://github.com/bukinoshita/pokeball-shake
algorithm javascript nodejs pokeball pokemon
Last synced: 8 days ago
JSON representation
Algorithm to determine how many times pokeball shakes
- Host: GitHub
- URL: https://github.com/bukinoshita/pokeball-shake
- Owner: bukinoshita
- License: mit
- Created: 2017-06-28T01:11:29.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2023-01-06T01:52:51.000Z (almost 2 years ago)
- Last Synced: 2024-10-27T18:12:48.240Z (2 months ago)
- Topics: algorithm, javascript, nodejs, pokeball, pokemon
- Language: TypeScript
- Homepage:
- Size: 689 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# pokeball-shake [![Build Status](https://travis-ci.org/bukinoshita/pokeball-shake.svg?branch=master)](https://travis-ci.org/bukinoshita/pokeball-shake)
> Algorithm to determine how many times pokeball shakes
## Install
```
$ yarn add pokeball-shake
```## Usage
```js
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`
RequiredPokemon's catch rate
#### pokeball
Type: `string`
Options: `pokeball`, `greatball`, `ultraball` and `safariball`
RequiredPokeball's name
#### f
Type: `number`
RequiredAlgorithm to calculate `f`
Use [pokemon-f](https://github.com/bukinoshita/pokemon-f) to calculate `f`.#### statusAilment
Type: `number`
Default: `0`
Options:- `12` if poisoned, burned, or paralyzed
- `25` if frozen or asleep## Related
- [pokemon-game](https://github.com/bukinoshita/pokemon-game) — Pokemon game — Get 'em all
- [pokedex-api](https://github.com/bukinoshita/pokedex-api) — Pokedex API
- [pokemon-catch-probability](https://github.com/bukinoshita/pokemon-catch-probability) — Check probabilty to catch a pokemon
- [get-pokeball](https://github.com/bukinoshita/get-pokeball) — Get pokeball information
- [catch-pokemon](https://github.com/bukinoshita/catch-pokemon) — Algorithm to catch a pokemon
- [pokemon-capture-quote](https://github.com/bukinoshita/pokemon-capture-quote) — Pokemon capture quote
- [pokemon-f](https://github.com/bukinoshita/pokemon-f) — Algorithm to calculate `f` on capture pokemon method## License
MIT © [Bu Kinoshita](https://bukinoshita.com)