Skip to content
This repository has been archived by the owner on Jul 31, 2022. It is now read-only.

dominik-th/pokemon-go-cp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pokemon-go-cp

A calculator for Pokémon combat power given their level and IVs

Usage

Install package using npm:

$ npm i pokemon-go-cp

Using the package:

var cpCalculator = require('pokemon-go-cp');

// Choose a Pokémon by its Dex number:
var pokemon = 1; // Bulbasaur

// Choose Pokémon iv between 0 and 15:
var atk = 12;
var def = 14;
var sta = 15;

// Calculate the combat power as shown in Pokémon Go
cpCalculator.calculate(pokemon, atk, def, sta); // 546

// Choose a Pokémon level. If not set, default is 20
var pokemonLevel = 31.5;

cpCalculator.calculate(pokemon, atk, def, sta, pokemonLevel); // 839

Contributing

Feel free to open pull requests.

In case there are Pokémon missing or combat power is calculated incorrectly, you might want to use the generator.js script to update the database.

$ cd src/
$ node generator.js

License

This project is licensed under the MIT License - see the LICENSE file for details

About

A calculator for Pokémon combat power given their level and IVs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published