[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>
This commit is contained in:
Jimmybald1 2025-10-25 03:33:17 +02:00 committed by GitHub
parent b3bee27d8a
commit 49bab02fca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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),