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

47 lines
1.7 KiB
VB.net
Raw Normal View History

Namespace Items.XItems
2016-09-07 18:50:38 +02:00
<Item(68, "Guard Spec.")>
2016-09-07 18:50:38 +02:00
Public Class GuardSpec
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 = 700
Public Overrides ReadOnly Property Description As String = "An item that prevents stat reduction among the Trainer's party Pokémon for five turns after it is used in battle."
2016-09-07 18:50:38 +02:00
2016-09-21 00:50:26 +02:00
Public Sub New()
_textureRectangle = New Rectangle(408, 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
If CType(s, BattleSystem.BattleScreen).FieldEffects.OwnGuardSpec = 0 Then
CType(s, BattleSystem.BattleScreen).FieldEffects.OwnGuardSpec = 1
Screen.TextBox.Show("Guard Spec. prevents~stat reduction." & RemoveItem(), {}, False, False)
PlayerStatistics.Track("[53]Status booster used", 1)
Return True
End If
Screen.TextBox.Show("It didn't have any effect...", {}, False, False)
Return False
Else
Logger.Log(Logger.LogTypes.Warning, "GuardSpec.vb: Used outside of battle environment!")
Return False
End If
End Function
End Class
End Namespace