GameMode Item Preparations

Implemented GameMode Mega Stones
This commit is contained in:
JappaWakka 2023-05-29 15:33:57 +02:00
parent ba98f40394
commit d13b5eb8d3
63 changed files with 892 additions and 304 deletions

View File

@ -496,10 +496,20 @@
End Select End Select
Next Next
Dim p As Pokemon = BattleScreen.OppPokemon Dim p As Pokemon = BattleScreen.OppPokemon
If p.Item IsNot Nothing AndAlso p.Item.IsMegaStone = True Then If p.Item IsNot Nothing Then
Dim megaStone = CType(p.Item, Items.MegaStone) If p.Item.IsGameModeItem = True Then
If p.Number = megaStone.MegaPokemonNumber Then If p.Item.gmIsMegaStone = True Then
BattleScreen.IsMegaEvolvingOpp = True If p.Number = CType(p.Item, GameModeItem).gmMegaPokemonNumber Then
BattleScreen.IsMegaEvolvingOpp = True
End If
End If
Else
If p.Item.IsMegaStone = True Then
Dim megaStone = CType(p.Item, Items.MegaStone)
If p.Number = megaStone.MegaPokemonNumber Then
BattleScreen.IsMegaEvolvingOpp = True
End If
End If
End If End If
End If End If
End Sub End Sub
@ -2474,9 +2484,11 @@
canSteal = False canSteal = False
End If End If
If canSteal Then If canSteal Then
Dim ItemID As Integer = p.Item.ID Dim ItemID As String = p.Item.ID.ToString
If p.Item.IsGameModeItem = True Then
p.OriginalItem = Item.GetItemByID(p.Item.ID) ItemID = p.Item.gmID
End If
p.OriginalItem = Item.GetItemByID(ItemID)
p.OriginalItem.AdditionalData = p.Item.AdditionalData p.OriginalItem.AdditionalData = p.Item.AdditionalData
If BattleScreen.Battle.RemoveHeldItem(own, Not own, BattleScreen, op.GetDisplayName() & " stole an item from " & p.GetDisplayName() & " due to " & op.Ability.Name & "!", op.Ability.Name.ToLower()) Then If BattleScreen.Battle.RemoveHeldItem(own, Not own, BattleScreen, op.GetDisplayName() & " stole an item from " & p.GetDisplayName() & " due to " & op.Ability.Name & "!", op.Ability.Name.ToLower()) Then
@ -2520,9 +2532,14 @@
canSteal = False canSteal = False
End If End If
If canSteal Then If canSteal Then
Dim ItemID As Integer = op.Item.ID Dim ItemID As String
If op.Item.IsGameModeItem = True Then
ItemID = op.Item.gmID
Else
ItemID = op.Item.ID.ToString
End If
op.OriginalItem = Item.GetItemByID(op.Item.ID) op.OriginalItem = Item.GetItemByID(ItemID)
op.OriginalItem.AdditionalData = op.Item.AdditionalData op.OriginalItem.AdditionalData = op.Item.AdditionalData
If BattleScreen.Battle.RemoveHeldItem(Not own, own, BattleScreen, p.GetDisplayName() & " stole an item from " & op.GetDisplayName() & " due to " & p.Ability.Name & "!", p.Ability.Name.ToLower()) Then If BattleScreen.Battle.RemoveHeldItem(Not own, own, BattleScreen, p.GetDisplayName() & " stole an item from " & op.GetDisplayName() & " due to " & p.Ability.Name & "!", p.Ability.Name.ToLower()) Then
@ -2651,7 +2668,7 @@
If Core.Random.Next(0, 2) = 0 AndAlso moveUsed.MakesContact = True AndAlso op.Item Is Nothing AndAlso op.HP > 0 Then If Core.Random.Next(0, 2) = 0 AndAlso moveUsed.MakesContact = True AndAlso op.Item Is Nothing AndAlso op.HP > 0 Then
ChangeCameraAngle(2, own, BattleScreen) ChangeCameraAngle(2, own, BattleScreen)
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & "'s Sticky Barb was passed over to " & op.GetDisplayName() & ".")) BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & "'s Sticky Barb was passed over to " & op.GetDisplayName() & "."))
op.Item = Item.GetItemByID(p.Item.ID) op.Item = Item.GetItemByID(p.Item.ID.ToString)
p.Item = Nothing p.Item = Nothing
End If 'CODELINE OF EVIL End If 'CODELINE OF EVIL
End If End If
@ -4485,7 +4502,7 @@
If Not p.Item Is Nothing Then If Not p.Item Is Nothing Then
If p.Item.OriginalName.ToLower() = "enigma" And BattleScreen.FieldEffects.CanUseItem(own) = True And BattleScreen.FieldEffects.CanUseOwnItem(own, BattleScreen) = True Then If p.Item.OriginalName.ToLower() = "enigma" And BattleScreen.FieldEffects.CanUseItem(own) = True And BattleScreen.FieldEffects.CanUseOwnItem(own, BattleScreen) = True Then
If RemoveHeldItem(own, own, BattleScreen, "", "berry:enigma") = True Then If RemoveHeldItem(own, own, BattleScreen, "", "berry:enigma") = True Then
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause) UseBerry(own, from, Item.GetItemByID(ItemID.ToString), BattleScreen, message, cause)
End If End If
End If End If
End If End If
@ -4496,7 +4513,7 @@
If Not p.Item Is Nothing Then If Not p.Item Is Nothing Then
If p.Item.OriginalName.ToLower() = "oran" And BattleScreen.FieldEffects.CanUseItem(own) = True And BattleScreen.FieldEffects.CanUseOwnItem(own, BattleScreen) = True Then If p.Item.OriginalName.ToLower() = "oran" And BattleScreen.FieldEffects.CanUseItem(own) = True And BattleScreen.FieldEffects.CanUseOwnItem(own, BattleScreen) = True Then
If RemoveHeldItem(own, own, BattleScreen, "", "berry:oran") = True Then If RemoveHeldItem(own, own, BattleScreen, "", "berry:oran") = True Then
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause) UseBerry(own, from, Item.GetItemByID(ItemID.ToString), BattleScreen, message, cause)
End If End If
End If End If
End If End If
@ -4507,7 +4524,7 @@
Select Case p.Item.OriginalName.ToLower() Select Case p.Item.OriginalName.ToLower()
Case "sitrus" Case "sitrus"
If RemoveHeldItem(own, own, BattleScreen, "", "berry:sitrus") = True Then If RemoveHeldItem(own, own, BattleScreen, "", "berry:sitrus") = True Then
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause) UseBerry(own, from, Item.GetItemByID(ItemID.ToString), BattleScreen, message, cause)
End If End If
End Select End Select
End If End If
@ -4519,59 +4536,59 @@
Select Case p.Item.OriginalName.ToLower() Select Case p.Item.OriginalName.ToLower()
Case "figy" Case "figy"
If RemoveHeldItem(own, own, BattleScreen, "", "berry:figy") = True Then If RemoveHeldItem(own, own, BattleScreen, "", "berry:figy") = True Then
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause) UseBerry(own, from, Item.GetItemByID(ItemID.ToString), BattleScreen, message, cause)
End If End If
Case "wiki" Case "wiki"
If RemoveHeldItem(own, own, BattleScreen, "", "berry:wiki") = True Then If RemoveHeldItem(own, own, BattleScreen, "", "berry:wiki") = True Then
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause) UseBerry(own, from, Item.GetItemByID(ItemID.ToString), BattleScreen, message, cause)
End If End If
Case "mago" Case "mago"
If RemoveHeldItem(own, own, BattleScreen, "", "berry:mago") = True Then If RemoveHeldItem(own, own, BattleScreen, "", "berry:mago") = True Then
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause) UseBerry(own, from, Item.GetItemByID(ItemID.ToString), BattleScreen, message, cause)
End If End If
Case "aguav" Case "aguav"
If RemoveHeldItem(own, own, BattleScreen, "", "berry:aguav") = True Then If RemoveHeldItem(own, own, BattleScreen, "", "berry:aguav") = True Then
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause) UseBerry(own, from, Item.GetItemByID(ItemID.ToString), BattleScreen, message, cause)
End If End If
Case "iapapa" Case "iapapa"
If RemoveHeldItem(own, own, BattleScreen, "", "berry:iapapa") = True Then If RemoveHeldItem(own, own, BattleScreen, "", "berry:iapapa") = True Then
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause) UseBerry(own, from, Item.GetItemByID(ItemID.ToString), BattleScreen, message, cause)
End If End If
Case "liechi" Case "liechi"
If RemoveHeldItem(own, own, BattleScreen, "", "berry:liechi") = True Then If RemoveHeldItem(own, own, BattleScreen, "", "berry:liechi") = True Then
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause) UseBerry(own, from, Item.GetItemByID(ItemID.ToString), BattleScreen, message, cause)
End If End If
Case "ganlon" Case "ganlon"
If RemoveHeldItem(own, own, BattleScreen, "", "berry:ganlon") = True Then If RemoveHeldItem(own, own, BattleScreen, "", "berry:ganlon") = True Then
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause) UseBerry(own, from, Item.GetItemByID(ItemID.ToString), BattleScreen, message, cause)
End If End If
Case "salac" Case "salac"
If RemoveHeldItem(own, own, BattleScreen, "", "berry:salac") = True Then If RemoveHeldItem(own, own, BattleScreen, "", "berry:salac") = True Then
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause) UseBerry(own, from, Item.GetItemByID(ItemID.ToString), BattleScreen, message, cause)
End If End If
Case "petaya" Case "petaya"
If RemoveHeldItem(own, own, BattleScreen, "", "berry:petaya") = True Then If RemoveHeldItem(own, own, BattleScreen, "", "berry:petaya") = True Then
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause) UseBerry(own, from, Item.GetItemByID(ItemID.ToString), BattleScreen, message, cause)
End If End If
Case "apicot" Case "apicot"
If RemoveHeldItem(own, own, BattleScreen, "", "berry:apicot") = True Then If RemoveHeldItem(own, own, BattleScreen, "", "berry:apicot") = True Then
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause) UseBerry(own, from, Item.GetItemByID(ItemID.ToString), BattleScreen, message, cause)
End If End If
Case "lansat" Case "lansat"
If RemoveHeldItem(own, own, BattleScreen, "", "berry:lansat") = True Then If RemoveHeldItem(own, own, BattleScreen, "", "berry:lansat") = True Then
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause) UseBerry(own, from, Item.GetItemByID(ItemID.ToString), BattleScreen, message, cause)
End If End If
Case "starf" Case "starf"
If RemoveHeldItem(own, own, BattleScreen, "", "berry:starf") = True Then If RemoveHeldItem(own, own, BattleScreen, "", "berry:starf") = True Then
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause) UseBerry(own, from, Item.GetItemByID(ItemID.ToString), BattleScreen, message, cause)
End If End If
Case "micle" Case "micle"
If RemoveHeldItem(own, own, BattleScreen, "", "berry:micle") = True Then If RemoveHeldItem(own, own, BattleScreen, "", "berry:micle") = True Then
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause) UseBerry(own, from, Item.GetItemByID(ItemID.ToString), BattleScreen, message, cause)
End If End If
Case "custap" Case "custap"
If RemoveHeldItem(own, own, BattleScreen, "", "berry:custap") = True Then If RemoveHeldItem(own, own, BattleScreen, "", "berry:custap") = True Then
UseBerry(own, from, Item.GetItemByID(ItemID), BattleScreen, message, cause) UseBerry(own, from, Item.GetItemByID(ItemID.ToString), BattleScreen, message, cause)
End If End If
End Select End Select
End If End If
@ -4710,7 +4727,7 @@
If TestFor = False Then If TestFor = False Then
Dim ItemID As Integer = p.Item.ID Dim ItemID As Integer = p.Item.ID
Dim lostItem As Item = Item.GetItemByID(ItemID) Dim lostItem As Item = Item.GetItemByID(ItemID.ToString)
If from = own Then If from = own Then
If own = True Then If own = True Then

View File

@ -631,7 +631,7 @@
TempBattleScreen = BattleScreen TempBattleScreen = BattleScreen
Player.Temp.PokemonScreenIndex = BattleScreen.OwnPokemonIndex Player.Temp.PokemonScreenIndex = BattleScreen.OwnPokemonIndex
Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), AddressOf ShowPokemonMenu, "Choose Pokémon", False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = False} Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5.ToString), AddressOf ShowPokemonMenu, "Choose Pokémon", False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = False}
AddHandler selScreen.SelectedObject, AddressOf ShowPokemonMenuHandler AddHandler selScreen.SelectedObject, AddressOf ShowPokemonMenuHandler
Core.SetScreen(selScreen) Core.SetScreen(selScreen)
@ -651,8 +651,8 @@
_mainMenuItemList.Clear() _mainMenuItemList.Clear()
Select Case BattleScreen.BattleMode Select Case BattleScreen.BattleMode
Case BattleSystem.BattleScreen.BattleModes.Safari Case BattleSystem.BattleScreen.BattleModes.Safari
Dim safariBallText As String = "Safari Ball x" & Core.Player.Inventory.GetItemAmount(181).ToString() Dim safariBallText As String = "Safari Ball x" & Core.Player.Inventory.GetItemAmount(181.ToString).ToString()
If Core.Player.Inventory.GetItemAmount(181) = 0 Then If Core.Player.Inventory.GetItemAmount(181.ToString) = 0 Then
safariBallText = "No Safari Balls." safariBallText = "No Safari Balls."
End If End If
_mainMenuItemList.Add(New MainMenuItem(4, safariBallText, 0, AddressOf MainMenuUseSafariBall)) _mainMenuItemList.Add(New MainMenuItem(4, safariBallText, 0, AddressOf MainMenuUseSafariBall))
@ -664,8 +664,8 @@
Case BattleSystem.BattleScreen.BattleModes.BugContest Case BattleSystem.BattleScreen.BattleModes.BugContest
_mainMenuItemList.Add(New MainMenuItem(0, "Battle", 0, AddressOf MainMenuOpenBattleMenu)) _mainMenuItemList.Add(New MainMenuItem(0, "Battle", 0, AddressOf MainMenuOpenBattleMenu))
Dim sportBallText As String = "Sport Ball x" & Core.Player.Inventory.GetItemAmount(177).ToString() Dim sportBallText As String = "Sport Ball x" & Core.Player.Inventory.GetItemAmount(177.ToString).ToString()
If Core.Player.Inventory.GetItemAmount(177) = 0 Then If Core.Player.Inventory.GetItemAmount(177.ToString) = 0 Then
sportBallText = "No Sport Balls." sportBallText = "No Sport Balls."
End If End If
_mainMenuItemList.Add(New MainMenuItem(4, sportBallText, 1, AddressOf MainMenuUseSportBall)) _mainMenuItemList.Add(New MainMenuItem(4, sportBallText, 1, AddressOf MainMenuUseSportBall))
@ -715,7 +715,7 @@
Private Sub MainMenuAddMegaEvolution(ByVal BattleScreen As BattleScreen, ByVal Index As Integer) Private Sub MainMenuAddMegaEvolution(ByVal BattleScreen As BattleScreen, ByVal Index As Integer)
'Checks if the player has the Mega Bracelet. 'Checks if the player has the Mega Bracelet.
If Not (Core.Player.Inventory.GetItemAmount(576) > 0) Then If Not (Core.Player.Inventory.GetItemAmount(576.ToString) > 0) Then
Exit Sub Exit Sub
End If End If
@ -738,12 +738,19 @@
'Next 'Next
Dim PokeIndex As Integer = BattleScreen.OwnPokemonIndex Dim PokeIndex As Integer = BattleScreen.OwnPokemonIndex
If BattleScreen.FieldEffects.OwnMegaEvolved = False Then If BattleScreen.FieldEffects.OwnMegaEvolved = False Then
If Not Core.Player.Pokemons(PokeIndex).Item Is Nothing Then If Core.Player.Pokemons(PokeIndex).Item IsNot Nothing Then
If Core.Player.Pokemons(PokeIndex).Item.IsMegaStone = True Then If Core.Player.Pokemons(PokeIndex).Item.IsGameModeItem = True Then
Dim megaStone = CType(Core.Player.Pokemons(PokeIndex).Item, Items.MegaStone) If Core.Player.Pokemons(PokeIndex).Item.gmIsMegaStone = True Then
If Core.Player.Pokemons(PokeIndex).Number = CType(Core.Player.Pokemons(PokeIndex).Item, GameModeItem).gmMegaPokemonNumber Then
If megaStone.MegaPokemonNumber = Core.Player.Pokemons(PokeIndex).Number Then _mainMenuItemList.Add(New MainMenuItem(5, "Mega Evolve!", Index, AddressOf MainMenuMegaEvolve))
_mainMenuItemList.Add(New MainMenuItem(5, "Mega Evolve!", Index, AddressOf MainMenuMegaEvolve)) End If
End If
Else
If Core.Player.Pokemons(PokeIndex).Item.IsMegaStone = True Then
Dim megaStone = CType(Core.Player.Pokemons(PokeIndex).Item, Items.MegaStone)
If megaStone.MegaPokemonNumber = Core.Player.Pokemons(PokeIndex).Number Then
_mainMenuItemList.Add(New MainMenuItem(5, "Mega Evolve!", Index, AddressOf MainMenuMegaEvolve))
End If
End If End If
End If End If
End If End If
@ -767,7 +774,7 @@
TempBattleScreen = BattleScreen TempBattleScreen = BattleScreen
Player.Temp.PokemonScreenIndex = BattleScreen.OwnPokemonIndex Player.Temp.PokemonScreenIndex = BattleScreen.OwnPokemonIndex
Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), AddressOf ShowPokemonMenu, "Choose Pokémon", True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5.ToString), AddressOf ShowPokemonMenu, "Choose Pokémon", True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True}
AddHandler selScreen.SelectedObject, AddressOf ShowPokemonMenuHandler AddHandler selScreen.SelectedObject, AddressOf ShowPokemonMenuHandler
Core.SetScreen(selScreen) Core.SetScreen(selScreen)
@ -805,15 +812,15 @@
End Sub End Sub
Private Sub MainMenuUseSafariBall(ByVal BattleScreen As BattleScreen) Private Sub MainMenuUseSafariBall(ByVal BattleScreen As BattleScreen)
If Core.Player.Inventory.GetItemAmount(181) > 0 Then If Core.Player.Inventory.GetItemAmount(181.ToString) > 0 Then
Core.Player.Inventory.RemoveItem(181, 1) Core.Player.Inventory.RemoveItem(181.ToString, 1)
BattleScreen.BattleQuery.Clear() BattleScreen.BattleQuery.Clear()
BattleScreen.BattleQuery.Add(BattleScreen.FocusBattle()) BattleScreen.BattleQuery.Add(BattleScreen.FocusBattle())
BattleScreen.BattleQuery.Insert(0, New ToggleMenuQueryObject(True)) BattleScreen.BattleQuery.Insert(0, New ToggleMenuQueryObject(True))
Core.SetScreen(New BattleCatchScreen(BattleScreen, Item.GetItemByID(181))) Core.SetScreen(New BattleCatchScreen(BattleScreen, Item.GetItemByID(181.ToString)))
Dim safariBallText As String = "Safari Ball x" & Core.Player.Inventory.GetItemAmount(181).ToString() Dim safariBallText As String = "Safari Ball x" & Core.Player.Inventory.GetItemAmount(181.ToString).ToString()
If Core.Player.Inventory.GetItemAmount(181) = 0 Then If Core.Player.Inventory.GetItemAmount(181.ToString) = 0 Then
safariBallText = "No Safari Balls." safariBallText = "No Safari Balls."
End If End If
_mainMenuItemList(0).Text = safariBallText _mainMenuItemList(0).Text = safariBallText
@ -821,15 +828,15 @@
End Sub End Sub
Private Sub MainMenuUseSportBall(ByVal BattleScreen As BattleScreen) Private Sub MainMenuUseSportBall(ByVal BattleScreen As BattleScreen)
If Core.Player.Inventory.GetItemAmount(177) > 0 Then If Core.Player.Inventory.GetItemAmount(177.ToString) > 0 Then
Core.Player.Inventory.RemoveItem(177, 1) Core.Player.Inventory.RemoveItem(177.ToString, 1)
BattleScreen.BattleQuery.Clear() BattleScreen.BattleQuery.Clear()
BattleScreen.BattleQuery.Add(BattleScreen.FocusBattle()) BattleScreen.BattleQuery.Add(BattleScreen.FocusBattle())
BattleScreen.BattleQuery.Insert(0, New ToggleMenuQueryObject(True)) BattleScreen.BattleQuery.Insert(0, New ToggleMenuQueryObject(True))
Core.SetScreen(New BattleCatchScreen(BattleScreen, Item.GetItemByID(177))) Core.SetScreen(New BattleCatchScreen(BattleScreen, Item.GetItemByID(177.ToString)))
Dim sportBallText As String = "Sport Ball x" & Core.Player.Inventory.GetItemAmount(177).ToString() Dim sportBallText As String = "Sport Ball x" & Core.Player.Inventory.GetItemAmount(177.ToString).ToString()
If Core.Player.Inventory.GetItemAmount(177) = 0 Then If Core.Player.Inventory.GetItemAmount(177.ToString) = 0 Then
sportBallText = "No Sport Balls." sportBallText = "No Sport Balls."
End If End If
_mainMenuItemList(0).Text = sportBallText _mainMenuItemList(0).Text = sportBallText
@ -1056,17 +1063,17 @@
End Sub End Sub
Private Shared Sub SelectedItem(ByVal itemID As Integer) Private Shared Sub SelectedItem(ByVal itemID As Integer)
Dim Item As Item = Item.GetItemByID(itemID) Dim Item As Item = Item.GetItemByID(itemID.ToString)
If Item.CanBeUsedInBattle = True Then If Item.CanBeUsedInBattle = True Then
If Item.IsBall = True Then If Item.IsBall = True Then
Core.Player.Inventory.RemoveItem(itemID, 1) Core.Player.Inventory.RemoveItem(itemID.ToString, 1)
If TempBattleScreen.IsTrainerBattle = False Then If TempBattleScreen.IsTrainerBattle = False Then
If BattleScreen.CanCatch = True Or CBool(GameModeManager.GetGameRuleValue("OnlyCaptureFirst", "0")) = True And Core.Player.PokeFiles.Contains(BattleScreen.TempPokeFile) = True Then If BattleScreen.CanCatch = True Or CBool(GameModeManager.GetGameRuleValue("OnlyCaptureFirst", "0")) = True And Core.Player.PokeFiles.Contains(BattleScreen.TempPokeFile) = True Then
TempBattleScreen.BattleQuery.Clear() TempBattleScreen.BattleQuery.Clear()
TempBattleScreen.BattleQuery.Add(TempBattleScreen.FocusBattle()) TempBattleScreen.BattleQuery.Add(TempBattleScreen.FocusBattle())
TempBattleScreen.BattleQuery.Insert(0, New ToggleMenuQueryObject(True)) TempBattleScreen.BattleQuery.Insert(0, New ToggleMenuQueryObject(True))
Core.SetScreen(New BattleCatchScreen(TempBattleScreen, Item.GetItemByID(itemID))) Core.SetScreen(New BattleCatchScreen(TempBattleScreen, Item.GetItemByID(itemID.ToString)))
PlayerStatistics.Track("[4]Poké Balls used", 1) PlayerStatistics.Track("[4]Poké Balls used", 1)
Else Else
TempBattleScreen.BattleQuery.Clear() TempBattleScreen.BattleQuery.Clear()
@ -1105,7 +1112,7 @@
Private Shared Sub UseItem(ByVal PokeIndex As Integer) Private Shared Sub UseItem(ByVal PokeIndex As Integer)
Dim Pokemon As Pokemon = Core.Player.Pokemons(PokeIndex) Dim Pokemon As Pokemon = Core.Player.Pokemons(PokeIndex)
Dim Item As Item = Item.GetItemByID(TempItemID) Dim Item As Item = Item.GetItemByID(TempItemID.ToString)
If Item.UseOnPokemon(PokeIndex) = True Then If Item.UseOnPokemon(PokeIndex) = True Then
TempBattleScreen.BattleQuery.Clear() TempBattleScreen.BattleQuery.Clear()

