diff --git a/commands/Economy/rob.js b/commands/Economy/rob.js index 64cf31da..949702cb 100644 --- a/commands/Economy/rob.js +++ b/commands/Economy/rob.js @@ -50,7 +50,7 @@ class Rob extends Command { memberData.cooldowns.rob = toWait; memberData.markModified("cooldowns"); await memberData.save(); - const randomNum = Math.floor(this.client.functions.randomNum(1, 3)); + const randomNum = this.client.functions.randomNum(1, 3); message.sendT("economy/rob:ROB_WON_" + randomNum, { money: `${amountToRob} ${message.getNoun(amountToRob, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`, username: member.user.username @@ -61,7 +61,7 @@ class Rob extends Command { data.memberData.save(); } else { const won = Math.floor(0.9 * amountToRob); - const randomNum = Math.floor(this.client.functions.randomNum(1, 3)); + const randomNum = this.client.functions.randomNum(1, 3); message.sendT("economy/rob:ROB_LOSE_" + randomNum, { fine: `${potentiallyLose} ${message.getNoun(potentiallyLose, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`, offset: `${won} ${message.getNoun(won, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`, diff --git a/commands/Fun/horserace.js b/commands/Fun/horserace.js index 417920b2..9e7eaad5 100644 --- a/commands/Fun/horserace.js +++ b/commands/Fun/horserace.js @@ -36,8 +36,8 @@ class Horserace extends Command { const f = []; for (let i = 0; i < 5; i++) { - const speed = Math.ceil(Math.random() * 10); - const profit = Math.floor((((8.9 / 9) * (10 - speed)) + 1.1) * 10) / 10; + const speed = this.client.functions.randomNum(1, 5); + const profit = Math.floor((((8.9 / 9) * (6 - speed)) + 1.1) * 10) / 10; thisGame.horseSpeeds.push(speed); f.push({ name: message.translate("fun/horserace:HORSE_NAME", { @@ -90,7 +90,7 @@ class Horserace extends Command { // eslint-disable-next-line no-constant-condition while (true) { for (let i = 0; i < 5; i++) { - if (thisGame.horseSpeeds[i] >= Math.random() * 15) { + if (thisGame.horseSpeeds[i] >= Math.floor(Math.random() * 15)) { horsePositions[i] += 1; if (horsePositions[i] === 3) { const winnings = []; diff --git a/commands/Fun/number.js b/commands/Fun/number.js index 68cde99d..9761311b 100644 --- a/commands/Fun/number.js +++ b/commands/Fun/number.js @@ -23,7 +23,7 @@ class Number extends Command { if (currentGames[message.guild.id]) return message.error("fun/number:GAME_RUNNING"); const participants = [], - number = Math.floor(this.client.functions.randomNum(1000, 10000)); + number = this.client.functions.randomNum(1000, 10000); await message.sendT("fun/number:GAME_START"); diff --git a/events/messageCreate.js b/events/messageCreate.js index 862c4704..5b1dba8b 100644 --- a/events/messageCreate.js +++ b/events/messageCreate.js @@ -225,7 +225,7 @@ async function updateXp(client, msg, data) { const toWait = Date.now() + 60000; xpCooldown[msg.author.id] = toWait; - // Gets a random number between 10 and 5 + // Gets a random number between 5 and 10 const won = client.functions.randomNum(5, 10); const newXp = parseInt(points + won, 10); diff --git a/languages/ru-RU/fun/horserace.json b/languages/ru-RU/fun/horserace.json index 6a013a06..b6840ff9 100644 --- a/languages/ru-RU/fun/horserace.json +++ b/languages/ru-RU/fun/horserace.json @@ -6,7 +6,7 @@ "HORSE_NUM": "На скачках всего 5 лошадей!", "EMBED_T": "Конные скачки", "HORSE_NAME": "Лошадь {{number}}", - "HORSE_VALUE": "Скорость - {{speed}}\nПрибыль - *ставка* x {{profit}}", + "HORSE_VALUE": "Скорость - {{speed}}\nПрибыль - *ставка* x **{{profit}}**", "BET": "**{{user}}** поставил {{amount}} на лошадь **{{horse}}**!", "NO_WINNERS": "Победила лошадь **{{horse}}**. Никто не выиграл кредиты!", "WINNERS": "Победила лошадь **{{horse}}**. {{winners}}!", diff --git a/languages/uk-UA/fun/horserace.json b/languages/uk-UA/fun/horserace.json index 6a013a06..b6840ff9 100644 --- a/languages/uk-UA/fun/horserace.json +++ b/languages/uk-UA/fun/horserace.json @@ -6,7 +6,7 @@ "HORSE_NUM": "На скачках всего 5 лошадей!", "EMBED_T": "Конные скачки", "HORSE_NAME": "Лошадь {{number}}", - "HORSE_VALUE": "Скорость - {{speed}}\nПрибыль - *ставка* x {{profit}}", + "HORSE_VALUE": "Скорость - {{speed}}\nПрибыль - *ставка* x **{{profit}}**", "BET": "**{{user}}** поставил {{amount}} на лошадь **{{horse}}**!", "NO_WINNERS": "Победила лошадь **{{horse}}**. Никто не выиграл кредиты!", "WINNERS": "Победила лошадь **{{horse}}**. {{winners}}!",