@tinypudding/puddy-lib
Advanced tools
Comparing version 1.1.37 to 1.1.38
@@ -32,4 +32,4 @@ class levelup { | ||
// Exp Generator | ||
expGenerator() { | ||
return Number(Math.floor(Math.random() * ((this.giveExp - 1) + 1) + 1)); | ||
expGenerator(multi = 1) { | ||
return Number(Math.floor(Math.random() * ((this.giveExp - 1) + 1) + 1)) * multi; | ||
} | ||
@@ -60,6 +60,7 @@ | ||
// Give | ||
give(user, extraExp = 0, type = 'add') { | ||
give(user, extraExp = 0, type = 'add', multi = 1) { | ||
// Get the new user exp | ||
if (type === "add") { user.exp += this.expGenerator() + extraExp; } | ||
if (type === "add") { user.exp += this.expGenerator(multi) + extraExp; } | ||
// Extra | ||
else if (type === "extra") { user.exp += extraExp; } | ||
@@ -77,6 +78,7 @@ this.expValidator(user); | ||
// Remove | ||
remove(user, extraExp = 0, type = 'add') { | ||
remove(user, extraExp = 0, type = 'add', multi = 1) { | ||
// Get the new user exp | ||
if (type === "add") { user.exp -= this.expGenerator() + extraExp } | ||
if (type === "add") { user.exp -= this.expGenerator(multi) + extraExp } | ||
// Extra | ||
else if (type === "extra") { user.exp -= extraExp } | ||
@@ -115,3 +117,3 @@ this.expValidator(user); | ||
// Add More Level | ||
if(extraValue > 0) { | ||
if (extraValue > 0) { | ||
return this.give(user, extraValue, 'extra'); | ||
@@ -129,3 +131,3 @@ } | ||
// Remove more level | ||
if(user.exp < 0) { | ||
if (user.exp < 0) { | ||
extraValue = Math.abs(user.exp); | ||
@@ -138,3 +140,3 @@ } | ||
// Remove More Level | ||
if(extraValue > 0) { | ||
if (extraValue > 0) { | ||
return this.remove(user, extraValue, 'extra'); | ||
@@ -141,0 +143,0 @@ } |
{ | ||
"name": "@tinypudding/puddy-lib", | ||
"version": "1.1.37", | ||
"version": "1.1.38", | ||
"description": "Essential codes to run the other repositories from the Tiny Pudding Account.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
77105
1266