View File

@ -1250,7 +1250,7 @@ nextIndex:
End If End If
If IsRemoteBattle = True Then If IsRemoteBattle = True Then
If p.OriginalItem IsNot Nothing Then If p.OriginalItem IsNot Nothing Then
p.Item = P3D.Item.GetItemByID(p.OriginalItem.ID) p.Item = P3D.Item.GetItemByID(p.OriginalItem.ID.ToString)
p.Item.AdditionalData = p.OriginalItem.AdditionalData p.Item.AdditionalData = p.OriginalItem.AdditionalData
Screen.TextBox.Show(Core.Player.Name & " received~" & p.OriginalItem.Name & "and gave it back to~" & p.GetDisplayName) Screen.TextBox.Show(Core.Player.Name & " received~" & p.OriginalItem.Name & "and gave it back to~" & p.GetDisplayName)
p.OriginalItem = Nothing p.OriginalItem = Nothing
@ -1258,12 +1258,12 @@ nextIndex:
Else Else
If Not p.OriginalItem Is Nothing Then If Not p.OriginalItem Is Nothing Then
If p.Item Is Nothing Then If p.Item Is Nothing Then
p.Item = P3D.Item.GetItemByID(p.OriginalItem.ID) p.Item = P3D.Item.GetItemByID(p.OriginalItem.ID.ToString)
p.Item.AdditionalData = p.OriginalItem.AdditionalData p.Item.AdditionalData = p.OriginalItem.AdditionalData
Screen.TextBox.Show(Core.Player.Name & " found~" & p.OriginalItem.Name & "*and gave it back to~" & p.GetDisplayName) Screen.TextBox.Show(Core.Player.Name & " found~" & p.OriginalItem.Name & "*and gave it back to~" & p.GetDisplayName)
p.OriginalItem = Nothing p.OriginalItem = Nothing
Else Else
Core.Player.Inventory.AddItem(p.OriginalItem.ID, 1) Core.Player.Inventory.AddItem(p.OriginalItem.ID.ToString, 1)
SoundManager.PlaySound("item_found", True) SoundManager.PlaySound("item_found", True)
Screen.TextBox.Show(Core.Player.Name & " found~" & p.OriginalItem.Name & "!*" & Core.Player.Inventory.GetMessageReceive(p.OriginalItem, 1)) Screen.TextBox.Show(Core.Player.Name & " found~" & p.OriginalItem.Name & "!*" & Core.Player.Inventory.GetMessageReceive(p.OriginalItem, 1))
p.OriginalItem = Nothing p.OriginalItem = Nothing
@ -1303,7 +1303,7 @@ nextIndex:
If Not p.Item Is Nothing Then If Not p.Item Is Nothing Then
If p.Item.IsBerry = True Then If p.Item.IsBerry = True Then
If Core.Random.Next(0, 3) = 0 Then If Core.Random.Next(0, 3) = 0 Then
p.Item = Item.GetItemByID(139) p.Item = Item.GetItemByID(139.ToString)
End If End If
End If End If
End If End If
@ -1313,19 +1313,19 @@ nextIndex:
For Each p As Pokemon In Core.Player.Pokemons For Each p As Pokemon In Core.Player.Pokemons
If IsRemoteBattle = True Then If IsRemoteBattle = True Then
If p.OriginalItem IsNot Nothing Then If p.OriginalItem IsNot Nothing Then
p.Item = P3D.Item.GetItemByID(p.OriginalItem.ID) p.Item = P3D.Item.GetItemByID(p.OriginalItem.ID.ToString)
p.Item.AdditionalData = p.OriginalItem.AdditionalData p.Item.AdditionalData = p.OriginalItem.AdditionalData
Screen.TextBox.Show(Core.Player.Name & " received~" & p.OriginalItem.Name & "and gave it back to~" & p.GetDisplayName) Screen.TextBox.Show(Core.Player.Name & " received~" & p.OriginalItem.Name & "and gave it back to~" & p.GetDisplayName)
End If End If
Else Else
If Not p.OriginalItem Is Nothing Then If Not p.OriginalItem Is Nothing Then
If p.Item IsNot Nothing Then If p.Item IsNot Nothing Then
Core.Player.Inventory.AddItem(p.OriginalItem.ID, 1) Core.Player.Inventory.AddItem(p.OriginalItem.ID.ToString, 1)
SoundManager.PlaySound("item_found", True) SoundManager.PlaySound("item_found", True)
Screen.TextBox.Show(Core.Player.Name & " found~" & p.OriginalItem.Name & "!*" & Core.Player.Inventory.GetMessageReceive(p.OriginalItem, 1)) Screen.TextBox.Show(Core.Player.Name & " found~" & p.OriginalItem.Name & "!*" & Core.Player.Inventory.GetMessageReceive(p.OriginalItem, 1))
p.OriginalItem = Nothing p.OriginalItem = Nothing
Else Else
p.Item = P3D.Item.GetItemByID(p.OriginalItem.ID) p.Item = P3D.Item.GetItemByID(p.OriginalItem.ID.ToString)
p.Item.AdditionalData = p.OriginalItem.AdditionalData p.Item.AdditionalData = p.OriginalItem.AdditionalData
Screen.TextBox.Show(Core.Player.Name & " found~" & p.OriginalItem.Name & "*and gave it back to~" & p.GetDisplayName) Screen.TextBox.Show(Core.Player.Name & " found~" & p.OriginalItem.Name & "*and gave it back to~" & p.GetDisplayName)
p.OriginalItem = Nothing p.OriginalItem = Nothing

View File

@ -281,7 +281,7 @@
'Special stuff 'Special stuff
Public RunTries As Integer = 0 Public RunTries As Integer = 0
Public UsedPokemon As New List(Of Integer) Public UsedPokemon As New List(Of Integer)
Public StolenItemIDs As New List(Of Integer) Public StolenItemIDs As New List(Of String)
Public DefeatedTrainerPokemon As Boolean = False Public DefeatedTrainerPokemon As Boolean = False
Public RoamingFled As Boolean = False Public RoamingFled As Boolean = False

View File

@ -89,7 +89,7 @@
If rec.Contains(MouseHandler.MousePosition) = False Then If rec.Contains(MouseHandler.MousePosition) = False Then
If Controls.Accept(True, True, True) = True Then If Controls.Accept(True, True, True) = True Then
If _chooseIndex = 0 Then If _chooseIndex = 0 Then
Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), AddressOf ChoosePokemon, Localization.GetString("battle_main_choose_pokemon"), False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5.ToString), AddressOf ChoosePokemon, Localization.GetString("battle_main_choose_pokemon"), False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True}
AddHandler selScreen.SelectedObject, AddressOf ChoosePokemonHandler AddHandler selScreen.SelectedObject, AddressOf ChoosePokemonHandler
SoundManager.PlaySound("select") SoundManager.PlaySound("select")
Core.SetScreen(selScreen) Core.SetScreen(selScreen)
@ -109,7 +109,7 @@
Else Else
If Controls.Accept(False, True, True) = True Then If Controls.Accept(False, True, True) = True Then
If _chooseIndex = 0 Then If _chooseIndex = 0 Then
Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), AddressOf ChoosePokemon, Localization.GetString("battle_main_choose_pokemon"), False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5.ToString), AddressOf ChoosePokemon, Localization.GetString("battle_main_choose_pokemon"), False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True}
AddHandler selScreen.SelectedObject, AddressOf ChoosePokemonHandler AddHandler selScreen.SelectedObject, AddressOf ChoosePokemonHandler
SoundManager.PlaySound("select") SoundManager.PlaySound("select")
Core.SetScreen(selScreen) Core.SetScreen(selScreen)
@ -129,7 +129,7 @@
If Controls.Accept(True, False, False) Then If Controls.Accept(True, False, False) Then
If New Rectangle(Core.windowSize.Width - 213, Core.windowSize.Height - 438, 80, 50).Contains(MouseHandler.MousePosition) Then If New Rectangle(Core.windowSize.Width - 213, Core.windowSize.Height - 438, 80, 50).Contains(MouseHandler.MousePosition) Then
_chooseIndex = 0 _chooseIndex = 0
Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), AddressOf ChoosePokemon, Localization.GetString("battle_main_choose_pokemon"), False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5.ToString), AddressOf ChoosePokemon, Localization.GetString("battle_main_choose_pokemon"), False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True}
AddHandler selScreen.SelectedObject, AddressOf ChoosePokemonHandler AddHandler selScreen.SelectedObject, AddressOf ChoosePokemonHandler
SoundManager.PlaySound("select") SoundManager.PlaySound("select")
Core.SetScreen(selScreen) Core.SetScreen(selScreen)

View File

@ -179,7 +179,7 @@ Public Class Trainer
If value <> "" Then If value <> "" Then
Dim itemData() As String = ScriptCommander.Parse(value).ToString().Split(CChar(",")) Dim itemData() As String = ScriptCommander.Parse(value).ToString().Split(CChar(","))
For Each ItemID As String In itemData For Each ItemID As String In itemData
Items.Add(Item.GetItemByID(CInt(ItemID))) Items.Add(Item.GetItemByID(CInt(ItemID).ToString))
Next Next
End If End If
Case "gender" Case "gender"

View File

@ -145,8 +145,13 @@
Public Overrides Sub ResultFunction(Result As Integer) Public Overrides Sub ResultFunction(Result As Integer)
If Result = 0 Then If Result = 0 Then
Dim Item As Item = GetItem() Dim Item As Item = GetItem()
Dim ItemID As String
Core.Player.Inventory.AddItem(Item.ID, 1) If Item.IsGameModeItem Then
ItemID = Item.gmID
Else
ItemID = Item.ID.ToString
End If
Core.Player.Inventory.AddItem(ItemID, 1)
PlayerStatistics.Track("[85]Apricorns picked", 1) PlayerStatistics.Track("[85]Apricorns picked", 1)
SoundManager.PlaySound("Receive_Item", True) SoundManager.PlaySound("Receive_Item", True)
Screen.TextBox.TextColor = TextBox.PlayerColor Screen.TextBox.TextColor = TextBox.PlayerColor
@ -193,7 +198,7 @@
ItemID = 101 ItemID = 101
End Select End Select
Return Item.GetItemByID(ItemID) Return Item.GetItemByID(ItemID.ToString)
End Function End Function
End Class End Class

View File

@ -16,7 +16,7 @@
Dim LastUpdateDate As Date Dim LastUpdateDate As Date
Public Overloads Sub Initialize(ByVal BerryIndex As Integer, ByVal BerriesYield As Integer, ByVal Watered As String, ByVal Time As String, ByVal FullGrown As Boolean) Public Overloads Sub Initialize(ByVal BerryIndex As Integer, ByVal BerriesYield As Integer, ByVal Watered As String, ByVal Time As String, ByVal FullGrown As Boolean)
Me.Berry = CType(Item.GetItemByID(BerryIndex + 2000), Items.Berry) Me.Berry = CType(Item.GetItemByID(CStr(BerryIndex + 2000)), Items.Berry)
Me.Berries = BerriesYield Me.Berries = BerriesYield
Me.PlantDate = Time Me.PlantDate = Time
Me.BerryIndex = BerryIndex Me.BerryIndex = BerryIndex
@ -130,7 +130,7 @@
Dim text As String = "" Dim text As String = ""
Dim hasBottle As Boolean = False Dim hasBottle As Boolean = False
If Core.Player.Inventory.GetItemAmount(175) > 0 Then If Core.Player.Inventory.GetItemAmount(175.ToString) > 0 Then
hasBottle = True hasBottle = True
End If End If
@ -180,7 +180,7 @@
If Result = 0 Then If Result = 0 Then
Select Case Me.ResultIndex Select Case Me.ResultIndex
Case 0 Case 0
Core.Player.Inventory.AddItem(Me.Berry.ID, Me.Berries) Core.Player.Inventory.AddItem(Me.Berry.ID.ToString, Me.Berries)
Dim Text As String = "" Dim Text As String = ""
If Me.Berries = 1 Then If Me.Berries = 1 Then
Text = Core.Player.Name & " picked the~" & Berry.Name & " Berry.*" & Core.Player.Inventory.GetMessageReceive(Berry, Me.Berries) Text = Core.Player.Name & " picked the~" & Berry.Name & " Berry.*" & Core.Player.Inventory.GetMessageReceive(Berry, Me.Berries)
@ -235,7 +235,7 @@
Dim cD As Date = Date.Now Dim cD As Date = Date.Now
Dim DateData As String = cD.Year & "," & cD.Month & "," & cD.Day & "," & cD.TimeOfDay.Hours & "," & cD.TimeOfDay.Minutes & "," & cD.TimeOfDay.Seconds Dim DateData As String = cD.Year & "," & cD.Month & "," & cD.Day & "," & cD.TimeOfDay.Hours & "," & cD.TimeOfDay.Minutes & "," & cD.TimeOfDay.Seconds
Dim Berry As Items.Berry = CType(Item.GetItemByID(BerryIndex + 2000), Items.Berry) Dim Berry As Items.Berry = CType(Item.GetItemByID(CStr(BerryIndex + 2000)), Items.Berry)
Dim BerryAmount As Integer = GetBerryAmount(Berry, 0) Dim BerryAmount As Integer = GetBerryAmount(Berry, 0)
@ -257,7 +257,7 @@
CType(newEnt, BerryPlant).Initialize(BerryIndex, 0, "", DateData, False) CType(newEnt, BerryPlant).Initialize(BerryIndex, 0, "", DateData, False)
Screen.Level.Entities.Add(newEnt) Screen.Level.Entities.Add(newEnt)
Core.Player.Inventory.RemoveItem(BerryIndex + 2000, 1) Core.Player.Inventory.RemoveItem(CStr(BerryIndex + 2000), 1)
End Sub End Sub
Private Shared Function GetBerryAmount(ByVal Berry As Items.Berry, ByVal Watered As Integer) As Integer Private Shared Function GetBerryAmount(ByVal Berry As Items.Berry, ByVal Watered As Integer) As Integer
@ -312,7 +312,7 @@
Dim DateData As String = PlantDate Dim DateData As String = PlantDate
Dim Berry As Items.Berry = CType(Item.GetItemByID(BerryIndex + 2000), Items.Berry) Dim Berry As Items.Berry = CType(Item.GetItemByID(CStr(BerryIndex + 2000)), Items.Berry)
Dim WateredData As String = "" Dim WateredData As String = ""
Dim wateredCount As Integer = 0 Dim wateredCount As Integer = 0

View File

@ -17,7 +17,7 @@
Public Overloads Sub Initialize(Optional ByVal AnimationData As List(Of List(Of Integer)) = Nothing) Public Overloads Sub Initialize(Optional ByVal AnimationData As List(Of List(Of Integer)) = Nothing)
MyBase.Initialize() MyBase.Initialize()
Me.Item = Item.GetItemByID(CInt(Me.AdditionalValue.GetSplit(1))) Me.Item = Item.GetItemByID(Me.AdditionalValue.GetSplit(1))
Me.ItemID = CInt(Me.AdditionalValue.GetSplit(0)) Me.ItemID = CInt(Me.AdditionalValue.GetSplit(0))
Me.Textures(0) = Me.Item.Texture Me.Textures(0) = Me.Item.Texture
@ -147,7 +147,13 @@
End If End If
Screen.TextBox.TextColor = TextBox.PlayerColor Screen.TextBox.TextColor = TextBox.PlayerColor
Screen.TextBox.Show(Core.Player.Name & " found~" & Me.Item.Name & "!*" & Core.Player.Inventory.GetMessageReceive(Item, 1), {Me}) Screen.TextBox.Show(Core.Player.Name & " found~" & Me.Item.Name & "!*" & Core.Player.Inventory.GetMessageReceive(Item, 1), {Me})
Core.Player.Inventory.AddItem(Me.Item.ID, 1) Dim ItemID As String
If Me.Item.IsGameModeItem Then
ItemID = Me.Item.gmID
Else
ItemID = Me.Item.ID.ToString
End If
Core.Player.Inventory.AddItem(ItemID, 1)
PlayerStatistics.Track("Items found", 1) PlayerStatistics.Track("Items found", 1)
Core.Player.AddPoints(1, "Found an item.") Core.Player.AddPoints(1, "Found an item.")

View File

