Implemented EV Training Items. Did not add their IV breeding functionality yet.

This commit is contained in:
CaptainSegis 2016-10-26 14:07:35 -05:00
parent 6dbf882698
commit 47410f1cd6
15 changed files with 227 additions and 38 deletions

View File

@ -1401,6 +1401,13 @@
<Compile Include="Pokemon\Items\Repels\RepelItem.vb" />
<Compile Include="Pokemon\Items\Repels\SuperRepel.vb" />
<Compile Include="Pokemon\Items\Standard\AbilityCapsule.vb" />
<Compile Include="Pokemon\Items\Standard\PowerAnklet.vb" />
<Compile Include="Pokemon\Items\Standard\PowerBracer.vb" />
<Compile Include="Pokemon\Items\Standard\PowerBelt.vb" />
<Compile Include="Pokemon\Items\Standard\PowerLens.vb" />
<Compile Include="Pokemon\Items\Standard\PowerBand.vb" />
<Compile Include="Pokemon\Items\Standard\PowerWeight.vb" />
<Compile Include="Pokemon\Items\Standard\MachoBrace.vb" />
<Compile Include="Pokemon\Items\Standard\AmuletCoin.vb" />
<Compile Include="Pokemon\Items\Standard\BalmMushroom.vb" />
<Compile Include="Pokemon\Items\Standard\BigMushroom.vb" />

View File

@ -6347,7 +6347,7 @@
Next
End If
Core.Player.Pokemons(PokeIndex).GainEffort(BattleScreen.OppPokemon)
Core.Player.Pokemons(PokeIndex).GainEffort(Core.Player.Pokemons(PokeIndex), BattleScreen.OppPokemon)
Next
End If

View File

@ -11,7 +11,7 @@
Public Overrides ReadOnly Property CanBeUsed As Boolean = False
Public Sub New()
_textureRectangle = New Rectangle(360, 72, 24, 24)
_textureRectangle = New Rectangle(360, 264, 24, 24)
End Sub
End Class

View File

@ -11,7 +11,7 @@
Public Overrides ReadOnly Property CanBeUsed As Boolean = False
Public Sub New()
_textureRectangle = New Rectangle(360, 72, 24, 24)
_textureRectangle = New Rectangle(384, 264, 24, 24)
End Sub
End Class

View File

@ -11,7 +11,7 @@
Public Overrides ReadOnly Property CanBeUsed As Boolean = False
Public Sub New()
_textureRectangle = New Rectangle(360, 72, 24, 24)
_textureRectangle = New Rectangle(432, 264, 24, 24)
End Sub
End Class

View File

@ -11,7 +11,7 @@
Public Overrides ReadOnly Property CanBeUsed As Boolean = False
Public Sub New()
_textureRectangle = New Rectangle(360, 72, 24, 24)
_textureRectangle = New Rectangle(456, 264, 24, 24)
End Sub
End Class

View File

@ -0,0 +1,19 @@
Namespace Items.Standard
<Item(581, "Macho Brace")>
Public Class MachoBrace
Inherits Item
Public Overrides ReadOnly Property Description As String = "An item to be held by a Pokémon. This stiff, heavy brace helps Pokemon grow strong but cuts Speed in battle."
Public Overrides ReadOnly Property PokeDollarPrice As Integer = 3000
Public Overrides ReadOnly Property CanBeUsedInBattle As Boolean = False
Public Overrides ReadOnly Property CanBeUsed As Boolean = False
Public Sub New()
_textureRectangle = New Rectangle(96, 288, 24, 24)
End Sub
End Class
End Namespace

View File

@ -0,0 +1,19 @@
Namespace Items.Standard
<Item(587, "Power Anklet")>
Public Class PowerAnklet
Inherits Item
Public Overrides ReadOnly Property Description As String = "An item to be held by a Pokémon. It reduces Speed but allows the holder's Speed stat to grow more after battling."
Public Overrides ReadOnly Property PokeDollarPrice As Integer = 3000
Public Overrides ReadOnly Property CanBeUsedInBattle As Boolean = False
Public Overrides ReadOnly Property CanBeUsed As Boolean = False
Public Sub New()
_textureRectangle = New Rectangle(240, 384, 24, 24)
End Sub
End Class
End Namespace

View File

@ -0,0 +1,19 @@
Namespace Items.Standard
<Item(586, "Power Band")>
Public Class PowerBand
Inherits Item
Public Overrides ReadOnly Property Description As String = "An item to be held by a Pokémon. It reduces Speed but allows the holder's Sp. Def stat to grow more after battling."
Public Overrides ReadOnly Property PokeDollarPrice As Integer = 3000
Public Overrides ReadOnly Property CanBeUsedInBattle As Boolean = False
Public Overrides ReadOnly Property CanBeUsed As Boolean = False
Public Sub New()
_textureRectangle = New Rectangle(216, 384, 24, 24)
End Sub
End Class
End Namespace

View File

