Updated the base stats data loading macro for my new Chinese-based data sheet.
This commit is contained in:
parent
505d154341
commit
cdc89ffcde
@ -63,9 +63,9 @@ Sub subShowChinesePokemonNames
|
|||||||
sResult = ""
|
sResult = ""
|
||||||
For nI = 1 To UBound (mData)
|
For nI = 1 To UBound (mData)
|
||||||
sNo = mData (nI) (1)
|
sNo = mData (nI) (1)
|
||||||
sName = mData (nI) (2)
|
|
||||||
If sName = "" Then
|
|
||||||
sName = mData (nI) (0)
|
sName = mData (nI) (0)
|
||||||
|
If sName = "" Then
|
||||||
|
sName = mData (nI) (2)
|
||||||
Else
|
Else
|
||||||
sNewName = ""
|
sNewName = ""
|
||||||
For nJ = 1 To Len (sName)
|
For nJ = 1 To Len (sName)
|
||||||
@ -146,10 +146,10 @@ Function fnReadBaseStatsSheet As String
|
|||||||
& "Function fnGetBaseStatsData As Variant" & Chr (10) _
|
& "Function fnGetBaseStatsData As Variant" & Chr (10) _
|
||||||
& Chr (9) & "fnGetBaseStatsData = Array( _" & Chr (10)
|
& Chr (9) & "fnGetBaseStatsData = Array( _" & Chr (10)
|
||||||
For nI = 1 To UBound (mData) - 1
|
For nI = 1 To UBound (mData) - 1
|
||||||
sEvolveForms = fnFindEvolveForms (mData (nI))
|
sEvolveForms = fnFindEvolveForms (mData, nI)
|
||||||
sOutput = sOutput _
|
sOutput = sOutput _
|
||||||
& Chr (9) & Chr (9) & "Array (""" _
|
& Chr (9) & Chr (9) & "Array (""" _
|
||||||
& fnMapPokemonNameToId (mData (nI) (0)) _
|
& fnMapPokemonNameToId (mData (nI) (2)) _
|
||||||
& """, """ & mData (nI) (1) _
|
& """, """ & mData (nI) (1) _
|
||||||
& """, " & mData (nI) (3) _
|
& """, " & mData (nI) (3) _
|
||||||
& ", " & mData (nI) (4) _
|
& ", " & mData (nI) (4) _
|
||||||
@ -157,10 +157,10 @@ Function fnReadBaseStatsSheet As String
|
|||||||
& ", " & sEvolveForms & "), _" & Chr (10)
|
& ", " & sEvolveForms & "), _" & Chr (10)
|
||||||
Next nI
|
Next nI
|
||||||
nI = UBound (mData)
|
nI = UBound (mData)
|
||||||
sEvolveForms = fnFindEvolveForms (mData (nI))
|
sEvolveForms = fnFindEvolveForms (mData, nI)
|
||||||
sOutput = sOutput _
|
sOutput = sOutput _
|
||||||
& Chr (9) & Chr (9) & "Array (""" _
|
& Chr (9) & Chr (9) & "Array (""" _
|
||||||
& fnMapPokemonNameToId (mData (nI) (0)) _
|
& fnMapPokemonNameToId (mData (nI) (2)) _
|
||||||
& """, """ & mData (nI) (1) _
|
& """, """ & mData (nI) (1) _
|
||||||
& """, " & mData (nI) (3) _
|
& """, " & mData (nI) (3) _
|
||||||
& ", " & mData (nI) (4) _
|
& ", " & mData (nI) (4) _
|
||||||
@ -171,34 +171,37 @@ Function fnReadBaseStatsSheet As String
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
' fnFindEvolveForms: Finds the evolved forms of the Pokémons.
|
' fnFindEvolveForms: Finds the evolved forms of the Pokémons.
|
||||||
Function fnFindEvolveForms (mData () As Variant) As String
|
Function fnFindEvolveForms (mData As Variant, nI As Integer) As String
|
||||||
Dim nJ As Integer, nStart As Integer, nEnd As Integer
|
Dim nJ As Integer, nStart As Integer, nEnd As Integer
|
||||||
Dim sEvolveForms As String
|
Dim sEvolveForms As String
|
||||||
|
|
||||||
' Special cases
|
' Special cases
|
||||||
If mData (0) = "Oddish" Then
|
If mData (nI) (2) = "Oddish" Then
|
||||||
fnFindEvolveForms = "Array (""Gloom"", ""Vileplume"", ""Bellossom"")"
|
fnFindEvolveForms = "Array (""Gloom"", ""Vileplume"", " _
|
||||||
|
& """Bellossom"")"
|
||||||
Exit Function
|
Exit Function
|
||||||
End If
|
End If
|
||||||
If mData (0) = "Gloom" Then
|
If mData (nI) (2) = "Gloom" Then
|
||||||
fnFindEvolveForms = "Array (""Vileplume"", ""Bellossom"")"
|
fnFindEvolveForms = "Array (""Vileplume"", ""Bellossom"")"
|
||||||
Exit Function
|
Exit Function
|
||||||
End If
|
End If
|
||||||
If mData (0) = "Slowpoke" Then
|
If mData (nI) (2) = "Slowpoke" Then
|
||||||
fnFindEvolveForms = "Array (""Slowbro"", ""Slowking"")"
|
fnFindEvolveForms = "Array (""Slowbro"", ""Slowking"")"
|
||||||
Exit Function
|
Exit Function
|
||||||
End If
|
End If
|
||||||
If mData (0) = "Tyrogue" Then
|
If mData (nI) (2) = "Tyrogue" Then
|
||||||
fnFindEvolveForms = "Array (""Hitmonlee"", ""Hitmonchan"", ""Hitmontop"")"
|
fnFindEvolveForms = "Array (""Hitmonlee"", ""Hitmonchan"", " _
|
||||||
|
& """Hitmontop"")"
|
||||||
Exit Function
|
Exit Function
|
||||||
End If
|
End If
|
||||||
If mData (0) = "Eevee" Then
|
If mData (nI) (2) = "Eevee" Then
|
||||||
fnFindEvolveForms = "Array (""Vaporeon"", ""Jolteon"", ""Flareon"", ""Espeon"", ""Umbreon"")"
|
fnFindEvolveForms = "Array (""Vaporeon"", ""Jolteon"", " _
|
||||||
|
& """Flareon"", ""Espeon"", ""Umbreon"")"
|
||||||
Exit Function
|
Exit Function
|
||||||
End If
|
End If
|
||||||
|
|
||||||
For nJ = 6 To 8
|
For nJ = 6 To 8
|
||||||
If mData (nJ) = mData (0) Then
|
If mData (nI) (nJ) = mData (nI) (0) Then
|
||||||
nStart = nJ + 1
|
nStart = nJ + 1
|
||||||
nJ = 9
|
nJ = 9
|
||||||
End If
|
End If
|
||||||
@ -207,7 +210,7 @@ Function fnFindEvolveForms (mData () As Variant) As String
|
|||||||
nEnd = 8
|
nEnd = 8
|
||||||
Else
|
Else
|
||||||
For nJ = nStart To 8
|
For nJ = nStart To 8
|
||||||
If mData (nJ) = "" Then
|
If mData (nI) (nJ) = "" Then
|
||||||
nEnd = nJ - 1
|
nEnd = nJ - 1
|
||||||
nJ = 9
|
nJ = 9
|
||||||
Else
|
Else
|
||||||
@ -222,17 +225,31 @@ Function fnFindEvolveForms (mData () As Variant) As String
|
|||||||
sEvolveForms = "Array ()"
|
sEvolveForms = "Array ()"
|
||||||
Else
|
Else
|
||||||
sEvolveForms = """" _
|
sEvolveForms = """" _
|
||||||
& fnMapPokemonNameToId (mData (nStart)) & """"
|
& fnMapChineseNameToId (mData, mData (nI) (nStart)) & """"
|
||||||
For nJ = nStart + 1 To nEnd
|
For nJ = nStart + 1 To nEnd
|
||||||
sEvolveForms = sEvolveForms _
|
sEvolveForms = sEvolveForms _
|
||||||
& ", """ _
|
& ", """ _
|
||||||
& fnMapPokemonNameToId (mData (nJ)) & """"
|
& fnMapChineseNameToId (mData, mData (nI) (nJ)) & """"
|
||||||
Next nJ
|
Next nJ
|
||||||
sEvolveForms = "Array (" & sEvolveForms & ")"
|
sEvolveForms = "Array (" & sEvolveForms & ")"
|
||||||
End If
|
End If
|
||||||
fnFindEvolveForms = sEvolveForms
|
fnFindEvolveForms = sEvolveForms
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
' fnMapChineseNameToId: Maps the Chinese Pokémon names to their IDs.
|
||||||
|
Function fnMapChineseNameToId ( _
|
||||||
|
mData As Variant, sChinese As String) As String
|
||||||
|
Dim nI As Integer
|
||||||
|
|
||||||
|
For nI = 0 To UBound (mData)
|
||||||
|
If mData (nI) (0) = sChinese Then
|
||||||
|
fnMapChineseNameToId = _
|
||||||
|
fnMapPokemonNameToId (mData (nI) (2))
|
||||||
|
Exit Function
|
||||||
|
End If
|
||||||
|
Next nI
|
||||||
|
End Function
|
||||||
|
|
||||||
' fnMapPokemonNameToId: Maps the English Pokémon names to their IDs.
|
' fnMapPokemonNameToId: Maps the English Pokémon names to their IDs.
|
||||||
Function fnMapPokemonNameToId (sName As String) As String
|
Function fnMapPokemonNameToId (sName As String) As String
|
||||||
Dim sId As String
|
Dim sId As String
|
||||||
|
Loading…
Reference in New Issue
Block a user