@ -42,9 +42,9 @@
End Sub End Sub
Public Sub PlantBerry(ByVal ChosenBerry As Integer) Public Sub PlantBerry(ByVal ChosenBerry As Integer)
Dim testItem As Item = Item.GetItemByID(ChosenBerry) Dim testItem As Item = Item.GetItemByID(ChosenBerry.ToString)
If testItem.isBerry = True Then If testItem.isBerry = True Then
Dim Berry As Items.Berry = CType(Item.GetItemByID(ChosenBerry), Items.Berry) Dim Berry As Items.Berry = CType(Item.GetItemByID(ChosenBerry.ToString), Items.Berry)
BerryPlant.AddBerryPlant(Screen.Level.LevelFile, Me.Position, Berry.BerryIndex) BerryPlant.AddBerryPlant(Screen.Level.LevelFile, Me.Position, Berry.BerryIndex)
Screen.TextBox.reDelay = 0.0F Screen.TextBox.reDelay = 0.0F

View File

@ -722,7 +722,7 @@
Core.SetScreen(New SelectFriendScreen(Me)) Core.SetScreen(New SelectFriendScreen(Me))
End If End If
If New Rectangle(100, 300, 32 * 5 + 64, 32).Contains(MouseHandler.MousePosition) = True Then If New Rectangle(100, 300, 32 * 5 + 64, 32).Contains(MouseHandler.MousePosition) = True Then
Dim selScreen = New PartyScreen(Me, Item.GetItemByID(5), AddressOf ChosenPokemon, "Choose Pokémon for Trade", True, True, False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} Dim selScreen = New PartyScreen(Me, Item.GetItemByID(5.ToString), AddressOf ChosenPokemon, "Choose Pokémon for Trade", True, True, False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True}
AddHandler selScreen.SelectedObject, AddressOf ChosenPokemonHandler AddHandler selScreen.SelectedObject, AddressOf ChosenPokemonHandler
Core.SetScreen(selScreen) Core.SetScreen(selScreen)

View File

@ -45,7 +45,7 @@
If Controls.Accept(True, False) = True Then If Controls.Accept(True, False) = True Then
If New Rectangle(180, 560, 32 * 5 + 64, 32).Contains(MouseHandler.MousePosition) = True Then If New Rectangle(180, 560, 32 * 5 + 64, 32).Contains(MouseHandler.MousePosition) = True Then
Dim selScreen = New PartyScreen(Me, Item.GetItemByID(5), AddressOf ChosePokemon, "Choose Pokémon to trade", True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} Dim selScreen = New PartyScreen(Me, Item.GetItemByID(5.ToString), AddressOf ChosePokemon, "Choose Pokémon to trade", True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True}
AddHandler selScreen.SelectedObject, AddressOf ChosePokemonHandler AddHandler selScreen.SelectedObject, AddressOf ChosePokemonHandler
SoundManager.PlaySound("select") SoundManager.PlaySound("select")
Core.SetScreen(selScreen) Core.SetScreen(selScreen)

View File

@ -204,7 +204,7 @@
If Me.OpenedSelect = True Then If Me.OpenedSelect = True Then
Me.CloseScreen() Me.CloseScreen()
Else Else
Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), AddressOf SelectPokemonForTrade, "Choose Pokémon for Trade", True, False, False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5.ToString), AddressOf SelectPokemonForTrade, "Choose Pokémon for Trade", True, False, False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True}
AddHandler selScreen.SelectedObject, AddressOf SelectPokemonForTradeHandler AddHandler selScreen.SelectedObject, AddressOf SelectPokemonForTradeHandler
Core.SetScreen(selScreen) Core.SetScreen(selScreen)

View File

@ -314,7 +314,7 @@
Case 0 Case 0
Me.StartTrade() Me.StartTrade()
Case 1 Case 1
Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), AddressOf SelectPokemonForTrade, "Choose Pokémon for Trade", True, False, False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5.ToString), AddressOf SelectPokemonForTrade, "Choose Pokémon for Trade", True, False, False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True}
AddHandler selScreen.SelectedObject, AddressOf SelectPokemonForTradeHandler AddHandler selScreen.SelectedObject, AddressOf SelectPokemonForTradeHandler
Core.SetScreen(selScreen) Core.SetScreen(selScreen)

View File

@ -329,7 +329,7 @@
Private Sub StartBattle() Private Sub StartBattle()
If Not Me.OwnTeam Is Nothing And Not OppTeam Is Nothing Then If Not Me.OwnTeam Is Nothing And Not OppTeam Is Nothing Then
Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), AddressOf LeadPickedStart, "Choose your Lead", True, True, False, _pokemonList:=OwnTeam) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5.ToString), AddressOf LeadPickedStart, "Choose your Lead", True, True, False, _pokemonList:=OwnTeam) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True}
AddHandler selScreen.SelectedObject, AddressOf LeadPickedStartHandler AddHandler selScreen.SelectedObject, AddressOf LeadPickedStartHandler
Core.SetScreen(selScreen) Core.SetScreen(selScreen)

View File

@ -18036,7 +18036,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Content\Textures\battlepike.png"> <Content Include="Content\Textures\battlepike.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Content\Sounds\VoltorbFlip\LoseGame.wav"> <Content Include="Content\Sounds\VoltorbFlip\LoseGame.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@ -28460,6 +28460,7 @@
<Compile Include="Pokemon\Items\Fossils\RootFossil.vb" /> <Compile Include="Pokemon\Items\Fossils\RootFossil.vb" />
<Compile Include="Pokemon\Items\Fossils\OldAmber.vb" /> <Compile Include="Pokemon\Items\Fossils\OldAmber.vb" />
<Compile Include="Pokemon\Items\Fossils\DomeFossil.vb" /> <Compile Include="Pokemon\Items\Fossils\DomeFossil.vb" />
<Compile Include="Pokemon\Items\GameModeItemLoader.vb" />
<Compile Include="Pokemon\Items\Gems\BugGem.vb" /> <Compile Include="Pokemon\Items\Gems\BugGem.vb" />
<Compile Include="Pokemon\Items\Gems\DarkGem.vb" /> <Compile Include="Pokemon\Items\Gems\DarkGem.vb" />
<Compile Include="Pokemon\Items\Gems\DragonGem.vb" /> <Compile Include="Pokemon\Items\Gems\DragonGem.vb" />
@ -28478,6 +28479,7 @@
<Compile Include="Pokemon\Items\Gems\RockGem.vb" /> <Compile Include="Pokemon\Items\Gems\RockGem.vb" />
<Compile Include="Pokemon\Items\Gems\SteelGem.vb" /> <Compile Include="Pokemon\Items\Gems\SteelGem.vb" />
<Compile Include="Pokemon\Items\Gems\WaterGem.vb" /> <Compile Include="Pokemon\Items\Gems\WaterGem.vb" />
<Compile Include="Pokemon\Items\GameModeItem.vb" />
<Compile Include="Pokemon\Items\KeyItems\LightStone.vb" /> <Compile Include="Pokemon\Items\KeyItems\LightStone.vb" />
<Compile Include="Pokemon\Items\KeyItems\DarkStone.vb" /> <Compile Include="Pokemon\Items\KeyItems\DarkStone.vb" />
<Compile Include="Pokemon\Items\KeyItems\LibertySeaMap.vb" /> <Compile Include="Pokemon\Items\KeyItems\LibertySeaMap.vb" />

View File

@ -534,6 +534,7 @@
GameModeManager.SetGameModePointer(GameMode) GameModeManager.SetGameModePointer(GameMode)
BattleSystem.GameModeAttackLoader.Load() BattleSystem.GameModeAttackLoader.Load()
GameModeItemLoader.Load()
If IsGameJoltSave = True Then If IsGameJoltSave = True Then
SandBoxMode = False SandBoxMode = False
@ -592,9 +593,9 @@
''' 2. Shiny Candy [ID: 501] ''' 2. Shiny Candy [ID: 501]
If Not ActionScript.IsRegistered("PokemonIndev054Update") Then If Not ActionScript.IsRegistered("PokemonIndev054Update") Then
' Check Inventory. ' Check Inventory.
Inventory.RemoveItem(501) Inventory.RemoveItem(501.ToString)
For i As Integer = 507 To 553 Step +1 For i As Integer = 507 To 553 Step +1
Inventory.RemoveItem(i) Inventory.RemoveItem(i.ToString)
Next Next
' Check Party Pokemon. ' Check Party Pokemon.
@ -958,7 +959,7 @@
Dim amount As Integer = CInt(ItemID.Remove(0, ItemID.IndexOf("|") + 1)) Dim amount As Integer = CInt(ItemID.Remove(0, ItemID.IndexOf("|") + 1))
ItemID = ItemID.Remove(ItemID.IndexOf("|")) ItemID = ItemID.Remove(ItemID.IndexOf("|"))
Inventory.AddItem(CInt(ItemID), amount) Inventory.AddItem(ItemID, amount)
Else Else
If ItemDat <> "" And ItemDat.StartsWith("Mail|") = True Then If ItemDat <> "" And ItemDat.StartsWith("Mail|") = True Then
Dim mailData As String = ItemDat.Remove(0, 5) Dim mailData As String = ItemDat.Remove(0, 5)
@ -1498,7 +1499,7 @@
End Sub End Sub
Private Sub SaveItems() Private Sub SaveItems()
Inventory.RemoveItem(177) 'Removing Sport Balls if player has those. Inventory.RemoveItem(177.ToString) 'Removing Sport Balls if player has those.
Dim Data As String = GetItemsData() Dim Data As String = GetItemsData()
@ -1840,7 +1841,7 @@
":end" ":end"
If Temp.LastUsedRepel > -1 Then If Temp.LastUsedRepel > -1 Then
Dim haveItemLeft As Boolean = Inventory.GetItemAmount(Temp.LastUsedRepel) > 0 Dim haveItemLeft As Boolean = Inventory.GetItemAmount(Temp.LastUsedRepel.ToString) > 0
If haveItemLeft = True Then If haveItemLeft = True Then
s = "version=2" & Environment.NewLine & s = "version=2" & Environment.NewLine &

View File

@ -10,14 +10,14 @@ Public Class PlayerInventory
''' </summary> ''' </summary>
Class ItemContainer Class ItemContainer
Private _itemID As Integer Private _itemID As String
Private _amount As Integer Private _amount As Integer
Public Property ItemID() As Integer Public Property ItemID() As String
Get Get
Return Me._itemID Return Me._itemID
End Get End Get
Set(value As Integer) Set(value As String)
Me._itemID = value Me._itemID = value
End Set End Set
End Property End Property
@ -31,7 +31,7 @@ Public Class PlayerInventory
End Set End Set
End Property End Property
Public Sub New(ByVal ItemID As Integer, ByVal Amount As Integer) Public Sub New(ByVal ItemID As String, ByVal Amount As Integer)
Me.ItemID = ItemID Me.ItemID = ItemID
Me.Amount = Amount Me.Amount = Amount
End Sub End Sub
@ -69,9 +69,7 @@ Public Class PlayerInventory
''' </summary> ''' </summary>
''' <param name="ID">The ID of the item.</param> ''' <param name="ID">The ID of the item.</param>
''' <param name="Amount">Amount of items to add.</param> ''' <param name="Amount">Amount of items to add.</param>
Public Sub AddItem(ByVal ID As Integer, ByVal Amount As Integer) Public Sub AddItem(ByVal ID As String, ByVal Amount As Integer)
Dim newItem As Item = P3D.Item.GetItemByID(ID)
For Each c As ItemContainer In Me For Each c As ItemContainer In Me
If c.ItemID = ID Then If c.ItemID = ID Then
c.Amount += Amount c.Amount += Amount
@ -87,7 +85,7 @@ Public Class PlayerInventory
''' </summary> ''' </summary>
''' <param name="ID">The ID of the item to remove.</param> ''' <param name="ID">The ID of the item to remove.</param>
''' <param name="Amount">The amount of items to remove.</param> ''' <param name="Amount">The amount of items to remove.</param>
Public Sub RemoveItem(ByVal ID As Integer, ByVal Amount As Integer) Public Sub RemoveItem(ByVal ID As String, ByVal Amount As Integer)
If Amount > 0 Then If Amount > 0 Then
For Each c As ItemContainer In Me For Each c As ItemContainer In Me
If c.ItemID = ID Then If c.ItemID = ID Then
@ -113,7 +111,7 @@ Public Class PlayerInventory
''' Removes all items of an ID from the inventory. ''' Removes all items of an ID from the inventory.
''' </summary> ''' </summary>
''' <param name="ID">The ID of the item.</param> ''' <param name="ID">The ID of the item.</param>
Public Sub RemoveItem(ByVal ID As Integer) Public Sub RemoveItem(ByVal ID As String)
Dim Amount As Integer = Me.GetItemAmount(ID) Dim Amount As Integer = Me.GetItemAmount(ID)
If Amount > 0 Then If Amount > 0 Then
Me.RemoveItem(ID, Amount) Me.RemoveItem(ID, Amount)
@ -124,7 +122,7 @@ Public Class PlayerInventory
''' Returns the count of the item in the inventory. ''' Returns the count of the item in the inventory.
''' </summary> ''' </summary>
''' <param name="ID">The ID of the item to be counted.</param> ''' <param name="ID">The ID of the item to be counted.</param>
Public Function GetItemAmount(ByVal ID As Integer) As Integer Public Function GetItemAmount(ByVal ID As String) As Integer
For Each c As ItemContainer In Me For Each c As ItemContainer In Me
If c.ItemID = ID Then If c.ItemID = ID Then
Return c.Amount Return c.Amount
@ -142,7 +140,7 @@ Public Class PlayerInventory
If Core.Player.SandBoxMode = True Or GameController.IS_DEBUG_ACTIVE = True Then If Core.Player.SandBoxMode = True Or GameController.IS_DEBUG_ACTIVE = True Then
Return True Return True
Else Else
If Me.GetItemAmount(78) > 0 Then If Me.GetItemAmount(78.ToString) > 0 Then
Return True Return True
End If End If
End If End If
@ -156,7 +154,7 @@ Public Class PlayerInventory
''' </summary> ''' </summary>
Public ReadOnly Property HasMegaBracelet() As Boolean Public ReadOnly Property HasMegaBracelet() As Boolean
Get Get
If Me.GetItemAmount(576) > 0 Then If Me.GetItemAmount(576.ToString) > 0 Then
Return True Return True
End If End If
@ -170,7 +168,7 @@ Public Class PlayerInventory
''' <param name="Item">The Item to store in the inventory.</param> ''' <param name="Item">The Item to store in the inventory.</param>
''' <param name="Amount">The amount.</param> ''' <param name="Amount">The amount.</param>
Public Function GetMessageReceive(ByVal Item As Item, ByVal Amount As Integer) As String Public Function GetMessageReceive(ByVal Item As Item, ByVal Amount As Integer) As String
Dim Message As String = "" Dim Message As String
If Amount = 1 Then If Amount = 1 Then
Message = Core.Player.Name & " stored it in the~" & Core.Player.Inventory.GetItemPocketChar(Item) & Item.ItemType.ToString() & " pocket." Message = Core.Player.Name & " stored it in the~" & Core.Player.Inventory.GetItemPocketChar(Item) & Item.ItemType.ToString() & " pocket."
Else Else

View File

@ -8,12 +8,12 @@ Namespace Abilities
MyBase.New(14, "Compoundeyes", "The Pokémon's accuracy is boosted.") MyBase.New(14, "Compoundeyes", "The Pokémon's accuracy is boosted.")
End Sub End Sub
Public Shared Function ConvertItemChances(ByVal WildItems As Dictionary(Of Integer, Integer)) As Dictionary(Of Integer, Integer) Public Shared Function ConvertItemChances(ByVal WildItems As Dictionary(Of Integer, String)) As Dictionary(Of Integer, String)
Dim d As New Dictionary(Of Integer, Integer) Dim d As New Dictionary(Of Integer, String)
For i = 0 To WildItems.Count - 1 For i = 0 To WildItems.Count - 1
Dim chance As Integer = WildItems.Keys(i) Dim chance As Integer = WildItems.Keys(i)
Dim itemID As Integer = WildItems.Values(i) Dim itemID As String = WildItems.Values(CInt(i))
Select Case chance Select Case chance
Case 50 Case 50

View File

@ -14,7 +14,7 @@ Namespace Abilities
If p.Item Is Nothing Then If p.Item Is Nothing Then
Dim chance As Integer = CInt(Math.Ceiling(p.Level / 10) * 5) Dim chance As Integer = CInt(Math.Ceiling(p.Level / 10) * 5)
If Core.Random.Next(0, 100) < chance Then If Core.Random.Next(0, 100) < chance Then
p.Item = Item.GetItemByID(253) p.Item = Item.GetItemByID(253.ToString)
End If End If
End If End If
End If End If

View File

@ -24,7 +24,7 @@ Namespace Abilities
itemList = Get1(p) itemList = Get1(p)
End If End If
If itemList.Count > 0 Then If itemList.Count > 0 Then
p.Item = Item.GetItemByID(itemList(Core.Random.Next(0, itemList.Count))) p.Item = Item.GetItemByID(itemList(Core.Random.Next(0, itemList.Count)).ToString)
End If End If
End If End If
End If End If

View File

@ -65,7 +65,7 @@
Dim ItemID As Integer = op.Item.ID Dim ItemID As Integer = op.Item.ID
BattleScreen.Battle.RemoveHeldItem(Not own, own, BattleScreen, p.GetDisplayName() & " ate the " & op.Item.Name & " berry!", "move:bugbite") BattleScreen.Battle.RemoveHeldItem(Not own, own, BattleScreen, p.GetDisplayName() & " ate the " & op.Item.Name & " berry!", "move:bugbite")
BattleScreen.Battle.UseBerry(own, own, Item.GetItemByID(ItemID), BattleScreen, "", "move:bugbite") BattleScreen.Battle.UseBerry(own, own, Item.GetItemByID(ItemID.ToString), BattleScreen, "", "move:bugbite")
End If End If
End If End If
End Sub End Sub

View File

@ -141,7 +141,11 @@
End If End If
End Select End Select
p.OriginalItem = Item.GetItemByID(p.Item.ID) Dim ItemID As String = p.Item.ID.ToString
If p.Item.IsGameModeItem = True Then
ItemID = p.Item.gmID
End If
p.OriginalItem = Item.GetItemByID(ItemID)
p.Item = Nothing p.Item = Nothing
End If End If
End Sub End Sub

View File

@ -117,7 +117,11 @@
Exit Sub Exit Sub
End If End If
op.OriginalItem = Item.GetItemByID(op.Item.ID) Dim ItemID As String = op.Item.ID.ToString
If op.Item.IsGameModeItem = True Then
ItemID = op.Item.gmID
End If
op.OriginalItem = Item.GetItemByID(ItemID)
op.OriginalItem.AdditionalData = op.Item.AdditionalData op.OriginalItem.AdditionalData = op.Item.AdditionalData
BattleScreen.Battle.RemoveHeldItem(Not own, own, BattleScreen, p.GetDisplayName() & " knocked off the " & op.GetDisplayName() & "'s " & op.OriginalItem.Name & "!", "move:knockoff") BattleScreen.Battle.RemoveHeldItem(Not own, own, BattleScreen, p.GetDisplayName() & " knocked off the " & op.GetDisplayName() & "'s " & op.OriginalItem.Name & "!", "move:knockoff")

View File

@ -84,9 +84,12 @@
End If End If
If p.Item Is Nothing Then If p.Item Is Nothing Then
Dim ItemID As Integer = op.Item.ID Dim ItemID As String = op.Item.ID.ToString
If op.Item.IsGameModeItem = True Then
ItemID = op.Item.gmID
End If
op.OriginalItem = Item.GetItemByID(op.Item.ID) op.OriginalItem = Item.GetItemByID(ItemID)
op.OriginalItem.AdditionalData = op.Item.AdditionalData op.OriginalItem.AdditionalData = op.Item.AdditionalData
If BattleScreen.Battle.RemoveHeldItem(Not own, own, BattleScreen, "Thief stole the item " & op.Item.Name & " from " & op.GetDisplayName() & "!", "move:thief") Then If BattleScreen.Battle.RemoveHeldItem(Not own, own, BattleScreen, "Thief stole the item " & op.Item.Name & " from " & op.GetDisplayName() & "!", "move:thief") Then

View File

