|
|
|
@ -875,7 +875,7 @@ Public Class PokedexScreen
|
|
|
|
|
TempPokemonStorage.Clear()
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
#Region "Menus"
|
|
|
|
|
#Region "Menus"
|
|
|
|
|
|
|
|
|
|
Private Sub SelectMenu1(ByVal s As SelectMenu)
|
|
|
|
|
Select Case s.SelectedItem.ToLower()
|
|
|
|
@ -987,7 +987,7 @@ Public Class PokedexScreen
|
|
|
|
|
End Select
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
#End Region
|
|
|
|
|
#End Region
|
|
|
|
|
|
|
|
|
|
Private Class SelectMenu
|
|
|
|
|
|
|
|
|
@ -1278,7 +1278,7 @@ Public Class PokedexScreen
|
|
|
|
|
|
|
|
|
|
End Class
|
|
|
|
|
|
|
|
|
|
End Class
|
|
|
|
|
End Class
|
|
|
|
|
|
|
|
|
|
Public Class PokedexViewScreen
|
|
|
|
|
|
|
|
|
@ -1294,90 +1294,36 @@ Public Class PokedexViewScreen
|
|
|
|
|
Dim yOffset As Integer = 0
|
|
|
|
|
Dim FrontView As Boolean = True
|
|
|
|
|
|
|
|
|
|
Dim EvolutionLines As new List(Of EvolutionLinePokemon)
|
|
|
|
|
Dim minimumLevel As Integer = 0
|
|
|
|
|
Dim maximumLevel As Integer = 0
|
|
|
|
|
Dim EvolutionLineConnections As New List(Of PokemonEvolutionLine)
|
|
|
|
|
|
|
|
|
|
Dim GridMinimum As New Vector2(0, 0)
|
|
|
|
|
Dim GridMaximum As New Vector2(0, 0)
|
|
|
|
|
|
|
|
|
|
Dim HabitatList As New List(Of PokedexScreen.Habitat)
|
|
|
|
|
|
|
|
|
|
Class EvolutionLinePokemon
|
|
|
|
|
Class PokemonEvolutionLine
|
|
|
|
|
|
|
|
|
|
Public Level As Integer = 0
|
|
|
|
|
Public PokemonID As String = "0"
|
|
|
|
|
Public PokemonAD As String = ""
|
|
|
|
|
Public Evolutions As New List(Of EvolutionLinePokemon)
|
|
|
|
|
Public Forms As New List(Of EvolutionLinePokemon)
|
|
|
|
|
Public Devolution As EvolutionLinePokemon = Nothing
|
|
|
|
|
Public Pokemon As Pokemon = Nothing
|
|
|
|
|
Public ConnectionList As New List(Of Tuple(Of Integer, Integer, Pokemon))
|
|
|
|
|
|
|
|
|
|
Public Sub New(ByVal Level As Integer, ByVal pokemonID As String, ByVal vS As PokedexViewScreen, ByVal fromEvolution As String)
|
|
|
|
|
Me.Level = Level
|
|
|
|
|
Me.PokemonID = pokemonID
|
|
|
|
|
If pokemonID.Contains("_") Then
|
|
|
|
|
Me.PokemonAD = PokemonForms.GetAdditionalValueFromDataFile(pokemonID)
|
|
|
|
|
ElseIf pokemonID.Contains(";") Then
|
|
|
|
|
Me.PokemonID = pokemonID.GetSplit(0, ";")
|
|
|
|
|
Me.PokemonAD = pokemonID.GetSplit(1, ";")
|
|
|
|
|
End If
|
|
|
|
|
Me.Pokemon = Pokemon.GetPokemonByID(CInt(Me.PokemonID.GetSplit(0, "_")), Me.PokemonAD)
|
|
|
|
|
Public Sub New(ByVal GridPositions As List(Of Vector2), ByVal PokemonIDs As List(Of String))
|
|
|
|
|
If GridPositions.Count = PokemonIDs.Count Then
|
|
|
|
|
For i = 0 To PokemonIDs.Count - 1
|
|
|
|
|
Dim DexID As Integer
|
|
|
|
|
Dim DexAD As String = ""
|
|
|
|
|
|
|
|
|
|
If Me.Pokemon.EvolutionConditions.Count > 0 Then
|
|
|
|
|
Dim evolutions As New List(Of String)
|
|
|
|
|
For Each ev As EvolutionCondition In Me.Pokemon.EvolutionConditions
|
|
|
|
|
If evolutions.Contains(ev.Evolution) = False And fromEvolution <> ev.Evolution Then
|
|
|
|
|
evolutions.Add(ev.Evolution)
|
|
|
|
|
End If
|
|
|
|
|
Next
|
|
|
|
|
|
|
|
|
|
For Each ev As String In evolutions
|
|
|
|
|
If vS.maximumLevel < Me.Level + 1 Then
|
|
|
|
|
vS.maximumLevel = Me.Level + 1
|
|
|
|
|
End If
|
|
|
|
|
Me.Evolutions.Add(New EvolutionLinePokemon(Me.Level + 1, ev, vS, ""))
|
|
|
|
|
Next
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
If Me.Pokemon.DexForms.Count > 0 Then
|
|
|
|
|
For Each form As String In Me.Pokemon.DexForms
|
|
|
|
|
|
|
|
|
|
Dim formID As String = Me.Pokemon.Number.ToString
|
|
|
|
|
If form <> " " Then
|
|
|
|
|
If StringHelper.IsNumeric(form) = False Then
|
|
|
|
|
formID &= "_" & form
|
|
|
|
|
If PokemonIDs(i).Contains("_") Then
|
|
|
|
|
DexID = CInt(PokemonIDs(i).GetSplit(0, "_"))
|
|
|
|
|
DexAD = PokemonForms.GetAdditionalValueFromDataFile(PokemonIDs(i))
|
|
|
|
|
ElseIf PokemonIDs(i).Contains(";") Then
|
|
|
|
|
DexID = CInt(PokemonIDs(i).GetSplit(0, ";"))
|
|
|
|
|
DexAD = PokemonIDs(i).GetSplit(1, ";")
|
|
|
|
|
Else
|
|
|
|
|
formID = form
|
|
|
|
|
End If
|
|
|
|
|
DexID = CInt(PokemonIDs(i))
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
Dim formAD As String = ""
|
|
|
|
|
If form <> " " AndAlso StringHelper.IsNumeric(form) = False Then
|
|
|
|
|
formAD = PokemonForms.GetAdditionalValueFromDataFile(Me.PokemonID.GetSplit(0, "_") & "_" & form)
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
Dim formpokemon As Pokemon = Pokemon.GetPokemonByID(CInt(Me.PokemonID.GetSplit(0, "_")), formAD, True)
|
|
|
|
|
If formpokemon.EvolutionConditions.Count > 0 Then
|
|
|
|
|
Dim evolutions As New List(Of String)
|
|
|
|
|
For Each ev As EvolutionCondition In formpokemon.EvolutionConditions
|
|
|
|
|
If evolutions.Contains(ev.Evolution) = False And fromEvolution <> ev.Evolution Then
|
|
|
|
|
evolutions.Add(ev.Evolution)
|
|
|
|
|
End If
|
|
|
|
|
Next
|
|
|
|
|
|
|
|
|
|
For Each ev As String In evolutions
|
|
|
|
|
If vS.maximumLevel < Me.Level + 1 Then
|
|
|
|
|
vS.maximumLevel = Me.Level + 1
|
|
|
|
|
End If
|
|
|
|
|
Me.Evolutions.Add(New EvolutionLinePokemon(Me.Level + 1, ev, vS, ""))
|
|
|
|
|
Next
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
If vS.maximumLevel < Me.Level + 1 Then
|
|
|
|
|
vS.maximumLevel = Me.Level + 1
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Me.Forms.Add(New EvolutionLinePokemon(Me.Level + 1, formID, vS, ""))
|
|
|
|
|
|
|
|
|
|
Dim p As Pokemon = Pokemon.GetPokemonByID(DexID, DexAD)
|
|
|
|
|
Dim entry As New Tuple(Of Integer, Integer, Pokemon)(CInt(GridPositions(i).X), CInt(GridPositions(i).Y), p)
|
|
|
|
|
ConnectionList.Add(entry)
|
|
|
|
|
Next
|
|
|
|
|
End If
|
|
|
|
|
End Sub
|
|
|
|
@ -1414,92 +1360,131 @@ Public Class PokedexViewScreen
|
|
|
|
|
Me.EntryType = Pokedex.GetEntryType(Core.Player.PokedexData, dexID)
|
|
|
|
|
|
|
|
|
|
Me.GetYOffset()
|
|
|
|
|
Me.FillEvolutionLine()
|
|
|
|
|
Me.FillEvolutionGrid()
|
|
|
|
|
Me.FillHabitats()
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Private Sub FillEvolutionLine()
|
|
|
|
|
Dim evoID As String = Me.Pokemon.Number.ToString
|
|
|
|
|
Dim p As New EvolutionLinePokemon(0, evoID, Me, "")
|
|
|
|
|
|
|
|
|
|
If CInt(p.Pokemon.Devolution.GetSplit(0, "_")) > 0 Then
|
|
|
|
|
Dim devoID As String = p.Pokemon.Devolution
|
|
|
|
|
Dim devoAD As String = ""
|
|
|
|
|
If devoID.Contains("_") Then
|
|
|
|
|
devoAD = PokemonForms.GetAdditionalValueFromDataFile(p.Pokemon.Devolution)
|
|
|
|
|
Private Sub FillEvolutionGrid()
|
|
|
|
|
If Me.Pokemon.EvolutionLines.Count > 0 Then
|
|
|
|
|
For e = 0 To Me.Pokemon.EvolutionLines.Count - 1
|
|
|
|
|
Dim GridPositions As New List(Of Vector2)
|
|
|
|
|
Dim PokemonIDs As New List(Of String)
|
|
|
|
|
Dim DataEntries As String() = Me.Pokemon.EvolutionLines(e).Split(",")
|
|
|
|
|
For i = 0 To DataEntries.Count - 1
|
|
|
|
|
PokemonIDs.Add(DataEntries(i).GetSplit(0, "\"))
|
|
|
|
|
Dim Position As New Vector2(CInt(DataEntries(i).GetSplit(1, "\")))
|
|
|
|
|
If DataEntries(i).Split("\").Count > 2 Then
|
|
|
|
|
Position.Y = CInt(DataEntries(i).GetSplit(2, "\"))
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
Dim devP As Pokemon = P3D.Pokemon.GetPokemonByID(CInt(devoID.GetSplit(0, "_")), devoAD)
|
|
|
|
|
Dim devR As EvolutionLinePokemon = Nothing
|
|
|
|
|
Dim level As Integer = -1
|
|
|
|
|
p.Devolution = New EvolutionLinePokemon(level, devoID, Me, evoID)
|
|
|
|
|
Logger.Debug("Add devolution level 1: " & devP.Number)
|
|
|
|
|
|
|
|
|
|
devR = p.Devolution
|
|
|
|
|
|
|
|
|
|
While CInt(devR.Pokemon.Devolution.GetSplit(0, "_")) > 0
|
|
|
|
|
devoID = devR.Pokemon.Devolution
|
|
|
|
|
devoAD = ""
|
|
|
|
|
If devR.Pokemon.AdditionalData <> "" Then
|
|
|
|
|
devoAD = PokemonForms.GetAdditionalValueFromDataFile(devR.Pokemon.Devolution)
|
|
|
|
|
If GridMinimum.X > Position.X Then
|
|
|
|
|
GridMinimum.X = Position.X
|
|
|
|
|
End If
|
|
|
|
|
If GridMinimum.Y > Position.Y Then
|
|
|
|
|
GridMinimum.Y = Position.Y
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
devP = P3D.Pokemon.GetPokemonByID(CInt(devoID.GetSplit(0, "_")), devoAD)
|
|
|
|
|
level -= 1
|
|
|
|
|
devR.Devolution = New EvolutionLinePokemon(level, devoID, Me, PokemonForms.GetPokemonDataFileName(devR.Pokemon.Number, devR.Pokemon.AdditionalData))
|
|
|
|
|
devR = devR.Devolution
|
|
|
|
|
Logger.Debug("Add devolution level " & (level * -1) & ": " & devP.Number)
|
|
|
|
|
End While
|
|
|
|
|
|
|
|
|
|
minimumLevel = level
|
|
|
|
|
If GridMaximum.X < Position.X Then
|
|
|
|
|
GridMaximum.X = Position.X
|
|
|
|
|
End If
|
|
|
|
|
If GridMaximum.Y < Position.Y Then
|
|
|
|
|
GridMaximum.Y = Position.Y
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
Logger.Debug("Minimum level: " & minimumLevel & "; maximum level: " & maximumLevel)
|
|
|
|
|
|
|
|
|
|
Me.EvolutionLines.Add(p)
|
|
|
|
|
If p.Forms.Count > 0 Then
|
|
|
|
|
For Each formp As EvolutionLinePokemon In p.Forms
|
|
|
|
|
Dim formEvoID As String = formp.Pokemon.Number.ToString
|
|
|
|
|
If formp.Pokemon.AdditionalData <> "" Then
|
|
|
|
|
formEvoID = PokemonForms.GetPokemonDataFileName(formp.Pokemon.Number, formp.Pokemon.AdditionalData)
|
|
|
|
|
End If
|
|
|
|
|
If CInt(formp.Pokemon.Devolution.GetSplit(0, "_")) > 0 Then
|
|
|
|
|
Dim devoID As String = formp.Pokemon.Devolution
|
|
|
|
|
Dim devoAD As String = ""
|
|
|
|
|
If devoID.Contains("_") Then
|
|
|
|
|
devoAD = PokemonForms.GetAdditionalValueFromDataFile(formp.Pokemon.Devolution)
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
Dim devP As Pokemon = P3D.Pokemon.GetPokemonByID(CInt(devoID.GetSplit(0, "_")), devoAD)
|
|
|
|
|
Dim devR As EvolutionLinePokemon = Nothing
|
|
|
|
|
Dim level As Integer = -1
|
|
|
|
|
formp.Devolution = New EvolutionLinePokemon(level, devoID, Me, evoID)
|
|
|
|
|
Logger.Debug("Add devolution level 1: " & devP.Number)
|
|
|
|
|
|
|
|
|
|
devR = formp.Devolution
|
|
|
|
|
|
|
|
|
|
While CInt(devR.Pokemon.Devolution.GetSplit(0, "_")) > 0
|
|
|
|
|
devoID = devR.Pokemon.Devolution
|
|
|
|
|
devoAD = ""
|
|
|
|
|
If devR.Pokemon.AdditionalData <> "" Then
|
|
|
|
|
devoAD = PokemonForms.GetAdditionalValueFromDataFile(devR.Pokemon.Devolution)
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
devP = P3D.Pokemon.GetPokemonByID(CInt(devoID.GetSplit(0, "_")), devoAD)
|
|
|
|
|
level -= 1
|
|
|
|
|
devR.Devolution = New EvolutionLinePokemon(level, devoID, Me, PokemonForms.GetPokemonDataFileName(devR.Pokemon.Number, devR.Pokemon.AdditionalData))
|
|
|
|
|
devR = devR.Devolution
|
|
|
|
|
Logger.Debug("Add devolution level " & (level * -1) & ": " & devP.Number)
|
|
|
|
|
End While
|
|
|
|
|
|
|
|
|
|
If minimumLevel > level Then
|
|
|
|
|
minimumLevel = level
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
Me.EvolutionLines.Add(formp)
|
|
|
|
|
GridPositions.Add(Position)
|
|
|
|
|
Next
|
|
|
|
|
Dim evoline As New PokemonEvolutionLine(GridPositions, PokemonIDs)
|
|
|
|
|
EvolutionLineConnections.Add(evoline)
|
|
|
|
|
Next
|
|
|
|
|
Else
|
|
|
|
|
Dim GridPositions As New List(Of Vector2)
|
|
|
|
|
Dim PokemonIDs As New List(Of String)
|
|
|
|
|
|
|
|
|
|
If Me.Pokemon.Devolution <> "0" Then
|
|
|
|
|
Dim DevoID As Integer = CInt(Me.Pokemon.Devolution.GetSplit(0, "_").GetSplit(0, ";"))
|
|
|
|
|
Dim DevoAD As String = ""
|
|
|
|
|
|
|
|
|
|
If Me.Pokemon.Devolution.Contains("_") Then
|
|
|
|
|
DevoAD = PokemonForms.GetAdditionalValueFromDataFile(Me.Pokemon.Devolution)
|
|
|
|
|
ElseIf Me.Pokemon.Devolution.Contains(";") Then
|
|
|
|
|
DevoAD = Me.Pokemon.Devolution.GetSplit(1, ";")
|
|
|
|
|
End If
|
|
|
|
|
Logger.Debug("Minimum level: " & minimumLevel & "; maximum level: " & maximumLevel)
|
|
|
|
|
|
|
|
|
|
Dim DevoP As Pokemon = Pokemon.GetPokemonByID(DevoID, DevoAD, True)
|
|
|
|
|
|
|
|
|
|
If DevoP.Devolution <> "0" Then
|
|
|
|
|
PokemonIDs.Add(DevoP.Devolution)
|
|
|
|
|
End If
|
|
|
|
|
PokemonIDs.Add(Me.Pokemon.Devolution)
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
Dim DexData As String = PokemonForms.GetPokemonDataFileName(Me.Pokemon.Number, Me.Pokemon.AdditionalData, True)
|
|
|
|
|
|
|
|
|
|
PokemonIDs.Add(DexData)
|
|
|
|
|
|
|
|
|
|
If Me.Pokemon.EvolutionConditions.Count > 0 Then
|
|
|
|
|
PokemonIDs.Add(Me.Pokemon.EvolutionConditions(0).Evolution)
|
|
|
|
|
|
|
|
|
|
Dim EvoID As Integer = CInt(Me.Pokemon.EvolutionConditions(0).Evolution.GetSplit(0, "_").GetSplit(0, ";"))
|
|
|
|
|
Dim EvoAD As String = ""
|
|
|
|
|
|
|
|
|
|
If Me.Pokemon.EvolutionConditions(0).Evolution.Contains("_") Then
|
|
|
|
|
EvoAD = PokemonForms.GetAdditionalValueFromDataFile(Me.Pokemon.EvolutionConditions(0).Evolution)
|
|
|
|
|
ElseIf Me.Pokemon.EvolutionConditions(0).Evolution.Contains(";") Then
|
|
|
|
|
EvoAD = Me.Pokemon.EvolutionConditions(0).Evolution.GetSplit(1, ";")
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
Dim EvoP As Pokemon = Pokemon.GetPokemonByID(EvoID, EvoAD, True)
|
|
|
|
|
|
|
|
|
|
If EvoP.EvolutionConditions.Count > 0 Then
|
|
|
|
|
PokemonIDs.Add(EvoP.EvolutionConditions(0).Evolution)
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
Select Case PokemonIDs.Count
|
|
|
|
|
Case 1
|
|
|
|
|
GridMinimum = New Vector2(0)
|
|
|
|
|
GridMaximum = New Vector2(0)
|
|
|
|
|
|
|
|
|
|
GridPositions.Add(New Vector2(0, 0))
|
|
|
|
|
Case 2
|
|
|
|
|
GridMinimum = New Vector2(0)
|
|
|
|
|
GridMaximum = New Vector2(2, 0)
|
|
|
|
|
|
|
|
|
|
GridPositions.Add(New Vector2(0, 0))
|
|
|
|
|
GridPositions.Add(New Vector2(2, 0))
|
|
|
|
|
Case 3
|
|
|
|
|
GridMinimum = New Vector2(-2, 0)
|
|
|
|
|
GridMaximum = New Vector2(2, 0)
|
|
|
|
|
|
|
|
|
|
GridPositions.Add(New Vector2(-2, 0))
|
|
|
|
|
GridPositions.Add(New Vector2(0, 0))
|
|
|
|
|
GridPositions.Add(New Vector2(2, 0))
|
|
|
|
|
Case 4
|
|
|
|
|
GridMinimum = New Vector2(-2, 0)
|
|
|
|
|
GridMaximum = New Vector2(4, 0)
|
|
|
|
|
|
|
|
|
|
GridPositions.Add(New Vector2(-2, 0))
|
|
|
|
|
GridPositions.Add(New Vector2(0, 0))
|
|
|
|
|
GridPositions.Add(New Vector2(2, 0))
|
|
|
|
|
GridPositions.Add(New Vector2(4, 0))
|
|
|
|
|
Case 5
|
|
|
|
|
GridMinimum = New Vector2(-4, 0)
|
|
|
|
|
GridMaximum = New Vector2(4, 0)
|
|
|
|
|
|
|
|
|
|
GridPositions.Add(New Vector2(-4, 0))
|
|
|
|
|
GridPositions.Add(New Vector2(-2, 0))
|
|
|
|
|
GridPositions.Add(New Vector2(0, 0))
|
|
|
|
|
GridPositions.Add(New Vector2(2, 0))
|
|
|
|
|
GridPositions.Add(New Vector2(4, 0))
|
|
|
|
|
End Select
|
|
|
|
|
|
|
|
|
|
Dim evoline As New PokemonEvolutionLine(GridPositions, PokemonIDs)
|
|
|
|
|
EvolutionLineConnections.Add(evoline)
|
|
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
Logger.Debug("Minimum level: " & GridMinimum.X & "x," & GridMinimum.Y & "y; Maximum level: " & GridMaximum.X & "x," & GridMaximum.Y & "y")
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Private Sub FillHabitats()
|
|
|
|
@ -1704,178 +1689,85 @@ Public Class PokedexViewScreen
|
|
|
|
|
Dim scale As Single = 2.0F
|
|
|
|
|
|
|
|
|
|
Private Sub DrawPage3()
|
|
|
|
|
If EvolutionLines.Count = 0 OrElse EvolutionLines.Count = 1 AndAlso EvolutionLines(0).Devolution Is Nothing AndAlso EvolutionLines(0).Evolutions.Count = 0 AndAlso EvolutionLines(0).Forms.Count = 0 Then
|
|
|
|
|
If EvolutionLineConnections Is Nothing OrElse EvolutionLineConnections.Count = 0 OrElse EvolutionLineConnections(0).ConnectionList.Count <= 1 Then
|
|
|
|
|
Canvas.DrawGradient(New Rectangle(CInt(Core.windowSize.Width / 2) - 282, CInt(Core.windowSize.Height / 2 - 45), 80, 90), New Color(84, 198, 216), New Color(42, 167, 198, 150), True, -1)
|
|
|
|
|
Canvas.DrawRectangle(New Rectangle(CInt(Core.windowSize.Width / 2) - 202, CInt(Core.windowSize.Height / 2 - 45), 404, 90), New Color(42, 167, 198, 150))
|
|
|
|
|
Canvas.DrawGradient(New Rectangle(CInt(Core.windowSize.Width / 2) + 202, CInt(Core.windowSize.Height / 2 - 45), 80, 90), New Color(42, 167, 198, 150), New Color(84, 198, 216), True, -1)
|
|
|
|
|
|
|
|
|
|
Core.SpriteBatch.DrawString(FontManager.MainFont, Pokemon.GetName() & " doesn't evolve.", New Vector2(CInt(Core.windowSize.Width / 2) - CInt(FontManager.MainFont.MeasureString(Pokemon.GetName() & " doesn't evolve.").X / 2), CInt(Core.windowSize.Height / 2 - 15)), Color.White)
|
|
|
|
|
Else
|
|
|
|
|
Dim connections As New List(Of String)
|
|
|
|
|
Dim levels As New Dictionary(Of Integer, Integer)
|
|
|
|
|
Dim levelsOffset As New Dictionary(Of Integer, Integer)
|
|
|
|
|
Dim connectionLines As New List(Of String)
|
|
|
|
|
Dim centerVector As Vector2 = Core.GetMiddlePosition(New Size(CInt(64 * scale), CInt(64 * scale)))
|
|
|
|
|
|
|
|
|
|
For i = minimumLevel To maximumLevel
|
|
|
|
|
levels.Add(i, 0)
|
|
|
|
|
levelsOffset.Add(i, 0)
|
|
|
|
|
Next
|
|
|
|
|
|
|
|
|
|
For i = 0 To EvolutionLines.Count - 1
|
|
|
|
|
If Not EvolutionLines(i).Devolution Is Nothing Then
|
|
|
|
|
connections.Add("-1_0|" & EvolutionLines(i).Devolution.PokemonID.ToString() & "-" & EvolutionLines(i).PokemonID.ToString())
|
|
|
|
|
levels(-1) += 1
|
|
|
|
|
|
|
|
|
|
For Each evolution As EvolutionLinePokemon In EvolutionLines(i).Devolution.Evolutions
|
|
|
|
|
connections.Add("-1_0|" & EvolutionLines(i).Devolution.PokemonID.ToString() & "-" & evolution.PokemonID.ToString())
|
|
|
|
|
levels(0) += 1
|
|
|
|
|
For Each eevolution As EvolutionLinePokemon In evolution.Evolutions
|
|
|
|
|
connections.Add("0_1|" & evolution.PokemonID.ToString() & "-" & eevolution.PokemonID.ToString())
|
|
|
|
|
levels(1) += 1
|
|
|
|
|
For e = 0 To EvolutionLineConnections.Count - 1
|
|
|
|
|
For l = 0 To EvolutionLineConnections(e).ConnectionList.Count - 1
|
|
|
|
|
If EvolutionLineConnections(e).ConnectionList.Count > 1 AndAlso l > 0 Then
|
|
|
|
|
connectionLines.Add(CStr(EvolutionLineConnections(e).ConnectionList(l - 1).Item1 & "_" & EvolutionLineConnections(e).ConnectionList(l - 1).Item2 & "," & EvolutionLineConnections(e).ConnectionList(l).Item1 & "_" & EvolutionLineConnections(e).ConnectionList(l).Item2))
|
|
|
|
|
End If
|
|
|
|
|
Next
|
|
|
|
|
Next
|
|
|
|
|
|
|
|
|
|
If Not EvolutionLines(i).Devolution.Devolution Is Nothing Then
|
|
|
|
|
connections.Add("-2_-1|" & EvolutionLines(i).Devolution.Devolution.PokemonID.ToString() & "-" & EvolutionLines(i).Devolution.PokemonID.ToString())
|
|
|
|
|
levels(-2) += 1
|
|
|
|
|
End If
|
|
|
|
|
ElseIf EvolutionLines(i).Evolutions.Count > 0 Then
|
|
|
|
|
levels(0) += 1
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
For Each evolution As EvolutionLinePokemon In EvolutionLines(i).Evolutions
|
|
|
|
|
connections.Add("0_1|" & EvolutionLines(i).PokemonID.ToString() & "-" & evolution.PokemonID.ToString())
|
|
|
|
|
levels(1) += 1
|
|
|
|
|
For Each eevolution As EvolutionLinePokemon In evolution.Evolutions
|
|
|
|
|
connections.Add("1_2|" & evolution.PokemonID.ToString() & "-" & eevolution.PokemonID.ToString())
|
|
|
|
|
levels(2) += 1
|
|
|
|
|
Next
|
|
|
|
|
Next
|
|
|
|
|
If EvolutionLines(i).Evolutions.Count = 0 AndAlso EvolutionLines(i).Devolution Is Nothing Then
|
|
|
|
|
connections.Add("0_0|" & EvolutionLines(i).PokemonID.ToString() & "-" & EvolutionLines(i).PokemonID.ToString())
|
|
|
|
|
levels(0) += 1
|
|
|
|
|
End If
|
|
|
|
|
For i = 0 To connectionLines.Count - 1
|
|
|
|
|
Dim LineStart As New Vector2(CInt(connectionLines(i).GetSplit(0, ",").GetSplit(0, "_")), CInt(connectionLines(i).GetSplit(0, ",").GetSplit(1, "_")))
|
|
|
|
|
Dim LineEnd As New Vector2(CInt(connectionLines(i).GetSplit(1, ",").GetSplit(0, "_")), CInt(connectionLines(i).GetSplit(1, ",").GetSplit(1, "_")))
|
|
|
|
|
|
|
|
|
|
Canvas.DrawLine(Color.Black, New Vector2(centerVector.X + (LineStart.X * (64 * scale)) + (scale * 32), centerVector.Y + (scale * 32) + (LineStart.Y * (32 * scale))), New Vector2(centerVector.X + (LineEnd.X * (64 * scale)) + (scale * 32), centerVector.Y + (scale * 32) + (LineEnd.Y * (32 * scale))), 2)
|
|
|
|
|
Next
|
|
|
|
|
|
|
|
|
|
Dim levelDraws As New Dictionary(Of Integer, Integer)
|
|
|
|
|
Dim PokemonDraws As New Dictionary(Of String, Integer)
|
|
|
|
|
|
|
|
|
|
For i = 0 To connections.Count - 1
|
|
|
|
|
Dim c As String = connections(i).Split(CChar("|"))(1)
|
|
|
|
|
|
|
|
|
|
Dim mv As Vector2 = Core.GetMiddlePosition(New Size(CInt(64 * scale), CInt(64 * scale)))
|
|
|
|
|
|
|
|
|
|
Dim p1 As String = c.Remove(c.IndexOf("-"))
|
|
|
|
|
Dim level1 As Integer = CInt(connections(i).GetSplit(0, "|").GetSplit(0, "_"))
|
|
|
|
|
Dim level1Count As Integer = levels(level1)
|
|
|
|
|
Dim p1ad As String = ""
|
|
|
|
|
If p1.Contains("_") = True Then
|
|
|
|
|
p1ad = PokemonForms.GetAdditionalValueFromDataFile(p1)
|
|
|
|
|
For x = CInt(GridMinimum.X) To CInt(GridMaximum.X)
|
|
|
|
|
For y = CInt(GridMinimum.Y) To CInt(GridMaximum.Y)
|
|
|
|
|
Dim pokemon As Pokemon = Nothing
|
|
|
|
|
Dim position As Vector2 = New Vector2(0)
|
|
|
|
|
For c = 0 To EvolutionLineConnections.Count - 1
|
|
|
|
|
For i = 0 To EvolutionLineConnections(c).ConnectionList.Count - 1
|
|
|
|
|
If EvolutionLineConnections(c).ConnectionList(i).Item1 = x AndAlso EvolutionLineConnections(c).ConnectionList(i).Item2 = y Then
|
|
|
|
|
position = New Vector2(EvolutionLineConnections(c).ConnectionList(i).Item1, EvolutionLineConnections(c).ConnectionList(i).Item2)
|
|
|
|
|
pokemon = EvolutionLineConnections(c).ConnectionList(i).Item3
|
|
|
|
|
End If
|
|
|
|
|
Dim pokemon1 As Pokemon = Pokemon.GetPokemonByID(CInt(p1.GetSplit(0, "_")), p1ad, True)
|
|
|
|
|
|
|
|
|
|
If levelDraws.ContainsKey(level1) = False Then
|
|
|
|
|
levelDraws.Add(level1, 0)
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
If PokemonDraws.ContainsKey(p1) = False Then
|
|
|
|
|
levelDraws(level1) += 1
|
|
|
|
|
PokemonDraws.Add(p1, levelDraws(level1))
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
Dim level1Offset As Integer = CInt(GetOffset(level1Count, PokemonDraws(p1)) * (64 * scale))
|
|
|
|
|
|
|
|
|
|
Dim p2 As String = c.Remove(0, c.IndexOf("-") + 1)
|
|
|
|
|
Dim level2 As Integer = CInt(connections(i).GetSplit(0, "|").Split(CChar("_"))(1))
|
|
|
|
|
Dim level2Count As Integer = levels(level2)
|
|
|
|
|
Dim p2ad As String = ""
|
|
|
|
|
If p2.Contains("_") = True Then
|
|
|
|
|
p2ad = PokemonForms.GetAdditionalValueFromDataFile(p2)
|
|
|
|
|
End If
|
|
|
|
|
Dim pokemon2 As Pokemon = Pokemon.GetPokemonByID(CInt(p2.GetSplit(0, "_")), p2ad, True)
|
|
|
|
|
|
|
|
|
|
If levelDraws.ContainsKey(level2) = False Then
|
|
|
|
|
levelDraws.Add(level2, 0)
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
If PokemonDraws.ContainsKey(p2) = False Then
|
|
|
|
|
levelDraws(level2) += 1
|
|
|
|
|
PokemonDraws.Add(p2, levelDraws(level2))
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
Dim level2Offset As Integer = CInt(GetOffset(level2Count, PokemonDraws(p2)) * (64 * scale))
|
|
|
|
|
|
|
|
|
|
If level1 <> level2 Then
|
|
|
|
|
If pokemon2.Devolution = PokemonForms.GetPokemonDataFileName(pokemon1.Number, pokemon1.AdditionalData) Then
|
|
|
|
|
Canvas.DrawLine(Color.Black, New Vector2(mv.X + (level1 * (128 * scale)) + (scale * 32), mv.Y + (scale * 32) + level1Offset), New Vector2(mv.X + (level2 * (128 * scale)) + (scale * 32), mv.Y + (scale * 32) + level2Offset), 2)
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
Dim dexID1 As String = PokemonForms.GetPokemonDataFileName(pokemon1.Number, pokemon1.AdditionalData)
|
|
|
|
|
If dexID1.Contains("_") = False Then
|
|
|
|
|
If PokemonForms.GetAdditionalDataForms(pokemon1.Number) IsNot Nothing AndAlso PokemonForms.GetAdditionalDataForms(pokemon1.Number).Contains(pokemon1.AdditionalData) Then
|
|
|
|
|
dexID1 = pokemon1.Number & ";" & pokemon1.AdditionalData
|
|
|
|
|
Else
|
|
|
|
|
dexID1 = pokemon1.Number.ToString
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
Dim dexID2 As String = PokemonForms.GetPokemonDataFileName(pokemon2.Number, pokemon2.AdditionalData)
|
|
|
|
|
If dexID2.Contains("_") = False Then
|
|
|
|
|
If PokemonForms.GetAdditionalDataForms(pokemon2.Number) IsNot Nothing AndAlso PokemonForms.GetAdditionalDataForms(pokemon2.Number).Contains(pokemon2.AdditionalData) Then
|
|
|
|
|
dexID2 = pokemon2.Number & ";" & pokemon2.AdditionalData
|
|
|
|
|
Else
|
|
|
|
|
dexID2 = pokemon2.Number.ToString
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
If Pokedex.GetEntryType(Core.Player.PokedexData, dexID1) = 0 Then
|
|
|
|
|
Dim pokeTexture = pokemon1.GetMenuTexture()
|
|
|
|
|
Next
|
|
|
|
|
Next
|
|
|
|
|
If pokemon IsNot Nothing Then
|
|
|
|
|
Dim dexID As String = PokemonForms.GetPokemonDataFileName(pokemon.Number, pokemon.AdditionalData, True)
|
|
|
|
|
Dim pokeTexture = pokemon.GetMenuTexture()
|
|
|
|
|
Dim pokeTextureScale As Vector2 = New Vector2(CSng(32 / pokeTexture.Width * 2), CSng(32 / pokeTexture.Height * 2))
|
|
|
|
|
Core.SpriteBatch.Draw(pokeTexture, New Rectangle(CInt(mv.X + (level1 * CInt(128 * scale))), CInt(mv.Y + level1Offset), CInt(pokeTexture.Width * pokeTextureScale.X * scale), CInt(pokeTexture.Height * pokeTextureScale.Y * scale)), Color.Black)
|
|
|
|
|
|
|
|
|
|
If Pokedex.GetEntryType(Core.Player.PokedexData, dexID) = 0 Then
|
|
|
|
|
Core.SpriteBatch.Draw(pokeTexture, New Rectangle(CInt(centerVector.X + (position.X * CInt(64 * scale))), CInt(centerVector.Y + (position.Y * (32 * scale))), CInt(pokeTexture.Width * pokeTextureScale.X * scale), CInt(pokeTexture.Height * pokeTextureScale.Y * scale)), Color.Black)
|
|
|
|
|
Else
|
|
|
|
|
Dim pokeTexture = pokemon1.GetMenuTexture()
|
|
|
|
|
Dim pokeTextureScale As Vector2 = New Vector2(CSng(32 / pokeTexture.Width * 2), CSng(32 / pokeTexture.Height * 2))
|
|
|
|
|
Core.SpriteBatch.Draw(pokeTexture, New Rectangle(CInt(mv.X + (level1 * (128 * scale))), CInt(mv.Y + level1Offset), CInt(pokeTexture.Width * pokeTextureScale.X * scale), CInt(pokeTexture.Height * pokeTextureScale.Y * scale)), Color.White)
|
|
|
|
|
Core.SpriteBatch.DrawString(FontManager.MainFont, pokemon1.GetName(), New Vector2(CInt(mv.X + (level1 * (128 * scale)) + CInt(pokeTexture.Width * pokeTextureScale.X / 2 * scale) - (FontManager.MainFont.MeasureString(pokemon1.GetName()).X / 2 * CSng(scale / 2)) + 2), CInt(mv.Y + level1Offset + (64 * scale)) + 2), Color.Black, 0.0F, Vector2.Zero, CInt(scale / 2), SpriteEffects.None, 0.0F)
|
|
|
|
|
Core.SpriteBatch.DrawString(FontManager.MainFont, pokemon1.GetName(), New Vector2(CInt(mv.X + (level1 * (128 * scale)) + CInt(pokeTexture.Width * pokeTextureScale.X / 2 * scale) - (FontManager.MainFont.MeasureString(pokemon1.GetName()).X / 2 * CSng(scale / 2))), CInt(mv.Y + level1Offset + (64 * scale))), Color.White, 0.0F, Vector2.Zero, CInt(scale / 2), SpriteEffects.None, 0.0F)
|
|
|
|
|
Core.SpriteBatch.Draw(pokeTexture, New Rectangle(CInt(centerVector.X + (position.X * CInt(64 * scale))), CInt(centerVector.Y + (position.Y * (32 * scale))), CInt(pokeTexture.Width * pokeTextureScale.X * scale), CInt(pokeTexture.Height * pokeTextureScale.Y * scale)), Color.White)
|
|
|
|
|
End If
|
|
|
|
|
If Pokedex.GetEntryType(Core.Player.PokedexData, dexID2) = 0 Then
|
|
|
|
|
Dim pokeTexture = pokemon2.GetMenuTexture()
|
|
|
|
|
Dim pokeTextureScale As Vector2 = New Vector2(CSng(32 / pokeTexture.Width * 2), CSng(32 / pokeTexture.Height * 2))
|
|
|
|
|
Core.SpriteBatch.Draw(pokeTexture, New Rectangle(CInt(mv.X + (level2 * CInt(128 * scale))), CInt(mv.Y + level2Offset), CInt(pokeTexture.Width * pokeTextureScale.X * scale), CInt(pokeTexture.Height * pokeTextureScale.X * scale)), Color.Black)
|
|
|
|
|
Else
|
|
|
|
|
Dim pokeTexture = pokemon2.GetMenuTexture()
|
|
|
|
|
Dim pokeTextureScale As Vector2 = New Vector2(CSng(32 / pokeTexture.Width * 2), CSng(32 / pokeTexture.Height * 2))
|
|
|
|
|
Core.SpriteBatch.Draw(pokeTexture, New Rectangle(CInt(mv.X + (level2 * CInt(128 * scale))), CInt(mv.Y + level2Offset), CInt(pokeTexture.Width * pokeTextureScale.X * scale), CInt(pokeTexture.Height * pokeTextureScale.Y * scale)), Color.White)
|
|
|
|
|
Core.SpriteBatch.DrawString(FontManager.MainFont, pokemon2.GetName(), New Vector2(CInt(mv.X + (level2 * (128 * scale)) + (32 * scale) - (FontManager.MainFont.MeasureString(pokemon2.GetName()).X / 2 * CSng(scale / 2)) + 2), CInt(mv.Y + level2Offset + (64 * scale)) + 2), Color.Black, 0.0F, Vector2.Zero, CInt(scale / 2), SpriteEffects.None, 0.0F)
|
|
|
|
|
Core.SpriteBatch.DrawString(FontManager.MainFont, pokemon2.GetName(), New Vector2(CInt(mv.X + (level2 * (128 * scale)) + (32 * scale) - (FontManager.MainFont.MeasureString(pokemon2.GetName()).X / 2 * CSng(scale / 2))), CInt(mv.Y + level2Offset + (64 * scale))), Color.White, 0.0F, Vector2.Zero, CInt(scale / 2), SpriteEffects.None, 0.0F)
|
|
|
|
|
End If
|
|
|
|
|
Next
|
|
|
|
|
Next
|
|
|
|
|
|
|
|
|
|
For x = CInt(GridMinimum.X) To CInt(GridMaximum.X)
|
|
|
|
|
For y = CInt(GridMinimum.Y) To CInt(GridMaximum.Y)
|
|
|
|
|
Dim pokemon As Pokemon = Nothing
|
|
|
|
|
Dim position As Vector2 = New Vector2(0)
|
|
|
|
|
For c = 0 To EvolutionLineConnections.Count - 1
|
|
|
|
|
For i = 0 To EvolutionLineConnections(c).ConnectionList.Count - 1
|
|
|
|
|
If EvolutionLineConnections(c).ConnectionList(i).Item1 = x AndAlso EvolutionLineConnections(c).ConnectionList(i).Item2 = y Then
|
|
|
|
|
position = New Vector2(EvolutionLineConnections(c).ConnectionList(i).Item1, EvolutionLineConnections(c).ConnectionList(i).Item2)
|
|
|
|
|
pokemon = EvolutionLineConnections(c).ConnectionList(i).Item3
|
|
|
|
|
End If
|
|
|
|
|
Next
|
|
|
|
|
Next
|
|
|
|
|
If pokemon IsNot Nothing Then
|
|
|
|
|
Dim dexID As String = PokemonForms.GetPokemonDataFileName(pokemon.Number, pokemon.AdditionalData, True)
|
|
|
|
|
Dim pokeTexture = pokemon.GetMenuTexture()
|
|
|
|
|
Dim pokeTextureScale As Vector2 = New Vector2(CSng(32 / pokeTexture.Width * 2), CSng(32 / pokeTexture.Height * 2))
|
|
|
|
|
|
|
|
|
|
If Pokedex.GetEntryType(Core.Player.PokedexData, dexID) <> 0 Then
|
|
|
|
|
Core.SpriteBatch.DrawString(FontManager.MainFont, pokemon.GetName(), New Vector2(CInt(centerVector.X + (position.X * (64 * scale)) + CInt(pokeTexture.Width * pokeTextureScale.X / 2 * scale) - (FontManager.MainFont.MeasureString(pokemon.GetName()).X / 2 * CSng(scale / 2)) + 2), CInt(centerVector.Y + position.Y * (32 * scale) + (64 * scale)) + 2), Color.Black, 0.0F, Vector2.Zero, CInt(scale / 2), SpriteEffects.None, 0.0F)
|
|
|
|
|
Core.SpriteBatch.DrawString(FontManager.MainFont, pokemon.GetName(), New Vector2(CInt(centerVector.X + (position.X * (64 * scale)) + CInt(pokeTexture.Width * pokeTextureScale.X / 2 * scale) - (FontManager.MainFont.MeasureString(pokemon.GetName()).X / 2 * CSng(scale / 2))), CInt(centerVector.Y + position.Y * (32 * scale) + (64 * scale))), Color.White, 0.0F, Vector2.Zero, CInt(scale / 2), SpriteEffects.None, 0.0F)
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
Next
|
|
|
|
|
Next
|
|
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Private Function GetOffset(ByVal count As Integer, ByVal c As Integer) As Double
|
|
|
|
|
If count = 0 Then
|
|
|
|
|
Return 0
|
|
|
|
|
End If
|
|
|
|
|
If count Mod 2 = 1 Then
|
|
|
|
|
' count = 7, c = 7
|
|
|
|
|
Dim middle As Integer = CInt(Math.Ceiling(count / 2))
|
|
|
|
|
' middle = 4
|
|
|
|
|
Dim stat As Integer = c - middle
|
|
|
|
|
' stat = 3
|
|
|
|
|
Return stat
|
|
|
|
|
Else
|
|
|
|
|
' count = 4, c = 1
|
|
|
|
|
Dim middle As Double = count / 2
|
|
|
|
|
' middle = 2
|
|
|
|
|
Dim stat As Double = c - middle - 0.5D
|
|
|
|
|
' stat = -1.5
|
|
|
|
|
Return stat
|
|
|
|
|
End If
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
Public Overrides Sub Update()
|
|
|
|
|
If Controls.Dismiss(True, True, True) = True Then
|
|
|
|
|
If Me._transitionOut = True Then
|
|
|
|
|