Limit the max level of Pokémons to 40.

This commit is contained in:
依瑪貓 2017-03-24 17:17:08 +08:00
parent 15e2d5012e
commit 7b344747e9
2 changed files with 22 additions and 8 deletions

View File

@ -89,7 +89,7 @@ Function fnFindIV ( _
Dim fLevel As Double, nStamina As Integer Dim fLevel As Double, nStamina As Integer
Dim nAttack As Integer, nDefense As integer Dim nAttack As Integer, nDefense As integer
Dim nI As Integer, nJ As Integer Dim nI As Integer, nJ As Integer
Dim fStep As Double, nN As Integer Dim fStep As Double, nN As Integer, nMaxLevel As Integer
If aQuery.sPokemonId = "" Then If aQuery.sPokemonId = "" Then
fnFindIV = maIV fnFindIV = maIV
@ -114,6 +114,10 @@ Function fnFindIV ( _
Next nI Next nI
End If End If
nN = -1 nN = -1
nMaxLevel = aQuery.nPlayerLevel + 1.5
If nMaxLevel > 40 Then
nMaxLevel = 40
End If
For fLevel = 1 To UBound (mStardust) Step fStep For fLevel = 1 To UBound (mStardust) Step fStep
If mStardust (CInt (fLevel - 0.5)) = aQuery.nStardust Then If mStardust (CInt (fLevel - 0.5)) = aQuery.nStardust Then
For nStamina = 0 To 15 For nStamina = 0 To 15
@ -134,8 +138,7 @@ Function fnFindIV ( _
End With End With
If aQuery.nPlayerLevel <> 0 Then If aQuery.nPlayerLevel <> 0 Then
maIV (nN).nMaxCP = fnCalcCP ( _ maIV (nN).nMaxCP = fnCalcCP ( _
aBaseStats, _ aBaseStats, nMaxLevel, _
aQuery.nPlayerLevel + 1.5, _
nAttack, nDefense, nStamina) nAttack, nDefense, nStamina)
End If End If
maIV (nN).maEvolved _ maIV (nN).maEvolved _
@ -147,7 +150,11 @@ Function fnFindIV ( _
fLevel, nAttack, _ fLevel, nAttack, _
nDefense, nStamina) nDefense, nStamina)
If aQuery.nPlayerLevel <> 0 Then If aQuery.nPlayerLevel <> 0 Then
maIV (nN).maEvolved (nI).nMaxCP = fnCalcCP (maEvBaseStats (nI), aQuery.nPlayerLevel + 1.5, nAttack, nDefense, nStamina) maIV (nN).maEvolved (nI).nMaxCP _
= fnCalcCP ( _
maEvBaseStats (nI), _
nMaxLevel, nAttack, _
nDefense, nStamina)
End If End If
Next nI Next nI
End If End If

View File

@ -91,7 +91,7 @@ Function fnFindIV ( _
Dim fLevel As Double, nStamina As Integer Dim fLevel As Double, nStamina As Integer
Dim nAttack As Integer, nDefense As integer Dim nAttack As Integer, nDefense As integer
Dim nI As Integer, nJ As Integer Dim nI As Integer, nJ As Integer
Dim fStep As Double, nN As Integer Dim fStep As Double, nN As Integer, nMaxLevel As Integer
If aQuery.sPokemonId = &quot;&quot; Then If aQuery.sPokemonId = &quot;&quot; Then
fnFindIV = maIV fnFindIV = maIV
@ -116,6 +116,10 @@ Function fnFindIV ( _
Next nI Next nI
End If End If
nN = -1 nN = -1
nMaxLevel = aQuery.nPlayerLevel + 1.5
If nMaxLevel &gt; 40 Then
nMaxLevel = 40
End If
For fLevel = 1 To UBound (mStardust) Step fStep For fLevel = 1 To UBound (mStardust) Step fStep
If mStardust (CInt (fLevel - 0.5)) = aQuery.nStardust Then If mStardust (CInt (fLevel - 0.5)) = aQuery.nStardust Then
For nStamina = 0 To 15 For nStamina = 0 To 15
@ -136,8 +140,7 @@ Function fnFindIV ( _
End With End With
If aQuery.nPlayerLevel &lt;&gt; 0 Then If aQuery.nPlayerLevel &lt;&gt; 0 Then
maIV (nN).nMaxCP = fnCalcCP ( _ maIV (nN).nMaxCP = fnCalcCP ( _
aBaseStats, _ aBaseStats, nMaxLevel, _
aQuery.nPlayerLevel + 1.5, _
nAttack, nDefense, nStamina) nAttack, nDefense, nStamina)
End If End If
maIV (nN).maEvolved _ maIV (nN).maEvolved _
@ -149,7 +152,11 @@ Function fnFindIV ( _
fLevel, nAttack, _ fLevel, nAttack, _
nDefense, nStamina) nDefense, nStamina)
If aQuery.nPlayerLevel &lt;&gt; 0 Then If aQuery.nPlayerLevel &lt;&gt; 0 Then
maIV (nN).maEvolved (nI).nMaxCP = fnCalcCP (maEvBaseStats (nI), aQuery.nPlayerLevel + 1.5, nAttack, nDefense, nStamina) maIV (nN).maEvolved (nI).nMaxCP _
= fnCalcCP ( _
maEvBaseStats (nI), _
nMaxLevel, nAttack, _
nDefense, nStamina)
End If End If
Next nI Next nI
End If End If