From 49bab02fcafe20b7d4365bd6215d3d407b585d70 Mon Sep 17 00:00:00 2001 From: Jimmybald1 <122436263+Jimmybald1@users.noreply.github.com> Date: Sat, 25 Oct 2025 03:33:17 +0200 Subject: [PATCH] [Beta][Bug] DetermineEnemySpecies was using a very low minimum value for evolution chance (#6678) * Fixed misuse of randSeedInt and just using randSeedIntRange instead * Update src/ai/ai-species-gen.ts Co-authored-by: Fabi <192151969+fabske0@users.noreply.github.com> * More comment typos --------- Co-authored-by: Jimmybald1 <147992650+IBBCalc@users.noreply.github.com> Co-authored-by: Fabi <192151969+fabske0@users.noreply.github.com> --- src/ai/ai-species-gen.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ai/ai-species-gen.ts b/src/ai/ai-species-gen.ts index 5420dea068e..ccd0e85764f 100644 --- a/src/ai/ai-species-gen.ts +++ b/src/ai/ai-species-gen.ts @@ -5,24 +5,24 @@ import type { PokemonSpecies } from "#data/pokemon-species"; import { EvoLevelThresholdKind } from "#enums/evo-level-threshold-kind"; import { PartyMemberStrength } from "#enums/party-member-strength"; import type { SpeciesId } from "#enums/species-id"; -import { randSeedInt, randSeedItem } from "#utils/common"; +import { randSeedIntRange, randSeedItem } from "#utils/common"; import { getPokemonSpecies } from "#utils/pokemon-utils"; /** * Controls the maximum level difference that a Pokémon spawned with - * {@linkcode EvoLevelThresholdKind.NORMAL} is allowd to remain unevolved. + * {@linkcode EvoLevelThresholdKind.NORMAL} is allowed to remain unevolved. */ -const NORMAL_TRAINER_LEVEL_DIFF_PERCENT = 0.1; +const NORMAL_TRAINER_LEVEL_DIFF_PERCENT = 1.1; /** * Controls the maximum level difference that a Pokémon spawned with - * {@linkcode EvoLevelThresholdKind.WILD} is allowd to remain unevolved. + * {@linkcode EvoLevelThresholdKind.WILD} is allowed to remain unevolved. */ -const WILD_LEVEL_DIFF_PERCENT = 0.2; +const WILD_LEVEL_DIFF_PERCENT = 1.2; /** * Controls the maximum level difference that a Pokémon spawned with - * {@linkcode EvoLevelThresholdKind.} is allowd to remain unevolved. + * {@linkcode EvoLevelThresholdKind.STRONG} is allowed to remain unevolved. */ -const STRONG_LEVEL_DIFF_PERCENT = 0; +const STRONG_LEVEL_DIFF_PERCENT = 1; /** * Get the evolution threshold for the given evolution, or `0` for ineligible @@ -162,7 +162,7 @@ export function determineEnemySpecies( break; } - const randomLevel = randSeedInt(choice, Math.round(choice * multiplier)); + const randomLevel = randSeedIntRange(choice, Math.round(choice * multiplier)); if (randomLevel <= level) { return determineEnemySpecies( getPokemonSpecies(evoSpecies),