Skip to content

Commit 440892c

Browse files
only show bot-match/bot-beat game over stuff if we're on daily mode
1 parent 638e905 commit 440892c

File tree

1 file changed

+30
-28
lines changed

1 file changed

+30
-28
lines changed

assets/js/app/modals.js

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -403,37 +403,39 @@ Deckdle.modalOpen = async (type) => {
403403
break
404404
}
405405

406-
// did you beat the bot?
407-
const botScore = parseInt(botScoreDaily)
408-
409-
// win
410-
if (tableauCount == 0) {
411-
// check if our stock count is better than the bot score
412-
// flip stockCount so it's negative (bot score will be negative, too)
413-
if (-stockCount < botScore) {
414-
modalText += `
415-
<div class="bot-match">
406+
if (gameMode == 'daily') {
407+
// did you beat the daily bot?
408+
const botScore = parseInt(botScoreDaily)
409+
410+
// win
411+
if (tableauCount == 0) {
412+
// check if our stock count is better than the bot score
413+
// flip stockCount so it's negative (bot score will be negative, too)
414+
if (-stockCount < botScore) {
415+
modalText += `
416+
<div class="bot-match">
417+
<div>🤖🤖🤖</div>
418+
<div>You <strong>beat</strong> the bot! <em>How on earth...?!?!</em></div>
419+
<div>🤖🤖🤖</div>
420+
</div>
421+
`
422+
} else if (-stockCount == botScore) {
423+
modalText += `<div class="bot-match">🤖 You matched the bot! <strong>Holy cowabunga!</strong> 🤖</div>`
424+
}
425+
}
426+
// loss
427+
else {
428+
// check if our tableau count is better than the bot score
429+
// (which will be a positive number for their tableau count)
430+
if (tableauCount < botScore) {
431+
modalText += `
416432
<div>🤖🤖🤖</div>
417433
<div>You <strong>beat</strong> the bot! <em>How on earth...?!?!</em></div>
418434
<div>🤖🤖🤖</div>
419-
</div>
420-
`
421-
} else if (-stockCount == botScore) {
422-
modalText += `<div class="bot-match">🤖 You matched the bot! <strong>Holy cowabunga!</strong> 🤖</div>`
423-
}
424-
}
425-
// loss
426-
else {
427-
// check if our tableau count is better than the bot score
428-
// (which will be a positive number for their tableau count)
429-
if (tableauCount < botScore) {
430-
modalText += `
431-
<div>🤖🤖🤖</div>
432-
<div>You <strong>beat</strong> the bot! <em>How on earth...?!?!</em></div>
433-
<div>🤖🤖🤖</div>
434-
`
435-
} else if (tableauCount == botScore) {
436-
modalText += `<div>🤖 You matched the bot! <strong>Holy cowabunga!</strong> 🤖</div>`
435+
`
436+
} else if (tableauCount == botScore) {
437+
modalText += `<div>🤖 You matched the bot! <strong>Holy cowabunga!</strong> 🤖</div>`
438+
}
437439
}
438440
}
439441

0 commit comments

Comments
 (0)