0.2.2 • Published 2 years ago

pokemon-go-pvp-rank v0.2.2

Weekly downloads
6
License
MIT
Repository
github
Last release
2 years ago

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.

0.3.1-rc1

2 years ago

0.2.2

2 years ago

0.2.2-0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.2.0-rc1

3 years ago

0.1.0

3 years ago