@ -64,8 +64,15 @@ Namespace BattleSystem.Moves.Flying
End If End If
If Not op.Item Is Nothing Then If Not op.Item Is Nothing Then
If op.Item.isBerry = True Then If op.Item.IsBerry = True Then
BattleScreen.Battle.UseBerry(own, own, Item.GetItemByID(op.Item.ID), BattleScreen, "", "move:pluck") Dim ItemID As String
If op.Item.IsGameModeItem Then
ItemID = op.Item.gmID
Else
ItemID = op.Item.ID.ToString
End If
BattleScreen.Battle.UseBerry(own, own, Item.GetItemByID(ItemID), BattleScreen, "", "move:pluck")
End If End If
End If End If
End Sub End Sub

View File

@ -95,9 +95,12 @@
End If End If
If op.Item Is Nothing And a = True And b = False Then If op.Item Is Nothing And a = True And b = False Then
Dim ItemID As Integer = p.Item.ID Dim ItemID As String = p.Item.ID.ToString
If p.Item.IsGameModeItem = True Then
ItemID = p.Item.gmID
End If
p.OriginalItem = Item.GetItemByID(p.Item.ID) p.OriginalItem = Item.GetItemByID(ItemID)
p.OriginalItem.AdditionalData = p.Item.AdditionalData p.OriginalItem.AdditionalData = p.Item.AdditionalData
If BattleScreen.Battle.RemoveHeldItem(own, own, BattleScreen, op.GetDisplayName() & " received the item " & p.Item.Name & " from " & p.GetDisplayName() & "!", "move:bestow") Then If BattleScreen.Battle.RemoveHeldItem(own, own, BattleScreen, op.GetDisplayName() & " received the item " & p.Item.Name & " from " & p.GetDisplayName() & "!", "move:bestow") Then

View File

@ -87,9 +87,12 @@ Namespace BattleSystem.Moves.Normal
End If End If
If p.Item Is Nothing Then If p.Item Is Nothing Then
Dim ItemID As Integer = op.Item.ID Dim ItemID As String = op.Item.ID.ToString
If op.Item.IsGameModeItem = True Then
ItemID = op.Item.gmID
End If
op.OriginalItem = Item.GetItemByID(op.Item.ID) op.OriginalItem = Item.GetItemByID(ItemID)
op.OriginalItem.AdditionalData = op.Item.AdditionalData op.OriginalItem.AdditionalData = op.Item.AdditionalData
If BattleScreen.Battle.RemoveHeldItem(Not own, own, BattleScreen, "Covet stole the item " & op.Item.Name & " from " & op.GetDisplayName() & "!", "move:covet") Then If BattleScreen.Battle.RemoveHeldItem(Not own, own, BattleScreen, "Covet stole the item " & op.Item.Name & " from " & op.GetDisplayName() & "!", "move:covet") Then

View File

@ -125,11 +125,29 @@ Namespace BattleSystem.Moves.Psychic
op.Item = i1 op.Item = i1
If p.Item IsNot Nothing AndAlso p.OriginalItem IsNot Nothing Then If p.Item IsNot Nothing AndAlso p.OriginalItem IsNot Nothing Then
If p.Item.ID = p.OriginalItem.ID AndAlso p.Item.AdditionalData = p.OriginalItem.AdditionalData Then Dim pItemID As String = p.Item.ID.ToString
Dim pOriginalItemID As String = p.OriginalItem.ID.ToString
If p.Item.IsGameModeItem = True Then
pItemID = p.Item.gmID
End If
If p.OriginalItem.IsGameModeItem = True Then
pOriginalItemID = p.Item.gmID
End If
If pItemID = pOriginalItemID AndAlso p.Item.AdditionalData = p.OriginalItem.AdditionalData Then
p.OriginalItem = Nothing p.OriginalItem = Nothing
End If End If
End If End If
If op.Item IsNot Nothing AndAlso op.OriginalItem IsNot Nothing Then If op.Item IsNot Nothing AndAlso op.OriginalItem IsNot Nothing Then
Dim opItemID As String = op.Item.ID.ToString
Dim opOriginalItemID As String = op.OriginalItem.ID.ToString
If op.Item.IsGameModeItem = True Then
opItemID = op.Item.gmID
End If
If op.OriginalItem.IsGameModeItem = True Then
opOriginalItemID = op.Item.gmID
End If
If op.Item.ID = op.OriginalItem.ID AndAlso op.Item.AdditionalData = op.OriginalItem.AdditionalData Then If op.Item.ID = op.OriginalItem.ID AndAlso op.Item.AdditionalData = op.OriginalItem.AdditionalData Then
p.OriginalItem = Nothing p.OriginalItem = Nothing
End If End If

View File

@ -5,7 +5,7 @@ Namespace Items.Balls
Inherits BallItem Inherits BallItem
Public Overrides ReadOnly Property CanBeHold As Boolean = False Public Overrides ReadOnly Property CanBeHeld As Boolean = False
Public Overrides ReadOnly Property Description As String = "A special Pokéball that is used only in the Great Marsh and the Safari Zone. It is decorated in a camouflage pattern." Public Overrides ReadOnly Property Description As String = "A special Pokéball that is used only in the Great Marsh and the Safari Zone. It is decorated in a camouflage pattern."
Public Overrides ReadOnly Property PokeDollarPrice As Integer = 200 Public Overrides ReadOnly Property PokeDollarPrice As Integer = 200
Public Overrides ReadOnly Property CatchMultiplier As Single = 1.5F Public Overrides ReadOnly Property CatchMultiplier As Single = 1.5F

View File

@ -5,7 +5,7 @@ Namespace Items.Balls
Inherits BallItem Inherits BallItem
Public Overrides ReadOnly Property CanBeHold As Boolean = False Public Overrides ReadOnly Property CanBeHeld As Boolean = False
Public Overrides ReadOnly Property Description As String = "A special Pokéball for the Bug-Catching Contest." Public Overrides ReadOnly Property Description As String = "A special Pokéball for the Bug-Catching Contest."
Public Overrides ReadOnly Property PokeDollarPrice As Integer = 200 Public Overrides ReadOnly Property PokeDollarPrice As Integer = 200
Public Overrides ReadOnly Property CatchMultiplier As Single = 1.5F Public Overrides ReadOnly Property CatchMultiplier As Single = 1.5F

View File

@ -0,0 +1,149 @@
Imports P3D.Items
''' <summary>
''' An item the player stores in their inventory.
''' </summary>
Public Class GameModeItem
Inherits Item
Public gmTextureSource As String = "Items\GameModeItems"
Public gmPluralName As String = gmName
Public gmPrice As Integer = 0
Public gmBattlePointsPrice As Integer = 1
Public gmItemType As ItemTypes = ItemTypes.Standard
Public gmCatchMultiplier As Single = 1.0F
Public gmMaxStack As Integer = 999
Public gmFlingDamage As Integer = 30
Public gmCanBeTraded As Boolean = True
Public gmCanBeHeld As Boolean = True
Public gmCanBeUsed As Boolean = True
Public gmCanBeUsedInBattle As Boolean = True
Public gmCanBeTossed As Boolean = True
Public gmBattleSelectPokemon As Boolean = True
'Medicine Item
Public gmIsHealingItem As Boolean = False
Public gmHealHPAmount As Integer = 0
Public gmCureStatusEffects As List(Of Pokemon.StatusProblems)
'Evolution Item
Public gmIsEvolutionItem As Boolean = False
Public gmEvolutionPokemon As List(Of Integer)
'Mega Stone Item
Public gmMegaPokemonNumber As Integer
Public Sub New()
IsGameModeItem = True
End Sub
''' <summary>
''' The plural name of the item.
''' </summary>
Public Overrides ReadOnly Property PluralName As String
Get
Return gmPluralName
End Get
End Property
''' <summary>
''' The price of this item if the player purchases it in exchange for PokéDollars. This halves when selling an item to the store.
''' </summary>
Public Overrides ReadOnly Property PokeDollarPrice As Integer = gmPrice
''' <summary>
''' The price of this item if the player purchases it exchange for BattlePoints.
''' </summary>
Public Overrides ReadOnly Property BattlePointsPrice As Integer = gmBattlePointsPrice
''' <summary>
''' The type of this item. This also controls in which bag this item gets sorted.
''' </summary>
Public Overrides ReadOnly Property ItemType As ItemTypes = gmItemType
''' <summary>
''' The default catch multiplier if the item gets used as a Pokéball.
''' </summary>
Public Overrides ReadOnly Property CatchMultiplier As Single = gmCatchMultiplier
''' <summary>
''' The maximum amount of this item type (per ID) that can be stored in the bag.
''' </summary>
Public Overrides ReadOnly Property MaxStack As Integer = gmMaxStack
''' <summary>
''' A value that can be used to sort items in the bag after. Lower values make items appear closer to the top.
''' </summary>
Public Overrides ReadOnly Property SortValue As Integer = 0
''' <summary>
''' The bag description of this item.
''' </summary>
Public Overrides ReadOnly Property Description As String = gmDescription
''' <summary>
''' The damage the Fling move does when this item is attached to a Pokémon.
''' </summary>
Public Overrides ReadOnly Property FlingDamage As Integer = gmFlingDamage
''' <summary>
''' If this item can be traded in for money.
''' </summary>
Public Overrides ReadOnly Property CanBeTraded As Boolean = gmCanBeTraded
''' <summary>
''' If this item can be given to a Pokémon.
''' </summary>
Public Overrides ReadOnly Property CanBeHeld As Boolean = gmCanBeHeld
''' <summary>
''' If this item can be used from the bag.
''' </summary>
Public Overrides ReadOnly Property CanBeUsed As Boolean = gmCanBeUsed
''' <summary>
''' If this item can be used in battle.
''' </summary>
Public Overrides ReadOnly Property CanBeUsedInBattle As Boolean = gmCanBeUsedInBattle
''' <summary>
''' If this item can be tossed in the bag.
''' </summary>
Public Overrides ReadOnly Property CanBeTossed As Boolean = gmCanBeTossed
''' <summary>
''' If this item requires the player to select a Pokémon to use the item on in battle.
''' </summary>
Public Overrides ReadOnly Property BattleSelectPokemon As Boolean = gmBattleSelectPokemon
''' <summary>
''' If this item is a Healing item.
''' </summary>
Public Overrides ReadOnly Property IsHealingItem As Boolean = gmIsHealingItem
''' <summary>
''' The item gets used from the bag.
''' </summary>
Public Overrides Sub Use()
Logger.Debug("PLACEHOLDER FOR GAMEMODE ITEM USE")
End Sub
''' <summary>
''' A method that gets used when the item is applied to a Pokémon. Returns True if the action was successful.
''' </summary>
''' <param name="PokeIndex">The Index of the Pokémon in party.</param>
Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean
If PokeIndex < 0 Or PokeIndex > 5 Then
Throw New ArgumentOutOfRangeException("PokeIndex", PokeIndex, "The index for a Pokémon in a player's party can only be between 0 and 5.")
End If
Logger.Debug("PLACEHOLDER FOR GAMEMODE ITEM USE ON POKEMON")
Return False
End Function
End Class

View File

@ -0,0 +1,207 @@
Imports P3D.Items
''' <summary>
''' Provides an interface to load additional GameMode items.
''' </summary>
Public Class GameModeItemLoader
'The default relative path to load items from (Content folder).
Const PATH As String = "Data\Items\"
'List of loaded items.
Shared LoadedItems As New List(Of GameModeItem)
''' <summary>
''' Load the attack list for the loaded GameMode.
''' </summary>
''' <remarks>The game won't try to load the list if the default GameMode is selected.</remarks>
Public Shared Sub Load()
LoadedItems.Clear()
If GameModeManager.ActiveGameMode.IsDefaultGamemode = False Then
If System.IO.Directory.Exists(GameController.GamePath & "\" & GameModeManager.ActiveGameMode.ContentPath & "\" & PATH) = True Then
For Each file As String In System.IO.Directory.GetFiles(GameController.GamePath & "\" & GameModeManager.ActiveGameMode.ContentPath & PATH, "*.dat")
LoadItem(file)
Next
End If
End If
If LoadedItems.Count > 0 Then
Logger.Debug("Loaded " & LoadedItems.Count.ToString() & " GameMode item(s).")
End If
End Sub
''' <summary>
''' Loads a item from a file.
''' </summary>
''' <param name="file">The file to load the item from.</param>
Private Shared Sub LoadItem(ByVal file As String)
Dim item As New GameModeItem
Dim content() As String = System.IO.File.ReadAllLines(file)
Dim key As String = ""
Dim value As String = ""
Dim setID As Boolean = False 'Controls if the item sets its ID.
Dim setName As Boolean = False 'Controls if the item sets its ID.
Try
'Go through lines of the file and set the properties depending on the content.
'Lines starting with # are comments.
For Each l As String In content
If l.Contains("|") = True And l.StartsWith("#") = False Then
key = l.Remove(l.IndexOf("|"))
value = l.Remove(0, l.IndexOf("|") + 1)
Select Case key.ToLower()
Case "id"
item.gmID = "gm" & CInt(value).ToString
Dim itemX As Integer = CInt(value)
Dim itemY As Integer = 0
Dim sheetWidth As Integer = CInt(TextureManager.GetTexture(item.gmTextureSource).Width / 24)
While itemX > sheetWidth - 1
itemX -= sheetWidth
itemY += 1
End While
item.gmTextureRectangle = New Rectangle(CInt(itemX * 24), CInt(itemY * 24), 24, 24)
setID = True
Case "name"
item.gmName = value
setName = True
Case "pluralname"
item.gmPluralName = value
Case "description"
item.gmDescription = value
Case "type"
Select Case value
Case "standard", "0"
item.gmItemType = ItemTypes.Standard
Case "medicine", "1"
item.gmItemType = ItemTypes.Medicine
Case "plants", "2"
item.gmItemType = ItemTypes.Plants
Case "balls", "pokeballs", "pokéballs", "3"
item.gmItemType = ItemTypes.Pokéballs
Case "machines", "4"
item.gmItemType = ItemTypes.Machines
Case "keyitems", "5"
item.gmItemType = ItemTypes.KeyItems
Case "mail", "6"
item.gmItemType = ItemTypes.Mail
Case "battleitems", "7"
item.gmItemType = ItemTypes.BattleItems
End Select
Case "canbeused"
item.gmCanBeUsed = CBool(value)
Case "canbeusedinbattle"
item.gmCanBeUsedInBattle = CBool(value)
Case "useonpokemoninbattle"
item.gmBattleSelectPokemon = CBool(value)
Case "canbetossed"
item.gmCanBeTossed = CBool(value)
Case "canbeheld"
item.gmCanBeHeld = CBool(value)
Case "canbetraded"
item.gmCanBeTraded = CBool(value)
Case "price"
item.gmPrice = CInt(value)
Case "battlepointsprice"
item.gmBattlePointsPrice = CInt(value)
Case "catchmultiplier"
item.gmCatchMultiplier = CSng(value)
Case "maxstack"
item.gmMaxStack = CInt(value)
Case "flingdamage"
item.gmFlingDamage = CInt(value)
Case "ishealingitem"
item.gmIsHealingItem = CBool(value)
Case "healhpamount"
item.gmHealHPAmount = CInt(value)
Case "curestatuseffects"
Dim StatusEffectList As New List(Of Pokemon.StatusProblems)
Dim valueSplit As String() = value.Split(",")
For i = 0 To valueSplit.Count - 1
Select Case valueSplit(i).ToLower
Case "brn"
StatusEffectList.Add(Pokemon.StatusProblems.Burn)
Case "frz"
StatusEffectList.Add(Pokemon.StatusProblems.Freeze)
Case "prz"
StatusEffectList.Add(Pokemon.StatusProblems.Paralyzed)
Case "psn"
StatusEffectList.Add(Pokemon.StatusProblems.Poison)
Case "bpsn"
StatusEffectList.Add(Pokemon.StatusProblems.BadPoison)
Case "slp"
StatusEffectList.Add(Pokemon.StatusProblems.Sleep)
Case "fnt"
StatusEffectList.Add(Pokemon.StatusProblems.Fainted)
End Select
Next
If item.gmCureStatusEffects Is Nothing Then
item.gmCureStatusEffects = StatusEffectList
Else
item.gmCureStatusEffects.AddRange(StatusEffectList)
End If
Case "isevolutionitem"
item.gmIsEvolutionItem = CBool(value)
Case "evolutionpokemon"
Dim PokemonList As New List(Of Integer)
Dim valueSplit As String() = value.Split(",")
For i = 0 To valueSplit.Count - 1
If Pokemon.PokemonDataExists(CInt(valueSplit(i))) Then
PokemonList.Add(CInt(valueSplit(i)))
End If
Next
If item.gmEvolutionPokemon Is Nothing Then
item.gmEvolutionPokemon = PokemonList
Else
item.gmEvolutionPokemon.AddRange(PokemonList)
End If
End Select
End If
Next
Catch ex As Exception
'If an error occurs loading a item, log the error.
Logger.Log(Logger.LogTypes.ErrorMessage, "GameModeItemLoader.vb: Error loading GameMode Item from file """ & file & """: " & ex.Message & "; Last Key/Value pair successfully loaded: " & key & "|" & value)
End Try
If setID = True AndAlso setName = True Then
If item.gmIsMegaStone = True AndAlso item.gmMegaPokemonNumber <> Nothing AndAlso item.gmDescription = "" Then
Dim MegaPokemonName As String = Pokemon.GetPokemonByID(item.gmMegaPokemonNumber, item.AdditionalData).GetName
item.gmDescription = "One variety of the mysterious Mega Stones. Have " & MegaPokemonName & " hold it, and this stone will enable it to Mega Evolve during battle."
item.gmCanBeTossed = False
item.gmCanBeTraded = False
item.gmCanBeUsed = False
item.gmCanBeUsedInBattle = False
End If
LoadedItems.Add(item) 'Add the item.
Else
Logger.Log(Logger.LogTypes.ErrorMessage, "GameModeItemLoader.vb: User defined Items must set their ID through the ""ID"" property and their Name through the ""Name"" property, however the item loaded from """ & file & """ has no ID or Name set so it will be ignored.")
End If
End Sub
''' <summary>
''' Returns a custom item based on its ID.
''' </summary>
''' <param name="ID">The ID of the custom item.</param>
''' <returns>Returns a item or nothing.</returns>
Public Shared Function GetItemByID(ByVal ID As String) As GameModeItem
For Each i As GameModeItem In LoadedItems
If i.gmID = ID Then
Return i
End If
Next
Return Nothing
End Function
Public Shared Function GetItemByName(ByVal Name As String) As GameModeItem
For Each i As GameModeItem In LoadedItems
If i.gmName.ToLowerInvariant() = Name.ToLowerInvariant() Then
Return i
End If
Next
Return Nothing
End Function
End Class

View File

