diff --git a/commands/games/battle.js b/commands/games/battle.js index 0660c45c..342ff9f3 100644 --- a/commands/games/battle.js +++ b/commands/games/battle.js @@ -24,8 +24,8 @@ module.exports = class BattleCommand extends Command { } async run(msg, { opponent }) { - if (opponent.id === msg.author.id) return msg.reply('You may not fight yourself.'); - if (this.battles.has(msg.channel.id)) return msg.reply('Only one fight may be occurring per channel.'); + if (opponent.id === msg.author.id) return msg.reply('You may not battle yourself.'); + if (this.battles.has(msg.channel.id)) return msg.reply('Only one battle may be occurring per channel.'); this.battles.set(msg.channel.id, new Battle(msg.author, opponent)); const battle = this.battles.get(msg.channel.id); try { @@ -39,21 +39,21 @@ module.exports = class BattleCommand extends Command { } while (!battle.winner) { const choice = await battle.attacker.chooseAction(msg); - if (choice === 'fight') { - const damage = randomRange(battle.defender.guarding ? 5 : 20, battle.defender.guarding ? 20 : 50); + if (choice === 'attack') { + const damage = randomRange(battle.defender.guard ? 5 : 20, battle.defender.guard ? 20 : 50); await msg.say(`${battle.attacker} deals **${damage}** damage!`); battle.defender.dealDamage(damage); battle.reset(); - } else if (choice === 'guard') { - await msg.say(`${battle.attacker} guards!`); + } else if (choice === 'defend') { + await msg.say(`${battle.attacker} defends!`); battle.attacker.changeGuard(); battle.reset(false); } else if (choice === 'special') { const miss = Math.floor(Math.random() * 3); if (miss) { - await msg.say(`${battle.attacker}'s attack missed!`); + await msg.say(`${battle.attacker}'s special attack missed!`); } else { - const damage = randomRange(battle.defender.guarding ? 50 : 100, battle.defender.guarding ? 100 : 200); + const damage = randomRange(battle.defender.guard ? 50 : 100, battle.defender.guard ? 100 : 200); await msg.say(`${battle.attacker} deals **${damage}** damage!`); battle.defender.dealDamage(damage); } diff --git a/package.json b/package.json index a7f4a85a..0131a768 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "93.1.4", + "version": "94.0.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": { diff --git a/structures/battle/Battler.js b/structures/battle/Battler.js index e0ba97fe..0de3a25d 100644 --- a/structures/battle/Battler.js +++ b/structures/battle/Battler.js @@ -1,7 +1,7 @@ const { stripIndents } = require('common-tags'); const { list } = require('../../util/Util'); -const choices = ['fight', 'guard', 'special', 'run']; -const botChoices = ['fight', 'guard', 'special']; +const choices = ['attack', 'defend', 'special', 'run']; +const botChoices = ['attack', 'defend', 'special']; module.exports = class Battler { constructor(battle, user) { @@ -9,7 +9,7 @@ module.exports = class Battler { this.user = user; this.bot = user.bot; this.hp = 500; - this.guarding = false; + this.guard = false; } async chooseAction(msg) { @@ -34,8 +34,8 @@ module.exports = class Battler { } changeGuard() { - this.guarding = !this.guarding; - return this.guarding; + this.guard = !this.guard; + return this.guard; } forfeit() {