* Updated that the maximum power-up level of a Pokémon is the trainer level + 2. It was the trainer level + 1.5 before.
* Updated to remember the last selected player level. Player level rarely changes when calculating a bunch of Pokémons.
This commit is contained in:
parent
2c5c0909e0
commit
de7dbdd676
@ -18,7 +18,9 @@
|
|||||||
Option Explicit
|
Option Explicit
|
||||||
|
|
||||||
' Remembers the selected Pokémon for the next run.
|
' Remembers the selected Pokémon for the next run.
|
||||||
Global sSelected As String
|
Global sLastSelected As String
|
||||||
|
' Remembers the selected player level for the next run.
|
||||||
|
Global sLastLevel As Integer
|
||||||
|
|
||||||
' The parameters to find the individual values.
|
' The parameters to find the individual values.
|
||||||
Type aFindIVParam
|
Type aFindIVParam
|
||||||
@ -72,15 +74,18 @@ Function fnAskParam As aFindIVParam
|
|||||||
"ImageURL", fnGetImageUrl ("Unknown"))
|
"ImageURL", fnGetImageUrl ("Unknown"))
|
||||||
|
|
||||||
' Remembers the previously-selected Pokémon.
|
' Remembers the previously-selected Pokémon.
|
||||||
oDialog.getControl ("lstPokemon").selectItem (sSelected, True)
|
oDialog.getControl ("lstPokemon").selectItem (sLastSelected, True)
|
||||||
|
oDialog.getControl ("lstPlayerLevel").selectItem (sLastLevel, True)
|
||||||
|
|
||||||
If oDialog.execute = 0 Then
|
If oDialog.execute = 0 Then
|
||||||
aQuery.bIsCancelled = True
|
aQuery.bIsCancelled = True
|
||||||
|
sLastLevel = oDialog.getControl ("lstPlayerLevel").getSelectedItem
|
||||||
fnAskParam = aQuery
|
fnAskParam = aQuery
|
||||||
Exit Function
|
Exit Function
|
||||||
End If
|
End If
|
||||||
|
|
||||||
subReadBaseStats
|
subReadBaseStats
|
||||||
|
sLastLevel = oDialog.getControl ("lstPlayerLevel").getSelectedItem
|
||||||
nSelected = oDialog.getControl ("lstPokemon").getSelectedItemPos
|
nSelected = oDialog.getControl ("lstPokemon").getSelectedItemPos
|
||||||
With aQuery
|
With aQuery
|
||||||
.sPokemonId = maBaseStats (nSelected).sPokemonId
|
.sPokemonId = maBaseStats (nSelected).sPokemonId
|
||||||
@ -175,9 +180,9 @@ Sub subLstPokemonSelected (oEvent As object)
|
|||||||
oDialog = oEvent.Source.getContext
|
oDialog = oEvent.Source.getContext
|
||||||
|
|
||||||
' Checks which Pokémon was selected.
|
' Checks which Pokémon was selected.
|
||||||
sSelected = oDialog.getControl ("lstPokemon").getSelectedItem
|
sLastSelected = oDialog.getControl ("lstPokemon").getSelectedItem
|
||||||
nSelected = oDialog.getControl ("lstPokemon").getSelectedItemPos
|
nSelected = oDialog.getControl ("lstPokemon").getSelectedItemPos
|
||||||
' This happens at the beginning where sSelected is "".
|
' This happens at the beginning where sLastSelected is "".
|
||||||
If nSelected = -1 Then
|
If nSelected = -1 Then
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
@ -100,7 +100,7 @@ Sub subCreateReport ( _
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If aQuery.nPlayerLevel <> 0 Then
|
If aQuery.nPlayerLevel <> 0 Then
|
||||||
fMaxLevel = aQuery.nPlayerLevel + 1.5
|
fMaxLevel = aQuery.nPlayerLevel + 2
|
||||||
If fMaxLevel > 40 Then
|
If fMaxLevel > 40 Then
|
||||||
fMaxLevel = 40
|
fMaxLevel = 40
|
||||||
End If
|
End If
|
||||||
|
@ -20,7 +20,9 @@
|
|||||||
Option Explicit
|
Option Explicit
|
||||||
|
|
||||||
' Remembers the selected Pokémon for the next run.
|
' Remembers the selected Pokémon for the next run.
|
||||||
Global sSelected As String
|
Global sLastSelected As String
|
||||||
|
' Remembers the selected player level for the next run.
|
||||||
|
Global sLastLevel As Integer
|
||||||
|
|
||||||
' The parameters to find the individual values.
|
' The parameters to find the individual values.
|
||||||
Type aFindIVParam
|
Type aFindIVParam
|
||||||
@ -74,15 +76,18 @@ Function fnAskParam As aFindIVParam
|
|||||||
"ImageURL", fnGetImageUrl ("Unknown"))
|
"ImageURL", fnGetImageUrl ("Unknown"))
|
||||||
|
|
||||||
' Remembers the previously-selected Pokémon.
|
' Remembers the previously-selected Pokémon.
|
||||||
oDialog.getControl ("lstPokemon").selectItem (sSelected, True)
|
oDialog.getControl ("lstPokemon").selectItem (sLastSelected, True)
|
||||||
|
oDialog.getControl ("lstPlayerLevel").selectItem (sLastLevel, True)
|
||||||
|
|
||||||
If oDialog.execute = 0 Then
|
If oDialog.execute = 0 Then
|
||||||
aQuery.bIsCancelled = True
|
aQuery.bIsCancelled = True
|
||||||
|
sLastLevel = oDialog.getControl ("lstPlayerLevel").getSelectedItem
|
||||||
fnAskParam = aQuery
|
fnAskParam = aQuery
|
||||||
Exit Function
|
Exit Function
|
||||||
End If
|
End If
|
||||||
|
|
||||||
subReadBaseStats
|
subReadBaseStats
|
||||||
|
sLastLevel = oDialog.getControl ("lstPlayerLevel").getSelectedItem
|
||||||
nSelected = oDialog.getControl ("lstPokemon").getSelectedItemPos
|
nSelected = oDialog.getControl ("lstPokemon").getSelectedItemPos
|
||||||
With aQuery
|
With aQuery
|
||||||
.sPokemonId = maBaseStats (nSelected).sPokemonId
|
.sPokemonId = maBaseStats (nSelected).sPokemonId
|
||||||
@ -177,9 +182,9 @@ Sub subLstPokemonSelected (oEvent As object)
|
|||||||
oDialog = oEvent.Source.getContext
|
oDialog = oEvent.Source.getContext
|
||||||
|
|
||||||
' Checks which Pokémon was selected.
|
' Checks which Pokémon was selected.
|
||||||
sSelected = oDialog.getControl ("lstPokemon").getSelectedItem
|
sLastSelected = oDialog.getControl ("lstPokemon").getSelectedItem
|
||||||
nSelected = oDialog.getControl ("lstPokemon").getSelectedItemPos
|
nSelected = oDialog.getControl ("lstPokemon").getSelectedItemPos
|
||||||
' This happens at the beginning where sSelected is "".
|
' This happens at the beginning where sLastSelected is "".
|
||||||
If nSelected = -1 Then
|
If nSelected = -1 Then
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
@ -102,7 +102,7 @@ Sub subCreateReport ( _
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If aQuery.nPlayerLevel <> 0 Then
|
If aQuery.nPlayerLevel <> 0 Then
|
||||||
fMaxLevel = aQuery.nPlayerLevel + 1.5
|
fMaxLevel = aQuery.nPlayerLevel + 2
|
||||||
If fMaxLevel > 40 Then
|
If fMaxLevel > 40 Then
|
||||||
fMaxLevel = 40
|
fMaxLevel = 40
|
||||||
End If
|
End If
|
||||||
|
Loading…
Reference in New Issue
Block a user