From 99193c14ba3dad2477b503c26a51370ea41398af Mon Sep 17 00:00:00 2001 From: TigerAttack302 Date: Mon, 3 Nov 2025 13:20:28 -0500 Subject: [PATCH 1/5] Added grey embed when tying --- src/commands/fun/blackjack.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/commands/fun/blackjack.ts b/src/commands/fun/blackjack.ts index b2c7807b..6fb3f046 100644 --- a/src/commands/fun/blackjack.ts +++ b/src/commands/fun/blackjack.ts @@ -32,6 +32,7 @@ export default class extends Command { let gameStatus = "Click 'Hit' to draw or 'Stand' to pass"; let gameOver = false; let win = false; + let tie = false; // Accounts for two aces drawn at the start, going over 21 if (playerHand === 22) { @@ -53,10 +54,12 @@ export default class extends Command { .setFooter({ text: status }); // Color of the embed on the left changes depending on if it's game over or not - if (gameOver && !win) { + if (gameOver && !win && !tie) { embed.setColor('Red'); } else if (gameOver && win) { embed.setColor('Green'); + } else if (gameOver && !win && tie) { + embed.setColor('Grey'); } else { embed.setColor('Blue'); } From 43a7ca83c3aed1d8cf978d8ef37ba190aa6d989a Mon Sep 17 00:00:00 2001 From: TigerAttack302 Date: Mon, 3 Nov 2025 13:25:44 -0500 Subject: [PATCH 2/5] Fixed a few comments --- src/commands/fun/blackjack.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/commands/fun/blackjack.ts b/src/commands/fun/blackjack.ts index 6fb3f046..c4654b29 100644 --- a/src/commands/fun/blackjack.ts +++ b/src/commands/fun/blackjack.ts @@ -170,7 +170,7 @@ export default class extends Command { components: [] }); - // Allows user to read game status before continuing + // Allows user to read game status before continuing (1.5 seconds) await wait(1500); dealerDrawnCard = Math.floor(Math.random() * 13); @@ -320,8 +320,7 @@ export default class extends Command { await i.reply({ content: 'Failed to send you a DM. Here are the rules: \n\n', embeds: [rulesEmbed], - // eslint-disable-next-line no-mixed-spaces-and-tabs - ephemeral: true + ephemeral: true }); } } From 6cc9a716c15cce8b30b887517f260ee1823466c2 Mon Sep 17 00:00:00 2001 From: TigerAttack302 Date: Mon, 3 Nov 2025 13:29:23 -0500 Subject: [PATCH 3/5] Fixed rules prompt in DM to update for tying --- src/commands/fun/blackjack.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/commands/fun/blackjack.ts b/src/commands/fun/blackjack.ts index c4654b29..7ae32bdc 100644 --- a/src/commands/fun/blackjack.ts +++ b/src/commands/fun/blackjack.ts @@ -298,7 +298,9 @@ export default class extends Command { { name: 'Winning', value: 'The player who doesn\'t bust and has the most points wins!\n' + - 'Ties: The dealer automatically wins ties.' + 'Ties: When both players have the same score, and the neither player started with a score of 21, no one wins.\n' + + 'If one player has 21 at the start of the game, they win automatically.\n' + + 'If both players have 21 at the start of the game, the game ties.' } ); From a0956df100553cf2fffee4b06e4493bd271b8714 Mon Sep 17 00:00:00 2001 From: TigerAttack302 Date: Mon, 3 Nov 2025 13:33:36 -0500 Subject: [PATCH 4/5] Added tie logic; Fixed rules embed --- src/commands/fun/blackjack.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/commands/fun/blackjack.ts b/src/commands/fun/blackjack.ts index 7ae32bdc..4ef6dc44 100644 --- a/src/commands/fun/blackjack.ts +++ b/src/commands/fun/blackjack.ts @@ -298,9 +298,7 @@ export default class extends Command { { name: 'Winning', value: 'The player who doesn\'t bust and has the most points wins!\n' + - 'Ties: When both players have the same score, and the neither player started with a score of 21, no one wins.\n' + - 'If one player has 21 at the start of the game, they win automatically.\n' + - 'If both players have 21 at the start of the game, the game ties.' + 'Ties: When both players have the same score, no one wins.\n' } ); @@ -347,11 +345,14 @@ export default class extends Command { gameStatus = 'Game timed out.'; } else if (reason === 'stand') { // Tells user who had the higher points - if (dealerHand >= playerHand) { + if (dealerHand > playerHand) { gameStatus = 'Sage wins.'; - } else { + } else if (dealerHand < playerHand) { gameStatus = 'You win!'; win = true; + } else if (dealerHand === playerHand) { + gameStatus = 'You tied.'; + tie = true; } } From cd3b29750a535ec060411327379c4fed065bdf81 Mon Sep 17 00:00:00 2001 From: TigerAttack302 Date: Wed, 5 Nov 2025 13:02:06 -0500 Subject: [PATCH 5/5] Fixed tied games below a score of 16 (dealer should keep going) --- src/commands/fun/blackjack.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/fun/blackjack.ts b/src/commands/fun/blackjack.ts index 4ef6dc44..9128edb9 100644 --- a/src/commands/fun/blackjack.ts +++ b/src/commands/fun/blackjack.ts @@ -203,7 +203,7 @@ export default class extends Command { }); // Keeps hitting if below 17 point threshold - while (dealerHand <= 16 && dealerHand < playerHand) { + while (dealerHand <= 16 && dealerHand <= playerHand) { // Allows user to read game status before continuing await wait(1500); dealerDrawnCard = Math.floor(Math.random() * 13);