Fixed some logic on ability changing situations. First implementation of Parental Bond. Fixed Solar Power effect upon round end.

This commit is contained in:
CaptainSegis 2018-03-12 01:58:10 -05:00
parent aa03355abf
commit 5e4d6e28ce
22 changed files with 125 additions and 41 deletions

View File

@ -1696,9 +1696,44 @@
Dim Hits As Integer = 0 Dim Hits As Integer = 0
Dim TimesToAttack As Integer = moveUsed.GetTimesToAttack(own, BattleScreen) Dim TimesToAttack As Integer = moveUsed.GetTimesToAttack(own, BattleScreen)
Dim useParentalBond As Boolean = False
If TimesToAttack = 1 AndAlso p.Ability IsNot Nothing AndAlso p.Ability.Name.ToLower = "parental bond" Then
Dim moveList As String() = {"endeavor",
"fling",
"explosion",
"selfdestruct",
"final gambit",
"bounce",
"dig",
"dive",
"fly",
"freeze shock",
"geomancy",
"ice burn",
"phantom force",
"razor wind",
"shadow force",
"skull bash",
"sky attack",
"sky drop",
"solar beam",
"solar blade"
}
If Not moveList.Contains(moveUsed.Name.ToLower) Then
useParentalBond = True
TimesToAttack += 1
End If
End If
For i = 1 To TimesToAttack For i = 1 To TimesToAttack
Dim Critical As Boolean = BattleCalculation.IsCriticalHit(moveUsed, own, BattleScreen) Dim Critical As Boolean = BattleCalculation.IsCriticalHit(moveUsed, own, BattleScreen)
Dim Damage As Integer = moveUsed.GetDamage(Critical, own, Not own, BattleScreen) Dim Damage As Integer = 0
If useParentalBond AndAlso i = TimesToAttack Then
Damage = moveUsed.GetDamage(Critical, own, Not own, BattleScreen, "parental bond")
Else
Damage = moveUsed.GetDamage(Critical, own, Not own, BattleScreen)
End If
If effectiveness <> 0 Then If effectiveness <> 0 Then
Dim sturdyWorked As Boolean = False Dim sturdyWorked As Boolean = False
@ -1861,6 +1896,8 @@
If effectiveness <> 0 Then If effectiveness <> 0 Then
Dim canUseEffect As Boolean = True Dim canUseEffect As Boolean = True
Dim canUseRecharge As Boolean = True
If op.Ability.Name.ToLower() = "shield dust" AndAlso moveUsed.HasSecondaryEffect = True Then If op.Ability.Name.ToLower() = "shield dust" AndAlso moveUsed.HasSecondaryEffect = True Then
If BattleScreen.FieldEffects.CanUseAbility(Not own, BattleScreen) = True Then If BattleScreen.FieldEffects.CanUseAbility(Not own, BattleScreen) = True Then
canUseEffect = False canUseEffect = False
@ -1870,6 +1907,39 @@
canUseEffect = False canUseEffect = False
End If End If
'Moves that only use secondary effects on the second turn of parental bond
If p.Ability IsNot Nothing AndAlso p.Ability.Name.ToLower = "parental bond" AndAlso i <> TimesToAttack Then
Dim PBmoveList As String() = {"secret power",
"struggle",
"circle throw",
"dragon tail",
"bug bite",
"pluck",
"u-turn",
"volt switch",
"smelling salt",
"wake-up slap",
"knock off",
"relic song",
"outrage",
"thrash",
"petal dance",
"hyper beam",
"giga impact",
"blast burn",
"frenzy plant",
"hydro cannon",
"roar of time",
"rock wrecker"
}
If PBmoveList.Contains(moveUsed.Name.ToLower) Then
canUseEffect = False
canUseRecharge = False
End If
End If
If canUseEffect = True Then If canUseEffect = True Then
If substitute = 0 OrElse moveUsed.IsAffectedBySubstitute = False Then If substitute = 0 OrElse moveUsed.IsAffectedBySubstitute = False Then
moveUsed.MoveHits(own, BattleScreen) moveUsed.MoveHits(own, BattleScreen)
@ -1886,7 +1956,11 @@
End If End If
moveUsed.MoveRecoil(own, BattleScreen) moveUsed.MoveRecoil(own, BattleScreen)
moveUsed.MoveRecharge(own, BattleScreen)
If canUseRecharge Then
moveUsed.MoveRecharge(own, BattleScreen)
End If
If op.HP > 0 Then If op.HP > 0 Then
If own = True Then If own = True Then
@ -1985,7 +2059,6 @@
Case "mummy" Case "mummy"
If moveUsed.MakesContact = True Then If moveUsed.MakesContact = True Then
If p.Ability.Name.ToLower() <> "multitype" And p.Ability.Name.ToLower() <> "mummy" Then If p.Ability.Name.ToLower() <> "multitype" And p.Ability.Name.ToLower() <> "mummy" Then
p.OriginalAbility = p.Ability
p.Ability = Ability.GetAbilityByID(152) p.Ability = Ability.GetAbilityByID(152)
ChangeCameraAngel(1, own, BattleScreen) ChangeCameraAngel(1, own, BattleScreen)
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & "'s ability changed to Mummy!")) BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & "'s ability changed to Mummy!"))
@ -4012,7 +4085,6 @@
LowerStat(Not own, own, BattleScreen, "Attack", 1, p.GetDisplayName() & "'s Intimidate cuts " & op.GetDisplayName() & "'s attack!", "intimidate") LowerStat(Not own, own, BattleScreen, "Attack", 1, p.GetDisplayName() & "'s Intimidate cuts " & op.GetDisplayName() & "'s attack!", "intimidate")
Case "trace" Case "trace"
If op.Ability.Name.ToLower() <> "multitype" And op.Ability.Name.ToLower() <> "illusion" Then If op.Ability.Name.ToLower() <> "multitype" And op.Ability.Name.ToLower() <> "illusion" Then
p.OriginalAbility = p.Ability
p.Ability = op.Ability p.Ability = op.Ability
.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " copied the ability " & op.Ability.Name & " from " & op.GetDisplayName() & "!")) .BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " copied the ability " & op.Ability.Name & " from " & op.GetDisplayName() & "!"))
End If End If
@ -4141,7 +4213,6 @@
p.OriginalShiny = CInt(p.IsShiny.ToNumberString()) p.OriginalShiny = CInt(p.IsShiny.ToNumberString())
p.OriginalMoves = New List(Of BattleSystem.Attack) p.OriginalMoves = New List(Of BattleSystem.Attack)
p.OriginalMoves.AddRange(p.Attacks.ToArray()) p.OriginalMoves.AddRange(p.Attacks.ToArray())
p.OriginalAbility = Ability.GetAbilityByID(p.Ability.ID)
'Apply new stats: 'Apply new stats:
p.Number = op.Number p.Number = op.Number
@ -4673,6 +4744,11 @@
HPChange = CInt(.OwnPokemon.MaxHP / 8) HPChange = CInt(.OwnPokemon.MaxHP / 8)
HPMessage = "Dry Skin" HPMessage = "Dry Skin"
End If End If
Case "solar power"
If .FieldEffects.Weather = BattleWeather.WeatherTypes.Sunny Then
HPChange = -CInt(.OwnPokemon.MaxHP / 8)
HPMessage = "Solar Power"
End If
Case "rain dish" Case "rain dish"
If .FieldEffects.Weather = BattleWeather.WeatherTypes.Rain Then If .FieldEffects.Weather = BattleWeather.WeatherTypes.Rain Then
HPChange = CInt(.OwnPokemon.MaxHP / 16) HPChange = CInt(.OwnPokemon.MaxHP / 16)
@ -5402,6 +5478,11 @@
HPChange = CInt(.OppPokemon.MaxHP / 8) HPChange = CInt(.OppPokemon.MaxHP / 8)
HPMessage = "Dry Skin" HPMessage = "Dry Skin"
End If End If
Case "solar power"
If .FieldEffects.Weather = BattleWeather.WeatherTypes.Sunny Then
HPChange = -CInt(.OppPokemon.MaxHP / 8)
HPMessage = "Solar Power"
End If
Case "rain dish" Case "rain dish"
If .FieldEffects.Weather = BattleWeather.WeatherTypes.Rain Then If .FieldEffects.Weather = BattleWeather.WeatherTypes.Rain Then
HPChange = CInt(.OppPokemon.MaxHP / 16) HPChange = CInt(.OppPokemon.MaxHP / 16)

