@@ -187,14 +187,30 @@ Deckdle._debugGameOver = (
187187 stockCount = 1 ,
188188 botStockCount = 10
189189) => {
190+ const botBeatHTML = `
191+ <div class="bot-beat">
192+ <div>🤖🤖🤖</div>
193+ <div>You <strong>BEAT</strong> the bot! <strong><em>How on earth...?!?!</em></strong></div>
194+ <div>🤖🤖🤖</div>
195+ </div>
196+ `
197+ const botMatchHTML = `
198+ <div class="bot-match">
199+ 🤖 You <strong>matched</strong> the bot! <strong>Holy cowabunga!</strong> 🤖
200+ </div>
201+ `
202+ let botCompScore = - 1
203+
190204 if ( Deckdle . myModal ) {
191205 Deckdle . myModal . _destroyModal ( )
192206 }
193207
208+ // START: block of stuff
194209 let modalText = `
195210 <div class="container game-over">
196211 `
197212
213+ // player score
198214 switch ( type ) {
199215 case 'golf' :
200216 default :
@@ -244,18 +260,14 @@ Deckdle._debugGameOver = (
244260 }
245261
246262 if ( stockCount > botStockCount ) {
247- modalText += `
248- <div class="bot-beat">
249- <div>🤖🤖🤖</div>
250- <div>You <strong>beat</strong> the bot! <em>How on earth...?!?!</em></div>
251- <div>🤖🤖🤖</div>
252- </div>
253- `
263+ modalText += botBeatHTML
264+ botCompScore = 1
254265 } else if ( stockCount == botStockCount ) {
255- modalText += `<div class="bot-match">🤖 You matched the bot! <strong>Holy cowabunga!</strong> 🤖</div>`
266+ modalText += botMatchHTML
267+ botCompScore = 0
256268 }
257269
258- // daily
270+ // daily: next puzzle text
259271 if ( gameMode == 'daily' ) {
260272 modalText += `
261273 <div class="para">New daily puzzle available at 12 am PST</div>
@@ -272,7 +284,7 @@ Deckdle._debugGameOver = (
272284 `
273285 }
274286 }
275- // free
287+ // free: try another
276288 else {
277289 modalText += `
278290 <div class="buttons">
@@ -281,15 +293,17 @@ Deckdle._debugGameOver = (
281293 `
282294 }
283295
296+ // share score
284297 modalText += `
285298 <div class="share">
286- <button class="game-over share" onclick="Deckdle._shareResults()">Share <i class="fa-solid fa-share-nodes"></i></button>
299+ <button class="game-over share" onclick="Deckdle._shareResults(${ botCompScore } )">Share <i class="fa-solid fa-share-nodes"></i></button>
287300 </div>
288301 `
289302
290303 modalText += `
291304 </div>
292305 `
306+ // END: block of stuff
293307
294308 Deckdle . myModal = new Modal ( 'end-state' , 'Game Over' , modalText , null , null , 'game-over' )
295309}
0 commit comments