Update random evolution logic

This commit is contained in:
Flashfyre 2023-10-20 16:55:46 -04:00
parent c778ef5e36
commit 84b487e719
1 changed files with 2 additions and 2 deletions

View File

@ -256,9 +256,9 @@ export default class PokemonSpecies extends PokemonSpeciesForm {
evolutionChance = Math.min(0.5 + easeInFunc((level - ev.level) / 40) / 2, 1); evolutionChance = Math.min(0.5 + easeInFunc((level - ev.level) / 40) / 2, 1);
else { else {
let preferredMinLevel = ev.wildDelay * 10; let preferredMinLevel = ev.wildDelay * 10;
let evolutionLevel = ev.level > 1 ? ev.level : 0; let evolutionLevel = ev.level > 1 ? ev.level : Math.floor(preferredMinLevel / 2);
if (!evolutionLevel && pokemonPrevolutions.hasOwnProperty(this.speciesId)) { if (ev.level <= 1 && pokemonPrevolutions.hasOwnProperty(this.speciesId)) {
const prevolutionLevel = pokemonEvolutions[pokemonPrevolutions[this.speciesId]].find(ev => ev.speciesId === this.speciesId).level; const prevolutionLevel = pokemonEvolutions[pokemonPrevolutions[this.speciesId]].find(ev => ev.speciesId === this.speciesId).level;
if (prevolutionLevel > 1) if (prevolutionLevel > 1)
evolutionLevel = prevolutionLevel; evolutionLevel = prevolutionLevel;