mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-04-08 18:35:09 +02:00
41 lines
1.6 KiB
VB.net
41 lines
1.6 KiB
VB.net
Namespace Items
|
|
|
|
''' <summary>
|
|
''' Represents a Wing Item.
|
|
''' </summary>
|
|
Public MustInherit Class WingItem
|
|
|
|
Inherits Item
|
|
|
|
Public Overrides ReadOnly Property ItemType As ItemTypes = ItemTypes.Medicine
|
|
Public Overrides ReadOnly Property CanBeUsedInBattle As Boolean = False
|
|
Public Overrides ReadOnly Property FlingDamage As Integer = 20
|
|
Public Overrides ReadOnly Property PokeDollarPrice As Integer = 3000
|
|
|
|
Public Overrides Sub Use()
|
|
Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, Localization.GetString("global_use", "Use") & " " & Me.OneLineName(), True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True}
|
|
AddHandler selScreen.SelectedObject, AddressOf UseItemhandler
|
|
|
|
Core.SetScreen(selScreen)
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' Checks if a Wing can be used on a Pokémon.
|
|
''' </summary>
|
|
''' <param name="stat">An integer representing the stat that should be upped by the Wing.</param>
|
|
''' <param name="p">The Pokémon that the Wing should be used on.</param>
|
|
Protected Shared Function CanUseWing(ByVal stat As Integer, ByVal p As Pokemon) As Boolean
|
|
If stat < 255 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
|
|
|
|
End Namespace
|