This repository has been archived on 2025-08-25. You can view files and clone it, but cannot push or open issues or pull requests.
Files
shiro-calculator/commands/ms.js
2025-08-07 23:35:29 +02:00

26 lines
1010 B
JavaScript

exports.name = "ms";
exports.description =
":tada: Calculate moon staff damage taking in to account projectile speed.";
exports.usage = "<<ms <elemental damage> <ups> [projectile speed]";
exports.example = "<<ms 10000 250 10000";
exports.run = (client, message, args) => {
if (!args[0] || !args[1])
return message.channel.send("Not enough arguments, consult <<help.");
let moonstaff = parseInt(args[0]);
let ups = parseInt(args[1]);
if (isNaN(moonstaff) || isNaN(ups))
return message.channel.send("Damage or ups should be a number.");
let initialspeed = null;
if (args[2]) {
initialspeed = parseInt(args[2]);
if (isNaN(initialspeed))
return message.channel.send("Projectile speed should be a number.");
initialspeed = 30000 - initialspeed;
let t = Math.ceil(initialspeed / 1200);
console.log(t);
ups = ups - t;
}
console.log(ups);
message.channel.send(`Should be ${moonstaff + ups * 99}.`);
};