Less AI Messages in Battle

This commit is contained in:
Daniel Odendahl Jr
2017-07-10 21:09:06 +00:00
parent 4f82bbdfc8
commit 26e9b38628
+2 -3
View File
@@ -15,7 +15,7 @@ module.exports = class BattleCommand extends Command {
key: 'opponent',
prompt: 'Who would you like to battle?',
type: 'user',
default: ''
default: 'AI'
}
]
});
@@ -24,7 +24,7 @@ module.exports = class BattleCommand extends Command {
}
async run(msg, args) { // eslint-disable-line complexity
const opponent = args.opponent || 'AI';
const opponent = args.opponent;
if (opponent.bot) return msg.say('Bots may not be fought.');
if (opponent.id === msg.author.id) return msg.say('You may not fight yourself.');
if (this.fighting.has(msg.guild.id)) return msg.say('Only one fight may be occurring per server.');
@@ -81,7 +81,6 @@ module.exports = class BattleCommand extends Command {
} else {
const choices = ['fight', 'guard', 'special'];
choice = choices[Math.floor(Math.random() * choices.length)];
await msg.say(`${user} chooses to **${choice}**!`);
}
if (choice === 'fight') {
const damage = Math.floor(Math.random() * (guard ? 10 : 100)) + 1;