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;
|
: trainerPoolEntry;
|
||||||
trainerTypes.push(trainerType);
|
trainerTypes.push(trainerType);
|
||||||
}
|
}
|
||||||
// If the trainer type has a double variant, there's a 33% chance of it being a double battle
|
// 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) {
|
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], Utils.randSeedInt(3) ? TrainerVariant.DOUBLE : TrainerVariant.DEFAULT);
|
||||||
}
|
}
|
||||||
return new Trainer(scene, trainerTypes[rand], 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 {ArenaTagSide, ArenaTrapTag} from "#app/data/arena-tag";
|
||||||
import {getIsInitialized, initI18n} from "#app/plugins/i18n";
|
import {getIsInitialized, initI18n} from "#app/plugins/i18n";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
import {Species} from "#app/data/enums/species";
|
||||||
|
|
||||||
export enum TrainerVariant {
|
export enum TrainerVariant {
|
||||||
DEFAULT,
|
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 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)) {
|
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 {
|
} else {
|
||||||
// If the index is odd, use the species pool for the partner trainer (that way he only uses his own pokemon in battle)
|
// 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
|
// Fallback for when the species pool is empty
|
||||||
if (newSpeciesPool.length === 0) {
|
if (newSpeciesPool.length === 0) {
|
||||||
// If all pokemon from this pool are already in the party, generate a random species
|
// If all pokemon from this pool are already in the party, generate a random species
|
||||||
|
|
Loading…
Reference in New Issue