@ -9,6 +9,18 @@ Public MustInherit Class Item
Protected _textureRectangle As Rectangle Protected _textureRectangle As Rectangle
Private _texture As Texture2D Private _texture As Texture2D
'GameMode Items
Public gmID As String = ""
Public gmName As String = ""
Public gmDescription As String = ""
Public gmTextureRectangle As Rectangle
Public gmIsBerry As Boolean = False
Public gmIsMail As Boolean = False
Public gmIsMegaStone As Boolean = False
Public gmIsPlate As Boolean = False
Public Property IsGameModeItem As Boolean = False
Public ReadOnly Property TextureSource As String Public ReadOnly Property TextureSource As String
Get Get
Return _textureSource & "," & _textureRectangle.X & "," & _textureRectangle.Y & "," & _textureRectangle.Width & "," & _textureRectangle.Height Return _textureSource & "," & _textureRectangle.X & "," & _textureRectangle.Y & "," & _textureRectangle.Width & "," & _textureRectangle.Height
@ -16,10 +28,18 @@ Public MustInherit Class Item
End Property End Property
Public Function GetDescription() As String Public Function GetDescription() As String
If Localization.TokenExists("item_desc_" & GetAttribute().Id) = True Then If IsGameModeItem = True Then
Return Localization.GetString("item_desc_" & GetAttribute().Id) If Localization.TokenExists("item_desc_" & gmID) = True Then
Return Localization.GetString("item_desc_" & gmID)
Else
Return Me.gmDescription
End If
Else Else
Return Me.Description If Localization.TokenExists("item_desc_" & GetAttribute().Id) = True Then
Return Localization.GetString("item_desc_" & GetAttribute().Id)
Else
Return Me.Description
End If
End If End If
End Function End Function
@ -34,7 +54,11 @@ Public MustInherit Class Item
End Function End Function
Public Function OriginalName() As String Public Function OriginalName() As String
Return GetAttribute().Name If IsGameModeItem = True Then
Return gmName
Else
Return GetAttribute().Name
End If
End Function End Function
''' <summary> ''' <summary>
@ -42,10 +66,18 @@ Public MustInherit Class Item
''' </summary> ''' </summary>
Public Overridable ReadOnly Property Name As String Public Overridable ReadOnly Property Name As String
Get Get
If Localization.TokenExists("item_name_" & GetAttribute().Id) = True Then If IsGameModeItem = True Then
Return Localization.GetString("item_name_" & GetAttribute().Id) If Localization.TokenExists("item_name_" & gmID) = True Then
Return Localization.GetString("item_name_" & gmID)
Else
Return gmName
End If
Else Else
Return GetAttribute().Name If Localization.TokenExists("item_name_" & GetAttribute().Id) = True Then
Return Localization.GetString("item_name_" & GetAttribute().Id)
Else
Return GetAttribute().Name
End If
End If End If
End Get End Get
End Property End Property
@ -103,8 +135,14 @@ Public MustInherit Class Item
''' </summary> ''' </summary>
Public ReadOnly Property Texture As Texture2D Public ReadOnly Property Texture As Texture2D
Get Get
If _texture Is Nothing Then If IsGameModeItem = True Then
_texture = TextureManager.GetTexture(_textureSource, _textureRectangle, "") If _texture Is Nothing Then
_texture = TextureManager.GetTexture(_textureSource, gmTextureRectangle, "")
End If
Else
If _texture Is Nothing Then
_texture = TextureManager.GetTexture(_textureSource, _textureRectangle, "")
End If
End If End If
Return _texture Return _texture
@ -120,6 +158,7 @@ Public MustInherit Class Item
''' The additional data that is stored with this item. ''' The additional data that is stored with this item.
''' </summary> ''' </summary>
Public Property AdditionalData As String = "" Public Property AdditionalData As String = ""
''' <summary> ''' <summary>
''' The damage the Fling move does when this item is attached to a Pokémon. ''' The damage the Fling move does when this item is attached to a Pokémon.
@ -134,7 +173,7 @@ Public MustInherit Class Item
''' <summary> ''' <summary>
''' If this item can be given to a Pokémon. ''' If this item can be given to a Pokémon.
''' </summary> ''' </summary>
Public Overridable ReadOnly Property CanBeHold As Boolean = True Public Overridable ReadOnly Property CanBeHeld As Boolean = True
''' <summary> ''' <summary>
''' If this item can be used from the bag. ''' If this item can be used from the bag.
@ -166,7 +205,11 @@ Public MustInherit Class Item
''' </summary> ''' </summary>
Public Overridable ReadOnly Property IsBall As Boolean Public Overridable ReadOnly Property IsBall As Boolean
Get Get
Return [GetType]().IsSubclassOf(GetType(Items.Balls.BallItem)) If IsGameModeItem = True Then
Return Me.ItemType = ItemTypes.Pokéballs
Else
Return [GetType]().IsSubclassOf(GetType(Items.Balls.BallItem))
End If
End Get End Get
End Property End Property
@ -175,7 +218,11 @@ Public MustInherit Class Item
''' </summary> ''' </summary>
Public ReadOnly Property IsBerry As Boolean Public ReadOnly Property IsBerry As Boolean
Get Get
Return [GetType]().IsSubclassOf(GetType(Berry)) If IsGameModeItem = True Then
Return gmIsBerry
Else
Return [GetType]().IsSubclassOf(GetType(Berry))
End If
End Get End Get
End Property End Property
@ -184,7 +231,11 @@ Public MustInherit Class Item
''' </summary> ''' </summary>
Public ReadOnly Property IsMail As Boolean Public ReadOnly Property IsMail As Boolean
Get Get
Return [GetType]().IsSubclassOf(GetType(MailItem)) If IsGameModeItem = True Then
Return gmIsMail
Else
Return [GetType]().IsSubclassOf(GetType(MailItem))
End If
End Get End Get
End Property End Property
@ -193,7 +244,11 @@ Public MustInherit Class Item
''' </summary> ''' </summary>
Public ReadOnly Property IsMegaStone As Boolean Public ReadOnly Property IsMegaStone As Boolean
Get Get
Return [GetType]().IsSubclassOf(GetType(MegaStone)) If IsGameModeItem = True Then
Return gmIsMegaStone
Else
Return [GetType]().IsSubclassOf(GetType(MegaStone))
End If
End Get End Get
End Property End Property
@ -202,7 +257,11 @@ Public MustInherit Class Item
''' </summary> ''' </summary>
Public ReadOnly Property IsPlate As Boolean Public ReadOnly Property IsPlate As Boolean
Get Get
Return [GetType]().IsSubclassOf(GetType(PlateItem)) If IsGameModeItem = True Then
Return gmIsPlate
Else
Return [GetType]().IsSubclassOf(GetType(PlateItem))
End If
End Get End Get
End Property End Property
@ -252,7 +311,13 @@ Public MustInherit Class Item
''' Tries to remove a single item of this item type from the player's bag and returns a message which changes depending on if the item that got removed was the last one of its kind. ''' Tries to remove a single item of this item type from the player's bag and returns a message which changes depending on if the item that got removed was the last one of its kind.
''' </summary> ''' </summary>
Public Function RemoveItem() As String Public Function RemoveItem() As String
Core.Player.Inventory.RemoveItem(Me.ID, 1) Dim ItemID As String
If IsGameModeItem = True Then
ItemID = Me.gmID
Else
ItemID = Me.ID.ToString
End If
Core.Player.Inventory.RemoveItem(ItemID, 1)
Dim s As Screen = Core.CurrentScreen Dim s As Screen = Core.CurrentScreen
While Not s.PreScreen Is Nothing And s.Identification <> Screen.Identifications.InventoryScreen While Not s.PreScreen Is Nothing And s.Identification <> Screen.Identifications.InventoryScreen
s = s.PreScreen s = s.PreScreen
@ -261,9 +326,11 @@ Public MustInherit Class Item
If s.Identification = Screen.Identifications.InventoryScreen Then If s.Identification = Screen.Identifications.InventoryScreen Then
CType(s, NewInventoryScreen).LoadItems() CType(s, NewInventoryScreen).LoadItems()
End If End If
If Core.Player.Inventory.GetItemAmount(Me.ID) <= 0 Then
If Core.Player.Inventory.GetItemAmount(ItemID) <= 0 Then
Return "*There are no~" & Me.PluralName & " left." Return "*There are no~" & Me.PluralName & " left."
End If End If
Return "" Return ""
End Function End Function
@ -289,18 +356,25 @@ Public MustInherit Class Item
''' Returns an item instance based on the passed in ID. ''' Returns an item instance based on the passed in ID.
''' </summary> ''' </summary>
''' <param name="ID">The desired item's ID.</param> ''' <param name="ID">The desired item's ID.</param>
Public Shared Function GetItemByID(ByVal ID As Integer) As Item Public Shared Function GetItemByID(ByVal ID As String) As Item
If _itemBuffer Is Nothing Then If ID.Contains("gm") Then
LoadItemBuffer() Dim gmItem As GameModeItem = GameModeItemLoader.GetItemByID(ID)
End If If gmItem IsNot Nothing Then
Return gmItem
End If
Else
If _itemBuffer Is Nothing Then
LoadItemBuffer()
End If
Dim type = _itemBuffer.FirstOrDefault(Function(itemTypePair) Dim type = _itemBuffer.FirstOrDefault(Function(itemTypePair)
Return itemTypePair.Key.Id = ID Return itemTypePair.Key.Id = CInt(ID)
End Function).Value End Function).Value
If type IsNot Nothing Then If type IsNot Nothing Then
Return CType(Activator.CreateInstance(type), Item) Return CType(Activator.CreateInstance(type), Item)
End If End If
End If
Return Nothing Return Nothing
End Function End Function

View File

@ -9,7 +9,7 @@
Public Overrides ReadOnly Property CanBeUsedInBattle As Boolean = False Public Overrides ReadOnly Property CanBeUsedInBattle As Boolean = False
Public Overrides ReadOnly Property CanBeTraded As Boolean = False Public Overrides ReadOnly Property CanBeTraded As Boolean = False
Public Overrides ReadOnly Property CanBeTossed As Boolean = False Public Overrides ReadOnly Property CanBeTossed As Boolean = False
Public Overrides ReadOnly Property CanBeHold As Boolean = False Public Overrides ReadOnly Property CanBeHeld As Boolean = False
Public Overrides ReadOnly Property PokeDollarPrice As Integer = 9800 Public Overrides ReadOnly Property PokeDollarPrice As Integer = 9800
End Class End Class

View File

@ -9,7 +9,7 @@ Namespace Items.Mail
Public Overrides ReadOnly Property CanBeUsed As Boolean = False Public Overrides ReadOnly Property CanBeUsed As Boolean = False
Public Overrides ReadOnly Property CanBeUsedInBattle As Boolean = False Public Overrides ReadOnly Property CanBeUsedInBattle As Boolean = False
Public Overrides ReadOnly Property CanBeTraded As Boolean = False Public Overrides ReadOnly Property CanBeTraded As Boolean = False
Public Overrides ReadOnly Property CanBeHold As Boolean = False Public Overrides ReadOnly Property CanBeHeld As Boolean = False
Public Overrides ReadOnly Property CanBeTossed As Boolean = False Public Overrides ReadOnly Property CanBeTossed As Boolean = False
Public Sub New() Public Sub New()

View File

@ -32,7 +32,7 @@ Namespace Items.Medicine
Pokemon.Status = P3D.Pokemon.StatusProblems.None Pokemon.Status = P3D.Pokemon.StatusProblems.None
Pokemon.ChangeFriendShip(Pokemon.FriendShipCauses.HealPowder) Pokemon.ChangeFriendShip(Pokemon.FriendShipCauses.HealPowder)
Core.Player.Inventory.RemoveItem(Me.ID, 1) Core.Player.Inventory.RemoveItem(Me.ID.ToString, 1)
Screen.TextBox.reDelay = 0.0F Screen.TextBox.reDelay = 0.0F

View File

@ -35,7 +35,7 @@ Namespace Items.Medicine
Pokemon.RemoveVolatileStatus(Pokemon.VolatileStatus.Confusion) Pokemon.RemoveVolatileStatus(Pokemon.VolatileStatus.Confusion)
End If End If
Core.Player.Inventory.RemoveItem(Me.ID, 1) Core.Player.Inventory.RemoveItem(Me.ID.ToString, 1)
Screen.TextBox.reDelay = 0.0F Screen.TextBox.reDelay = 0.0F

View File

@ -8,7 +8,7 @@ Namespace Items.Medicine
Public Overrides ReadOnly Property Description As String = "This mysterious candy sparkles when unwrapped. It attracts all sorts of Pokémon." Public Overrides ReadOnly Property Description As String = "This mysterious candy sparkles when unwrapped. It attracts all sorts of Pokémon."
Public Overrides ReadOnly Property PokeDollarPrice As Integer = 4800 Public Overrides ReadOnly Property PokeDollarPrice As Integer = 4800
Public Overrides ReadOnly Property MaxStack As Integer = 1 Public Overrides ReadOnly Property MaxStack As Integer = 1
Public Overrides ReadOnly Property CanBeHold As Boolean = False Public Overrides ReadOnly Property CanBeHeld As Boolean = False
Public Overrides ReadOnly Property PluralName As String = "Shiny Candies" Public Overrides ReadOnly Property PluralName As String = "Shiny Candies"
Public Sub New() Public Sub New()

View File

@ -186,7 +186,7 @@ Namespace Items
ElseIf Pokemon.Status = P3D.Pokemon.StatusProblems.Freeze Then ElseIf Pokemon.Status = P3D.Pokemon.StatusProblems.Freeze Then
Pokemon.Status = P3D.Pokemon.StatusProblems.None Pokemon.Status = P3D.Pokemon.StatusProblems.None
Core.Player.Inventory.RemoveItem(Me.ID, 1) Core.Player.Inventory.RemoveItem(Me.ID.ToString, 1)
Screen.TextBox.reDelay = 0.0F Screen.TextBox.reDelay = 0.0F
@ -225,7 +225,7 @@ Namespace Items
ElseIf Pokemon.Status = P3D.Pokemon.StatusProblems.Paralyzed Then ElseIf Pokemon.Status = P3D.Pokemon.StatusProblems.Paralyzed Then
Pokemon.Status = P3D.Pokemon.StatusProblems.None Pokemon.Status = P3D.Pokemon.StatusProblems.None
Core.Player.Inventory.RemoveItem(Me.ID, 1) Core.Player.Inventory.RemoveItem(Me.ID.ToString, 1)
Screen.TextBox.reDelay = 0.0F Screen.TextBox.reDelay = 0.0F

View File

@ -15,7 +15,7 @@
Public CanTeachWhenGender As Boolean = False Public CanTeachWhenGender As Boolean = False
Public Overrides ReadOnly Property CanBeUsedInBattle As Boolean = False Public Overrides ReadOnly Property CanBeUsedInBattle As Boolean = False
Public Overrides ReadOnly Property CanBeHold As Boolean = False Public Overrides ReadOnly Property CanBeHeld As Boolean = False
Public Overrides ReadOnly Property CanBeTraded As Boolean = True Public Overrides ReadOnly Property CanBeTraded As Boolean = True
Public Overrides ReadOnly Property CanBeTossed As Boolean = True Public Overrides ReadOnly Property CanBeTossed As Boolean = True
Public Overrides ReadOnly Property SortValue As Integer Public Overrides ReadOnly Property SortValue As Integer
@ -106,12 +106,12 @@
If t = "" Then If t = "" Then
If p.Attacks.Count = 4 Then If p.Attacks.Count = 4 Then
SetScreen(New LearnAttackScreen(CurrentScreen, p, a, ID)) SetScreen(New LearnAttackScreen(CurrentScreen, p, a, ID.ToString))
Return True Return True
Else Else
If IsTM = True AndAlso CBool(GameModeManager.GetGameRuleValue("SingleUseTM", "0")) = True Then If IsTM = True AndAlso CBool(GameModeManager.GetGameRuleValue("SingleUseTM", "0")) = True Then
Core.Player.Inventory.RemoveItem(ID, 1) Core.Player.Inventory.RemoveItem(ID.ToString, 1)
End If End If
p.Attacks.Add(BattleSystem.Attack.GetAttackByID(a.ID)) p.Attacks.Add(BattleSystem.Attack.GetAttackByID(a.ID))

View File

@ -20,7 +20,7 @@ Public Class Pokemon
Next Next
'ShinyCharm 'ShinyCharm
If Core.Player.Inventory.GetItemAmount(242) > 0 Then If Core.Player.Inventory.GetItemAmount(242.ToString) > 0 Then
shinyRate = CInt(shinyRate * 0.25F) shinyRate = CInt(shinyRate * 0.25F)
End If End If
End If End If
@ -568,7 +568,7 @@ Public Class Pokemon
Public Machines As New List(Of Integer) Public Machines As New List(Of Integer)
Public PokedexEntry As PokedexEntry Public PokedexEntry As PokedexEntry
Public Cry As SoundEffect Public Cry As SoundEffect
Public WildItems As New Dictionary(Of Integer, Integer) Public WildItems As New Dictionary(Of Integer, String)
Public RegionalForms As String = "" Public RegionalForms As String = ""
Private _name As String Private _name As String
@ -896,7 +896,7 @@ Public Class Pokemon
Public Attacks As New List(Of BattleSystem.Attack) Public Attacks As New List(Of BattleSystem.Attack)
Public Ability As Ability Public Ability As Ability
Public CatchBall As Item = Item.GetItemByID(5) Public CatchBall As Item = Item.GetItemByID(5.ToString)
Private _experience As Integer Private _experience As Integer
Private _gender As Genders Private _gender As Genders
@ -1504,7 +1504,7 @@ Public Class Pokemon
End If End If
Case "item" Case "item"
Dim chance As Integer = CInt(Value.GetSplit(0)) Dim chance As Integer = CInt(Value.GetSplit(0))
Dim itemID As Integer = CInt(Value.GetSplit(1)) Dim itemID As String = Value.GetSplit(1)
If Not WildItems.ContainsKey(chance) Then If Not WildItems.ContainsKey(chance) Then
WildItems.Add(chance, itemID) WildItems.Add(chance, itemID)
@ -1585,7 +1585,7 @@ Public Class Pokemon
Me.CatchTrainerName = Core.Player.Name Me.CatchTrainerName = Core.Player.Name
Me.OT = Core.Player.OT Me.OT = Core.Player.OT
Me.CatchBall = Item.GetItemByID(5) Me.CatchBall = Item.GetItemByID(5.ToString)
For i = 0 To Tags.Count - 1 For i = 0 To Tags.Count - 1
Dim tagName As String = Tags.Keys(i) Dim tagName As String = Tags.Keys(i)
@ -1611,7 +1611,7 @@ Public Class Pokemon
Me.EggSteps = CInt(tagValue) Me.EggSteps = CInt(tagValue)
Case "item" Case "item"
If StringHelper.IsNumeric(tagValue) Then If StringHelper.IsNumeric(tagValue) Then
Me.Item = Item.GetItemByID(CInt(tagValue)) Me.Item = Item.GetItemByID(tagValue)
End If End If
Case "itemdata" Case "itemdata"
If Not Me.Item Is Nothing Then If Not Me.Item Is Nothing Then
@ -1656,7 +1656,7 @@ Public Class Pokemon
Case "catchtrainer" Case "catchtrainer"
Me.CatchTrainerName = tagValue Me.CatchTrainerName = tagValue
Case "catchball" Case "catchball"
Me.CatchBall = Item.GetItemByID(CInt(tagValue)) Me.CatchBall = Item.GetItemByID(tagValue)
Case "catchmethod" Case "catchmethod"
Me.CatchMethod = tagValue Me.CatchMethod = tagValue
Case "friendship" Case "friendship"
@ -1998,18 +1998,18 @@ Public Class Pokemon
If WildItems.Count > 0 Then If WildItems.Count > 0 Then
Dim has100 As Boolean = False Dim has100 As Boolean = False
Dim ChosenItemID As Integer = 0 Dim ChosenItemID As String = 0.ToString
For i = 0 To WildItems.Count - 1 For i = 0 To WildItems.Count - 1
If WildItems.Keys(i) = 100 Then If WildItems.Keys(i) = 100 Then
has100 = True has100 = True
ChosenItemID = WildItems.Values(i) ChosenItemID = WildItems.Values(cint(i))
Exit For Exit For
End If End If
Next Next
If has100 = True Then If has100 = True Then
Me.Item = Item.GetItemByID(ChosenItemID) Me.Item = Item.GetItemByID(ChosenItemID)
Else Else
Dim usedWildItems As Dictionary(Of Integer, Integer) = Me.WildItems Dim usedWildItems As Dictionary(Of Integer, String) = Me.WildItems
'Compound eyes ability: 'Compound eyes ability:
If Core.Player.Pokemons.Count > 0 Then If Core.Player.Pokemons.Count > 0 Then

View File

