pokemon-go-pvp-rank
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

Pokémon Go - PVP Ranking

code size project license Node.js version npm test coverage tests status

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 on pogostat.com and gostadiumpvp on stadiumgaming.gg.

Install

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

Use

Import the library:

// 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.

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.

{
  attackStat: 1,
  defenseStat: 14,
  healthStat: 14,
  level: 18,
  attackProduct: 133.1873121765,
  defenseProduct: 98.04853194270001,
  healthProduct: 125,
  product: 1632352.55403749,
  cp: 1475,
  rank: 235
}

Disclaimer

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.

Readme

Keywords

Package Sidebar

Install

npm i pokemon-go-pvp-rank

Weekly Downloads

2

Version

0.2.2

License

MIT

Unpacked Size

331 kB

Total Files

22

Last publish

Collaborators

  • pedrosancao