Coin Case Cap is now a GameRule

This commit is contained in:
JappaWakka 2023-07-01 20:47:06 +02:00
parent 4a7c89cf53
commit b6ba893a5d
4 changed files with 10 additions and 10 deletions

View File

@ -609,6 +609,7 @@ Public Class GameMode
gameRules.Add(New GameRule("SavingDisabled", "0"))
gameRules.Add(New GameRule("SingleUseTM", "0"))
gameRules.Add(New GameRule("CanForgetHM", "0"))
gameRules.Add(New GameRule("CoinCaseCap", "0"))
gameMode._gameRules = gameRules

View File

@ -1034,8 +1034,8 @@ TryAgain:
'Completed the level
If GameState = States.GameWon Then
If Core.Player.Coins + TotalCoins > 50000 Then
TotalCoins = 50000 - Core.Player.Coins
If CInt(GameModeManager.GetGameRuleValue("CoinCaseCap", "0")) > 0 AndAlso Core.Player.Coins + TotalCoins > CInt(GameModeManager.GetGameRuleValue("CoinCaseCap", "0")) Then
TotalCoins = CInt(GameModeManager.GetGameRuleValue("CoinCaseCap", "0")) - Core.Player.Coins
CurrentCoins = 0
TextBox.Show(Localization.GetString("VoltorbFlip_MaxCoins", "Your Coin Case can't fit~any more Coin(s)!"))
Quit()
@ -1286,7 +1286,7 @@ TryAgain:
Delay = 5
End If
If Delay > 3 Then
If Core.Player.Coins + TotalCoins > 50000 Then
If CInt(GameModeManager.GetGameRuleValue("CoinCaseCap", "0")) > 0 AndAlso Core.Player.Coins + TotalCoins > CInt(GameModeManager.GetGameRuleValue("CoinCaseCap", "0")) Then
If CurrentLevel < PreviousLevel Then
TextBox.Show(Localization.GetString("VoltorbFlip_NewLevel_Lower1", "Dropped to Game Lv.") & " " & CurrentLevel & Localization.GetString("VoltorbFlip_NewLevel_Lower2", "!"))
End If

View File

@ -303,8 +303,8 @@
Case "addcoins"
Dim coins As Integer = int(argument)
If Core.Player.Coins + coins > 50000 Then
coins = 50000 - Core.Player.Coins
If CInt(GameModeManager.GetGameRuleValue("CoinCaseCap", "0")) > 0 AndAlso Core.Player.Coins + coins > CInt(GameModeManager.GetGameRuleValue("CoinCaseCap", "0")) Then
coins = CInt(GameModeManager.GetGameRuleValue("CoinCaseCap", "0")) - Core.Player.Coins
End If
Core.Player.Coins += coins

View File

@ -284,7 +284,10 @@
CanContinue = False
Case "voltorbflip"
If Core.Player.Inventory.GetItemAmount(54.ToString) > 0 Then
If Core.Player.Coins < 50000 Then
If CInt(GameModeManager.GetGameRuleValue("CoinCaseCap", "0")) > 0 AndAlso Core.Player.Coins > CInt(GameModeManager.GetGameRuleValue("CoinCaseCap", "0")) Then
Screen.TextBox.Show(Localization.GetString("VoltorbFlip_BeforeGame_FullCoinCase", "Your Coin Case is already full!"))
IsReady = True
Else
If VoltorbFlip.VoltorbFlipScreen.TotalCoins = -1 Then
Core.SetScreen(New VoltorbFlip.VoltorbFlipScreen(CurrentScreen))
End If
@ -303,10 +306,6 @@
IsReady = True
End If
End If
Else
Screen.TextBox.Show(Localization.GetString("VoltorbFlip_BeforeGame_FullCoinCase", "Your Coin Case is already full!"))
IsReady = True
End If
Else
Screen.TextBox.Show(Localization.GetString("VoltorbFlip_BeforeGame_NoCoinCase", "You don't have a Coin Case!~Come back when you have one!"))