mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-15 15:57:47 +02:00
Oops
This commit is contained in:
@@ -49,8 +49,8 @@ module.exports = class BattleCommand extends Command {
|
|||||||
if (guard) guard = false;
|
if (guard) guard = false;
|
||||||
};
|
};
|
||||||
const dealDamage = (damage) => {
|
const dealDamage = (damage) => {
|
||||||
if (userTurn) userHP -= damage;
|
if (userTurn) oppoHP -= damage;
|
||||||
else oppoHP -= damage;
|
else userHP -= damage;
|
||||||
};
|
};
|
||||||
while (userHP > 0 && oppoHP > 0) { // eslint-disable-line no-unmodified-loop-condition
|
while (userHP > 0 && oppoHP > 0) { // eslint-disable-line no-unmodified-loop-condition
|
||||||
const username = userTurn ? msg.author.username : opponent.username;
|
const username = userTurn ? msg.author.username : opponent.username;
|
||||||
@@ -89,7 +89,7 @@ module.exports = class BattleCommand extends Command {
|
|||||||
}
|
}
|
||||||
} else if (choice === 'run') {
|
} else if (choice === 'run') {
|
||||||
await msg.say(`**${username}** flees!`);
|
await msg.say(`**${username}** flees!`);
|
||||||
dealDamage(500 - (userTurn ? userHP : oppoHP));
|
break;
|
||||||
} else {
|
} else {
|
||||||
await msg.say('I do not understand what you want to do.');
|
await msg.say('I do not understand what you want to do.');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user