shitty-swgoh-stats

2.0.1 • Public • Published

SWGOH Unit-stats Calculator

Unit stats and Galactic Power calculator for raw player data

npm i shitty-swgoh-stats

Initializing the class

Initialize with an existing crinolo_core

const Stats = require(`shitty-swgoh-stats`)
const stats = new Stats( crinolo_core )

Initialize and fetch/update crinolo core

For shittybots api token, see: https://swgoh.shittybots.me/register

Note: "update" will update the class and return you the updated gamedata

const Stats = require(`shitty-swgoh-stats`)
const stats = new Stats()
 
const token = "your_shittybots_api_token"
const crinolo_core = await stats.update( token )

Calculate stats

Units-in are modified with stats and gp attached

Returns a Map of all players, keyed by playerId

Each player is a Map of roster units keyed by baseId

//Requires player's rosterUnitList
const rosterMap = stats.calcRosterStats( player.roserUnitsList )
/*
Map {
  'unit_baseId' => { stats:{ final:<Object>, mods:<Object>, crew:<Object> }, gp:<Integer> },
  ...
}
*/
//Accepts a single or array of players
const playerMap = stats.calcPlayerStats( players )
/*
Map { 
  'playerId' => Map {
    'unit_baseId' => { stats:{ final:<Object>, mods:<Object>, crew:<Object> }, gp:<Integer> },
    ...
  },
  ...
}
*/

/shitty-swgoh-stats/

    Package Sidebar

    Install

    npm i shitty-swgoh-stats

    Weekly Downloads

    0

    Version

    2.0.1

    License

    ISC

    Unpacked Size

    40.4 kB

    Total Files

    5

    Last publish

    Collaborators

    • r3volved