@ -0,0 +1,19 @@
Namespace Items.Standard
<Item(584, "Power Belt")>
Public Class PowerBelt
Inherits Item
Public Overrides ReadOnly Property Description As String = "An item to be held by a Pokémon. It reduces Speed but allows the holder's Defense stat to grow more after battling."
Public Overrides ReadOnly Property PokeDollarPrice As Integer = 3000
Public Overrides ReadOnly Property CanBeUsedInBattle As Boolean = False
Public Overrides ReadOnly Property CanBeUsed As Boolean = False
Public Sub New()
_textureRectangle = New Rectangle(168, 384, 24, 24)
End Sub
End Class
End Namespace

View File

@ -0,0 +1,19 @@
Namespace Items.Standard
<Item(583, "Power Bracer")>
Public Class PowerBracer
Inherits Item
Public Overrides ReadOnly Property Description As String = "An item to be held by a Pokémon. It reduces Speed but allows the holder's Attack stat to grow more after battling."
Public Overrides ReadOnly Property PokeDollarPrice As Integer = 3000
Public Overrides ReadOnly Property CanBeUsedInBattle As Boolean = False
Public Overrides ReadOnly Property CanBeUsed As Boolean = False
Public Sub New()
_textureRectangle = New Rectangle(144, 384, 24, 24)
End Sub
End Class
End Namespace

View File

@ -0,0 +1,19 @@
Namespace Items.Standard
<Item(585, "Power Lens")>
Public Class PowerLens
Inherits Item
Public Overrides ReadOnly Property Description As String = "An item to be held by a Pokémon. It reduces Speed but allows the holder's Sp. Atk stat to grow more after battling."
Public Overrides ReadOnly Property PokeDollarPrice As Integer = 3000
Public Overrides ReadOnly Property CanBeUsedInBattle As Boolean = False
Public Overrides ReadOnly Property CanBeUsed As Boolean = False
Public Sub New()
_textureRectangle = New Rectangle(192, 384, 24, 24)
End Sub
End Class
End Namespace

View File

@ -0,0 +1,19 @@
Namespace Items.Standard
<Item(582, "Power Weight")>
Public Class PowerWeight
Inherits Item
Public Overrides ReadOnly Property Description As String = "An item to be held by a Pokémon. It reduces Speed but allows the holder's maximum HP to grow more after battling."
Public Overrides ReadOnly Property PokeDollarPrice As Integer = 3000
Public Overrides ReadOnly Property CanBeUsedInBattle As Boolean = False
Public Overrides ReadOnly Property CanBeUsed As Boolean = False
Public Sub New()
_textureRectangle = New Rectangle(120, 288, 24, 24)
End Sub
End Class
End Namespace

View File

@ -11,7 +11,7 @@
Public Overrides ReadOnly Property CanBeUsed As Boolean = False
Public Sub New()
_textureRectangle = New Rectangle(360, 72, 24, 24)
_textureRectangle = New Rectangle(408, 264, 24, 24)
End Sub
End Class

View File

