Socket
Book a DemoInstallSign in
Socket

pokemon-stat-calculator

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pokemon-stat-calculator

Pokémon stat calculator

0.3.0
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

pokemon-stat-calculator

Build Status npm package

Calculate Pokémon stats

Install

$ npm install pokemon-stat-calculator --save

Usage

const calculator = require('pokemon-stat-calculator')

calculator.getNatureNames()
// => ['hardy', 'timid' ...]

calculator.getNatureValue('timid')
// => [0.9, 1, 1, 1, 1.1]

calculator.getNatureDatas()
// => See Natures Section

calculator.calHpStats(3, 78, 249, 50)
// => 170

calculator.calHpStats(31, 1, 252, 100)
// => 1, No.292 Shedinja's HP always be 1.

calculator.calUnhpStats(0, 159, 0, 100)
// => 323

calculator.calUnhpStats(31, 159, 249, 50)
// => 210

let charizardBaseStats = [78, 104, 78, 159, 115, 100]
let fullIVs = [31, 31, 31, 31, 31, 31]
let zeroIVs = [0, 0, 0, 0, 0, 0]
let emptyEVs = [0, 0, 0, 0, 0, 0]
let fullEVs = [6, 0, 0, 252, 0, 252]
let nature = [1, 1, 1, 1, 1]

calculator.calAllStats(fullIVs, charizardBaseStats, emptyEVs, 50, nature)
// => [153, 124, 98, 179, 135, 120]

calculator.calAllStats(zeroIVs, charizardBaseStats, fullEVs, 100, nature)
// => [267, 213, 161, 386, 235, 268]

Natures

{
  hardy: [1, 1, 1, 1, 1],
  lonely: [1.1, 0.9, 1, 1, 1],
  adamant: [1.1, 1, 0.9, 1, 1],
  naughty: [1.1, 1, 1, 0.9, 1],
  brave: [1.1, 1, 1, 1, 0.9],
  bold: [0.9, 1.1, 1, 1, 1],
  docile: [1, 1, 1, 1, 1],
  impish: [1, 1.1, 0.9, 1, 1],
  lax: [1, 1.1, 1, 0.9, 1],
  relaxed: [1, 1.1, 1, 1, 0.9],
  modest: [0.9, 1, 1.1, 1, 1],
  mild: [1, 0.9, 1.1, 1, 1],
  bashful: [1, 1, 1, 1, 1],
  rash: [1, 1, 1.1, 0.9, 1],
  quiet: [1, 1, 1.1, 1, 0.9],
  calm: [0.9, 1, 1, 1.1, 1],
  gentle: [1, 0.9, 1, 1.1, 1],
  careful: [1, 1, 0.9, 1.1, 1],
  quirky: [1, 1, 1, 1, 1],
  sassy: [1, 1, 1, 1.1, 0.9],
  timid: [0.9, 1, 1, 1, 1.1],
  hasty: [1, 0.9, 1, 1, 1.1],
  jolly: [1, 1, 0.9, 1, 1.1],
  naive: [1, 1, 1, 0.9, 1.1],
  serious: [1, 1, 1, 1, 1]
}

API

getNatureNames

getNatureValue: (nature)

getNatureDatas

calHpStats: (iv, baseStats, ev, level)

calUnhpStats: (iv, baseStats, ev = 0, level = 1, nature = 1)

calAllStats: (ivs, baseStats, evs, level = 1, nature = [1, 1, 1, 1, 1])

License

MIT © dalphyx

Keywords

pokemon

FAQs

Package last updated on 11 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.