Old Gens Random Battles: allow battle only formes to generate in Monotype battles (#9490)

This commit is contained in:
livid washed 2023-04-10 23:58:51 +02:00 committed by GitHub
parent 480498a64e
commit b17aae9aa5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2406,14 +2406,14 @@ export class RandomGen8Teams {
) {
const exclude = pokemonToExclude.map(p => toID(p.species));
const pokemonPool = [];
for (let species of this.dex.species.all()) {
for (const species of this.dex.species.all()) {
if (species.gen > this.gen || exclude.includes(species.id)) continue;
if (this.dex.currentMod === 'gen8bdsp' && species.gen > 4) continue;
if (isMonotype) {
if (!species.types.includes(type)) continue;
if (typeof species.battleOnly === 'string') {
species = this.dex.species.get(species.battleOnly);
if (!species.types.includes(type)) continue;
const baseSpecies = this.dex.species.get(species.battleOnly);
if (!baseSpecies.types.includes(type)) continue;
}
}
pokemonPool.push(species.id);