This commit is contained in:
2025-08-07 23:35:29 +02:00
parent 5381bed30a
commit 805fc266d5
11 changed files with 961 additions and 398 deletions

29
commands/bonus.js Normal file
View File

@ -0,0 +1,29 @@
exports.name = "bonus";
exports.description =
":star: Sums and calculates bonus for player stat numbers.";
exports.usage = "<<bonus <number> <number> [inf optional extra numbers]";
exports.example = "<<bonus 100 100";
exports.run = (client, message, args) => {
let is1nan = false;
if (!args[0])
return message.channel.send("Not enough arguments, consult <<help.");
args.forEach((arg) => {
if (isNaN(parseInt(arg))) {
is1nan = true;
}
arg = parseInt(arg);
});
if (is1nan)
return message.channel.send(
"You have provided invalid arguments to this command, please consult <<help."
);
let sum = 0;
args.forEach((arg) => {
if (arg > 2000) arg = 2000; // just dont bother for anything higher than 2000
sum += parseInt(arg);
});
sum--;
message.channel.send(
`Will reach ${sum}, ${Math.ceil(sum * 1.4)} with bonus.`
);
};