diff --git a/data/random-battles/gen9/teams.ts b/data/random-battles/gen9/teams.ts index 9128bc8db7533..2cdbce02cc099 100644 --- a/data/random-battles/gen9/teams.ts +++ b/data/random-battles/gen9/teams.ts @@ -1988,7 +1988,7 @@ export class RandomTeams { for (const species of speciesPool) { if (species.isNonstandard && species.isNonstandard !== 'Unobtainable') continue; if (requireMoves) { - const hasMovesInCurrentGen = this.dex.species.getMovePool(species.id).size; + const hasMovesInCurrentGen = this.dex.species.getMovePool(species.id, false, 1).size; if (!hasMovesInCurrentGen) continue; } if (requiredType && !species.types.includes(requiredType)) continue; diff --git a/sim/dex-species.ts b/sim/dex-species.ts index 297cdc45db018..9063eac0c64ba 100644 --- a/sim/dex-species.ts +++ b/sim/dex-species.ts @@ -578,12 +578,13 @@ export class DexSpecies { /** * @param id the ID of the species the move pool belongs to * @param isNatDex + * @param sizeLimit 0 for all * @returns a Set of IDs of the full valid movepool of the given species for the current generation/mod. * Note that inter-move incompatibilities, such as those from exclusive events, are not considered and all moves are * lumped together. However, Necturna and Necturine's Sketchable moves are omitted from this pool, as their fundamental * incompatibility with each other is essential to the nature of those species. */ - getMovePool(id: ID, isNatDex = false): Set { + getMovePool(id: ID, isNatDex = false, sizeLimit = 0): Set { let eggMovesOnly = false; let maxGen = this.dex.gen; const gen3HMMoves = ['cut', 'fly', 'surf', 'strength', 'flash', 'rocksmash', 'waterfall', 'dive']; @@ -592,6 +593,9 @@ export class DexSpecies { for (const {species, learnset} of this.getFullLearnset(id)) { if (!eggMovesOnly) eggMovesOnly = this.eggMovesOnly(species, this.get(id)); for (const moveid in learnset) { + if (sizeLimit && movePool.size >= sizeLimit) { + return movePool; + } if (species.isNonstandard !== 'CAP') { if (gen4HMMoves.includes(moveid) && this.dex.gen >= 5) { if (!learnset[moveid].some(source => parseInt(source.charAt(0)) >= 5 &&