allow coins to be used in shops and track as stats

This commit is contained in:
darkfire006 2023-05-29 20:32:57 -05:00
parent 2e1b66a45d
commit ddbbd21043
2 changed files with 13 additions and 1 deletions

View File

@ -75,6 +75,7 @@ Public Class TradeScreen
Public Enum Currencies Public Enum Currencies
Pokédollar Pokédollar
BattlePoints BattlePoints
Coins
End Enum End Enum
''' <summary> ''' <summary>
@ -187,6 +188,8 @@ Public Class TradeScreen
Me.Currency = Currencies.Pokédollar Me.Currency = Currencies.Pokédollar
Case "bp", "battlepoints", "battle points" Case "bp", "battlepoints", "battle points"
Me.Currency = Currencies.BattlePoints Me.Currency = Currencies.BattlePoints
Case "c", "coins"
Me.Currency = Currencies.Coins
End Select End Select
End Sub End Sub
@ -1279,6 +1282,8 @@ Public Class TradeScreen
Select Case Me.Currency Select Case Me.Currency
Case Currencies.BattlePoints Case Currencies.BattlePoints
Return Core.Player.BP Return Core.Player.BP
Case Currencies.Coins
Return Core.Player.Coins
Case Currencies.Pokédollar Case Currencies.Pokédollar
Return Core.Player.Money Return Core.Player.Money
End Select End Select
@ -1289,6 +1294,8 @@ Public Class TradeScreen
Select Case Me.Currency Select Case Me.Currency
Case Currencies.BattlePoints Case Currencies.BattlePoints
Return GetCurrencyAmount().ToString() & " Battle Points" Return GetCurrencyAmount().ToString() & " Battle Points"
Case Currencies.Coins
Return GetCurrencyAmount().ToString() & " Coins"
Case Currencies.Pokédollar Case Currencies.Pokédollar
Return GetCurrencyAmount().ToString() & " Pokémon Dollars" Return GetCurrencyAmount().ToString() & " Pokémon Dollars"
End Select End Select
@ -1299,6 +1306,8 @@ Public Class TradeScreen
Select Case Me.Currency Select Case Me.Currency
Case Currencies.BattlePoints Case Currencies.BattlePoints
Return "BP" Return "BP"
Case Currencies.Coins
Return "C"
Case Currencies.Pokédollar Case Currencies.Pokédollar
Return "$" Return "$"
End Select End Select
@ -1309,6 +1318,8 @@ Public Class TradeScreen
Select Case Me.Currency Select Case Me.Currency
Case Currencies.BattlePoints Case Currencies.BattlePoints
Core.Player.BP = (Core.Player.BP + change).Clamp(0, Integer.MaxValue) Core.Player.BP = (Core.Player.BP + change).Clamp(0, Integer.MaxValue)
Case Currencies.Coins
Core.Player.Coins = (Core.Player.Coins + change).Clamp(0, Integer.MaxValue)
Case Currencies.Pokédollar Case Currencies.Pokédollar
Core.Player.Money = (Core.Player.Money + change).Clamp(0, Integer.MaxValue) Core.Player.Money = (Core.Player.Money + change).Clamp(0, Integer.MaxValue)
End Select End Select

View File

@ -47,7 +47,7 @@
Dim currencyIndicator As String = "P" Dim currencyIndicator As String = "P"
If argument.CountSplits() > 3 Then If argument.CountSplits() > 3 Then
currencyIndicator = argument.GetSplit(3) ' p for PokéDollars, bp for Battle Points. currencyIndicator = argument.GetSplit(3) ' p for PokéDollars, bp for Battle Points, c for coins.
End If End If
Core.SetScreen(New TransitionScreen(Core.CurrentScreen, New TradeScreen(Core.CurrentScreen, storeData, canBuy, canSell, currencyIndicator), Color.Black, False)) Core.SetScreen(New TransitionScreen(Core.CurrentScreen, New TradeScreen(Core.CurrentScreen, storeData, canBuy, canSell, currencyIndicator), Color.Black, False))
@ -286,6 +286,7 @@
If VoltorbFlip.VoltorbFlipScreen.TotalCoins > 0 Then If VoltorbFlip.VoltorbFlipScreen.TotalCoins > 0 Then
Screen.TextBox.Show(Localization.GetString("VoltorbFlip_AfterGame_Won1", "You've won") & " " & VoltorbFlip.VoltorbFlipScreen.TotalCoins & " " & Localization.GetString("VoltorbFlip_AfterGame_Won2", "Coins!")) Screen.TextBox.Show(Localization.GetString("VoltorbFlip_AfterGame_Won1", "You've won") & " " & VoltorbFlip.VoltorbFlipScreen.TotalCoins & " " & Localization.GetString("VoltorbFlip_AfterGame_Won2", "Coins!"))
Core.Player.Coins += VoltorbFlip.VoltorbFlipScreen.TotalCoins Core.Player.Coins += VoltorbFlip.VoltorbFlipScreen.TotalCoins
PlayerStatistics.Track("Obtained Coins", VoltorbFlip.VoltorbFlipScreen.TotalCoins)
VoltorbFlip.VoltorbFlipScreen.TotalCoins = -1 VoltorbFlip.VoltorbFlipScreen.TotalCoins = -1
IsReady = True IsReady = True
Else Else