Fix Consecutive Wins

This commit is contained in:
JappaWakka 2023-05-27 16:10:30 +02:00
parent 966525b14d
commit 39ce4458f1
2 changed files with 7 additions and 5 deletions

View File

@ -295,9 +295,10 @@
#End Region #End Region
Private Sub QuitGame() Private Sub QuitGame()
'Reset VoltorbFlipScreen's Levels 'Reset VoltorbFlipScreen's Variables
VoltorbFlip.VoltorbFlipScreen.CurrentLevel = 1 VoltorbFlip.VoltorbFlipScreen.CurrentLevel = 1
VoltorbFlip.VoltorbFlipScreen.PreviousLevel = 1 VoltorbFlip.VoltorbFlipScreen.PreviousLevel = 1
VoltorbFlip.VoltorbFlipScreen.ConsecutiveWins = 0
If JoinServerScreen.Online = True Then If JoinServerScreen.Online = True Then
Core.ServersManager.ServerConnection.Disconnect() Core.ServersManager.ServerConnection.Disconnect()

View File

@ -39,7 +39,7 @@ Namespace VoltorbFlip
Public Shared Property CurrentCoins As Integer = 0 Public Shared Property CurrentCoins As Integer = 0
Public Shared Property TotalCoins As Integer = -1 Public Shared Property TotalCoins As Integer = -1
Public Shared Property ConsequentWins As Integer = 0 Public Shared Property ConsecutiveWins As Integer = 0
Public Shared MaxCoins As Integer = 1 Public Shared MaxCoins As Integer = 1
Public Board As List(Of List(Of Tile)) Public Board As List(Of List(Of Tile))
@ -934,9 +934,9 @@ TryAgain:
TotalFlips += CurrentFlips TotalFlips += CurrentFlips
CurrentFlips = 0 CurrentFlips = 0
ConsequentWins += 1 ConsecutiveWins += 1
If ConsequentWins = 5 AndAlso TotalFlips >= 8 Then If ConsecutiveWins = 5 AndAlso TotalFlips >= 8 Then
CurrentLevel = MaxLevel + 1 CurrentLevel = MaxLevel + 1
Else Else
If CurrentLevel < MaxLevel + 1 Then If CurrentLevel < MaxLevel + 1 Then
@ -1252,6 +1252,7 @@ TryAgain:
SoundManager.PlaySound("VoltorbFlip\LoseGame", True) SoundManager.PlaySound("VoltorbFlip\LoseGame", True)
End If End If
Screen.TextBox.Show("Oh no! You get 0 coins!") Screen.TextBox.Show("Oh no! You get 0 coins!")
VoltorbFlipScreen.ConsecutiveWins = 0
VoltorbFlipScreen.GameState = VoltorbFlipScreen.States.GameLost VoltorbFlipScreen.GameState = VoltorbFlipScreen.States.GameLost
Else Else
If VoltorbFlipScreen.CurrentCoins = 0 Then If VoltorbFlipScreen.CurrentCoins = 0 Then