@ -23,11 +23,11 @@
End Enum End Enum
Public Shared Function GetScriptString(ByVal p As Pokemon, ByVal cPosition As Vector3, ByVal facing As Integer) As String Public Shared Function GetScriptString(ByVal p As Pokemon, ByVal cPosition As Vector3, ByVal facing As Integer) As String
If PickupItemID > -1 Then If PickupItemID > CInt(-1).ToString Then
If PickupIndividualValue = p.IndividualValue Then If PickupIndividualValue = p.IndividualValue Then
Return GenerateItemReaction(p, cPosition, facing) Return GenerateItemReaction(p, cPosition, facing)
Else Else
PickupItemID = -1 PickupItemID = CInt(-1).ToString
PickupIndividualValue = "" PickupIndividualValue = ""
End If End If
End If End If
@ -139,7 +139,7 @@
End If End If
s &= ":end" s &= ":end"
PickupItemID = -1 PickupItemID = CInt(-1).ToString
PickupIndividualValue = "" PickupIndividualValue = ""
Return s Return s
@ -873,7 +873,7 @@
End Class End Class
Shared PickupIndividualValue As String = "" 'This value holds the individual value of the Pokémon that picked up the item. Shared PickupIndividualValue As String = "" 'This value holds the individual value of the Pokémon that picked up the item.
Shared PickupItemID As Integer = -1 'This is the Item ID of the item that the Pokémon picked up. -1 means no item got picked up. Shared PickupItemID As String = CInt(-1).ToString 'This is the Item ID of the item that the Pokémon picked up. -1 means no item got picked up.
Public Shared Sub CheckForRandomPickup() Public Shared Sub CheckForRandomPickup()
'Checks if the first Pokémon in the party is following the player: 'Checks if the first Pokémon in the party is following the player:
@ -883,7 +883,7 @@
If Core.Player.GetWalkPokemon().Status = Pokemon.StatusProblems.None Then If Core.Player.GetWalkPokemon().Status = Pokemon.StatusProblems.None Then
'If the player switched the Pokémon, reset the item ID. 'If the player switched the Pokémon, reset the item ID.
If PickupIndividualValue <> Core.Player.GetWalkPokemon().IndividualValue Then If PickupIndividualValue <> Core.Player.GetWalkPokemon().IndividualValue Then
PickupItemID = -1 PickupItemID = CInt(-1).ToString
End If End If
'Check if an item should be generated: 'Check if an item should be generated:
@ -1044,8 +1044,8 @@
'If an item got generated, assign it to the global value to store it until the player interacts with the Pokémon. Also store the individual value. 'If an item got generated, assign it to the global value to store it until the player interacts with the Pokémon. Also store the individual value.
If newItemID > -1 Then If newItemID > -1 Then
Logger.Debug("Pokémon picks up item (" & Item.GetItemByID(newItemID).Name & ")") Logger.Debug("Pokémon picks up item (" & Item.GetItemByID(newItemID.ToString).Name & ")")
PickupItemID = newItemID PickupItemID = newItemID.ToString
PickupIndividualValue = Core.Player.GetWalkPokemon().IndividualValue PickupIndividualValue = Core.Player.GetWalkPokemon().IndividualValue
SoundManager.PlaySound("pickup") SoundManager.PlaySound("pickup")
End If End If
@ -1053,7 +1053,7 @@
End If End If
Else Else
'Reset the system if no Pokémon: 'Reset the system if no Pokémon:
PickupItemID = -1 PickupItemID = CInt(-1).ToString
PickupIndividualValue = "" PickupIndividualValue = ""
End If End If
End If End If

View File

@ -45,7 +45,7 @@ Public Class Shedinja
Public Shared Function CanEvolveInto(ByVal EvolvedPokemon As Pokemon, ByVal Trigger As EvolutionCondition.EvolutionTrigger) As Boolean Public Shared Function CanEvolveInto(ByVal EvolvedPokemon As Pokemon, ByVal Trigger As EvolutionCondition.EvolutionTrigger) As Boolean
If EvolvedPokemon.Number = 291 And Trigger = EvolutionCondition.EvolutionTrigger.LevelUp Then If EvolvedPokemon.Number = 291 And Trigger = EvolutionCondition.EvolutionTrigger.LevelUp Then
If Core.Player.Pokemons.Count < 6 Then If Core.Player.Pokemons.Count < 6 Then
If Core.Player.Inventory.GetItemAmount(5) > 0 Then If Core.Player.Inventory.GetItemAmount(5.ToString) > 0 Then
Return True Return True
End If End If
End If End If

View File

@ -53,12 +53,12 @@
SetStats(p, Stats(0), Stats(1), pokemon_class) SetStats(p, Stats(0), Stats(1), pokemon_class)
If ItemID <> "" Then If ItemID <> "" Then
p.Item = Item.GetItemByID(CInt(ItemID)) p.Item = Item.GetItemByID(ItemID)
End If End If
If p.Item Is Nothing Then If p.Item Is Nothing Then
Dim items() As Integer = {146, 2009, 119, 140, 73, 74} Dim items() As Integer = {146, 2009, 119, 140, 73, 74}
p.Item = Item.GetItemByID(items(Core.Random.Next(0, items.Length))) p.Item = Item.GetItemByID(items(Core.Random.Next(0, items.Length)).ToString)
End If End If
p.FullRestore() p.FullRestore()
@ -74,7 +74,7 @@
If Not p.Item Is Nothing Then If Not p.Item Is Nothing Then
Dim items() As Integer = {146, 2009, 119, 140, 73, 74} Dim items() As Integer = {146, 2009, 119, 140, 73, 74}
p.Item = Item.GetItemByID(items(Core.Random.Next(0, items.Length))) p.Item = Item.GetItemByID(items(Core.Random.Next(0, items.Length)).ToString)
End If End If
End If End If
End Sub End Sub

View File

@ -151,7 +151,7 @@
Public Overrides Sub ChangeTo() Public Overrides Sub ChangeTo()
MusicManager.PlayNoMusic() MusicManager.PlayNoMusic()
Core.Player.Inventory.RemoveItem(177) ' Remove all Park Balls (happens regardless of whether or not the player was currently in the Bug-Catching Contest). Core.Player.Inventory.RemoveItem(177.ToString) ' Remove all Park Balls (happens regardless of whether or not the player was currently in the Bug-Catching Contest).
PlayerStatistics.Track("Blackouts", 1) PlayerStatistics.Track("Blackouts", 1)
End Sub End Sub

View File

@ -62,13 +62,13 @@
Dim T As Texture2D = TextureManager.GetTexture("Items\ItemSheet") Dim T As Texture2D = TextureManager.GetTexture("Items\ItemSheet")
Me.Labels.Add(New Label(Localization.GetString("apricorn_screen_choose_apricorns"), New Vector2(100, 200), FontManager.MainFont)) Me.Labels.Add(New Label(Localization.GetString("apricorn_screen_choose_apricorns"), New Vector2(100, 200), FontManager.MainFont))
Dim RedApricorn As ButtonIcon = New ButtonIcon(AddressOf Me.GiveApricorn, "0 / " & Core.Player.Inventory.GetItemAmount(85), FontManager.MainFont, T, New Rectangle(240, 72, 24, 24), New Vector2(98, 240), New Size(48, 48), "85") Dim RedApricorn As ButtonIcon = New ButtonIcon(AddressOf Me.GiveApricorn, "0 / " & Core.Player.Inventory.GetItemAmount(85.ToString), FontManager.MainFont, T, New Rectangle(240, 72, 24, 24), New Vector2(98, 240), New Size(48, 48), "85")
Dim BlueApricorn As ButtonIcon = New ButtonIcon(AddressOf Me.GiveApricorn, "0 / " & Core.Player.Inventory.GetItemAmount(89), FontManager.MainFont, T, New Rectangle(336, 72, 24, 24), New Vector2(98, 304), New Size(48, 48), "89") Dim BlueApricorn As ButtonIcon = New ButtonIcon(AddressOf Me.GiveApricorn, "0 / " & Core.Player.Inventory.GetItemAmount(89.ToString), FontManager.MainFont, T, New Rectangle(336, 72, 24, 24), New Vector2(98, 304), New Size(48, 48), "89")
Dim YellowApricorn As ButtonIcon = New ButtonIcon(AddressOf Me.GiveApricorn, "0 / " & Core.Player.Inventory.GetItemAmount(92), FontManager.MainFont, T, New Rectangle(384, 72, 24, 24), New Vector2(98, 368), New Size(48, 48), "92") Dim YellowApricorn As ButtonIcon = New ButtonIcon(AddressOf Me.GiveApricorn, "0 / " & Core.Player.Inventory.GetItemAmount(92.ToString), FontManager.MainFont, T, New Rectangle(384, 72, 24, 24), New Vector2(98, 368), New Size(48, 48), "92")
Dim GreenApricorn As ButtonIcon = New ButtonIcon(AddressOf Me.GiveApricorn, "0 / " & Core.Player.Inventory.GetItemAmount(93), FontManager.MainFont, T, New Rectangle(408, 72, 24, 24), New Vector2(98, 432), New Size(48, 48), "93") Dim GreenApricorn As ButtonIcon = New ButtonIcon(AddressOf Me.GiveApricorn, "0 / " & Core.Player.Inventory.GetItemAmount(93.ToString), FontManager.MainFont, T, New Rectangle(408, 72, 24, 24), New Vector2(98, 432), New Size(48, 48), "93")
Dim WhiteApricorn As ButtonIcon = New ButtonIcon(AddressOf Me.GiveApricorn, "0 / " & Core.Player.Inventory.GetItemAmount(97), FontManager.MainFont, T, New Rectangle(0, 96, 24, 24), New Vector2(98, 496), New Size(48, 48), "97") Dim WhiteApricorn As ButtonIcon = New ButtonIcon(AddressOf Me.GiveApricorn, "0 / " & Core.Player.Inventory.GetItemAmount(97.ToString), FontManager.MainFont, T, New Rectangle(0, 96, 24, 24), New Vector2(98, 496), New Size(48, 48), "97")
Dim BlackApricorn As ButtonIcon = New ButtonIcon(AddressOf Me.GiveApricorn, "0 / " & Core.Player.Inventory.GetItemAmount(99), FontManager.MainFont, T, New Rectangle(48, 96, 24, 24), New Vector2(162, 240), New Size(48, 48), "99") Dim BlackApricorn As ButtonIcon = New ButtonIcon(AddressOf Me.GiveApricorn, "0 / " & Core.Player.Inventory.GetItemAmount(99.ToString), FontManager.MainFont, T, New Rectangle(48, 96, 24, 24), New Vector2(162, 240), New Size(48, 48), "99")
Dim PinkApricorn As ButtonIcon = New ButtonIcon(AddressOf Me.GiveApricorn, "0 / " & Core.Player.Inventory.GetItemAmount(101), FontManager.MainFont, T, New Rectangle(72, 96, 24, 24), New Vector2(162, 304), New Size(48, 48), "101") Dim PinkApricorn As ButtonIcon = New ButtonIcon(AddressOf Me.GiveApricorn, "0 / " & Core.Player.Inventory.GetItemAmount(101.ToString), FontManager.MainFont, T, New Rectangle(72, 96, 24, 24), New Vector2(162, 304), New Size(48, 48), "101")
Dim GiveButton As ButtonIcon = New ButtonIcon(AddressOf Me.Give, Localization.GetString("apricorn_screen_ok"), FontManager.MainFont, mainTexture, New Rectangle(48, 128, 16, 16), New Vector2(162, 496), New Size(48, 48), "OK") Dim GiveButton As ButtonIcon = New ButtonIcon(AddressOf Me.Give, Localization.GetString("apricorn_screen_ok"), FontManager.MainFont, mainTexture, New Rectangle(48, 128, 16, 16), New Vector2(162, 496), New Size(48, 48), "OK")
GiveButton.Enabled = False GiveButton.Enabled = False
@ -206,7 +206,7 @@
ItemID = 166 ItemID = 166
End Select End Select
Dim Item As Item = Item.GetItemByID(ItemID) Dim Item As Item = Item.GetItemByID(ItemID.ToString)
Core.SpriteBatch.Draw(Item.Texture, New Rectangle(100 + x * 64, 260 + y * 96, 48, 48), Color.White) Core.SpriteBatch.Draw(Item.Texture, New Rectangle(100 + x * 64, 260 + y * 96, 48, 48), Color.White)
Core.SpriteBatch.DrawString(FontManager.MainFont, "x" & Apricorns(i), New Vector2(110 + x * 64, 300 + y * 96), Color.Black) Core.SpriteBatch.DrawString(FontManager.MainFont, "x" & Apricorns(i), New Vector2(110 + x * 64, 300 + y * 96), Color.Black)
Next Next
@ -236,7 +236,7 @@
apricornID = 6 apricornID = 6
End Select End Select
If Core.Player.Inventory.GetItemAmount(CInt(b.AdditionalValue)) > CInt(Me.Apricorns(apricornID)) Then If Core.Player.Inventory.GetItemAmount(b.AdditionalValue) > CInt(Me.Apricorns(apricornID)) Then
Me.Apricorns(apricornID) = CStr(CInt(Me.Apricorns(apricornID)) + 1) Me.Apricorns(apricornID) = CStr(CInt(Me.Apricorns(apricornID)) + 1)
If HasApricorns() = True Then If HasApricorns() = True Then
@ -273,7 +273,7 @@
apricornID = 6 apricornID = 6
End Select End Select
b.Text = Me.Apricorns(apricornID) & " / " & Core.Player.Inventory.GetItemAmount(CInt(b.AdditionalValue)) b.Text = Me.Apricorns(apricornID) & " / " & Core.Player.Inventory.GetItemAmount(b.AdditionalValue)
End If End If
Next Next
End Sub End Sub
@ -287,13 +287,13 @@
Private Sub Give() Private Sub Give()
Me.State = States.Wait Me.State = States.Wait
Core.Player.Inventory.RemoveItem(85, CInt(Me.Apricorns(0))) Core.Player.Inventory.RemoveItem(85.ToString, CInt(Me.Apricorns(0)))
Core.Player.Inventory.RemoveItem(89, CInt(Me.Apricorns(1))) Core.Player.Inventory.RemoveItem(89.ToString, CInt(Me.Apricorns(1)))
Core.Player.Inventory.RemoveItem(92, CInt(Me.Apricorns(2))) Core.Player.Inventory.RemoveItem(92.ToString, CInt(Me.Apricorns(2)))
Core.Player.Inventory.RemoveItem(93, CInt(Me.Apricorns(3))) Core.Player.Inventory.RemoveItem(93.ToString, CInt(Me.Apricorns(3)))
Core.Player.Inventory.RemoveItem(97, CInt(Me.Apricorns(4))) Core.Player.Inventory.RemoveItem(97.ToString, CInt(Me.Apricorns(4)))
Core.Player.Inventory.RemoveItem(99, CInt(Me.Apricorns(5))) Core.Player.Inventory.RemoveItem(99.ToString, CInt(Me.Apricorns(5)))
Core.Player.Inventory.RemoveItem(101, CInt(Me.Apricorns(6))) Core.Player.Inventory.RemoveItem(101.ToString, CInt(Me.Apricorns(6)))
Dim d As Date = Date.Now Dim d As Date = Date.Now
@ -320,32 +320,32 @@
Dim text As String = Core.Player.Name & Localization.GetString("apricorn_screen_obtain") Dim text As String = Core.Player.Name & Localization.GetString("apricorn_screen_obtain")
If CInt(Apricorns(0)) > 0 Then If CInt(Apricorns(0)) > 0 Then
Core.Player.Inventory.AddItem(159, CInt(Apricorns(0))) Core.Player.Inventory.AddItem(159.ToString, CInt(Apricorns(0)))
text &= "~" & Apricorns(0) & " " & Item.GetItemByID(159).Name text &= "~" & Apricorns(0) & " " & Item.GetItemByID(159.ToString).Name
End If End If
If CInt(Apricorns(1)) > 0 Then If CInt(Apricorns(1)) > 0 Then
Core.Player.Inventory.AddItem(160, CInt(Apricorns(1))) Core.Player.Inventory.AddItem(160.ToString, CInt(Apricorns(1)))
text &= ",~" & Apricorns(1) & " " & Item.GetItemByID(160).Name text &= ",~" & Apricorns(1) & " " & Item.GetItemByID(160.ToString).Name
End If End If
If CInt(Apricorns(2)) > 0 Then If CInt(Apricorns(2)) > 0 Then
Core.Player.Inventory.AddItem(165, CInt(Apricorns(2))) Core.Player.Inventory.AddItem(165.ToString, CInt(Apricorns(2)))
text &= ",~" & Apricorns(2) & " " & Item.GetItemByID(165).Name text &= ",~" & Apricorns(2) & " " & Item.GetItemByID(165.ToString).Name
End If End If
If CInt(Apricorns(3)) > 0 Then If CInt(Apricorns(3)) > 0 Then
Core.Player.Inventory.AddItem(164, CInt(Apricorns(3))) Core.Player.Inventory.AddItem(164.ToString, CInt(Apricorns(3)))
text &= ",~" & Apricorns(3) & " " & Item.GetItemByID(164).Name text &= ",~" & Apricorns(3) & " " & Item.GetItemByID(164.ToString).Name
End If End If
If CInt(Apricorns(4)) > 0 Then If CInt(Apricorns(4)) > 0 Then
Core.Player.Inventory.AddItem(161, CInt(Apricorns(4))) Core.Player.Inventory.AddItem(161.ToString, CInt(Apricorns(4)))
text &= ",~" & Apricorns(4) & " " & Item.GetItemByID(161).Name text &= ",~" & Apricorns(4) & " " & Item.GetItemByID(161.ToString).Name
End If End If
If CInt(Apricorns(5)) > 0 Then If CInt(Apricorns(5)) > 0 Then
Core.Player.Inventory.AddItem(157, CInt(Apricorns(5))) Core.Player.Inventory.AddItem(157.ToString, CInt(Apricorns(5)))
text &= ",~" & Apricorns(5) & " " & Item.GetItemByID(157).Name text &= ",~" & Apricorns(5) & " " & Item.GetItemByID(157.ToString).Name
End If End If
If CInt(Apricorns(6)) > 0 Then If CInt(Apricorns(6)) > 0 Then
Core.Player.Inventory.AddItem(166, CInt(Apricorns(6))) Core.Player.Inventory.AddItem(166.ToString, CInt(Apricorns(6)))
text &= ",~" & Apricorns(6) & " " & Item.GetItemByID(166).Name text &= ",~" & Apricorns(6) & " " & Item.GetItemByID(166.ToString).Name
End If End If
text &= "." text &= "."

View File

@ -536,7 +536,13 @@ Public Class NewInventoryScreen
Dim CanvasTexture As Texture2D Dim CanvasTexture As Texture2D
CanvasTexture = TextureManager.GetTexture(TextureManager.GetTexture("GUI\Menus\Menu"), New Rectangle(0, 0, 48, 48)) CanvasTexture = TextureManager.GetTexture(TextureManager.GetTexture("GUI\Menus\Menu"), New Rectangle(0, 0, 48, 48))
Dim trashText As String = _tossValue & "/" & Core.Player.Inventory.GetItemAmount(cItem.ID) Dim ItemID As String
If cItem.IsGameModeItem = True Then
ItemID = cItem.gmID
Else
ItemID = cItem.ID.ToString
End If
Dim trashText As String = _tossValue & "/" & Core.Player.Inventory.GetItemAmount(ItemID)
Dim offsetX As Integer = 100 Dim offsetX As Integer = 100
Dim offsetY As Integer = Core.windowSize.Height - 390 Dim offsetY As Integer = Core.windowSize.Height - 390
@ -694,12 +700,18 @@ Public Class NewInventoryScreen
_tossValue -= 1 _tossValue -= 1
End If End If
_tossValue = CInt(MathHelper.Clamp(_tossValue, 1, Core.Player.Inventory.GetItemAmount(cItem.ID))) Dim ItemID As String
If cItem.IsGameModeItem = True Then
ItemID = cItem.gmID
Else
ItemID = cItem.ID.ToString
End If
_tossValue = CInt(MathHelper.Clamp(_tossValue, 1, Core.Player.Inventory.GetItemAmount(ItemID)))
If Not TextBox.Showing Then If Not TextBox.Showing Then
If Controls.Accept Then If Controls.Accept Then
SoundManager.PlaySound("select") SoundManager.PlaySound("select")
Core.Player.Inventory.RemoveItem(cItem.ID, _tossValue) Core.Player.Inventory.RemoveItem(ItemID, _tossValue)
LoadItems() LoadItems()
_tossingItems = False _tossingItems = False
ElseIf Controls.Dismiss Then ElseIf Controls.Dismiss Then
@ -949,15 +961,28 @@ Public Class NewInventoryScreen
Dim Pokemon As Pokemon = Core.Player.Pokemons(PokeIndex) Dim Pokemon As Pokemon = Core.Player.Pokemons(PokeIndex)
If Pokemon.IsEgg() = False Then If Pokemon.IsEgg() = False Then
Core.Player.Inventory.RemoveItem(cItem.ID, 1) Dim ItemID As String
If cItem.IsGameModeItem = True Then
ItemID = cItem.gmID
Else
ItemID = cItem.ID.ToString
End If
Core.Player.Inventory.RemoveItem(ItemID, 1)
Dim reItem As Item = Nothing Dim reItem As Item = Nothing
If Not Pokemon.Item Is Nothing Then If Not Pokemon.Item Is Nothing Then
Dim ReItemID As String
If cItem.IsGameModeItem = True Then
ReItemID = cItem.gmID
Else
ReItemID = cItem.ID.ToString
End If
reItem = Pokemon.Item reItem = Pokemon.Item
Core.Player.Inventory.AddItem(reItem.ID, 1) Core.Player.Inventory.AddItem(ReItemID, 1)
End If End If
Pokemon.Item = Item.GetItemByID(cItem.ID) Pokemon.Item = Item.GetItemByID(ItemID)
If reItem Is Nothing Then If reItem Is Nothing Then
'JSON Stuff 'JSON Stuff
@ -1101,7 +1126,7 @@ Public Class NewInventoryScreen
_infoItemOptions.Add("Use") _infoItemOptions.Add("Use")
_infoItemOptionsNormal.Add(INFO_ITEM_OPTION_USE) _infoItemOptionsNormal.Add(INFO_ITEM_OPTION_USE)
End If End If
If cItem.CanBeHold Then If cItem.CanBeHeld Then
'JSON Stuff 'JSON Stuff
' _infoItemOptions.Add(_translation.INFO_ITEM_OPTION_GIVE) ' _infoItemOptions.Add(_translation.INFO_ITEM_OPTION_GIVE)
_infoItemOptions.Add("Give") _infoItemOptions.Add("Give")

