Giter Club home page Giter Club logo

pokemon-go-pvp-rank's Introduction

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.

pokemon-go-pvp-rank's People

Contributors

knutkirkhorn avatar pedrosancao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

nguoianphu

pokemon-go-pvp-rank's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.