mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-25 08:16:04 +00:00
Disables all unique double battles but tate and Liza. And those two will now always have lunatone and the other one (solrock?) as their first pokemon (#1654)
This commit is contained in:
parent
06ba63dd7d
commit
7ee6c979cf
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user