From 00cedf786e6527907ca91e6270795e0fe63bf547 Mon Sep 17 00:00:00 2001 From: nilllzz Date: Tue, 20 Sep 2016 06:29:17 +0200 Subject: [PATCH] Changed repel items. --- 2.5DHero/2.5DHero/2.5DHero.vbproj | 1 + .../2.5DHero/Pokemon/Items/Repels/MaxRepel.vb | 27 +++++-------------- .../2.5DHero/Pokemon/Items/Repels/Repel.vb | 27 +++++-------------- .../Pokemon/Items/Repels/RepelItem.vb | 27 +++++++++++++++++++ .../Pokemon/Items/Repels/SuperRepel.vb | 27 +++++-------------- 5 files changed, 46 insertions(+), 63 deletions(-) create mode 100644 2.5DHero/2.5DHero/Pokemon/Items/Repels/RepelItem.vb diff --git a/2.5DHero/2.5DHero/2.5DHero.vbproj b/2.5DHero/2.5DHero/2.5DHero.vbproj index 7813e693f..e59ca5330 100644 --- a/2.5DHero/2.5DHero/2.5DHero.vbproj +++ b/2.5DHero/2.5DHero/2.5DHero.vbproj @@ -1389,6 +1389,7 @@ + diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Repels/MaxRepel.vb b/2.5DHero/2.5DHero/Pokemon/Items/Repels/MaxRepel.vb index e3e0f8870..17aac7ee5 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Repels/MaxRepel.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Repels/MaxRepel.vb @@ -3,29 +3,14 @@ Namespace Items.Repels Public Class MaxRepel - Inherits Item + Inherits RepelItem + + Public Overrides ReadOnly Property Description As String = "An item that prevents any low-level wild Pokémon from jumping out at you for 250 steps after its use." + Public Overrides ReadOnly Property PokeDollarPrice As Integer = 700 + Public Overrides ReadOnly Property RepelSteps As Integer = 250 Public Sub New() - MyBase.New("Max Repel", 700, ItemTypes.Standard, 43, 1, 0, New Rectangle(456, 24, 24, 24), "An item that prevents any low-level wild Pokémon from jumping out at you for 250 steps after its use.") - - Me._canBeHold = True - Me._canBeTraded = True - Me._canBeUsed = True - Me._canBeUsedInBattle = False - End Sub - - Public Overrides Sub Use() - If Core.Player.RepelSteps <= 0 Then - Core.Player.Inventory.RemoveItem(Me.ID, 1) - Player.Temp.LastUsedRepel = Me.ID - - SoundManager.PlaySound("repel_use", False) - Screen.TextBox.Show(Core.Player.Name & " used a~" & Me.Name, {}, True, True) - Core.Player.RepelSteps = 250 - PlayerStatistics.Track("[42]Repels used", 1) - Else - Screen.TextBox.Show("The Repel is still~in effect.", {}, True, True) - End If + _textureRectangle = New Rectangle(456, 24, 24, 24) End Sub End Class diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Repels/Repel.vb b/2.5DHero/2.5DHero/Pokemon/Items/Repels/Repel.vb index d7d6a127e..83413f83c 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Repels/Repel.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Repels/Repel.vb @@ -3,29 +3,14 @@ Namespace Items.Repels Public Class Repel - Inherits Item + Inherits RepelItem + + Public Overrides ReadOnly Property Description As String = "An item that prevents any low-level wild Pokémon from jumping out at you for 100 steps after its use." + Public Overrides ReadOnly Property PokeDollarPrice As Integer = 350 + Public Overrides ReadOnly Property RepelSteps As Integer = 100 Public Sub New() - MyBase.New("Repel", 350, ItemTypes.Standard, 20, 1, 0, New Rectangle(432, 0, 24, 24), "An item that prevents any low-level wild Pokémon from jumping out at you for 100 steps after its use.") - - Me._canBeHold = True - Me._canBeTraded = True - Me._canBeUsed = True - Me._canBeUsedInBattle = False - End Sub - - Public Overrides Sub Use() - If Core.Player.RepelSteps <= 0 Then - Core.Player.Inventory.RemoveItem(Me.ID, 1) - Player.Temp.LastUsedRepel = Me.ID - - SoundManager.PlaySound("repel_use", False) - Screen.TextBox.Show(Core.Player.Name & " used a~" & Me.Name, {}, True, True) - Core.Player.RepelSteps = 100 - PlayerStatistics.Track("[42]Repels used", 1) - Else - Screen.TextBox.Show("The Repel is still~in effect.", {}, True, True) - End If + _textureRectangle = New Rectangle(432, 0, 24, 24) End Sub End Class diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Repels/RepelItem.vb b/2.5DHero/2.5DHero/Pokemon/Items/Repels/RepelItem.vb new file mode 100644 index 000000000..cac4e215b --- /dev/null +++ b/2.5DHero/2.5DHero/Pokemon/Items/Repels/RepelItem.vb @@ -0,0 +1,27 @@ +Namespace Items.Repels + + Public MustInherit Class RepelItem + + Inherits Item + + Public Overrides ReadOnly Property CanBeUsedInBattle As Boolean = False + + Public MustOverride ReadOnly Property RepelSteps As Integer + + Public Overrides Sub Use() + If Core.Player.RepelSteps <= 0 Then + Core.Player.Inventory.RemoveItem(ID, 1) + Player.Temp.LastUsedRepel = ID + + SoundManager.PlaySound("repel_use", False) + Screen.TextBox.Show(Core.Player.Name & " used a~" & Name, {}, True, True) + Core.Player.RepelSteps = RepelSteps + PlayerStatistics.Track("[42]Repels used", 1) + Else + Screen.TextBox.Show("The Repel is still~in effect.", {}, True, True) + End If + End Sub + + End Class + +End Namespace diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Repels/SuperRepel.vb b/2.5DHero/2.5DHero/Pokemon/Items/Repels/SuperRepel.vb index 2c82290d5..fbb1700cb 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Repels/SuperRepel.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Repels/SuperRepel.vb @@ -3,29 +3,14 @@ Namespace Items.Repels Public Class SuperRepel - Inherits Item + Inherits RepelItem + + Public Overrides ReadOnly Property Description As String = "An item that prevents any low-level wild Pokémon from jumping out at you for 200 steps after its use." + Public Overrides ReadOnly Property PokeDollarPrice As Integer = 500 + Public Overrides ReadOnly Property RepelSteps As Integer = 200 Public Sub New() - MyBase.New("Super Repel", 500, ItemTypes.Standard, 42, 1, 0, New Rectangle(432, 24, 24, 24), "An item that prevents any low-level wild Pokémon from jumping out at you for 200 steps after its use.") - - Me._canBeHold = True - Me._canBeTraded = True - Me._canBeUsed = True - Me._canBeUsedInBattle = False - End Sub - - Public Overrides Sub Use() - If Core.Player.RepelSteps <= 0 Then - Core.Player.Inventory.RemoveItem(Me.ID, 1) - Player.Temp.LastUsedRepel = Me.ID - - SoundManager.PlaySound("repel_use", False) - Screen.TextBox.Show(Core.Player.Name & " used a~" & Me.Name, {}, True, True) - Core.Player.RepelSteps = 200 - PlayerStatistics.Track("[42]Repels used", 1) - Else - Screen.TextBox.Show("The Repel is still~in effect.", {}, True, True) - End If + _textureRectangle = New Rectangle(432, 24, 24, 24) End Sub End Class