From 2dca19cb9d0319520b23ddcc864d40a9651d5080 Mon Sep 17 00:00:00 2001 From: Marco Loenen Date: Tue, 21 Nov 2023 20:46:46 +0100 Subject: [PATCH] Lifeline bug fix --- Het DJG Toernooi/My Project/AssemblyInfo.vb | 6 +- .../Source_Scripts/Classes/Question.vb | 395 +++++++++--------- Het DJG Toernooi/The Millionaire Game.vbproj | 2 +- 3 files changed, 209 insertions(+), 194 deletions(-) diff --git a/Het DJG Toernooi/My Project/AssemblyInfo.vb b/Het DJG Toernooi/My Project/AssemblyInfo.vb index d8a9b4d..f926e59 100644 --- a/Het DJG Toernooi/My Project/AssemblyInfo.vb +++ b/Het DJG Toernooi/My Project/AssemblyInfo.vb @@ -31,8 +31,8 @@ Imports System.Runtime.InteropServices ' by using the '*' as shown below: ' - - + + - + diff --git a/Het DJG Toernooi/Source_Scripts/Classes/Question.vb b/Het DJG Toernooi/Source_Scripts/Classes/Question.vb index a56a5c1..b240495 100644 --- a/Het DJG Toernooi/Source_Scripts/Classes/Question.vb +++ b/Het DJG Toernooi/Source_Scripts/Classes/Question.vb @@ -497,15 +497,176 @@ Public Class Question End Sub Public Shared Sub PlayAnswerRevealCue(ByVal IsItCorrect As Boolean) + Dim StartBedAfterDD As Boolean = False + + ' Run code below if contestant has walked away or not + If IsItCorrect = True Then 'On a right answer + ' Stop Double Dip lifeline when chances are zero! + If LifeLineDouble.active = True Then + Dim trStopDD As Threading.Thread = New Threading.Thread(AddressOf LifeLineDouble.StopCue2) + trStopDD.Start() + LifeLineDouble.active = False + StartBedAfterDD = True + End If + + TVControlPnl.tmrFlash.Start() + LifeLineDouble.chance = 2 + If ControlPanel.answer = "A" Then + ControlPanel.txtA.BackColor = Color.Green + HostScreen.pnlA.BackgroundImage = My.Resources._0_Correct_Answer_Fill_l + HostScreen.txtA.ForeColor = Color.Black + GuestScreen.pnlA.BackgroundImage = My.Resources._0_Correct_Answer_Fill_l + GuestScreen.txtA.ForeColor = Color.Black + End If + If ControlPanel.answer = "B" Then + ControlPanel.txtB.BackColor = Color.Green + HostScreen.pnlB.BackgroundImage = My.Resources._0_Correct_Answer_Fill_r + HostScreen.txtB.ForeColor = Color.Black + GuestScreen.pnlB.BackgroundImage = My.Resources._0_Correct_Answer_Fill_r + GuestScreen.txtB.ForeColor = Color.Black + End If + If ControlPanel.answer = "C" Then + HostScreen.pnlC.BackgroundImage = My.Resources._0_Correct_Answer_Fill_l + HostScreen.txtC.ForeColor = Color.Black + GuestScreen.pnlC.BackgroundImage = My.Resources._0_Correct_Answer_Fill_l + GuestScreen.txtC.ForeColor = Color.Black + ControlPanel.txtC.BackColor = Color.Green + End If + If ControlPanel.answer = "D" Then + HostScreen.pnlD.BackgroundImage = My.Resources._0_Correct_Answer_Fill_r + HostScreen.txtD.ForeColor = Color.Black + GuestScreen.pnlD.BackgroundImage = My.Resources._0_Correct_Answer_Fill_r + GuestScreen.txtD.ForeColor = Color.Black + ControlPanel.txtD.BackColor = Color.Green + End If + If Game.walkaway = False Then + If Game.level = 14 Then + HostScreen.txtWinnings.Text = "Total Score: " + Game.varCorrect + End If + End If + + ' Make lifeline textures invisible on TV Screen + TVControlPnl.grpATA.Visible = False + TVControlPnl.picLifelineUse.Visible = False + + ' Update host screen and control panel money values for next question + If Game.level >= 15 Then + + Else + Game.level = Game.level + 1 + Game.ChangeLevel(Game.level) + ControlPanel.txtCorrect.Text = Game.varCorrect + ControlPanel.txtCurrent.Text = Game.varCurrent + ControlPanel.txtDrop.Text = Game.varDrop + ControlPanel.txtQLeft.Text = Game.varQLeft + ControlPanel.txtWrong.Text = Game.varWrong + HostScreen.lblCorrect.Text = Game.varCorrect + HostScreen.lblCurrent.Text = Game.varCurrent + HostScreen.lblDrop.Text = Game.varDrop + HostScreen.lblQLeft.Text = Game.varQLeft + HostScreen.lblWrong.Text = Game.varWrong + Question.act = 0 + ControlPanel.tmrLifelineUpdate.Start() + End If + + Else ' On a wrong answer + If LifeLineDouble.chance = 0 Then + LifeLineDouble.active = False + Dim trStopDD As Threading.Thread = New Threading.Thread(AddressOf LifeLineDouble.StopCue2) + trStopDD.Start() + End If + If LifeLineDouble.active = True Then + LifeLineDouble.SecondChance() + If ControlPanel.answer = "A" Then + TVControlPnl.txtA.Text = "" + TVControlPnl.picA.BackgroundImage = My.Resources._0_Normal_Answer_Fill_l + HostScreen.txtA.Text = "" + HostScreen.pnlA.BackgroundImage = My.Resources._0_Normal_Answer_Fill_l + GuestScreen.txtA.Text = "" + GuestScreen.pnlA.BackgroundImage = My.Resources._0_Normal_Answer_Fill_l + ControlPanel.txtA.Text = "" + ControlPanel.txtA.BackColor = Color.Silver + End If + If ControlPanel.answer = "B" Then + TVControlPnl.txtB.Text = "" + TVControlPnl.picB.BackgroundImage = My.Resources._0_Normal_Answer_Fill_r + HostScreen.txtB.Text = "" + HostScreen.pnlB.BackgroundImage = My.Resources._0_Normal_Answer_Fill_r + GuestScreen.txtB.Text = "" + GuestScreen.pnlB.BackgroundImage = My.Resources._0_Normal_Answer_Fill_r + ControlPanel.txtB.Text = "" + ControlPanel.txtB.BackColor = Color.Silver + End If + If ControlPanel.answer = "C" Then + TVControlPnl.txtC.Text = "" + TVControlPnl.picC.BackgroundImage = My.Resources._0_Normal_Answer_Fill_l + HostScreen.txtC.Text = "" + HostScreen.pnlC.BackgroundImage = My.Resources._0_Normal_Answer_Fill_l + GuestScreen.txtC.Text = "" + GuestScreen.pnlC.BackgroundImage = My.Resources._0_Normal_Answer_Fill_l + ControlPanel.txtC.Text = "" + ControlPanel.txtC.BackColor = Color.Silver + End If + If ControlPanel.answer = "D" Then + TVControlPnl.txtD.Text = "" + TVControlPnl.picD.BackgroundImage = My.Resources._0_Normal_Answer_Fill_r + HostScreen.txtD.Text = "" + HostScreen.pnlD.BackgroundImage = My.Resources._0_Normal_Answer_Fill_r + GuestScreen.txtD.Text = "" + GuestScreen.pnlD.BackgroundImage = My.Resources._0_Normal_Answer_Fill_r + ControlPanel.txtD.Text = "" + ControlPanel.txtD.BackColor = Color.Silver + End If + ControlPanel.Timer2.Stop() + Else + LifeLineDouble.chance = 2 + TVControlPnl.tmrFlash.Start() + TVControlPnl.grpATA.Visible = False + TVControlPnl.picLifelineUse.Visible = False + If ControlPanel.lblAnswer.Text = "A" Then + HostScreen.pnlA.BackgroundImage = My.Resources._0_Correct_Answer_Fill_l + HostScreen.txtA.ForeColor = Color.Black + GuestScreen.pnlA.BackgroundImage = My.Resources._0_Correct_Answer_Fill_l + GuestScreen.txtA.ForeColor = Color.Black + ControlPanel.txtA.BackColor = Color.Green + End If + If ControlPanel.lblAnswer.Text = "B" Then + HostScreen.pnlB.BackgroundImage = My.Resources._0_Correct_Answer_Fill_r + HostScreen.txtB.ForeColor = Color.Black + GuestScreen.pnlB.BackgroundImage = My.Resources._0_Correct_Answer_Fill_r + GuestScreen.txtB.ForeColor = Color.Black + ControlPanel.txtB.BackColor = Color.Green + End If + If ControlPanel.lblAnswer.Text = "C" Then + HostScreen.pnlC.BackgroundImage = My.Resources._0_Correct_Answer_Fill_l + HostScreen.txtC.ForeColor = Color.Black + GuestScreen.pnlC.BackgroundImage = My.Resources._0_Correct_Answer_Fill_l + GuestScreen.txtC.ForeColor = Color.Black + ControlPanel.txtC.BackColor = Color.Green + End If + If ControlPanel.lblAnswer.Text = "D" Then + HostScreen.pnlD.BackgroundImage = My.Resources._0_Correct_Answer_Fill_r + HostScreen.txtD.ForeColor = Color.Black + GuestScreen.pnlD.BackgroundImage = My.Resources._0_Correct_Answer_Fill_r + GuestScreen.txtD.ForeColor = Color.Black + ControlPanel.txtD.BackColor = Color.Green + End If + If Game.walkaway = False Then + TVControlPnl.lblAmount.Text = "" & Game.varWrong + HostScreen.txtWinnings.Text = "Total Score: " + Game.varWrong + Else + ControlPanel.Timer2.Start() + TVControlPnl.lblAmount.Text = "" & Game.varCurrent + End If + + HostScreen.txtExplain.ForeColor = Color.White + End If + End If + ' Run code below if contestant hasn't walked away If Game.walkaway = False Then If IsItCorrect = True Then Select Case Game.level - Case 0 - With Sounds.sndAnswer - .URL = Sounds.SoundsPath + Profile.Options.snd_Q1to4Correct - .controls.play() - End With Case 1 With Sounds.sndAnswer .URL = Sounds.SoundsPath + Profile.Options.snd_Q1to4Correct @@ -523,34 +684,39 @@ Public Class Question End With Case 4 With Sounds.sndAnswer - .URL = Sounds.SoundsPath + Profile.Options.snd_Q5Correct + .URL = Sounds.SoundsPath + Profile.Options.snd_Q1to4Correct .controls.play() End With Case 5 + With Sounds.sndAnswer + .URL = Sounds.SoundsPath + Profile.Options.snd_Q5Correct + .controls.play() + End With + Case 6 Sounds.sndQuestion.controls.stop() With Sounds.sndAnswer .URL = Sounds.SoundsPath + Profile.Options.snd_Q6Correct .controls.play() End With - Case 6 + Case 7 Sounds.sndQuestion.controls.stop() With Sounds.sndAnswer .URL = Sounds.SoundsPath + Profile.Options.snd_Q7Correct .controls.play() End With - Case 7 + Case 8 Sounds.sndQuestion.controls.stop() With Sounds.sndAnswer .URL = Sounds.SoundsPath + Profile.Options.snd_Q8Correct .controls.play() End With - Case 8 + Case 9 Sounds.sndQuestion.controls.stop() With Sounds.sndAnswer .URL = Sounds.SoundsPath + Profile.Options.snd_Q9Correct .controls.play() End With - Case 9 + Case 10 Sounds.sndQuestion.controls.stop() If Game.gamemode = 0 Then With Sounds.sndAnswer @@ -563,31 +729,31 @@ Public Class Question .controls.play() End With End If - Case 10 + Case 11 Sounds.sndQuestion.controls.stop() With Sounds.sndAnswer .URL = Sounds.SoundsPath + Profile.Options.snd_Q11Correct .controls.play() End With - Case 11 + Case 12 Sounds.sndQuestion.controls.stop() With Sounds.sndAnswer .URL = Sounds.SoundsPath + Profile.Options.snd_Q12Correct .controls.play() End With - Case 12 + Case 13 Sounds.sndQuestion.controls.stop() With Sounds.sndAnswer .URL = Sounds.SoundsPath + Profile.Options.snd_Q13Correct .controls.play() End With - Case 13 + Case 14 Sounds.sndQuestion.controls.stop() With Sounds.sndAnswer .URL = Sounds.SoundsPath + Profile.Options.snd_Q14Correct .controls.play() End With - Case 14 + Case 15 Sounds.sndQuestion.controls.stop() With Sounds.sndAnswer .URL = Sounds.SoundsPath + Profile.Options.snd_Q15Correct @@ -601,14 +767,20 @@ Public Class Question Dim stopaudio As New Thread(Sub() Sounds.StopAudio("question", 600)) stopaudio.Start() End If + + If StartBedAfterDD = True Then + If Game.level < 4 Then + With Sounds.sndQuestion + .URL = Sounds.SoundsPath + Profile.Options.snd_Q1to5Bed + .settings.setMode("Loop", True) + .controls.play() + End With + End If + useMusic = True + End If Else If LifeLineDouble.active = False Then Select Case Game.level - Case 0 - With Sounds.sndAnswer - .URL = Sounds.SoundsPath + Profile.Options.snd_Q1to5Wrong - .controls.play() - End With Case 1 With Sounds.sndAnswer .URL = Sounds.SoundsPath + Profile.Options.snd_Q1to5Wrong @@ -631,45 +803,50 @@ Public Class Question End With Case 5 With Sounds.sndAnswer - .URL = Sounds.SoundsPath + Profile.Options.snd_Q6Wrong + .URL = Sounds.SoundsPath + Profile.Options.snd_Q1to5Wrong .controls.play() End With Case 6 With Sounds.sndAnswer - .URL = Sounds.SoundsPath + Profile.Options.snd_Q7Wrong + .URL = Sounds.SoundsPath + Profile.Options.snd_Q6Wrong .controls.play() End With Case 7 With Sounds.sndAnswer - .URL = Sounds.SoundsPath + Profile.Options.snd_Q8Wrong + .URL = Sounds.SoundsPath + Profile.Options.snd_Q7Wrong .controls.play() End With Case 8 With Sounds.sndAnswer - .URL = Sounds.SoundsPath + Profile.Options.snd_Q9Wrong + .URL = Sounds.SoundsPath + Profile.Options.snd_Q8Wrong .controls.play() End With Case 9 With Sounds.sndAnswer - .URL = Sounds.SoundsPath + Profile.Options.snd_Q10Wrong + .URL = Sounds.SoundsPath + Profile.Options.snd_Q9Wrong .controls.play() End With Case 10 With Sounds.sndAnswer - .URL = Sounds.SoundsPath + Profile.Options.snd_Q11Wrong + .URL = Sounds.SoundsPath + Profile.Options.snd_Q10Wrong .controls.play() End With Case 11 With Sounds.sndAnswer - .URL = Sounds.SoundsPath + Profile.Options.snd_Q12Wrong + .URL = Sounds.SoundsPath + Profile.Options.snd_Q11Wrong .controls.play() End With Case 12 With Sounds.sndAnswer - .URL = Sounds.SoundsPath + Profile.Options.snd_Q13Wrong + .URL = Sounds.SoundsPath + Profile.Options.snd_Q12Wrong .controls.play() End With Case 13 + With Sounds.sndAnswer + .URL = Sounds.SoundsPath + Profile.Options.snd_Q13Wrong + .controls.play() + End With + Case 14 With Sounds.sndAnswer .URL = Sounds.SoundsPath + Profile.Options.snd_Q14Wrong .controls.play() @@ -691,168 +868,6 @@ Public Class Question End If End If End If - - ' Run code below if contestant has walked away or not - If IsItCorrect = True Then 'On a right answer - TVControlPnl.tmrFlash.Start() - LifeLineDouble.chance = 2 - If ControlPanel.answer = "A" Then - ControlPanel.txtA.BackColor = Color.Green - HostScreen.pnlA.BackgroundImage = My.Resources._0_Correct_Answer_Fill_l - HostScreen.txtA.ForeColor = Color.Black - GuestScreen.pnlA.BackgroundImage = My.Resources._0_Correct_Answer_Fill_l - GuestScreen.txtA.ForeColor = Color.Black - End If - If ControlPanel.answer = "B" Then - ControlPanel.txtB.BackColor = Color.Green - HostScreen.pnlB.BackgroundImage = My.Resources._0_Correct_Answer_Fill_r - HostScreen.txtB.ForeColor = Color.Black - GuestScreen.pnlB.BackgroundImage = My.Resources._0_Correct_Answer_Fill_r - GuestScreen.txtB.ForeColor = Color.Black - End If - If ControlPanel.answer = "C" Then - HostScreen.pnlC.BackgroundImage = My.Resources._0_Correct_Answer_Fill_l - HostScreen.txtC.ForeColor = Color.Black - GuestScreen.pnlC.BackgroundImage = My.Resources._0_Correct_Answer_Fill_l - GuestScreen.txtC.ForeColor = Color.Black - ControlPanel.txtC.BackColor = Color.Green - End If - If ControlPanel.answer = "D" Then - HostScreen.pnlD.BackgroundImage = My.Resources._0_Correct_Answer_Fill_r - HostScreen.txtD.ForeColor = Color.Black - GuestScreen.pnlD.BackgroundImage = My.Resources._0_Correct_Answer_Fill_r - GuestScreen.txtD.ForeColor = Color.Black - ControlPanel.txtD.BackColor = Color.Green - End If - If Game.walkaway = False Then - If Game.level = 14 Then - HostScreen.txtWinnings.Text = "Total Score: " + Game.varCorrect - End If - End If - - ' Make lifeline textures invisible on TV Screen - TVControlPnl.grpATA.Visible = False - TVControlPnl.picLifelineUse.Visible = False - - ' Stop Double Dip final answer cue - If LifeLineDouble.active = True Then - Dim trStopDD As Threading.Thread = New Threading.Thread(AddressOf LifeLineDouble.StopCue2) - trStopDD.Start() - LifeLineDouble.active = False - End If - - ' Update host screen and control panel money values for next question - If Game.level >= 15 Then - - Else - Game.level = Game.level + 1 - Game.ChangeLevel(Game.level) - ControlPanel.txtCorrect.Text = Game.varCorrect - ControlPanel.txtCurrent.Text = Game.varCurrent - ControlPanel.txtDrop.Text = Game.varDrop - ControlPanel.txtQLeft.Text = Game.varQLeft - ControlPanel.txtWrong.Text = Game.varWrong - HostScreen.lblCorrect.Text = Game.varCorrect - HostScreen.lblCurrent.Text = Game.varCurrent - HostScreen.lblDrop.Text = Game.varDrop - HostScreen.lblQLeft.Text = Game.varQLeft - HostScreen.lblWrong.Text = Game.varWrong - Question.act = 0 - ControlPanel.tmrLifelineUpdate.Start() - End If - - Else ' On a wrong answer - - If LifeLineDouble.active = True Then - LifeLineDouble.SecondChance() - If ControlPanel.answer = "A" Then - TVControlPnl.txtA.Text = "" - TVControlPnl.picA.BackgroundImage = My.Resources._0_Normal_Answer_Fill_l - HostScreen.txtA.Text = "" - HostScreen.pnlA.BackgroundImage = My.Resources._0_Normal_Answer_Fill_l - GuestScreen.txtA.Text = "" - GuestScreen.pnlA.BackgroundImage = My.Resources._0_Normal_Answer_Fill_l - ControlPanel.txtA.Text = "" - ControlPanel.txtA.BackColor = Color.Silver - End If - If ControlPanel.answer = "B" Then - TVControlPnl.txtB.Text = "" - TVControlPnl.picB.BackgroundImage = My.Resources._0_Normal_Answer_Fill_r - HostScreen.txtB.Text = "" - HostScreen.pnlB.BackgroundImage = My.Resources._0_Normal_Answer_Fill_r - GuestScreen.txtB.Text = "" - GuestScreen.pnlB.BackgroundImage = My.Resources._0_Normal_Answer_Fill_r - ControlPanel.txtB.Text = "" - ControlPanel.txtB.BackColor = Color.Silver - End If - If ControlPanel.answer = "C" Then - TVControlPnl.txtC.Text = "" - TVControlPnl.picC.BackgroundImage = My.Resources._0_Normal_Answer_Fill_l - HostScreen.txtC.Text = "" - HostScreen.pnlC.BackgroundImage = My.Resources._0_Normal_Answer_Fill_l - GuestScreen.txtC.Text = "" - GuestScreen.pnlC.BackgroundImage = My.Resources._0_Normal_Answer_Fill_l - ControlPanel.txtC.Text = "" - ControlPanel.txtC.BackColor = Color.Silver - End If - If ControlPanel.answer = "D" Then - TVControlPnl.txtD.Text = "" - TVControlPnl.picD.BackgroundImage = My.Resources._0_Normal_Answer_Fill_r - HostScreen.txtD.Text = "" - HostScreen.pnlD.BackgroundImage = My.Resources._0_Normal_Answer_Fill_r - GuestScreen.txtD.Text = "" - GuestScreen.pnlD.BackgroundImage = My.Resources._0_Normal_Answer_Fill_r - ControlPanel.txtD.Text = "" - ControlPanel.txtD.BackColor = Color.Silver - End If - ControlPanel.Timer2.Stop() - Else - LifeLineDouble.chance = 2 - TVControlPnl.tmrFlash.Start() - TVControlPnl.grpATA.Visible = False - TVControlPnl.picLifelineUse.Visible = False - Dim trStopDD As Threading.Thread = New Threading.Thread(AddressOf LifeLineDouble.StopCue2) - trStopDD.Start() - If ControlPanel.lblAnswer.Text = "A" Then - HostScreen.pnlA.BackgroundImage = My.Resources._0_Correct_Answer_Fill_l - HostScreen.txtA.ForeColor = Color.Black - GuestScreen.pnlA.BackgroundImage = My.Resources._0_Correct_Answer_Fill_l - GuestScreen.txtA.ForeColor = Color.Black - ControlPanel.txtA.BackColor = Color.Green - End If - If ControlPanel.lblAnswer.Text = "B" Then - HostScreen.pnlB.BackgroundImage = My.Resources._0_Correct_Answer_Fill_r - HostScreen.txtB.ForeColor = Color.Black - GuestScreen.pnlB.BackgroundImage = My.Resources._0_Correct_Answer_Fill_r - GuestScreen.txtB.ForeColor = Color.Black - ControlPanel.txtB.BackColor = Color.Green - End If - If ControlPanel.lblAnswer.Text = "C" Then - HostScreen.pnlC.BackgroundImage = My.Resources._0_Correct_Answer_Fill_l - HostScreen.txtC.ForeColor = Color.Black - GuestScreen.pnlC.BackgroundImage = My.Resources._0_Correct_Answer_Fill_l - GuestScreen.txtC.ForeColor = Color.Black - ControlPanel.txtC.BackColor = Color.Green - End If - If ControlPanel.lblAnswer.Text = "D" Then - HostScreen.pnlD.BackgroundImage = My.Resources._0_Correct_Answer_Fill_r - HostScreen.txtD.ForeColor = Color.Black - GuestScreen.pnlD.BackgroundImage = My.Resources._0_Correct_Answer_Fill_r - GuestScreen.txtD.ForeColor = Color.Black - ControlPanel.txtD.BackColor = Color.Green - End If - If Game.walkaway = False Then - TVControlPnl.lblAmount.Text = "" & Game.varWrong - HostScreen.txtWinnings.Text = "Total Score: " + Game.varWrong - Else - ControlPanel.Timer2.Start() - TVControlPnl.lblAmount.Text = "" & Game.varCurrent - End If - - HostScreen.txtExplain.ForeColor = Color.White - End If - - End If End Sub Public Shared Sub UndoAnswer(ByVal music As Boolean) diff --git a/Het DJG Toernooi/The Millionaire Game.vbproj b/Het DJG Toernooi/The Millionaire Game.vbproj index 127fa00..9b2255d 100644 --- a/Het DJG Toernooi/The Millionaire Game.vbproj +++ b/Het DJG Toernooi/The Millionaire Game.vbproj @@ -37,7 +37,7 @@ Het TeamDJG Toernooi true 2233 - 1.1.662.0 + 1.1.669.0 false true true