From 2e93aed4df4770d7f0a5d38ad7fe2f6d9f607ecd Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Thu, 1 Jun 2017 19:05:20 +0000 Subject: [PATCH] Oops --- commands/games/battle.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/games/battle.js b/commands/games/battle.js index 8a111cdc..7b4bb025 100644 --- a/commands/games/battle.js +++ b/commands/games/battle.js @@ -49,8 +49,8 @@ module.exports = class BattleCommand extends Command { if (guard) guard = false; }; const dealDamage = (damage) => { - if (userTurn) userHP -= damage; - else oppoHP -= damage; + if (userTurn) oppoHP -= damage; + else userHP -= damage; }; while (userHP > 0 && oppoHP > 0) { // eslint-disable-line no-unmodified-loop-condition const username = userTurn ? msg.author.username : opponent.username; @@ -89,7 +89,7 @@ module.exports = class BattleCommand extends Command { } } else if (choice === 'run') { await msg.say(`**${username}** flees!`); - dealDamage(500 - (userTurn ? userHP : oppoHP)); + break; } else { await msg.say('I do not understand what you want to do.'); }