pokemagic
Usage
npm install pokemagic
API
Pokedex
Example
const dex = ; dex; // Pokemondex; // Movedex; // [Pokemon]dex; // [Moves]
Battle Simulator
Example
const simulateBattle = ; const attackers = iv: 0xfff lvl: 40 name: 'machamp' move1: 'counter' move2: 'dynamic punch' ; const defenders = iv: 0xfff lvl: 40 name: 'tyranitar' move1: 'bite' move2: 'crunch' ; const options = raid: null weather: 'EXTREME'; const stats = ; statswinner === 'atk'; // true
Attacker/Defender Objects
iv: 'number' // hexadecimal lvl: 'number' // 1-40 move1: 'string' // a valid Move name (see json/moves.json) move2: 'string' pokemon: // a valid Pokemon object (see json/pokemon.json) id: 'number' name: 'string' type1: 'string' type2: 'string' stats: stamina: 'number' attack: 'number' defense: 'number'
Request Options
atkDodgeStrategy: 'charge' // 'all' | 'charge' | null raid: cp: 'number' hp: 'number' cpm: 'number' raidTier: 'number' weather: 'string' // EXTREME, CLEAR, FOGGY, SUNNY (see lib/weather.js);
Response
const Pokemon = id: 'number' name: 'string' iv: 'string' moves: 'string' 'string' cp: 'number' hp: 'number' dmgDealt: 'number' dmgTaken: 'number'; const Response = log: // A log of all the moves that took place p: 'string' // Pokemon m: 'string' // Move dmg: 'number' // Damage ms: 'number' // Time state: atk: Pokemon def: Pokemon timeElapsed: 'number' timeRemaining: 'number' timedOut: 'boolean' winner: 'string' // atk | def;
Breakpoint & Bulkpoint
Example
const breakpoint = ; // Calculate the break/bulk points for a Raikou fighting a Kyogreconst point = ;
Response
atk: // breakpoints move: 'string' table: dmg: 'number' cp: 'number' lvl: 'number' pct: 'string' // percentage increase over previous point def: // bulkpoints move: 'string' table: dmg: 'number' cp: 'number' lvl: 'number' pct: 'string'
Attacker/Defender Profile
Response
pokemon: Pokemon raidInfo: cp: "number" hp: "number" cpm: "number" data: // Each move will have its own counters list quick: "string" charge: "string" // Each list belongs to a Pokemon, in case there are multiple movesets // that are viable counters results: name: "string" stats: dps: 'number' legacy: 'number' // 0=not legacy,1=quick legacy,2=charge legacy,3=double legacy,4=community day moves: 'string' 'string' // Quick & Charge move name: 'string' // Pokemon's name score: 'number' // Internally used to rank best counters tdo: 'number' types: immune: 'string' notEffective: 'string' superEffective: 'string'
Type Rankings
Example
const typeRankings = ; const rank = ;
Response
name: 'string' moves: 'string' 'string' dps: 'number' // Damage per second score: 'number' // Internally used to sort tdo: 'number' // Total time wins: 'number' // Number of battles won count: 'number' // Number of battles fought ;
IV Calculator
Example
const calculateIV = ; const matches = ;
Response
Possible IV values are returned. If the array is empty then no IVs were matched.
atk: 'number' def: 'number' sta: 'number' ;