mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-13 00:09:08 +02:00
Fix
This commit is contained in:
@@ -100,11 +100,7 @@ module.exports = class PokerCommand extends Command {
|
|||||||
else turnRotation.push(turnRotation[0], turnRotation[1]);
|
else turnRotation.push(turnRotation[0], turnRotation[1]);
|
||||||
turnRotation.shift();
|
turnRotation.shift();
|
||||||
turnRotation.shift();
|
turnRotation.shift();
|
||||||
while (!turnOver) {
|
while (!turnOver) turnOver = await this.bettingRound(msg, players, turnRotation, turnData);
|
||||||
const results = await this.bettingRound(msg, players, turnRotation, turnData);
|
|
||||||
turnData = results.data;
|
|
||||||
turnOver = results.turnOver;
|
|
||||||
}
|
|
||||||
if (turnRotation.length === 1) {
|
if (turnRotation.length === 1) {
|
||||||
const remainer = players.get(turnRotation[0]);
|
const remainer = players.get(turnRotation[0]);
|
||||||
await msg.say(`${remainer.user} takes the pot.`);
|
await msg.say(`${remainer.user} takes the pot.`);
|
||||||
@@ -121,11 +117,7 @@ module.exports = class PokerCommand extends Command {
|
|||||||
`);
|
`);
|
||||||
await delay(5000);
|
await delay(5000);
|
||||||
turnOver = false;
|
turnOver = false;
|
||||||
while (!turnOver) {
|
while (!turnOver) turnOver = await this.bettingRound(msg, players, turnRotation, turnData);
|
||||||
const results = await this.bettingRound(msg, players, turnRotation, turnData);
|
|
||||||
turnData = results.data;
|
|
||||||
turnOver = results.turnOver;
|
|
||||||
}
|
|
||||||
if (turnRotation.length === 1) {
|
if (turnRotation.length === 1) {
|
||||||
const remainer = players.get(turnRotation[0]);
|
const remainer = players.get(turnRotation[0]);
|
||||||
await msg.say(`${remainer.user} takes the pot.`);
|
await msg.say(`${remainer.user} takes the pot.`);
|
||||||
@@ -142,11 +134,7 @@ module.exports = class PokerCommand extends Command {
|
|||||||
`);
|
`);
|
||||||
await delay(5000);
|
await delay(5000);
|
||||||
turnOver = false;
|
turnOver = false;
|
||||||
while (!turnOver) {
|
while (!turnOver) turnOver = await this.bettingRound(msg, players, turnRotation, turnData);
|
||||||
const results = await this.bettingRound(msg, players, turnRotation, turnData);
|
|
||||||
turnData = results.data;
|
|
||||||
turnOver = results.turnOver;
|
|
||||||
}
|
|
||||||
if (turnRotation.length === 1) {
|
if (turnRotation.length === 1) {
|
||||||
const remainer = players.get(turnRotation[0]);
|
const remainer = players.get(turnRotation[0]);
|
||||||
await msg.say(`${remainer.user} takes the pot.`);
|
await msg.say(`${remainer.user} takes the pot.`);
|
||||||
@@ -163,11 +151,7 @@ module.exports = class PokerCommand extends Command {
|
|||||||
`);
|
`);
|
||||||
await delay(5000);
|
await delay(5000);
|
||||||
turnOver = false;
|
turnOver = false;
|
||||||
while (!turnOver) {
|
while (!turnOver) turnOver = await this.bettingRound(msg, players, turnRotation, turnData);
|
||||||
const results = await this.bettingRound(msg, players, turnRotation, turnData);
|
|
||||||
turnData = results.data;
|
|
||||||
turnOver = results.turnOver;
|
|
||||||
}
|
|
||||||
if (turnRotation.length === 1) {
|
if (turnRotation.length === 1) {
|
||||||
const remainer = players.get(turnRotation[0]);
|
const remainer = players.get(turnRotation[0]);
|
||||||
await msg.say(`${remainer.user} takes the pot.`);
|
await msg.say(`${remainer.user} takes the pot.`);
|
||||||
@@ -287,12 +271,9 @@ module.exports = class PokerCommand extends Command {
|
|||||||
}
|
}
|
||||||
if (choiceAction !== 'fold') turnRotation.push(turnRotation[0]);
|
if (choiceAction !== 'fold') turnRotation.push(turnRotation[0]);
|
||||||
turnRotation.shift();
|
turnRotation.shift();
|
||||||
return {
|
return (data.highestBetter.id === turnPlayer.id && choiceAction === 'check')
|
||||||
turnOver: (data.highestBetter.id === turnPlayer.id && choiceAction === 'check')
|
|| (data.highestBetter.currentBet === turnPlayer.currentBet && turnRotation[0] === data.highestBetter.id)
|
||||||
|| (data.highestBetter.currentBet === turnPlayer.currentBet && turnRotation[0] === data.highestBetter.id)
|
|| turnRotation.length === 1;
|
||||||
|| turnRotation.length === 1,
|
|
||||||
data
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async resetGame(msg, players) {
|
async resetGame(msg, players) {
|
||||||
|
|||||||
Reference in New Issue
Block a user