diff --git a/commands/games/battle.js b/commands/games/battle.js index ea22c531..bac40f0d 100644 --- a/commands/games/battle.js +++ b/commands/games/battle.js @@ -85,8 +85,8 @@ module.exports = class BattleCommand extends Command { guard = true; reset(false); } else if (choice === 'special') { - const hit = Math.floor(Math.random() * 4) + 1; - if (hit === 1) { + const miss = Math.floor(Math.random() * 4); + if (!miss) { const damage = randomRange(100, guard ? 150 : 300); await msg.say(`${user} deals **${damage}** damage!`); dealDamage(damage); diff --git a/commands/games/lottery.js b/commands/games/lottery.js index 9e12cda0..c705da17 100644 --- a/commands/games/lottery.js +++ b/commands/games/lottery.js @@ -11,8 +11,8 @@ module.exports = class LotteryCommand extends Command { } run(msg) { - const lottery = Math.floor(Math.random() * 1000) + 1; - if (lottery === 1) return msg.reply('Nice job! 10/10! You deserve some cake!'); + const loss = Math.floor(Math.random() * 1000); + if (!loss) return msg.reply('Nice job! 10/10! You deserve some cake!'); return msg.reply('Nope, sorry, you lost.'); } };