diff --git a/package.json b/package.json index 860dba0e..9f2cbff3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "120.0.3", + "version": "120.0.4", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": { diff --git a/structures/cards/Card.js b/structures/cards/Card.js index 6906a818..405fdbe9 100644 --- a/structures/cards/Card.js +++ b/structures/cards/Card.js @@ -29,7 +29,7 @@ module.exports = class Card { } get pokersolverKey() { - if (this.value === 'Joker') return null; + if (this.value === 'Joker') return 'Or'; let suitLetter; switch (this.suit) { case 'clubs': suitLetter = 'c'; break; diff --git a/structures/cards/Deck.js b/structures/cards/Deck.js index 522546f7..f90a3694 100644 --- a/structures/cards/Deck.js +++ b/structures/cards/Deck.js @@ -12,18 +12,19 @@ module.exports = class Deck { } makeCards(deckCount) { + const newDeck = []; for (let i = 0; i < deckCount; i++) { for (const suit of suits) { - this.deck.push(new Card('Ace', suit)); - for (let j = 2; j <= 10; j++) this.deck.push(new Card(j, suit)); - for (const face of faces) this.deck.push(new Card(face, suit)); + newDeck.push(new Card('Ace', suit)); + for (let j = 2; j <= 10; j++) newDeck.push(new Card(j, suit)); + for (const face of faces) newDeck.push(new Card(face, suit)); } if (this.includeJokers) { - this.deck.push(new Card('Joker', 'joker')); - this.deck.push(new Card('Joker', 'joker')); + newDeck.push(new Card('Joker', 'joker')); + newDeck.push(new Card('Joker', 'joker')); } } - this.deck = shuffle(this.deck); + this.deck = shuffle(newDeck); return this.deck; } @@ -38,7 +39,7 @@ module.exports = class Deck { } reset() { - this.deck = this.makeCards(this.deckCount); + this.makeCards(this.deckCount); return this; } };