mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-27 14:18:36 +02:00
Beep
This commit is contained in:
@@ -39,17 +39,9 @@ module.exports = class BalloonPopCommand extends Command {
|
|||||||
let remains = 1000;
|
let remains = 1000;
|
||||||
while (!winner) {
|
while (!winner) {
|
||||||
const user = userTurn ? msg.author : opponent;
|
const user = userTurn ? msg.author : opponent;
|
||||||
await msg.say(`${user} pumps the balloon!`);
|
|
||||||
remains -= 50;
|
|
||||||
const popped = !Math.floor(Math.random() * (remains < 0 ? 2 : remains));
|
|
||||||
if (popped) {
|
|
||||||
await msg.say('The balloon pops!');
|
|
||||||
winner = userTurn ? opponent : msg.author;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
let pump;
|
let pump;
|
||||||
if (!opponent.bot || (opponent.bot && userTurn)) {
|
if (!opponent.bot || (opponent.bot && userTurn)) {
|
||||||
await msg.say(`${user}, do you pump the balloon again?`);
|
await msg.say(`${user}, do you pump the balloon?`);
|
||||||
const verification = await verify(msg.channel, user);
|
const verification = await verify(msg.channel, user);
|
||||||
pump = verification;
|
pump = verification;
|
||||||
} else {
|
} else {
|
||||||
@@ -58,8 +50,8 @@ module.exports = class BalloonPopCommand extends Command {
|
|||||||
if (pump) {
|
if (pump) {
|
||||||
await msg.say(`${user} pumps the balloon!`);
|
await msg.say(`${user} pumps the balloon!`);
|
||||||
remains -= 50;
|
remains -= 50;
|
||||||
const popped2 = !Math.floor(Math.random() * (remains < 0 ? 2 : remains));
|
const popped = !Math.floor(Math.random() * (remains < 0 ? 2 : remains));
|
||||||
if (popped2) {
|
if (popped) {
|
||||||
await msg.say('The balloon pops!');
|
await msg.say('The balloon pops!');
|
||||||
winner = userTurn ? opponent : msg.author;
|
winner = userTurn ? opponent : msg.author;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user