View File

@ -976,7 +976,7 @@
Return True Return True
End Function End Function
Public Shared Function CalculateDamage(ByVal Attack As Attack, ByVal Critical As Boolean, ByVal Own As Boolean, ByVal targetPokemon As Boolean, ByVal BattleScreen As BattleScreen) As Integer Public Shared Function CalculateDamage(ByVal Attack As Attack, ByVal Critical As Boolean, ByVal Own As Boolean, ByVal targetPokemon As Boolean, ByVal BattleScreen As BattleScreen, Optional ByVal ExtraParameter As String = "") As Integer
Dim p As Pokemon = Nothing Dim p As Pokemon = Nothing
Dim Op As Pokemon = Nothing Dim Op As Pokemon = Nothing
If Own = True Then If Own = True Then
@ -1221,6 +1221,10 @@
If Attack.Type.Type = Element.Types.Fairy Then If Attack.Type.Type = Element.Types.Fairy Then
UA = 1.3F UA = 1.3F
End If End If
Case "parental bond"
If ExtraParameter = "parental bond" Then
UA = 0.25
End If
Case Else Case Else
UA = 1.0F UA = 1.0F
End Select End Select

View File

@ -405,6 +405,10 @@
Return New Abilities.Pixilate Return New Abilities.Pixilate
Case 183 Case 183
Return New Abilities.Gooey Return New Abilities.Gooey
Case 184
Return New Abilities.Aerilate
Case 185
Return New Abilities.ParentalBond
Case 186 Case 186
Return New Abilities.DarkAura Return New Abilities.DarkAura
Case 187 Case 187

