Fixed Transform, made PvP data exchange methods somewhat more robust. Added data catching for PvP in debug mode.

This commit is contained in:
CaptainSegis 2017-09-20 02:17:09 -05:00
parent f35af71a36
commit 2068159522
9 changed files with 212 additions and 46 deletions

View File

@ -149,6 +149,7 @@
<Compile Include="Battle\BattleSystemV2\PokemonProfile.vb" /> <Compile Include="Battle\BattleSystemV2\PokemonProfile.vb" />
<Compile Include="Battle\BattleSystemV2\QueryObjects\CameraQueryObject.vb" /> <Compile Include="Battle\BattleSystemV2\QueryObjects\CameraQueryObject.vb" />
<Compile Include="Battle\BattleSystemV2\QueryObjects\ChoosePokemonQueryObject.vb" /> <Compile Include="Battle\BattleSystemV2\QueryObjects\ChoosePokemonQueryObject.vb" />
<Compile Include="Battle\BattleSystemV2\QueryObjects\AfterFaintQueryObject.vb" />
<Compile Include="Battle\BattleSystemV2\QueryObjects\DelayQueryObject.vb" /> <Compile Include="Battle\BattleSystemV2\QueryObjects\DelayQueryObject.vb" />
<Compile Include="Battle\BattleSystemV2\QueryObjects\DisplayLevelUpQueryObject.vb" /> <Compile Include="Battle\BattleSystemV2\QueryObjects\DisplayLevelUpQueryObject.vb" />
<Compile Include="Battle\BattleSystemV2\QueryObjects\EndBattleQueryObject.vb" /> <Compile Include="Battle\BattleSystemV2\QueryObjects\EndBattleQueryObject.vb" />
@ -1691,7 +1692,6 @@
<Compile Include="Screens\MapPreview\MapPreviewCamera.vb" /> <Compile Include="Screens\MapPreview\MapPreviewCamera.vb" />
<Compile Include="Screens\MapPreview\MapPreviewScreen.vb" /> <Compile Include="Screens\MapPreview\MapPreviewScreen.vb" />
<Compile Include="Screens\MapScreen.vb" /> <Compile Include="Screens\MapScreen.vb" />
<Compile Include="Screens\NewGameScreen.vb" />
<Compile Include="Screens\NewMenuScreen.vb" /> <Compile Include="Screens\NewMenuScreen.vb" />
<Compile Include="Screens\NewTrainerScreen.vb" /> <Compile Include="Screens\NewTrainerScreen.vb" />
<Compile Include="Screens\OptionScreen.vb" /> <Compile Include="Screens\OptionScreen.vb" />

View File

@ -4164,7 +4164,10 @@
p.IsShiny = op.IsShiny p.IsShiny = op.IsShiny
p.Attacks.Clear() p.Attacks.Clear()
p.Attacks.AddRange(op.Attacks.ToArray()) For i = 0 To op.Attacks.Count - 1
p.Attacks.Add(Attack.GetAttackByID(op.Attacks(i).ID))
p.Attacks(i).CurrentPP = 5
Next
p.Ability = Ability.GetAbilityByID(op.Ability.ID) p.Ability = Ability.GetAbilityByID(op.Ability.ID)
@ -4447,7 +4450,8 @@
BattleScreen.BattleQuery.AddRange({cq1, cq2}) BattleScreen.BattleQuery.AddRange({cq1, cq2})
StartRound(BattleScreen) StartRound(BattleScreen)
BattleScreen.ClearMenuTime = True BattleScreen.ClearMainMenuTime = True
BattleScreen.ClearMoveMenuTime = True
Case 1 'Own round Case 1 'Own round
EndTurnOwn(BattleScreen) EndTurnOwn(BattleScreen)
Case 2 'Opp round Case 2 'Opp round

View File

