P3D-Legacy/P3D/Pokemon/Items/VitaminItem.vb

40 lines
1.5 KiB
VB.net
Raw Normal View History

2016-09-19 03:26:44 +02:00
Namespace Items
2016-09-07 18:50:38 +02:00
''' <summary>
''' Represents a Vitamin Item.
''' </summary>
Public MustInherit Class VitaminItem
2016-09-07 18:50:38 +02:00
Inherits Item
2016-09-20 02:18:12 +02:00
Public Overrides ReadOnly Property ItemType As ItemTypes = ItemTypes.Medicine
2016-09-21 00:04:47 +02:00
Public Overrides ReadOnly Property PokeDollarPrice As Integer = 9800
Public Overrides ReadOnly Property CanBeUsedInBattle As Boolean = False
Public Overrides Sub Use()
Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True}
AddHandler selScreen.SelectedObject, AddressOf UseItemhandler
Core.SetScreen(selScreen)
2016-09-21 00:04:47 +02:00
End Sub
2016-09-07 18:50:38 +02:00
''' <summary>
''' Checks if a Vitamin can be used on a Pokémon.
''' </summary>
''' <param name="stat">An integer representing the stat that should be upped by the Vitamin.</param>
''' <param name="p">The Pokémon that the Vitamin should be used on.</param>
2016-09-20 02:18:12 +02:00
Protected Shared Function CanUseVitamin(ByVal stat As Integer, ByVal p As Pokemon) As Boolean
2016-09-07 18:50:38 +02:00
If stat < 100 Then
Dim allStats As Integer = p.EVAttack + p.EVDefense + p.EVSpAttack + p.EVSpDefense + p.EVHP + p.EVSpeed
If allStats < 510 Then
Return True
End If
End If
Return False
End Function
End Class
2016-09-19 03:26:44 +02:00
End Namespace