mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
adds failsafe for when randomizer can't find a Pokemon
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -128,12 +128,18 @@ def getRandomPokemon(originalPokemon,bstRange,maxDexNumber)
|
|||||||
bstMax = originalBst+bstRange
|
bstMax = originalBst+bstRange
|
||||||
|
|
||||||
foundAPokemon = false
|
foundAPokemon = false
|
||||||
|
int i=0
|
||||||
while ! foundAPokemon
|
while ! foundAPokemon
|
||||||
newPoke = rand(maxDexNumber-1)+1
|
newPoke = rand(maxDexNumber-1)+1
|
||||||
newPokeBST = getBaseStatsTotal(newPoke)
|
newPokeBST = getBaseStatsTotal(newPoke)
|
||||||
if newPokeBST >= bstMin && newPokeBST <= bstMax
|
if newPokeBST >= bstMin && newPokeBST <= bstMax
|
||||||
foundAPokemon = true
|
foundAPokemon = true
|
||||||
end
|
end
|
||||||
|
i+=1
|
||||||
|
if i %10 ==0
|
||||||
|
bstMin-=5
|
||||||
|
bstMax+=5
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return newPoke
|
return newPoke
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -278,8 +278,13 @@ def getNewSpecies(oldSpecies,bst_range=50, ignoreRivalPlaceholder = false, maxDe
|
|||||||
return oldSpecies_dex if (oldSpecies_dex == Settings::RIVAL_STARTER_PLACEHOLDER_SPECIES && !ignoreRivalPlaceholder)
|
return oldSpecies_dex if (oldSpecies_dex == Settings::RIVAL_STARTER_PLACEHOLDER_SPECIES && !ignoreRivalPlaceholder)
|
||||||
return oldSpecies_dex if oldSpecies_dex >= Settings::ZAPMOLCUNO_NB
|
return oldSpecies_dex if oldSpecies_dex >= Settings::ZAPMOLCUNO_NB
|
||||||
newspecies_dex = rand(maxDexNumber - 1) + 1
|
newspecies_dex = rand(maxDexNumber - 1) + 1
|
||||||
|
i=0
|
||||||
while bstOk(newspecies_dex,oldSpecies_dex,bst_range)
|
while bstOk(newspecies_dex,oldSpecies_dex,bst_range)
|
||||||
newspecies_dex = rand(maxDexNumber - 1) + 1
|
newspecies_dex = rand(maxDexNumber - 1) + 1
|
||||||
|
i+=1
|
||||||
|
if i%10 == 0
|
||||||
|
bst_range += 5
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return newspecies_dex
|
return newspecies_dex
|
||||||
end
|
end
|
||||||
@@ -290,10 +295,15 @@ def getNewCustomSpecies(oldSpecies,customSpeciesList,bst_range=50, ignoreRivalPl
|
|||||||
return oldSpecies_dex if (oldSpecies_dex == Settings::RIVAL_STARTER_PLACEHOLDER_SPECIES && !ignoreRivalPlaceholder)
|
return oldSpecies_dex if (oldSpecies_dex == Settings::RIVAL_STARTER_PLACEHOLDER_SPECIES && !ignoreRivalPlaceholder)
|
||||||
return oldSpecies_dex if oldSpecies_dex >= Settings::ZAPMOLCUNO_NB
|
return oldSpecies_dex if oldSpecies_dex >= Settings::ZAPMOLCUNO_NB
|
||||||
i = rand(customSpeciesList.length - 1) + 1
|
i = rand(customSpeciesList.length - 1) + 1
|
||||||
|
n=0
|
||||||
newspecies_dex = customSpeciesList[i]
|
newspecies_dex = customSpeciesList[i]
|
||||||
while bstOk(newspecies_dex,oldSpecies_dex,bst_range)
|
while bstOk(newspecies_dex,oldSpecies_dex,bst_range)
|
||||||
i = rand(customSpeciesList.length - 1)#+1
|
i = rand(customSpeciesList.length - 1)#+1
|
||||||
newspecies_dex = customSpeciesList[i]
|
newspecies_dex = customSpeciesList[i]
|
||||||
|
n+=1
|
||||||
|
if n % 10 == 0
|
||||||
|
bst_range+=5
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return newspecies_dex
|
return newspecies_dex
|
||||||
end
|
end
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user