P3D-Legacy/P3D/Pokemon/Items/XItems/DireHit.vb

49 lines
1.8 KiB
VB.net
Raw Normal View History

Namespace Items.XItems
2016-09-07 18:50:38 +02:00
<Item(44, "Dire Hit")>
2016-09-07 18:50:38 +02:00
Public Class DireHit
2016-09-21 00:50:26 +02:00
Inherits XItem
2016-09-07 18:50:38 +02:00
2016-09-21 00:50:26 +02:00
Public Overrides ReadOnly Property PokeDollarPrice As Integer = 650
Public Overrides ReadOnly Property Description As String = "An item that raises the critical-hit ratio greatly. It can be used only once and wears off if the Pokémon is withdrawn."
2016-09-07 18:50:38 +02:00
2016-09-21 00:50:26 +02:00
Public Sub New()
_textureRectangle = New Rectangle(480, 24, 24, 24)
2016-09-07 18:50:38 +02:00
End Sub
Public Overrides Function UseOnPokemon(PokeIndex As Integer) As Boolean
Dim foundBattleScreen As Boolean = True
Dim s As Screen = Core.CurrentScreen
While s.Identification <> Screen.Identifications.BattleScreen
If s.PreScreen Is Nothing Then
foundBattleScreen = False
Exit While
End If
2017-08-28 04:48:05 +02:00
s = s.PreScreen
2016-09-07 18:50:38 +02:00
End While
If foundBattleScreen = True Then
Dim p As Pokemon = CType(s, BattleSystem.BattleScreen).OwnPokemon
If CType(s, BattleSystem.BattleScreen).FieldEffects.OwnFocusEnergy = 0 Then
CType(s, BattleSystem.BattleScreen).FieldEffects.OwnFocusEnergy = 1
Screen.TextBox.Show(p.GetDisplayName() & "~got pumped!" & RemoveItem(), {}, False, False)
PlayerStatistics.Track("[53]Status booster used", 1)
Return True
End If
Screen.TextBox.Show("Cannot boost~ " & p.GetDisplayName() & "'s hit ratio!", {}, False, False)
Return False
Else
Logger.Log(Logger.LogTypes.Warning, "DireHit.vb: Used outside of battle environment!")
Return False
End If
End Function
End Class
End Namespace