View File

@ -1559,8 +1559,8 @@
''' </summary> ''' </summary>
''' <param name="Own">If the own Pokémon used the move.</param> ''' <param name="Own">If the own Pokémon used the move.</param>
''' <param name="BattleScreen">Reference to the BattleScreen.</param> ''' <param name="BattleScreen">Reference to the BattleScreen.</param>
Public Overridable Function GetDamage(ByVal Critical As Boolean, ByVal Own As Boolean, ByVal targetPokemon As Boolean, ByVal BattleScreen As BattleScreen) As Integer Public Overridable Function GetDamage(ByVal Critical As Boolean, ByVal Own As Boolean, ByVal targetPokemon As Boolean, ByVal BattleScreen As BattleScreen, Optional ByVal ExtraParameter As String = "") As Integer
Return BattleCalculation.CalculateDamage(Me, Critical, Own, targetPokemon, BattleScreen) Return BattleCalculation.CalculateDamage(Me, Critical, Own, targetPokemon, BattleScreen, ExtraParameter)
End Function End Function
''' <summary> ''' <summary>

View File

@ -52,7 +52,7 @@
'#End '#End
End Sub End Sub
Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen) As Integer Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen, Optional ExtraParameter As String = "") As Integer
Return 40 Return 40
End Function End Function

View File

@ -80,7 +80,7 @@
Return True Return True
End Function End Function
Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen) As Integer Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen, Optional ExtraParameter As String = "") As Integer
Dim damage As Integer = BattleScreen.FieldEffects.OwnLastDamage Dim damage As Integer = BattleScreen.FieldEffects.OwnLastDamage
If Own = True Then If Own = True Then
damage = BattleScreen.FieldEffects.OppLastDamage damage = BattleScreen.FieldEffects.OppLastDamage

