8000 GitHub - gu-fan/bonusgen: a simple bonus generator
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

gu-fan/bonusgen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

a simple bonus generator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0