pokemon-go-pvp-rank
Version:
Pokémon Go PVP ranking calculator
95 lines (72 loc) • 2.64 kB
Markdown






A rank calculator for PVP on Pokémon Go.
It features full support for Typescript, ES Modules and Common JS imports.
Based on the work of [nickmagus][pogostat-reddit] on pogostat.com
and [gostadiumpvp][gostadiumpvp] on stadiumgaming.gg.
This was written as a library and can be requested with `npm` or `yarn`.
`yarn add pokemon-go-pvp-rank`
Or
`npm install pokemon-go-pvp-rank`
Import the library:
```javascript
// for Typescript / ESM
import { calculateRank, getByName } from 'pokemon-go-pvp-rank';
// for Common JS
const { calculateRank, getByName } = require('pokemon-go-pvp-rank');
```
All function use objects as named parameters.
```javascript
const pokedexEntry = getByName({ name: 'Machamp' });
const { rank, occurence } = calculateRank({
pokedexEntry,
// refs from pokémon being compared (1-15)
refAttackStat: 1,
refDefenseStat: 14,
refHealthStat: 14,
// max league CP
maxCP: 1500,
// max desired level (1-55)
maxLevel: 40,
// minimum stat:
// 0 - wild
// 1 - good friend trade
// 2 - great friend trade
// 3 - ultra friend trade
// 4 - weather boost
// 5 - best friend trade
// 10 - raid/egg/mission
// 12 - lucky
minimumStatValue: 0,
});
```
The `rank` object contains an array of `occurence` which contains the structure below,
`ocurrence` is has the data for the reference stats provided.
```javascript
{
attackStat: 1,
defenseStat: 14,
healthStat: 14,
level: 18,
attackProduct: 133.1873121765,
defenseProduct: 98.04853194270001,
healthProduct: 125,
product: 1632352.55403749,
cp: 1475,
rank: 235
}
```
Pokémon and all respective names and images are trademark & copyright of
Nintendo. Pokémon GO is trademark & copyright of Niantic, Inc.
This project is not affiliated with Niantic Inc., The Pokemon Company nor Nintendo.
[]: https://www.reddit.com/r/TheSilphRoad/comments/bwtsqg/pvp_iv_rank_calculator/
[]: https://www.reddit.com/user/nickmagus/
[]: https://www.twitter.com/gostadiumpvp