View File

@ -22,6 +22,7 @@
Next Next
BattleSystem.GameModeAttackLoader.Load() BattleSystem.GameModeAttackLoader.Load()
GameModeItemLoader.Load()
SmashRock.Load() SmashRock.Load()
Badge.Load() Badge.Load()

View File

@ -49,7 +49,7 @@
End If End If
If Screen.Level.IsBugCatchingContest = True Then If Screen.Level.IsBugCatchingContest = True Then
_menuOptions.AddRange({Screen.Level.BugCatchingContestData.GetSplit(2) & " x" & Core.Player.Inventory.GetItemAmount(177), _menuOptions.AddRange({Screen.Level.BugCatchingContestData.GetSplit(2) & " x" & Core.Player.Inventory.GetItemAmount(177.ToString),
"Bag", "Bag",
"|||" & Core.Player.Name, 'Trainer card "|||" & Core.Player.Name, 'Trainer card
"End Contest"}) "End Contest"})
@ -307,7 +307,7 @@
Core.SetScreen(New NewOptionScreen(Me)) Core.SetScreen(New NewOptionScreen(Me))
Case "Exit" Case "Exit"
Core.SetScreen(PreScreen) Core.SetScreen(PreScreen)
Case Screen.Level.BugCatchingContestData.GetSplit(2) & " x" & Core.Player.Inventory.GetItemAmount(177) Case Screen.Level.BugCatchingContestData.GetSplit(2) & " x" & Core.Player.Inventory.GetItemAmount(177.ToString)
Me.ShowBalls() Me.ShowBalls()
Case "End Contest" Case "End Contest"
Me.EndContest() Me.EndContest()

View File

@ -66,7 +66,7 @@
Canvas.DrawImageBorder(TextureManager.GetTexture("GUI\Menus\Menu", New Rectangle(x, y, 48, 48), ""), 1, New Rectangle(CInt(P.X), CInt(P.Y), 288, 32)) Canvas.DrawImageBorder(TextureManager.GetTexture("GUI\Menus\Menu", New Rectangle(x, y, 48, 48), ""), 1, New Rectangle(CInt(P.X), CInt(P.Y), 288, 32))
Core.SpriteBatch.DrawString(FontManager.MiniFont, "Write new mail.", New Vector2(CInt(P.X) + 13, CInt(P.Y) + 14), Color.Black) Core.SpriteBatch.DrawString(FontManager.MiniFont, "Write new mail.", New Vector2(CInt(P.X) + 13, CInt(P.Y) + 14), Color.Black)
Else Else
Dim item As Item = Item.GetItemByID(mail.MailID) Dim item As Item = Item.GetItemByID(mail.MailID.ToString)
Dim x As Integer = 0 Dim x As Integer = 0
Dim y As Integer = 0 Dim y As Integer = 0
@ -101,7 +101,7 @@
Private Sub DrawCurrentMail() Private Sub DrawCurrentMail()
If index = 0 Then If index = 0 Then
Dim mail As Items.MailItem.MailData = TempNewMail Dim mail As Items.MailItem.MailData = TempNewMail
Dim item As Item = Item.GetItemByID(mail.MailID) Dim item As Item = Item.GetItemByID(mail.MailID.ToString)
Core.SpriteBatch.Draw(item.Texture, New Rectangle(420, 84, 48, 48), Color.White) Core.SpriteBatch.Draw(item.Texture, New Rectangle(420, 84, 48, 48), Color.White)
@ -154,7 +154,7 @@
Core.SpriteBatch.DrawString(FontManager.MiniFont, "Cancel", New Vector2(696, yPlus + 334), Color.Black) Core.SpriteBatch.DrawString(FontManager.MiniFont, "Cancel", New Vector2(696, yPlus + 334), Color.Black)
Else Else
Dim mail As Items.MailItem.MailData = Core.Player.Mails(index - 1) Dim mail As Items.MailItem.MailData = Core.Player.Mails(index - 1)
Dim item As Item = Item.GetItemByID(mail.MailID) Dim item As Item = Item.GetItemByID(mail.MailID.ToString)
Core.SpriteBatch.Draw(item.Texture, New Rectangle(420, 84, 48, 48), Color.White) Core.SpriteBatch.Draw(item.Texture, New Rectangle(420, 84, 48, 48), Color.White)
@ -281,7 +281,7 @@
If TempNewMail.MailHeader = "" Or TempNewMail.MailText = "" Or TempNewMail.MailSignature = "" Then If TempNewMail.MailHeader = "" Or TempNewMail.MailText = "" Or TempNewMail.MailSignature = "" Then
message = "Please fill in the Header, the Message and the Signature." message = "Please fill in the Header, the Message and the Signature."
Else Else
Dim selScreen = New PartyScreen(Me, Item.GetItemByID(TempNewMail.MailID), AddressOf Me.ChosenPokemon, "Give mail to:", True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} Dim selScreen = New PartyScreen(Me, Item.GetItemByID(TempNewMail.MailID.ToString), AddressOf Me.ChosenPokemon, "Give mail to:", True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True}
AddHandler selScreen.SelectedObject, AddressOf ChosenPokemonHandler AddHandler selScreen.SelectedObject, AddressOf ChosenPokemonHandler
Core.SetScreen(selScreen) Core.SetScreen(selScreen)
@ -322,13 +322,18 @@
Private Sub ChosenPokemon(ByVal PokeIndex As Integer) Private Sub ChosenPokemon(ByVal PokeIndex As Integer)
If Not Core.Player.Pokemons(PokeIndex).Item Is Nothing Then If Not Core.Player.Pokemons(PokeIndex).Item Is Nothing Then
Core.Player.Inventory.AddItem(Core.Player.Pokemons(PokeIndex).Item.ID, 1) If Core.Player.Pokemons(PokeIndex).Item.IsGameModeItem Then
Core.Player.Inventory.AddItem(Core.Player.Pokemons(PokeIndex).Item.gmID, 1)
Else
Core.Player.Inventory.AddItem(Core.Player.Pokemons(PokeIndex).Item.ID.ToString, 1)
End If
End If End If
Core.Player.Pokemons(PokeIndex).Item = Item.GetItemByID(TempNewMail.MailID) Core.Player.Pokemons(PokeIndex).Item = Item.GetItemByID(TempNewMail.MailID.ToString)
Core.Player.Pokemons(PokeIndex).Item.AdditionalData = Items.MailItem.GetStringFromMail(TempNewMail) Core.Player.Pokemons(PokeIndex).Item.AdditionalData = Items.MailItem.GetStringFromMail(TempNewMail)
Core.Player.Inventory.RemoveItem(TempNewMail.MailID, 1) Core.Player.Inventory.RemoveItem(TempNewMail.MailID.ToString, 1)
Me.index = -1 Me.index = -1
Me.message = "Attached the Mail to " & Core.Player.Pokemons(PokeIndex).GetDisplayName() & "." Me.message = "Attached the Mail to " & Core.Player.Pokemons(PokeIndex).GetDisplayName() & "."

View File

@ -74,7 +74,7 @@
p.Generate(1, True, OptionalAdditionalData) p.Generate(1, True, OptionalAdditionalData)
p.EggSteps = 1 p.EggSteps = 1
p.SetCatchInfos(Item.GetItemByID(5), "obtained at") p.SetCatchInfos(Item.GetItemByID(5.ToString), "obtained at")
p.CatchBall = Item.GetItemByID(GetEggPokeballID({parent1, parent2}.ToList())) p.CatchBall = Item.GetItemByID(GetEggPokeballID({parent1, parent2}.ToList()))
p.ReloadDefinitions() p.ReloadDefinitions()
@ -473,7 +473,7 @@
End If End If
If chance > 0 And multiplier = True Then If chance > 0 And multiplier = True Then
If Core.Player.Inventory.GetItemAmount(241) > 0 Then If Core.Player.Inventory.GetItemAmount(241.ToString) > 0 Then
chance = CInt(chance * 1.3F) chance = CInt(chance * 1.3F)
End If End If
End If End If
@ -526,42 +526,56 @@
Return 0 Return 0
End Function End Function
Private Shared Function GetEggPokeballID(ByVal Pokemon As List(Of Pokemon)) As Integer Private Shared Function GetEggPokeballID(ByVal Pokemon As List(Of Pokemon)) As String
Dim ballID As Integer = 5 Dim ballID As String = 5.ToString
If Pokemon.Count = 2 Then If Pokemon.Count = 2 Then
Dim p1 As Pokemon = Pokemon(0) Dim p1 As Pokemon = Pokemon(0)
Dim p2 As Pokemon = Pokemon(1) Dim p2 As Pokemon = Pokemon(1)
Dim CatchBallID1 As String
Dim CatchBallID2 As String
If p1.CatchBall.IsGameModeItem Then
CatchBallID1 = p1.CatchBall.gmID
Else
CatchBallID1 = p1.CatchBall.ID.ToString
End If
If p2.CatchBall.IsGameModeItem Then
CatchBallID2 = p2.CatchBall.gmID
Else
CatchBallID2 = p2.CatchBall.ID.ToString
End If
' First Pokémon is Ditto: ' First Pokémon is Ditto:
If p1.EggGroup1 = P3D.Pokemon.EggGroups.Ditto Or p1.EggGroup2 = P3D.Pokemon.EggGroups.Ditto Then If p1.EggGroup1 = P3D.Pokemon.EggGroups.Ditto Or p1.EggGroup2 = P3D.Pokemon.EggGroups.Ditto Then
' If the first Pokémon is Ditto, then the other Pokémon must be female to inherit the Poké Ball. ' If the first Pokémon is Ditto, then the other Pokémon must be female to inherit the Poké Ball.
If p2.Gender = P3D.Pokemon.Genders.Female Then If p2.Gender = P3D.Pokemon.Genders.Female Then
ballID = p2.CatchBall.ID ballID = CatchBallID2
End If End If
End If End If
'Second Pokémon is Ditto. 'Second Pokémon is Ditto.
If p2.EggGroup1 = P3D.Pokemon.EggGroups.Ditto Or p2.EggGroup2 = P3D.Pokemon.EggGroups.Ditto Then If p2.EggGroup1 = P3D.Pokemon.EggGroups.Ditto Or p2.EggGroup2 = P3D.Pokemon.EggGroups.Ditto Then
'If the second Pokémon is Ditto, then the other Pokémon must be female to inherit the Poké Ball. 'If the second Pokémon is Ditto, then the other Pokémon must be female to inherit the Poké Ball.
If p1.Gender = P3D.Pokemon.Genders.Female Then If p1.Gender = P3D.Pokemon.Genders.Female Then
ballID = p1.CatchBall.ID ballID = CatchBallID1
End If End If
End If End If
' No Pokémon is Ditto: ' No Pokémon is Ditto:
If p1.EggGroup1 <> P3D.Pokemon.EggGroups.Ditto And p1.EggGroup2 <> P3D.Pokemon.EggGroups.Ditto And p2.EggGroup1 <> P3D.Pokemon.EggGroups.Ditto And p2.EggGroup2 <> P3D.Pokemon.EggGroups.Ditto Then If p1.EggGroup1 <> P3D.Pokemon.EggGroups.Ditto And p1.EggGroup2 <> P3D.Pokemon.EggGroups.Ditto And p2.EggGroup1 <> P3D.Pokemon.EggGroups.Ditto And p2.EggGroup2 <> P3D.Pokemon.EggGroups.Ditto Then
' First Pokémon is female: ' First Pokémon is female:
If p1.Gender = P3D.Pokemon.Genders.Female Then If p1.Gender = P3D.Pokemon.Genders.Female Then
ballID = p1.CatchBall.ID ballID = CatchBallID1
End If End If
' Second Pokémon is female: ' Second Pokémon is female:
If p2.Gender = P3D.Pokemon.Genders.Female Then If p2.Gender = P3D.Pokemon.Genders.Female Then
ballID = p2.CatchBall.ID ballID = CatchBallID2
End If End If
End If End If
' Check for: Master Ball, Cherish Ball: Set to Poké Ball ' Check for: Master Ball, Cherish Ball: Set to Poké Ball
If ballID = 1 Or ballID = 45 Then If ballID = 1.ToString Or ballID = 45.ToString Then
ballID = 5 ballID = 5.ToString
End If End If
End If End If

View File

@ -304,7 +304,7 @@
' Nincada's evolution to Shedinja if a Poké Ball is in the player's Bag and free space is available in the player's party: ' Nincada's evolution to Shedinja if a Poké Ball is in the player's Bag and free space is available in the player's party:
If Shedinja.CanEvolveInto(Me.evolvedPokemon, Me.EvolutionTrigger) = True Then If Shedinja.CanEvolveInto(Me.evolvedPokemon, Me.EvolutionTrigger) = True Then
Core.Player.Pokemons.Add(Shedinja.GenerateNew(evolvedPokemon)) Core.Player.Pokemons.Add(Shedinja.GenerateNew(evolvedPokemon))
Core.Player.Inventory.RemoveItem(5, 1) Core.Player.Inventory.RemoveItem(5.ToString, 1)
End If End If
Core.Player.Pokemons(PokeList(0)) = evolvedPokemon Core.Player.Pokemons(PokeList(0)) = evolvedPokemon

View File

@ -13,15 +13,15 @@
Dim AttackPos As Single = 320.0F Dim AttackPos As Single = 320.0F
Dim canForget As Boolean = True Dim canForget As Boolean = True
Dim MachineItemID As Integer = -1 Dim MachineItemID As String = CInt(-1).ToString
Dim currentCharIndex As Integer = 0 Dim currentCharIndex As Integer = 0
Public Sub New(ByVal currentScreen As Screen, ByVal Pokemon As Pokemon, ByVal newAttack As BattleSystem.Attack) Public Sub New(ByVal currentScreen As Screen, ByVal Pokemon As Pokemon, ByVal newAttack As BattleSystem.Attack)
Me.New(currentScreen, Pokemon, newAttack, -1) Me.New(currentScreen, Pokemon, newAttack, CInt(-1).ToString)
End Sub End Sub
Public Sub New(ByVal currentScreen As Screen, ByVal Pokemon As Pokemon, ByVal newAttack As BattleSystem.Attack, ByVal MachineItemID As Integer) Public Sub New(ByVal currentScreen As Screen, ByVal Pokemon As Pokemon, ByVal newAttack As BattleSystem.Attack, ByVal MachineItemID As String)
Me.Identification = Identifications.LearnAttackScreen Me.Identification = Identifications.LearnAttackScreen
Me.PreScreen = currentScreen Me.PreScreen = currentScreen
@ -261,7 +261,7 @@
Pokemon.Attacks.RemoveAt(AttackIndex) Pokemon.Attacks.RemoveAt(AttackIndex)
Pokemon.Attacks.Insert(AttackIndex, newAttack) Pokemon.Attacks.Insert(AttackIndex, newAttack)
If Me.MachineItemID > -1 Then If Me.MachineItemID <> CInt(-1).ToString Then
PlayerStatistics.Track("TMs/HMs used", 1) PlayerStatistics.Track("TMs/HMs used", 1)
If CBool(GameModeManager.GetGameRuleValue("SingleUseTM", "0")) = True Then If CBool(GameModeManager.GetGameRuleValue("SingleUseTM", "0")) = True Then
Dim TechMachine As Item = Item.GetItemByID(Me.MachineItemID) Dim TechMachine As Item = Item.GetItemByID(Me.MachineItemID)

View File

@ -763,9 +763,14 @@ Public Class PartyScreen
p.Item = Nothing p.Item = Nothing
Else Else
ShowMessage("Taken " & p.Item.Name & " from " & p.GetDisplayName() & ".") ShowMessage("Taken " & p.Item.Name & " from " & p.GetDisplayName() & ".")
Dim ItemID As String
Core.Player.Inventory.AddItem(p.Item.ID, 1) If p.Item.IsGameModeItem Then
ItemID = p.Item.gmID
Else
ItemID = p.Item.ID.ToString
End If
Core.Player.Inventory.AddItem(ItemID, 1)
p.Item = Nothing p.Item = Nothing
End If End If
Case "Back" Case "Back"
@ -777,13 +782,13 @@ Public Class PartyScreen
''' A handler method to convert the incoming object array. ''' A handler method to convert the incoming object array.
''' </summary> ''' </summary>
Private Sub GiveItemHandler(ByVal params As Object()) Private Sub GiveItemHandler(ByVal params As Object())
GiveItem(CInt(params(0))) GiveItem(params(0).ToString)
End Sub End Sub
Private Sub GiveItem(ByVal itemID As Integer) Private Sub GiveItem(ByVal itemID As String)
Dim i As Item = Item.GetItemByID(itemID) Dim i As Item = Item.GetItemByID(itemID)
If i.CanBeHold Then If i.CanBeHeld Then
Dim p As Pokemon = PokemonList(_index) Dim p As Pokemon = PokemonList(_index)
Core.Player.Inventory.RemoveItem(itemID, 1) Core.Player.Inventory.RemoveItem(itemID, 1)
@ -797,7 +802,13 @@ Public Class PartyScreen
message = "Gave " & i.Name & " to " & p.GetDisplayName() & " and took the Mail to the PC." message = "Gave " & i.Name & " to " & p.GetDisplayName() & " and took the Mail to the PC."
Else Else
Core.Player.Inventory.AddItem(reItem.ID, 1) Dim ReItemID As String
If reItem.IsGameModeItem Then
ReItemID = reItem.gmID
Else
ReItemID = reItem.ID.ToString
End If
Core.Player.Inventory.AddItem(ReItemID, 1)
message = "Switched " & p.GetDisplayName() & "'s " & i.Name & " with a " & reItem.Name & "." message = "Switched " & p.GetDisplayName() & "'s " & i.Name & " with a " & reItem.Name & "."
End If End If

View File

@ -70,7 +70,7 @@
Dim value As Integer = Me.Statistics.Values(i) Dim value As Integer = Me.Statistics.Values(i)
If ItemID <> "" Then If ItemID <> "" Then
Dim Item As Item = Item.GetItemByID(CInt(ItemID)) Dim Item As Item = Item.GetItemByID(ItemID)
Core.SpriteBatch.Draw(Item.Texture, New Rectangle(CInt(140), CInt(152 + i * 50 + Scroll), 48, 48), Color.White) Core.SpriteBatch.Draw(Item.Texture, New Rectangle(CInt(140), CInt(152 + i * 50 + Scroll), 48, 48), Color.White)
End If End If

View File

