Fixed Mega Evolution not reverting when the pokemon faints

This commit is contained in:
CaptainSegis 2018-03-25 19:44:21 -05:00
parent 096fc52ec8
commit b9c39c07ae
1 changed files with 14 additions and 0 deletions

View File

@ -2331,6 +2331,20 @@
message = p.GetDisplayName() & " fainted!"
End If
BattleScreen.BattleQuery.Add(New TextQueryObject(message))
Dim str = p.AdditionalData.ToLower()
Select Case str
Case "mega", "mega_x", "mega_y", "primal", "blade"
p.AdditionalData = PokemonForms.GetInitialAdditionalData(p)
p.ReloadDefinitions()
p.CalculateStats()
If str <> "blade" Then
p.RestoreAbility() 'currently only used for mega evolutions
End If
End Select
If Not p.Ability Is Nothing Then
p.Ability.EndBattle(p)
End If
End Sub
#Region "Applystuff"