View File

@ -52,7 +52,7 @@
'#End '#End
End Sub End Sub
Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen) As Integer Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen, Optional ExtraParameter As String = "") As Integer
Dim p As Pokemon = BattleScreen.OwnPokemon Dim p As Pokemon = BattleScreen.OwnPokemon
If Own = False Then If Own = False Then
p = BattleScreen.OppPokemon p = BattleScreen.OppPokemon

View File

@ -52,7 +52,7 @@
'#End '#End
End Sub End Sub
Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen) As Integer Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen, Optional ExtraParameter As String = "") As Integer
Dim p As Pokemon = BattleScreen.OwnPokemon Dim p As Pokemon = BattleScreen.OwnPokemon
If Own = False Then If Own = False Then
p = BattleScreen.OppPokemon p = BattleScreen.OppPokemon

View File

@ -79,7 +79,7 @@
End If End If
End Function End Function
Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen) As Integer Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen, Optional ExtraParameter As String = "") As Integer
If Own = True Then If Own = True Then
Dim damage As Integer = BattleScreen.FieldEffects.OwnBideDamage * 2 Dim damage As Integer = BattleScreen.FieldEffects.OwnBideDamage * 2
BattleScreen.FieldEffects.OwnBideDamage = 0 BattleScreen.FieldEffects.OwnBideDamage = 0

View File

@ -52,10 +52,10 @@ Namespace BattleSystem.Moves.Normal
'#End '#End
End Sub End Sub
Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen) As Integer Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen, Optional ExtraParameter As String = "") As Integer
Dim p As Pokemon = BattleScreen.OwnPokemon Dim p As Pokemon = BattleScreen.OwnPokemon
Dim o As Pokemon = BattleScreen.OppPokemon Dim o As Pokemon = BattleScreen.OppPokemon
If own = False Then If Own = False Then
p = BattleScreen.OppPokemon p = BattleScreen.OppPokemon
o = BattleScreen.OwnPokemon o = BattleScreen.OwnPokemon
End If End If
@ -68,6 +68,6 @@ Namespace BattleSystem.Moves.Normal
Return (o.HP - p.HP) Return (o.HP - p.HP)
End Function End Function
End Class End Class
End Namespace End Namespace

View File

@ -55,7 +55,7 @@
Me.AIField2 = AIField.Nothing Me.AIField2 = AIField.Nothing
End Sub End Sub
Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen) As Integer Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen, Optional ExtraParameter As String = "") As Integer
Dim d As Integer = MyBase.GetDamage(Critical, Own, targetPokemon, BattleScreen) Dim d As Integer = MyBase.GetDamage(Critical, Own, targetPokemon, BattleScreen)
Dim subst As Integer = BattleScreen.FieldEffects.OppSubstitute Dim subst As Integer = BattleScreen.FieldEffects.OppSubstitute

View File

@ -52,7 +52,7 @@
'#End '#End
End Sub End Sub
Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen) As Integer Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen, Optional ExtraParameter As String = "") As Integer
Return 20 Return 20
End Function End Function

View File

@ -52,7 +52,7 @@
'#End '#End
End Sub End Sub
Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen) As Integer Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen, Optional ExtraParameter As String = "") As Integer
Dim op As Pokemon = BattleScreen.OppPokemon Dim op As Pokemon = BattleScreen.OppPokemon
If Own = False Then If Own = False Then
op = BattleScreen.OwnPokemon op = BattleScreen.OwnPokemon

View File

@ -79,7 +79,7 @@
p.OriginalShiny = CInt(p.IsShiny.ToNumberString()) p.OriginalShiny = CInt(p.IsShiny.ToNumberString())
p.OriginalMoves = New List(Of BattleSystem.Attack) p.OriginalMoves = New List(Of BattleSystem.Attack)
p.OriginalMoves.AddRange(p.Attacks.ToArray()) p.OriginalMoves.AddRange(p.Attacks.ToArray())
p.OriginalAbility = Ability.GetAbilityByID(p.Ability.ID)
'Apply new stats: 'Apply new stats:
p.Number = op.Number p.Number = op.Number

