This commit is contained in:
47
commands/hb.js
Normal file
47
commands/hb.js
Normal file
@ -0,0 +1,47 @@
|
||||
const STAT_MULT_INITIAL_AB2 = 0.66;
|
||||
const STAT_MULT_FULL_AB2 = 0.75;
|
||||
|
||||
const STAT_EXP_INITIAL_AB2 = 0.0825;
|
||||
const STAT_EXP_FULL_AB2 = 0.3375;
|
||||
|
||||
const ADDITIONAL_DAMAGE_MULTIPLIER = 0.25;
|
||||
const ADDITIONAL_DAMAGE_EXPONENT = 0.95;
|
||||
|
||||
// Functions
|
||||
function get_ab2_scaling(stat_val) {
|
||||
return (
|
||||
1.0 +
|
||||
STAT_MULT_INITIAL_AB2 *
|
||||
(Math.min(stat_val + 1.0, 4.0) ** STAT_EXP_INITIAL_AB2 - 1.0) +
|
||||
STAT_MULT_FULL_AB2 * ((stat_val + 1.0) ** STAT_EXP_FULL_AB2 - 1.0)
|
||||
);
|
||||
}
|
||||
|
||||
function get_damage_multiplier(stat_val) {
|
||||
return (
|
||||
1.0 +
|
||||
ADDITIONAL_DAMAGE_MULTIPLIER *
|
||||
get_ab2_scaling(Math.max(stat_val, 1)) ** ADDITIONAL_DAMAGE_EXPONENT
|
||||
);
|
||||
}
|
||||
|
||||
exports.name = "hb";
|
||||
exports.description = ":muscle: Calculate hero boost's damage multiplier.";
|
||||
exports.usage = "<<hb <points>";
|
||||
exports.example = "<<hb 5000";
|
||||
exports.hidden = false;
|
||||
exports.run = (client, message, args) => {
|
||||
if (!args[0])
|
||||
return message.channel.send("Not enough arguments, consult <<help.");
|
||||
let hbPoints = parseInt(args[0]);
|
||||
if (isNaN(hbPoints))
|
||||
return message.channel.send(
|
||||
"Given argument is not a number. Consult <<help."
|
||||
);
|
||||
|
||||
message.channel.send(
|
||||
`With **${hbPoints}** points in your hero boost, you will boost with a ${get_damage_multiplier(
|
||||
hbPoints
|
||||
).toFixed(4)} damage multiplier.`
|
||||
);
|
||||
};
|
@ -1,5 +1,5 @@
|
||||
exports.name = "refetch";
|
||||
exports.description = ":ninja: Refetch user react data.";
|
||||
exports.description = ":ninja: Refetch user react data. (shiro)";
|
||||
exports.usage = "<<refetch";
|
||||
exports.example = "<<refetch";
|
||||
exports.hidden = true;
|
||||
|
48
commands/tb.js
Normal file
48
commands/tb.js
Normal file
@ -0,0 +1,48 @@
|
||||
const STAT_MULT_INITIAL_AB2 = 0.66;
|
||||
const STAT_MULT_FULL_AB2 = 0.75;
|
||||
|
||||
const STAT_EXP_INITIAL_AB2 = 0.0825;
|
||||
const STAT_EXP_FULL_AB2 = 0.3375;
|
||||
|
||||
// only this changed for tower boosting
|
||||
const ADDITIONAL_DAMAGE_MULTIPLIER = 0.1;
|
||||
const ADDITIONAL_DAMAGE_EXPONENT = 1.25;
|
||||
|
||||
// Functions
|
||||
function get_ab2_scaling(stat_val) {
|
||||
return (
|
||||
1.0 +
|
||||
STAT_MULT_INITIAL_AB2 *
|
||||
(Math.min(stat_val + 1.0, 4.0) ** STAT_EXP_INITIAL_AB2 - 1.0) +
|
||||
STAT_MULT_FULL_AB2 * ((stat_val + 1.0) ** STAT_EXP_FULL_AB2 - 1.0)
|
||||
);
|
||||
}
|
||||
|
||||
function get_damage_multiplier(stat_val) {
|
||||
return (
|
||||
1.0 +
|
||||
ADDITIONAL_DAMAGE_MULTIPLIER *
|
||||
get_ab2_scaling(Math.max(stat_val, 1)) ** ADDITIONAL_DAMAGE_EXPONENT
|
||||
);
|
||||
}
|
||||
|
||||
exports.name = "tb";
|
||||
exports.description = ":fire: Calculate tower boost's damage multiplier.";
|
||||
exports.usage = "<<tb <points>";
|
||||
exports.example = "<<tb 5000";
|
||||
exports.hidden = false;
|
||||
exports.run = (client, message, args) => {
|
||||
if (!args[0])
|
||||
return message.channel.send("Not enough arguments, consult <<help.");
|
||||
let hbPoints = parseInt(args[0]);
|
||||
if (isNaN(hbPoints))
|
||||
return message.channel.send(
|
||||
"Given argument is not a number. Consult <<help."
|
||||
);
|
||||
|
||||
message.channel.send(
|
||||
`With **${hbPoints}** points in your tower boost, you will boost towers with a ${get_damage_multiplier(
|
||||
hbPoints
|
||||
).toFixed(4)} multiplier.`
|
||||
);
|
||||
};
|
Reference in New Issue
Block a user