Skip to content

A series of go packages for interacting with data from Pokemon Go's gamemaster file.

License

Notifications You must be signed in to change notification settings

Sigafoos/pokemongo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pokemon-go

Contributor Covenant GoDoc

A library for dealing with Pokemon Go CP and IVs.

It requires you to have a gamemaster.json file in the same format as what PVPoke uses. The easiest way would be to... use PVPoke's:

curl -O https://raw.githubusercontent.com/pvpoke/pvpoke/master/src/data/gamemaster.json

Usage

Here's an example main.go. It:

  • loads the gamemaster file
  • looks up Wobbuffet by its Pokedex number
  • sets its level and IVs
  • calculates its CP and stat product
  • prints the object
package main

import (
	"fmt"
	"os"

	"github.com/Sigafoos/pokemongo"
)

func main() {
	fp, err := os.Open("gamemaster.json")
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}
	defer fp.Close()

	gm, err := pokemongo.NewGamemaster(fp)
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}

	wob := gm.PokemonByNumber(202)
	wob.Level = 23.5
	wob.IVs = pokemongo.Stats{
		Attack:  10,
		Defense: 13,
		HP:      12,
	}
	wob.Calculate()
	fmt.Printf("%+v\n", wob)
}

About

A series of go packages for interacting with data from Pokemon Go's gamemaster file.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages