refactor(stats): Address PR comments

This commit is contained in:
Sabe Jones
2015-11-18 15:06:55 -05:00
parent 7d2643063f
commit 31b68219d1
3 changed files with 57 additions and 62 deletions

View File

@@ -4,9 +4,9 @@
------------------------------------------------------
*/
const maxLevel = 100;
export const maxLevel = 100;
function capByLevel (lvl) {
export function capByLevel (lvl) {
if (lvl > maxLevel) {
return maxLevel;
} else {
@@ -20,7 +20,7 @@ function capByLevel (lvl) {
------------------------------------------------------
*/
const maxHealth = 50;
export const MAX_HEALTH = 50;
/*
------------------------------------------------------
@@ -28,7 +28,7 @@ const maxHealth = 50;
------------------------------------------------------
*/
function tnl (lvl) {
export function toNextLevel (lvl) {
return Math.round((Math.pow(lvl, 2) * 0.25 + 10 * lvl + 139.75) / 10) * 10;
}
@@ -39,17 +39,6 @@ function tnl (lvl) {
{halfway} (optional) the point at which the graph starts bending
*/
function diminishingReturns (bonus, max, halfway) {
if (!halfway) {
halfway = max / 2;
}
export function diminishingReturns (bonus, max, halfway = max/2) {
return max * (bonus / (bonus + halfway));
}
export default {
maxLevel,
capByLevel,
maxHealth,
tnl,
diminishingReturns,
};