@ -561,9 +561,9 @@
Private Sub UpdateMainMenu(ByRef BattleScreen As BattleScreen) Private Sub UpdateMainMenu(ByRef BattleScreen As BattleScreen)
If BattleScreen.ClearMenuTime = True Then If BattleScreen.ClearMainMenuTime = True Then
_mainMenuItemList.Clear() _mainMenuItemList.Clear()
BattleScreen.ClearMenuTime = False BattleScreen.ClearMainMenuTime = False
End If End If
If _mainMenuItemList.Count = 0 Then If _mainMenuItemList.Count = 0 Then
@ -816,6 +816,11 @@
End Sub End Sub
Private Sub UpdateMoveMenu(ByVal BattleScreen As BattleScreen) Private Sub UpdateMoveMenu(ByVal BattleScreen As BattleScreen)
If BattleScreen.ClearMoveMenuTime = True Then
_moveMenuItemList.Clear()
BattleScreen.ClearMoveMenuTime = False
End If
If _moveMenuChoseMove = True Then If _moveMenuChoseMove = True Then
_moveMenuAlpha -= 15 _moveMenuAlpha -= 15
If _moveMenuAlpha <= 0 Then If _moveMenuAlpha <= 0 Then

View File

@ -15,7 +15,8 @@
#Region "BattleValues" #Region "BattleValues"
Public IsChoiced As Boolean = False Public IsChoiced As Boolean = False
Public ClearMenuTime As Boolean = False Public ClearMainMenuTime As Boolean = False
Public ClearMoveMenuTime As Boolean = False
Public Shared CanCatch As Boolean = True Public Shared CanCatch As Boolean = True
Public Shared CanRun As Boolean = True Public Shared CanRun As Boolean = True
Public Shared CanBlackout As Boolean = True Public Shared CanBlackout As Boolean = True
@ -854,7 +855,8 @@ nextIndex:
ClientWaitForData = False ClientWaitForData = False
ReceivedPokemonData = False ReceivedPokemonData = False
BattleMenu.Reset() BattleMenu.Reset()
ClearMenuTime = True ClearMainMenuTime = True
ClearMoveMenuTime = True
BattleMenu.Update(Me) BattleMenu.Update(Me)
End If End If
End If End If
@ -1346,8 +1348,15 @@ nextIndex:
Public Shared Sub ReceiveHostEndRoundData(ByVal data As String) Public Shared Sub ReceiveHostEndRoundData(ByVal data As String)
Dim newQueries As New List(Of String) Dim newQueries As New List(Of String)
Dim tempData As String = "" Dim tempData As String = ""
Dim cData As String = data
Dim cData As String = data
If GameController.IS_DEBUG_ACTIVE Then
If Directory.Exists(GameController.GamePath & "\PvP Log\") = False Then
Directory.CreateDirectory(GameController.GamePath & "\PvP Log\")
End If
Dim shownData As String = data.Replace("}{", "}" & vbNewLine & "{").Replace("}|{", "}|" & vbNewLine & vbNewLine & "{")
IO.File.WriteAllText(GameController.GamePath & "\PvP Log\HostEndRoundData.dat", shownData)
End If
'Converts the single string received as data into a list of string 'Converts the single string received as data into a list of string
While cData.Length > 0 While cData.Length > 0
If cData(0).ToString() = "|" AndAlso tempData(tempData.Length - 1).ToString() = "}" Then If cData(0).ToString() = "|" AndAlso tempData(tempData.Length - 1).ToString() = "}" Then
@ -1430,11 +1439,18 @@ nextIndex:
Logger.Debug("[Battle]: The host's pokemon faints") Logger.Debug("[Battle]: The host's pokemon faints")
OppFaint = True OppFaint = True
Exit Sub Exit Sub
End If ElseIf data = "-ClientFainted-" Then
If data = "-ClientFainted-" Then
Logger.Debug("[Battle]: The client's pokemon faints") Logger.Debug("[Battle]: The client's pokemon faints")
OwnFaint = True OwnFaint = True
Exit Sub Exit Sub
Else
If GameController.IS_DEBUG_ACTIVE Then
If Directory.Exists(GameController.GamePath & "\PvP Log\") = False Then
Directory.CreateDirectory(GameController.GamePath & "\PvP Log\")
End If
Dim shownData As String = data.Replace("}{", "}" & vbNewLine & "{").Replace("}|{", "}|" & vbNewLine & vbNewLine & "{")
IO.File.WriteAllText(GameController.GamePath & "\PvP Log\HostData.dat", shownData)
End If
End If End If
End If End If
@ -1456,7 +1472,10 @@ nextIndex:
If s.Identification = Identifications.BattleScreen Then If s.Identification = Identifications.BattleScreen Then
CType(s, BattleScreen).BattleQuery.Clear() CType(s, BattleScreen).BattleQuery.Clear()
For Each q As String In newQueries For Each q As String In newQueries
CType(s, BattleScreen).BattleQuery.Add(QueryObject.FromString(q)) Dim Query As QueryObject = QueryObject.FromString(q)
If Query IsNot Nothing Then
CType(s, BattleScreen).BattleQuery.Add(Query)
End If
Next Next
For i = 0 To 99 For i = 0 To 99
CType(s, BattleScreen).InsertCasualCameramove() CType(s, BattleScreen).InsertCasualCameramove()
@ -1487,6 +1506,14 @@ nextIndex:
Logger.Debug("[Battle]: Received Client data") Logger.Debug("[Battle]: Received Client data")
ReceivedInput = data ReceivedInput = data
If GameController.IS_DEBUG_ACTIVE Then
If Directory.Exists(GameController.GamePath & "\PvP Log\") = False Then
Directory.CreateDirectory(GameController.GamePath & "\PvP Log\")
End If
Dim shownData As String = data.Replace("}{", "}" & vbNewLine & "{").Replace("}|{", "}|" & vbNewLine & vbNewLine & "{")
IO.File.WriteAllText(GameController.GamePath & "\PvP Log\ClientCommand.dat", shownData)
End If
Dim s As Screen = Core.CurrentScreen Dim s As Screen = Core.CurrentScreen
While Not s.PreScreen Is Nothing And s.Identification <> Identifications.BattleScreen While Not s.PreScreen Is Nothing And s.Identification <> Identifications.BattleScreen
s = s.PreScreen s = s.PreScreen
@ -1532,6 +1559,13 @@ nextIndex:
End If End If
d &= p.GetSaveData() d &= p.GetSaveData()
Next Next
If GameController.IS_DEBUG_ACTIVE Then
If Directory.Exists(GameController.GamePath & "\PvP Log\") = False Then
Directory.CreateDirectory(GameController.GamePath & "\PvP Log\")
End If
Dim shownData As String = d.Replace("}{", "}" & vbNewLine & "{").Replace("}|{", "}|" & vbNewLine & vbNewLine & "{")
IO.File.WriteAllText(GameController.GamePath & "\PvP Log\SentEndRoundData.dat", shownData)
End If
Logger.Debug("[Battle]: Sent End Round data") Logger.Debug("[Battle]: Sent End Round data")
Core.ServersManager.ServerConnection.SendPackage(New Servers.Package(Servers.Package.PackageTypes.BattlePokemonData, Core.ServersManager.ID, Servers.Package.ProtocolTypes.TCP, {PartnerNetworkID.ToString(), d}.ToList())) Core.ServersManager.ServerConnection.SendPackage(New Servers.Package(Servers.Package.PackageTypes.BattlePokemonData, Core.ServersManager.ID, Servers.Package.ProtocolTypes.TCP, {PartnerNetworkID.ToString(), d}.ToList()))
End Sub End Sub
@ -1558,6 +1592,13 @@ nextIndex:
Me.TempPVPBattleQuery.Clear() Me.TempPVPBattleQuery.Clear()
Logger.Debug("[Battle]: Sent Host Query") Logger.Debug("[Battle]: Sent Host Query")
If GameController.IS_DEBUG_ACTIVE Then
If Directory.Exists(GameController.GamePath & "\PvP Log\") = False Then
Directory.CreateDirectory(GameController.GamePath & "\PvP Log\")
End If
Dim shownData As String = d.Replace("}{", "}" & vbNewLine & "{").Replace("}|{", "}|" & vbNewLine & vbNewLine & "{")
IO.File.WriteAllText(GameController.GamePath & "\PvP Log\SentHostQuery.dat", shownData)
End If
Core.ServersManager.ServerConnection.SendPackage(New Servers.Package(Servers.Package.PackageTypes.BattleHostData, Core.ServersManager.ID, Servers.Package.ProtocolTypes.TCP, {PartnerNetworkID.ToString(), d}.ToList())) Core.ServersManager.ServerConnection.SendPackage(New Servers.Package(Servers.Package.PackageTypes.BattleHostData, Core.ServersManager.ID, Servers.Package.ProtocolTypes.TCP, {PartnerNetworkID.ToString(), d}.ToList()))
SentHostData = True SentHostData = True
End Sub End Sub

View File

@ -0,0 +1,44 @@
Namespace BattleSystem
Public Class AfterFaintQueryObject
Inherits QueryObject
Private _delay As Integer = 0
Public Sub New(ByVal Delay As Integer)
MyBase.New(QueryTypes.Delay)
Me._delay = Delay
End Sub
Public Overrides Sub Update(BV2Screen As BattleScreen)
If Me._delay > 0 Then
Me._delay -= 1
End If
End Sub
Public Overrides ReadOnly Property IsReady As Boolean
Get
If Me._delay = 0 Then
Return True
End If
Return False
End Get
End Property
Public Overrides Function NeedForPVPData() As Boolean
Return True
End Function
Public Shared Shadows Function FromString(input As String) As QueryObject
Return New DelayQueryObject(CInt(input))
End Function
Public Overrides Function ToString() As String
Return "{DELAY|" & Me._delay.ToString() & "}"
End Function
End Class
End Namespace

View File

@ -64,6 +64,7 @@
Dim Type As String = input.Remove(input.IndexOf("|")) Dim Type As String = input.Remove(input.IndexOf("|"))
Dim Data As String = input.Remove(0, input.IndexOf("|") + 1) Dim Data As String = input.Remove(0, input.IndexOf("|") + 1)
Try
Select Case Type Select Case Type
Case "CAMERA" Case "CAMERA"
Return CameraQueryObject.FromString(Data) Return CameraQueryObject.FromString(Data)
@ -88,6 +89,12 @@
Case "TRIGGERNEWROUNDPVP" Case "TRIGGERNEWROUNDPVP"
Return TriggerNewRoundPVPQueryObject.FromString(Data) Return TriggerNewRoundPVPQueryObject.FromString(Data)
End Select End Select
Catch ex As Exception
Logger.Debug("QueryObject.vb: Wrong data received, could not convert to [" & Type & "] query object. Return Nothing.")
Logger.Debug(input)
Return Nothing
End Try
End If End If
Return Nothing Return Nothing
End Function End Function

View File

@ -536,10 +536,10 @@ Namespace GameJolt
Next Next
If exists(ID_BERRIES) = False Then If exists(ID_BERRIES) = False Then
_berries = NewGameScreen.GetBerryData() _berries = GetBerryData()
End If End If
If exists(ID_OPTIONS) = False Then If exists(ID_OPTIONS) = False Then
_options = NewGameScreen.GetOptionsData() _options = GetOptionsData()
End If End If
If exists(ID_PLAYER) = False Then If exists(ID_PLAYER) = False Then
_player = GetPlayerData() _player = GetPlayerData()
@ -623,7 +623,7 @@ Namespace GameJolt
_berries = data.Replace("\""", """") _berries = data.Replace("\""", """")
Else Else
_berries = NewGameScreen.GetBerryData() _berries = GetBerryData()
End If End If
_downloadedFlags(ID_BERRIES) = True _downloadedFlags(ID_BERRIES) = True
@ -713,7 +713,7 @@ Namespace GameJolt
_options = data.Replace("\""", """") _options = data.Replace("\""", """")
Else Else
_options = NewGameScreen.GetOptionsData() _options = GetOptionsData()
End If End If
_downloadedFlags(ID_OPTIONS) = True _downloadedFlags(ID_OPTIONS) = True
@ -963,13 +963,13 @@ Namespace GameJolt
Gender = "0" Gender = "0"
_apricorns = "" _apricorns = ""
_berries = NewGameScreen.GetBerryData() _berries = GetBerryData()
_box = "" _box = ""
_daycare = "" _daycare = ""
_itemData = "" _itemData = ""
_items = "" _items = ""
_NPC = "" _NPC = ""
_options = NewGameScreen.GetOptionsData() _options = GetOptionsData()
_party = "" _party = ""
_player = GetPlayerData() _player = GetPlayerData()
_pokedex = "" _pokedex = ""
@ -980,6 +980,44 @@ Namespace GameJolt
_statistics = "" _statistics = ""
End Sub End Sub
Public Shared Function GetOptionsData() As String
Dim s As String = "FOV|50" & vbNewLine &
"TextSpeed|2" & vbNewLine &
"MouseSpeed|12"
Return s
End Function
Public Shared Function GetBerryData() As String
Dim s As String = "{route29.dat|13,0,5|6|2|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{route29.dat|14,0,5|6|2|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{route29.dat|15,0,5|6|2|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{azalea.dat|9,0,3|0|2|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{azalea.dat|9,0,4|1|1|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{azalea.dat|9,0,5|0|2|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{route30.dat|7,0,41|10|1|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{route30.dat|14,0,5|2|1|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{route30.dat|15,0,5|6|2|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{route30.dat|16,0,5|2|1|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{routes\route35.dat|0,0,4|7|2|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{routes\route35.dat|1,0,4|8|2|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{route36.dat|37,0,7|0|1|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{route36.dat|38,0,7|4|1|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{route36.dat|39,0,7|3|2|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{route39.dat|8,0,2|9|1|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{route39.dat|8,0,3|6|1|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{route38.dat|13,0,12|16|2|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{route38.dat|14,0,12|23|1|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{route38.dat|15,0,12|16|2|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{routes\route43.dat|13,0,45|23|2|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{routes\route43.dat|13,0,46|24|2|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{routes\route43.dat|13,0,47|25|2|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{safarizone\main.dat|3,0,11|5|2|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{safarizone\main.dat|4,0,11|0|2|0|2012,9,21,4,0,0|1}" & vbNewLine &
"{safarizone\main.dat|5,0,11|6|3|0|2012,9,21,4,0,0|1}"
Return s
End Function
End Class End Class
Public Class StaffProfile Public Class StaffProfile
@ -993,6 +1031,7 @@ Namespace GameJolt
Staff.Add(New StaffProfile("33742", "Prince", "princevade", {StaffArea.GlobalAdmin, StaffArea.GTSAdmin, StaffArea.GTSDaily, StaffArea.MailManagement})) Staff.Add(New StaffProfile("33742", "Prince", "princevade", {StaffArea.GlobalAdmin, StaffArea.GTSAdmin, StaffArea.GTSDaily, StaffArea.MailManagement}))
Staff.Add(New StaffProfile("1", "GameJolt", "cros", {})) Staff.Add(New StaffProfile("1", "GameJolt", "cros", {}))
Staff.Add(New StaffProfile("35947", "", "", {StaffArea.GTSDaily})) Staff.Add(New StaffProfile("35947", "", "", {StaffArea.GTSDaily}))
Staff.Add(New StaffProfile("541732", "The Captain", "", {StaffArea.GTSDaily}))
End Sub End Sub
Public Enum StaffArea Public Enum StaffArea

View File

@ -102,7 +102,10 @@
p.IsShiny = op.IsShiny p.IsShiny = op.IsShiny
p.Attacks.Clear() p.Attacks.Clear()
p.Attacks.AddRange(op.Attacks.ToArray()) For i = 0 To op.Attacks.Count - 1
p.Attacks.Add(GetAttackByID(op.Attacks(i).ID))
p.Attacks(i).CurrentPP = 5
Next
p.Ability = Ability.GetAbilityByID(op.Ability.ID) p.Ability = Ability.GetAbilityByID(op.Ability.ID)

View File

@ -1237,10 +1237,18 @@ Public Class Pokemon
For Each Tag As String In Data For Each Tag As String In Data
If Tag.Contains("{") = True And Tag.Contains("[") = True Then If Tag.Contains("{") = True And Tag.Contains("[") = True Then
Dim TagName As String = Tag.Remove(0, 2) Dim TagName As String = Tag.Remove(0, 2)
Try
TagName = TagName.Remove(TagName.IndexOf("""")) TagName = TagName.Remove(TagName.IndexOf(""""))
Catch ex As Exception
Logger.Debug("Pokemon.vb, GetPokemonByData: Wrong Pokemon data, symbol "" was missing")
End Try
Dim TagContent As String = Tag.Remove(0, Tag.IndexOf("[") + 1) Dim TagContent As String = Tag.Remove(0, Tag.IndexOf("[") + 1)
Try
TagContent = TagContent.Remove(TagContent.IndexOf("]")) TagContent = TagContent.Remove(TagContent.IndexOf("]"))
Catch ex As Exception
Logger.Debug("Pokemon.vb, GetPokemonByData: Wrong Pokemon data, symbol ] was missing")
End Try
If Tags.ContainsKey(TagName) = False Then If Tags.ContainsKey(TagName) = False Then
Tags.Add(TagName, TagContent) Tags.Add(TagName, TagContent)
@ -1514,10 +1522,20 @@ Public Class Pokemon
For Each Tag As String In Data For Each Tag As String In Data
If Tag.Contains("{") = True And Tag.Contains("[") = True Then If Tag.Contains("{") = True And Tag.Contains("[") = True Then
Dim TagName As String = Tag.Remove(0, 2) Dim TagName As String = Tag.Remove(0, 2)
Try
TagName = TagName.Remove(TagName.IndexOf("""")) TagName = TagName.Remove(TagName.IndexOf(""""))
Catch ex As Exception
Logger.Debug("Pokemon.vb, LoadData: Wrong Pokemon data, symbol "" was missing")
End Try
Dim TagContent As String = Tag.Remove(0, Tag.IndexOf("[") + 1) Dim TagContent As String = Tag.Remove(0, Tag.IndexOf("[") + 1)
Try
TagContent = TagContent.Remove(TagContent.IndexOf("]")) TagContent = TagContent.Remove(TagContent.IndexOf("]"))
Catch ex As Exception
Logger.Debug("Pokemon.vb, LoadData: Wrong Pokemon data, symbol ] was missing")
End Try
If Tags.ContainsKey(TagName) = False Then If Tags.ContainsKey(TagName) = False Then
Tags.Add(TagName, TagContent) Tags.Add(TagName, TagContent)
@ -1530,6 +1548,8 @@ Public Class Pokemon
Dim tagValue As String = Tags.Values(i) Dim tagValue As String = Tags.Values(i)
Select Case tagName.ToLower() Select Case tagName.ToLower()
Case "originalnumber"
Me.OriginalNumber = CInt(tagValue)
Case "experience" Case "experience"
Me.Experience = CInt(tagValue) Me.Experience = CInt(tagValue)
Case "gender" Case "gender"
@ -1750,6 +1770,7 @@ Public Class Pokemon
End If End If
Dim Data As String = "{""Pokemon""[" & Me.Number & "]}" & Dim Data As String = "{""Pokemon""[" & Me.Number & "]}" &
"{""OriginalNumber""[" & Me.OriginalNumber & "]}" &
"{""Experience""[" & Me.Experience & "]}" & "{""Experience""[" & Me.Experience & "]}" &
"{""Gender""[" & SaveGender & "]}" & "{""Gender""[" & SaveGender & "]}" &
"{""EggSteps""[" & Me.EggSteps & "]}" & "{""EggSteps""[" & Me.EggSteps & "]}" &
@ -2190,6 +2211,8 @@ Public Class Pokemon
If DoHP = True Then If DoHP = True Then
If Me.Number = 292 Then If Me.Number = 292 Then
Return 1 Return 1
ElseIf OriginalNumber <> -1 AndAlso OriginalNumber <> Number Then 'when transformed
Return CInt(Math.Floor((((IVStat + (2 * GetPokemonByID(OriginalNumber).BaseHP) + (EVStat / 4) + 100) * calcLevel) / 100) + 10))
Else Else
Return CInt(Math.Floor((((IVStat + (2 * baseStat) + (EVStat / 4) + 100) * calcLevel) / 100) + 10)) Return CInt(Math.Floor((((IVStat + (2 * baseStat) + (EVStat / 4) + 100) * calcLevel) / 100) + 10))
End If End If