View File

@ -76,7 +76,7 @@
Return True Return True
End Function End Function
Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen) As Integer Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen, Optional ExtraParameter As String = "") As Integer
Dim damage As Integer = BattleScreen.FieldEffects.OwnLastDamage Dim damage As Integer = BattleScreen.FieldEffects.OwnLastDamage
If Own = True Then If Own = True Then
damage = BattleScreen.FieldEffects.OppLastDamage damage = BattleScreen.FieldEffects.OppLastDamage

View File

@ -52,7 +52,7 @@
'#End '#End
End Sub End Sub
Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen) As Integer Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen, Optional ExtraParameter As String = "") As Integer
Dim p As Pokemon = BattleScreen.OwnPokemon Dim p As Pokemon = BattleScreen.OwnPokemon
If Own = False Then If Own = False Then
p = BattleScreen.OppPokemon p = BattleScreen.OppPokemon

View File

@ -63,10 +63,6 @@ Namespace BattleSystem.Moves.Psychic
op = BattleScreen.OwnPokemon op = BattleScreen.OwnPokemon
End If End If
If p.OriginalAbility Is Nothing Then
p.OriginalAbility = p.Ability
End If
p.Ability = New Ability(op.Ability.ID, op.Ability.Name, op.Ability.Description) p.Ability = New Ability(op.Ability.ID, op.Ability.Name, op.Ability.Description)
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " copies " & op.Ability.Name & " from " & op.GetDisplayName() & ".")) BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " copies " & op.Ability.Name & " from " & op.GetDisplayName() & "."))

View File

@ -69,9 +69,6 @@ Namespace BattleSystem.Moves.Psychic
Dim pAbility As Integer = p.Ability.ID Dim pAbility As Integer = p.Ability.ID
Dim opAbility As Integer = op.Ability.ID Dim opAbility As Integer = op.Ability.ID
p.OriginalAbility = Ability.GetAbilityByID(p.Ability.ID)
op.OriginalAbility = Ability.GetAbilityByID(op.Ability.ID)
p.Ability = Ability.GetAbilityByID(opAbility) p.Ability = Ability.GetAbilityByID(opAbility)
op.Ability = Ability.GetAbilityByID(pAbility) op.Ability = Ability.GetAbilityByID(pAbility)

View File

@ -77,7 +77,7 @@
Return True Return True
End Function End Function
Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen) As Integer Public Overrides Function GetDamage(Critical As Boolean, Own As Boolean, targetPokemon As Boolean, BattleScreen As BattleScreen, Optional ExtraParameter As String = "") As Integer
If Own = True Then If Own = True Then
Return CInt(BattleScreen.FieldEffects.OppLastDamage * 1.5) Return CInt(BattleScreen.FieldEffects.OppLastDamage * 1.5)
Else Else

View File

@ -49,6 +49,7 @@ Namespace Items.Standard
End While End While
p.Ability = Ability.GetAbilityByID(p.NewAbilities(newAbility).ID) p.Ability = Ability.GetAbilityByID(p.NewAbilities(newAbility).ID)
p.SetOriginalAbility()
Screen.TextBox.Show(p.GetDisplayName() & " forgot how~to use " & oldAbilityName & ".*It learned~" & p.NewAbilities(newAbility).Name & " instead." & RemoveItem()) Screen.TextBox.Show(p.GetDisplayName() & " forgot how~to use " & oldAbilityName & ".*It learned~" & p.NewAbilities(newAbility).Name & " instead." & RemoveItem())
Return True Return True

View File

