mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-23 18:05:01 +02:00
Fix
This commit is contained in:
@@ -36,7 +36,7 @@ module.exports = class BattleCommand extends Command {
|
||||
return msg.say('Looks like they declined...');
|
||||
}
|
||||
}
|
||||
while (battle.winner === null || battle.winner !== 'time') {
|
||||
while (!battle.winner) {
|
||||
const choice = await battle.attacker.chooseAction(msg);
|
||||
if (choice === 'attack') {
|
||||
const damage = randomRange(battle.defender.guard ? 5 : 20, battle.defender.guard ? 20 : 50);
|
||||
@@ -81,6 +81,7 @@ module.exports = class BattleCommand extends Command {
|
||||
await msg.say(`Time's up, ${battle.attacker}!`);
|
||||
battle.reset();
|
||||
if (battle.lastTurnTimeout) {
|
||||
battle.endedDueToInactivity = true;
|
||||
break;
|
||||
} else {
|
||||
battle.lastTurnTimeout = true;
|
||||
|
||||
Reference in New Issue
Block a user