@ -2676,7 +2676,7 @@ Public Class Pokemon
''' Adds Effort values (EV) to this Pokémon after defeated another Pokémon, if possible.
''' </summary>
''' <param name="DefeatedPokemon">The defeated Pokémon.</param>
Public Sub GainEffort(ByVal DefeatedPokemon As Pokemon)
Public Sub GainEffort(ByVal pokemon As Pokemon, ByVal DefeatedPokemon As Pokemon)
Dim allEV As Integer = EVHP + EVAttack + EVDefense + EVSpeed + EVSpAttack + EVSpDefense
If allEV < 510 Then
Dim maxGainEV As Integer = 0
@ -2684,43 +2684,92 @@ Public Class Pokemon
maxGainEV = 510 - allEV
End If
If maxGainEV > 0 Then
maxGainEV = CInt(MathHelper.Clamp(maxGainEV, 1, 3))
maxGainEV = CInt(MathHelper.Clamp(maxGainEV, 1, 6))
Select Case pokemon.Item.ID()
Case 582, 583, 584, 585, 586, 587 'EV Items
If Me.EVHP < 255 And DefeatedPokemon.GiveEVHP > 0 Then
Dim gainHPEV As Integer = DefeatedPokemon.GiveEVHP
gainHPEV = CInt(MathHelper.Clamp(gainHPEV, 0, 255 - Me.EVHP))
Me.EVHP += gainHPEV
End If
If Me.EVHP < 252 And pokemon.Item.ID = 582 Then
Me.EVHP += CInt(MathHelper.Clamp(4, 0, 252 - Me.EVHP))
End If
If Me.EVAttack < 255 And DefeatedPokemon.GiveEVAttack > 0 Then
Dim gainAttackEV As Integer = DefeatedPokemon.GiveEVAttack
gainAttackEV = CInt(MathHelper.Clamp(gainAttackEV, 0, 255 - Me.EVAttack))
Me.EVAttack += gainAttackEV
End If
If Me.EVAttack < 252 And pokemon.Item.ID = 583 Then
Me.EVAttack += CInt(MathHelper.Clamp(4, 0, 252 - Me.EVHP))
End If
If Me.EVDefense < 255 And DefeatedPokemon.GiveEVDefense > 0 Then
Dim gainDefenseEV As Integer = DefeatedPokemon.GiveEVDefense
gainDefenseEV = CInt(MathHelper.Clamp(gainDefenseEV, 0, 255 - Me.EVDefense))
Me.EVDefense += gainDefenseEV
End If
If Me.EVDefense < 252 And pokemon.Item.ID = 584 Then
Me.EVDefense += CInt(MathHelper.Clamp(4, 0, 252 - Me.EVHP))
End If
If Me.EVSpeed < 255 And DefeatedPokemon.GiveEVSpeed > 0 Then
Dim gainSpeedEV As Integer = DefeatedPokemon.GiveEVSpeed
gainSpeedEV = CInt(MathHelper.Clamp(gainSpeedEV, 0, 255 - Me.EVSpeed))
Me.EVSpeed += gainSpeedEV
End If
If Me.EVSpAttack < 252 And pokemon.Item.ID = 585 Then
Me.EVSpAttack += CInt(MathHelper.Clamp(4, 0, 252 - Me.EVHP))
End If
If Me.EVSpAttack < 255 And DefeatedPokemon.GiveEVSpAttack > 0 Then
Dim gainSpAttackEV As Integer = DefeatedPokemon.GiveEVSpAttack
gainSpAttackEV = CInt(MathHelper.Clamp(gainSpAttackEV, 0, 255 - Me.EVSpAttack))
Me.EVSpAttack += gainSpAttackEV
End If
If Me.EVSpDefense < 252 And pokemon.Item.ID = 586 Then
Me.EVSpDefense += CInt(MathHelper.Clamp(4, 0, 252 - Me.EVHP))
End If
If Me.EVSpDefense < 255 And DefeatedPokemon.GiveEVSpDefense > 0 Then
Dim gainSpDefenseEV As Integer = DefeatedPokemon.GiveEVSpDefense
gainSpDefenseEV = CInt(MathHelper.Clamp(gainSpDefenseEV, 0, 255 - Me.EVSpDefense))
Me.EVSpDefense += gainSpDefenseEV
End If
If Me.Speed < 252 And pokemon.Item.ID = 587 Then
Me.Speed += CInt(MathHelper.Clamp(4, 0, 252 - Me.EVHP))
End If
Case Else
'Item 581 is Macho Brace
If Me.EVHP < 252 And DefeatedPokemon.GiveEVHP > 0 Then
Dim gainHPEV As Integer = DefeatedPokemon.GiveEVHP
If pokemon.Item.ID = 581 Then
gainHPEV *= 2
End If
gainHPEV = CInt(MathHelper.Clamp(gainHPEV, 0, 252 - Me.EVHP))
Me.EVHP += gainHPEV
End If
If Me.EVAttack < 252 And DefeatedPokemon.GiveEVAttack > 0 Then
Dim gainAttackEV As Integer = DefeatedPokemon.GiveEVAttack
If pokemon.Item.ID = 581 Then
gainAttackEV *= 2
End If
gainAttackEV = CInt(MathHelper.Clamp(gainAttackEV, 0, 252 - Me.EVAttack))
Me.EVAttack += gainAttackEV
End If
If Me.EVDefense < 252 And DefeatedPokemon.GiveEVDefense > 0 Then
Dim gainDefenseEV As Integer = DefeatedPokemon.GiveEVDefense
If pokemon.Item.ID = 581 Then
gainDefenseEV *= 2
End If
gainDefenseEV = CInt(MathHelper.Clamp(gainDefenseEV, 0, 252 - Me.EVDefense))
Me.EVDefense += gainDefenseEV
End If
If Me.EVSpAttack < 252 And DefeatedPokemon.GiveEVSpAttack > 0 Then
Dim gainSpAttackEV As Integer = DefeatedPokemon.GiveEVSpAttack
If pokemon.Item.ID = 581 Then
gainSpAttackEV *= 2
End If
gainSpAttackEV = CInt(MathHelper.Clamp(gainSpAttackEV, 0, 252 - Me.EVSpAttack))
Me.EVSpAttack += gainSpAttackEV
End If
If Me.EVSpDefense < 252 And DefeatedPokemon.GiveEVSpDefense > 0 Then
Dim gainSpDefenseEV As Integer = DefeatedPokemon.GiveEVSpDefense
If pokemon.Item.ID = 581 Then
gainSpDefenseEV *= 2
End If
gainSpDefenseEV = CInt(MathHelper.Clamp(gainSpDefenseEV, 0, 252 - Me.EVSpDefense))
Me.EVSpDefense += gainSpDefenseEV
End If
If Me.EVSpeed < 252 And DefeatedPokemon.GiveEVSpeed > 0 Then
Dim gainSpeedEV As Integer = DefeatedPokemon.GiveEVSpeed
If pokemon.Item.ID = 581 Then
gainSpeedEV *= 2
End If
gainSpeedEV = CInt(MathHelper.Clamp(gainSpeedEV, 0, 252 - Me.EVSpeed))
Me.EVSpeed += gainSpeedEV
End If
End Select
End If
End If
End Sub