@ -1012,10 +1012,7 @@ Public Class Pokemon
Me._originalMoves = Nothing Me._originalMoves = Nothing
End If End If
If Not Me._originalAbility Is Nothing Then Me.Ability = Me._originalAbility
Me.Ability = Me._originalAbility
Me._originalAbility = Nothing
End If
'If Not Me._originalItem Is Nothing Then 'If Not Me._originalItem Is Nothing Then
' Me.Item = P3D.Item.GetItemByID(Me._originalItem.ID) ' Me.Item = P3D.Item.GetItemByID(Me._originalItem.ID)
@ -1031,11 +1028,12 @@ Public Class Pokemon
'Just use these subs when doing/reverting mega evolutions. 'Just use these subs when doing/reverting mega evolutions.
Public NormalAbility As Ability = New Abilities.Stench Public NormalAbility As Ability = New Abilities.Stench
Public Sub LoadAltAbility() Public Sub LoadAltAbility()
NormalAbility = Ability NormalAbility = OriginalAbility
Me.Ability = NewAbilities(0) Me.Ability = NewAbilities(0)
End Sub End Sub
Public Sub RestoreAbility() Public Sub RestoreAbility()
Me.Ability = NormalAbility Me.Ability = NormalAbility
SetOriginalAbility()
End Sub End Sub
#End Region #End Region
@ -1118,16 +1116,14 @@ Public Class Pokemon
''' <summary> ''' <summary>
''' The Pokémon's original ability. ''' The Pokémon's original ability.
''' </summary> ''' </summary>
Public Property OriginalAbility() As Ability Public ReadOnly Property OriginalAbility() As Ability
Get Get
Return Me._originalAbility Return Me._originalAbility
End Get End Get
Set(value As Ability)
If Me._originalAbility Is Nothing Then
Me._originalAbility = value
End If
End Set
End Property End Property
Public Sub SetOriginalAbility()
Me._originalAbility = Ability
End Sub
''' <summary> ''' <summary>
''' The Pokémon's original hold item. ''' The Pokémon's original hold item.
@ -1579,6 +1575,8 @@ Public Class Pokemon
Me.OT = tagValue Me.OT = tagValue
Case "ability" Case "ability"
Me.Ability = P3D.Ability.GetAbilityByID(CInt(tagValue)) Me.Ability = P3D.Ability.GetAbilityByID(CInt(tagValue))
'is this relevant for the client in PvP?
SetOriginalAbility()
Me.NormalAbility = Ability Me.NormalAbility = Ability
Case "status" Case "status"
Select Case tagValue Select Case tagValue
@ -1767,6 +1765,7 @@ Public Class Pokemon
If Me.Ability Is Nothing Then If Me.Ability Is Nothing Then
Me.Ability = Me.NewAbilities(Core.Random.Next(0, Me.NewAbilities.Count)) Me.Ability = Me.NewAbilities(Core.Random.Next(0, Me.NewAbilities.Count))
SetOriginalAbility()
End If End If
Dim Data As String = "{""Pokemon""[" & Me.Number & "]}" & Dim Data As String = "{""Pokemon""[" & Me.Number & "]}" &
@ -1827,8 +1826,10 @@ Public Class Pokemon
If Screen.Level IsNot Nothing Then If Screen.Level IsNot Nothing Then
If Screen.Level.HiddenAbilityChance > Core.Random.Next(0, 100) And Me.HasHiddenAbility = True Then If Screen.Level.HiddenAbilityChance > Core.Random.Next(0, 100) And Me.HasHiddenAbility = True Then
Me.Ability = P3D.Ability.GetAbilityByID(Me.HiddenAbility.ID) Me.Ability = P3D.Ability.GetAbilityByID(Me.HiddenAbility.ID)
SetOriginalAbility()
Else Else
Me.Ability = P3D.Ability.GetAbilityByID(Me.NewAbilities(Core.Random.Next(0, Me.NewAbilities.Count)).ID) Me.Ability = P3D.Ability.GetAbilityByID(Me.NewAbilities(Core.Random.Next(0, Me.NewAbilities.Count)).ID)
SetOriginalAbility()
End If End If
End If End If

Binary file not shown.