diff --git a/src/battle.ts b/src/battle.ts index 0f893fc50162..f6db308d344f 100644 --- a/src/battle.ts +++ b/src/battle.ts @@ -314,8 +314,8 @@ function getRandomTrainerFunc(trainerPool: (TrainerType | TrainerType[])[]): Get : trainerPoolEntry; trainerTypes.push(trainerType); } - // If the trainer type has a double variant, there's a 33% chance of it being a double battle - if (trainerConfigs[trainerTypes[rand]].trainerTypeDouble) { + // If the trainer type has a double variant, there's a 33% chance of it being a double battle (for now we only allow tate&liza to be double) + if (trainerConfigs[trainerTypes[rand]].trainerTypeDouble && (trainerTypes[rand] === TrainerType.TATE || trainerTypes[rand] === TrainerType.LIZA)) { return new Trainer(scene, trainerTypes[rand], Utils.randSeedInt(3) ? TrainerVariant.DOUBLE : TrainerVariant.DEFAULT); } return new Trainer(scene, trainerTypes[rand], TrainerVariant.DEFAULT); diff --git a/src/field/trainer.ts b/src/field/trainer.ts index 3e59eaf78329..fb85bfbe8b79 100644 --- a/src/field/trainer.ts +++ b/src/field/trainer.ts @@ -20,6 +20,7 @@ import {trainerNamePools} from "../data/trainer-names"; import {ArenaTagSide, ArenaTrapTag} from "#app/data/arena-tag"; import {getIsInitialized, initI18n} from "#app/plugins/i18n"; import i18next from "i18next"; +import {Species} from "#app/data/enums/species"; export enum TrainerVariant { DEFAULT, @@ -314,12 +315,25 @@ export default class Trainer extends Phaser.GameObjects.Container { // If the index is even, use the species pool for the main trainer (that way he only uses his own pokemon in battle) if (!(index % 2)) { - newSpeciesPool = speciesPoolFiltered; + // Since the only currently allowed double battle with named trainers is Tate & Liza, we need to make sure that Solrock is the first pokemon in the party for Tate and Lunatone for Liza + if (index === 0 && (TrainerType[this.config.trainerType] === TrainerType[TrainerType.TATE])) { + newSpeciesPool = [Species.SOLROCK]; + } else if (index === 0 && (TrainerType[this.config.trainerType] === TrainerType[TrainerType.LIZA])) { + newSpeciesPool = [Species.LUNATONE]; + } else { + newSpeciesPool = speciesPoolFiltered; + } } else { // If the index is odd, use the species pool for the partner trainer (that way he only uses his own pokemon in battle) - newSpeciesPool = speciesPoolPartnerFiltered; + // Since the only currently allowed double battle with named trainers is Tate & Liza, we need to make sure that Solrock is the first pokemon in the party for Tate and Lunatone for Liza + if (index === 1 && (TrainerType[this.config.trainerTypeDouble] === TrainerType[TrainerType.TATE])) { + newSpeciesPool = [Species.SOLROCK]; + } else if (index === 1 && (TrainerType[this.config.trainerTypeDouble] === TrainerType[TrainerType.LIZA])) { + newSpeciesPool = [Species.LUNATONE]; + } else { + newSpeciesPool = speciesPoolPartnerFiltered; + } } - // Fallback for when the species pool is empty if (newSpeciesPool.length === 0) { // If all pokemon from this pool are already in the party, generate a random species