1.0.2 • Published 5 years ago
bonusgen v1.0.2
Bonus Gen
A Simple Bonus Generator.
through this generator, bonus will break into 3 parts, latter player will got less bonus, and make bonus randomized,
also you can change the player_ratio and bonus_ratio as your demands
example
install
yarn install bonusgen
use
import BonusGen from 'bonusgen'
const player_total = 5
const bonus_total = 100
// this means player count ratio for each part, default is 1:5:10
// that is, player of part 3 is 10 times of part 1
const player_ratio = [1,2,10]
// this means avg bonus ratio, default is 5:2:1
// that is, avg bonus of part 1 player is 5 times of part 3 player
const bonus_ratio = [5,3,1]
const bonus = BonusGen(player_total, bonus_total, player_ratio, bonus_ratio)
// randomized bonus array
console.log(bonus.randomized)
// plain bonus array
console.log(bonus.plain)