chromatic-orb

4.0.0 • Public • Published

chromatic-orb

Calculate odds of rolling desired socket colors with a chromatic orb. Formula is based on Siveran's calculator, which is based on Lawphill's calculator. Results are not guaranteed to be completely accurate.

Example

For example, let's say you want to find out the chances of rolling 5 red sockets and 1 green socket on a piece of armor that requires 180 strength to wield:

var chromatic = require('chromatic-orb');

var chance = chromatic({
  sockets: 6,
  red: 5,
  green: 1,
  strength: 180
}));
// => 0.23161598136624462

That's a 23% chance of success! From here, we can also find out the average number of chromatic orbs one would have to spend:

1 / chance;
// => 4.3

So on average it will take you 4-5 chromatic orbs to roll such sockets. Note that you can also calculate standard deviation yourself:

Math.sqrt((1 - chance) / Math.pow(chance, 2));
// => 3.78

Installation

$ npm install chromatic-orb

API

var chromatic = require('chromatic-orb');

chromatic(opts)

Same API as socket-colors-chance.

/chromatic-orb/

    Package Sidebar

    Install

    npm i chromatic-orb

    Weekly Downloads

    3

    Version

    4.0.0

    License

    MIT

    Unpacked Size

    34 kB

    Total Files

    12

    Last publish

    Collaborators

    • kenan