@ -88,7 +88,7 @@ Public Class TradeScreen
''' <param name="ItemID">The ID of the Item.</param> ''' <param name="ItemID">The ID of the Item.</param>
''' <param name="Price">The Price of the Item. Leave -1 for automatic Price.</param> ''' <param name="Price">The Price of the Item. Leave -1 for automatic Price.</param>
''' <param name="Amount">The Amount of the Item available in the store. Leave -1 for infinite.</param> ''' <param name="Amount">The Amount of the Item available in the store. Leave -1 for infinite.</param>
Public Sub New(ByVal ItemID As Integer, ByVal Amount As Integer, ByVal Price As Integer, ByVal Currency As Currencies) Public Sub New(ByVal ItemID As String, ByVal Amount As Integer, ByVal Price As Integer, ByVal Currency As Currencies)
Me.ItemID = ItemID Me.ItemID = ItemID
Me.Amount = Amount Me.Amount = Amount
@ -105,7 +105,7 @@ Public Class TradeScreen
End If End If
End Sub End Sub
Public ItemID As Integer Public ItemID As String
Public Price As Integer Public Price As Integer
Public Amount As Integer Public Amount As Integer
@ -148,7 +148,7 @@ Public Class TradeScreen
Dim itemData = lItem.Split(CChar("|")) Dim itemData = lItem.Split(CChar("|"))
Me.TradeItems.Add(New TradeItem(ScriptConversion.ToInteger(itemData(0)), ScriptConversion.ToInteger(itemData(1)), ScriptConversion.ToInteger(itemData(2)), Me.Currency)) Me.TradeItems.Add(New TradeItem(itemData(0), ScriptConversion.ToInteger(itemData(1)), ScriptConversion.ToInteger(itemData(2)), Me.Currency))
Next Next
Me.texture = TextureManager.GetTexture("GUI\Menus\General") Me.texture = TextureManager.GetTexture("GUI\Menus\General")
@ -637,8 +637,8 @@ Public Class TradeScreen
Core.Player.Inventory.AddItem(tradeItem.ItemID, Me.BuyItemsAmount) Core.Player.Inventory.AddItem(tradeItem.ItemID, Me.BuyItemsAmount)
' Add a Premier Ball (ID=3) if the player bought 10 or more Poké Balls (ID=5): ' Add a Premier Ball (ID=3) if the player bought 10 or more Poké Balls (ID=5):
If tradeItem.ItemID = 5 And Me.BuyItemsAmount >= 10 Then If tradeItem.ItemID = 5.ToString And Me.BuyItemsAmount >= 10 Then
Core.Player.Inventory.AddItem(3, 1) Core.Player.Inventory.AddItem(3.ToString, 1)
End If End If
' Remove trade item from seller's side if the rest amount is smaller than 0: ' Remove trade item from seller's side if the rest amount is smaller than 0:
@ -671,7 +671,13 @@ Public Class TradeScreen
Private Function GetMaxBuyItemAmount(ByVal tradeItem As TradeItem) As Integer Private Function GetMaxBuyItemAmount(ByVal tradeItem As TradeItem) As Integer
Dim item As Item = tradeItem.GetItem() Dim item As Item = tradeItem.GetItem()
Dim maxAmount As Integer = item.MaxStack - Core.Player.Inventory.GetItemAmount(item.ID) Dim ItemID As String
If item.IsGameModeItem Then
ItemID = item.gmID
Else
ItemID = item.ID.ToString
End If
Dim maxAmount As Integer = item.MaxStack - Core.Player.Inventory.GetItemAmount(ItemID)
If maxAmount > tradeItem.Amount And tradeItem.Amount > -1 Then If maxAmount > tradeItem.Amount And tradeItem.Amount > -1 Then
maxAmount = tradeItem.Amount maxAmount = tradeItem.Amount
@ -886,9 +892,15 @@ Public Class TradeScreen
Me.SellItemsList.Clear() Me.SellItemsList.Clear()
For Each c In Core.Player.Inventory For Each c In Core.Player.Inventory
Dim i = Item.GetItemByID(c.ItemID) Dim i = Item.GetItemByID(c.ItemID)
Dim ItemID As String
If i.IsGameModeItem Then
ItemID = i.gmID
Else
ItemID = i.ID.ToString
End If
If i.CanBeTraded = True Then If i.CanBeTraded = True Then
If i.ItemType = Me.CurrentCategory Then If i.ItemType = Me.CurrentCategory Then
SellItemsList.Add(New TradeItem(i.ID, c.Amount, -1, Me.Currency)) SellItemsList.Add(New TradeItem(ItemID, c.Amount, -1, Me.Currency))
End If End If
End If End If
Next Next

View File

@ -266,11 +266,11 @@
oppPokemon.OT = Script.SaveNPCTrade(6) oppPokemon.OT = Script.SaveNPCTrade(6)
oppPokemon.CatchTrainerName = Script.SaveNPCTrade(7) oppPokemon.CatchTrainerName = Script.SaveNPCTrade(7)
oppPokemon.CatchBall = Item.GetItemByID(ScriptConversion.ToInteger(Script.SaveNPCTrade(8))) oppPokemon.CatchBall = Item.GetItemByID(Script.SaveNPCTrade(8))
Dim itemID As String = Script.SaveNPCTrade(9) Dim itemID As String = Script.SaveNPCTrade(9)
If StringHelper.IsNumeric(itemID) Then If StringHelper.IsNumeric(itemID) Then
oppPokemon.Item = Item.GetItemByID(ScriptConversion.ToInteger(itemID)) oppPokemon.Item = Item.GetItemByID(itemID)
End If End If
oppPokemon.CatchLocation = Script.SaveNPCTrade(10) oppPokemon.CatchLocation = Script.SaveNPCTrade(10)

View File

@ -569,7 +569,7 @@
T = False T = False
End If End If
Case "hasitem" Case "hasitem"
If Core.Player.Inventory.GetItemAmount(CInt(condition)) > 0 Then If Core.Player.Inventory.GetItemAmount(condition) > 0 Then
T = True T = True
Else Else
T = False T = False
@ -644,9 +644,9 @@
catchMethod = Me.Value.GetSplit(2) catchMethod = Me.Value.GetSplit(2)
End If End If
Dim catchBall As Item = Item.GetItemByID(1) Dim catchBall As Item = Item.GetItemByID(1.ToString)
If commas > 2 Then If commas > 2 Then
catchBall = Item.GetItemByID(CInt(Me.Value.GetSplit(3))) catchBall = Item.GetItemByID(Me.Value.GetSplit(3))
End If End If
Dim catchLocation As String = Screen.Level.MapName Dim catchLocation As String = Screen.Level.MapName
@ -676,7 +676,7 @@
If isEgg = True Then If isEgg = True Then
Pokemon.EggSteps = 1 Pokemon.EggSteps = 1
Pokemon.SetCatchInfos(Item.GetItemByID(5), "obtained at") Pokemon.SetCatchInfos(Item.GetItemByID(5.ToString), "obtained at")
Else Else
Pokemon.EggSteps = 0 Pokemon.EggSteps = 0
End If End If
@ -1083,9 +1083,9 @@
catchMethod = argument.GetSplit(2) catchMethod = argument.GetSplit(2)
End If End If
Dim catchBall As Item = Item.GetItemByID(1) Dim catchBall As Item = Item.GetItemByID(1.ToString)
If commas > 2 Then If commas > 2 Then
catchBall = Item.GetItemByID(CInt(argument.GetSplit(3))) catchBall = Item.GetItemByID(argument.GetSplit(3))
End If End If
Dim catchLocation As String = Screen.Level.MapName Dim catchLocation As String = Screen.Level.MapName
@ -1115,7 +1115,7 @@
If isEgg = True Then If isEgg = True Then
Pokemon.EggSteps = 1 Pokemon.EggSteps = 1
Pokemon.SetCatchInfos(Item.GetItemByID(5), "obtained at") Pokemon.SetCatchInfos(Item.GetItemByID(5.ToString), "obtained at")
Else Else
Pokemon.EggSteps = 0 Pokemon.EggSteps = 0
End If End If
@ -1241,7 +1241,7 @@
Dim splits() As String = argument.Split(CChar("|")) Dim splits() As String = argument.Split(CChar("|"))
Script.SaveNPCTrade = splits Script.SaveNPCTrade = splits
Core.SetScreen(New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), AddressOf Script.DoNPCTrade, "Choose trade Pokémon", True)) Core.SetScreen(New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5.ToString), AddressOf Script.DoNPCTrade, "Choose trade Pokémon", True))
CType(Core.CurrentScreen, PartyScreen).ExitedSub = AddressOf Script.ExitedNPCTrade CType(Core.CurrentScreen, PartyScreen).ExitedSub = AddressOf Script.ExitedNPCTrade
Case "hide" Case "hide"
Screen.Level.OverworldPokemon.Visible = False Screen.Level.OverworldPokemon.Visible = False
@ -1649,7 +1649,7 @@
End Sub End Sub
Private Sub GiveItem() Private Sub GiveItem()
Dim ItemID As Integer = CInt(Me.Value.GetSplit(0)) Dim ItemID As String = Me.Value.GetSplit(0)
Dim Item As Item = Item.GetItemByID(ItemID) Dim Item As Item = Item.GetItemByID(ItemID)
Dim Amount As Integer = CInt(Me.Value.GetSplit(1)) Dim Amount As Integer = CInt(Me.Value.GetSplit(1))
@ -1671,7 +1671,7 @@
End Sub End Sub
Private Sub RemoveItem() Private Sub RemoveItem()
Dim ItemID As Integer = CInt(Me.Value.GetSplit(0)) Dim ItemID As String = Me.Value.GetSplit(0)
Dim Item As Item = Item.GetItemByID(ItemID) Dim Item As Item = Item.GetItemByID(ItemID)
Dim Amount As Integer = CInt(Me.Value.GetSplit(1)) Dim Amount As Integer = CInt(Me.Value.GetSplit(1))

View File

@ -20,17 +20,22 @@
ItemID = argument.GetSplit(0) ItemID = argument.GetSplit(0)
End If End If
If ScriptConversion.IsArithmeticExpression(ItemID) = False Then If ScriptConversion.IsArithmeticExpression(ItemID) = False AndAlso ItemID.StartsWith("gm") = False Then
item = Item.GetItemByName(ItemID) item = Item.GetItemByName(ItemID)
Else Else
item = Item.GetItemByID(int(ItemID)) item = Item.GetItemByID(ItemID)
End If End If
If Not item Is Nothing Then If Not item Is Nothing Then
If item.MaxStack < Core.Player.Inventory.GetItemAmount(item.ID) + amount Then Dim _itemID As String
amount = int(item.MaxStack - Core.Player.Inventory.GetItemAmount(item.ID)).Clamp(0, 999) If item.IsGameModeItem Then
_itemID = item.gmID
Else
_itemID = item.ID.ToString
End If End If
Core.Player.Inventory.AddItem(item.ID, amount) If item.MaxStack < Core.Player.Inventory.GetItemAmount(_itemID) + amount Then
amount = int(item.MaxStack - Core.Player.Inventory.GetItemAmount(_itemID)).Clamp(0, 999)
End If
Core.Player.Inventory.AddItem(_itemID, amount)
End If End If
Case "remove" Case "remove"
Dim amount As Integer = 1 Dim amount As Integer = 1
@ -45,9 +50,16 @@
End If End If
End If End If
Dim Item As Item = Item.GetItemByID(int(ItemID)) Dim Item As Item = Item.GetItemByID(ItemID)
Core.Player.Inventory.RemoveItem(Item.ID, amount) Dim _itemID As String
If Item.IsGameModeItem Then
_itemID = Item.gmID
Else
_itemID = Item.ID.ToString
End If
Core.Player.Inventory.RemoveItem(_itemID, amount)
If showMessage = True Then If showMessage = True Then
Dim Message As String = "" Dim Message As String = ""
@ -65,7 +77,7 @@
End If End If
Case "clearitem" Case "clearitem"
If argument <> "" Then If argument <> "" Then
Dim ItemID As Integer = int(argument) Dim ItemID As String = argument
Dim amount As Integer = Core.Player.Inventory.GetItemAmount(ItemID) Dim amount As Integer = Core.Player.Inventory.GetItemAmount(ItemID)
If amount > 0 Then If amount > 0 Then
@ -77,10 +89,10 @@
Case "messagegive" Case "messagegive"
Dim ItemID As String = argument.GetSplit(0) Dim ItemID As String = argument.GetSplit(0)
Dim item As Item Dim item As Item
If ScriptConversion.IsArithmeticExpression(ItemID) = False Then If ScriptConversion.IsArithmeticExpression(ItemID) = False AndAlso ItemID.StartsWith("gm") = False Then
item = Item.GetItemByName(ItemID) item = Item.GetItemByName(ItemID)
Else Else
item = Item.GetItemByID(int(ItemID)) item = Item.GetItemByID(ItemID)
End If End If
Dim Amount As Integer = int(argument.GetSplit(1)) Dim Amount As Integer = int(argument.GetSplit(1))

View File

@ -61,9 +61,9 @@
catchMethod = argument.GetSplit(2) catchMethod = argument.GetSplit(2)
End If End If
Dim catchBall As Item = Item.GetItemByID(1) Dim catchBall As Item = Item.GetItemByID(1.ToString)
If commas > 2 Then If commas > 2 Then
catchBall = Item.GetItemByID(int(argument.GetSplit(3))) catchBall = Item.GetItemByID(argument.GetSplit(3))
End If End If
Dim catchLocation As String = Screen.Level.MapName Dim catchLocation As String = Screen.Level.MapName
@ -81,9 +81,9 @@
catchTrainer = argument.GetSplit(6) catchTrainer = argument.GetSplit(6)
End If End If
Dim heldItem As Integer = 0 Dim heldItem As String = 0.ToString
If commas > 6 Then If commas > 6 Then
heldItem = CInt(argument.GetSplit(7)) heldItem = argument.GetSplit(7)
End If End If
Dim isShiny As Boolean = False Dim isShiny As Boolean = False
@ -106,12 +106,12 @@
If isEgg = True Then If isEgg = True Then
Pokemon.EggSteps = 1 Pokemon.EggSteps = 1
Pokemon.SetCatchInfos(Item.GetItemByID(5), "obtained at") Pokemon.SetCatchInfos(Item.GetItemByID(5.ToString), "obtained at")
Else Else
Pokemon.EggSteps = 0 Pokemon.EggSteps = 0
End If End If
If heldItem <> 0 Then If heldItem <> 0.ToString Then
Pokemon.Item = Item.GetItemByID(heldItem) Pokemon.Item = Item.GetItemByID(heldItem)
End If End If
@ -249,7 +249,7 @@
Dim splits() As String = argument.Split(CChar("|")) Dim splits() As String = argument.Split(CChar("|"))
Script.SaveNPCTrade = splits Script.SaveNPCTrade = splits
Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), AddressOf Script.DoNPCTrade, "Choose Pokémon for trade", True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5.ToString), AddressOf Script.DoNPCTrade, "Choose Pokémon for trade", True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True}
AddHandler selScreen.SelectedObject, AddressOf Script.DoNPCTradeHandler AddHandler selScreen.SelectedObject, AddressOf Script.DoNPCTradeHandler
Core.SetScreen(selScreen) Core.SetScreen(selScreen)
@ -372,7 +372,7 @@
End If End If
End If End If
Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), Nothing, "Choose Pokémon", canExit, canChooseFainted, canChooseEgg) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = canExit} Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5.ToString), Nothing, "Choose Pokémon", canExit, canChooseFainted, canChooseEgg) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = canExit}
AddHandler selScreen.SelectedObject, Nothing AddHandler selScreen.SelectedObject, Nothing
Core.SetScreen(selScreen) Core.SetScreen(selScreen)
@ -550,7 +550,7 @@
End If End If
Case "setitem" Case "setitem"
Dim Index As Integer = int(argument.GetSplit(0, ",")) Dim Index As Integer = int(argument.GetSplit(0, ","))
Dim newItem As Item = Item.GetItemByID(int(argument.GetSplit(1, ","))) Dim newItem As Item = Item.GetItemByID(argument.GetSplit(1, ","))
If Core.Player.Pokemons.Count - 1 >= Index Then If Core.Player.Pokemons.Count - 1 >= Index Then
Core.Player.Pokemons(Index).Item = newItem Core.Player.Pokemons(Index).Item = newItem
@ -577,7 +577,7 @@
End If End If
Case "setcatchball" Case "setcatchball"
Dim Index As Integer = int(argument.GetSplit(0, ",")) Dim Index As Integer = int(argument.GetSplit(0, ","))
Dim catchBall As Integer = int(argument.GetSplit(1, ",")) Dim catchBall As String = argument.GetSplit(1, ",")
If Core.Player.Pokemons.Count - 1 >= Index Then If Core.Player.Pokemons.Count - 1 >= Index Then
Core.Player.Pokemons(Index).CatchBall = Item.GetItemByID(catchBall) Core.Player.Pokemons(Index).CatchBall = Item.GetItemByID(catchBall)
@ -764,9 +764,9 @@
catchMethod = argument.GetSplit(2) catchMethod = argument.GetSplit(2)
End If End If
Dim catchBall As Item = Item.GetItemByID(1) Dim catchBall As Item = Item.GetItemByID(1.ToString)
If commas > 2 Then If commas > 2 Then
catchBall = Item.GetItemByID(int(argument.GetSplit(3))) catchBall = Item.GetItemByID(argument.GetSplit(3))
End If End If
Dim catchLocation As String = Screen.Level.MapName Dim catchLocation As String = Screen.Level.MapName
@ -784,9 +784,9 @@
catchTrainer = argument.GetSplit(6) catchTrainer = argument.GetSplit(6)
End If End If
Dim heldItem As Integer = 0 Dim heldItem As String = 0.ToString
If commas > 6 Then If commas > 6 Then
heldItem = CInt(argument.GetSplit(7)) heldItem = argument.GetSplit(7)
End If End If
Dim isShiny As Boolean = False Dim isShiny As Boolean = False
@ -809,12 +809,12 @@
If isEgg = True Then If isEgg = True Then
Pokemon.EggSteps = 1 Pokemon.EggSteps = 1
Pokemon.SetCatchInfos(Item.GetItemByID(5), "obtained at") Pokemon.SetCatchInfos(Item.GetItemByID(5.ToString), "obtained at")
Else Else
Pokemon.EggSteps = 0 Pokemon.EggSteps = 0
End If End If
If heldItem <> 0 Then If heldItem <> 0.ToString Then
Pokemon.Item = Item.GetItemByID(heldItem) Pokemon.Item = Item.GetItemByID(heldItem)
End If End If

View File

@ -277,7 +277,7 @@
CanContinue = False CanContinue = False
Case "voltorbflip" Case "voltorbflip"
If Core.Player.Inventory.GetItemAmount(54) > 0 Then If Core.Player.Inventory.GetItemAmount(54.ToString) > 0 Then
If Core.Player.Coins < 50000 Then If Core.Player.Coins < 50000 Then
If VoltorbFlip.VoltorbFlipScreen.TotalCoins = -1 Then If VoltorbFlip.VoltorbFlipScreen.TotalCoins = -1 Then
Core.SetScreen(New VoltorbFlip.VoltorbFlipScreen(CurrentScreen)) Core.SetScreen(New VoltorbFlip.VoltorbFlipScreen(CurrentScreen))

View File

@ -12,7 +12,7 @@
Select Case command.ToLower() Select Case command.ToLower()
Case "countitem" Case "countitem"
Dim ItemID As Integer = int(argument.GetSplit(0)) Dim ItemID As String = argument.GetSplit(0)
Return Core.Player.Inventory.GetItemAmount(ItemID) Return Core.Player.Inventory.GetItemAmount(ItemID)
Case "countitems" Case "countitems"
@ -27,13 +27,13 @@
If argument.Contains(",") Then If argument.Contains(",") Then
Select Case argument.GetSplit(1).ToLower() Select Case argument.GetSplit(1).ToLower()
Case "p", "plural" Case "p", "plural"
Return Item.GetItemByID(int(ItemID)).PluralName Return Item.GetItemByID(ItemID).PluralName
Case "s", "singular" Case "s", "singular"
Return Item.GetItemByID(int(ItemID)).Name Return Item.GetItemByID(ItemID).Name
End Select End Select
End If End If
Return Item.GetItemByID(int(ItemID)).Name Return Item.GetItemByID(ItemID).Name
Case "id" Case "id"
Dim item As Item = Item.GetItemByName(argument) Dim item As Item = Item.GetItemByName(argument)
If Not item Is Nothing Then If Not item Is Nothing Then