fix switching override in doubles
This commit is contained in:
parent
a086b3a0ad
commit
c1019bac39
|
@ -430,16 +430,17 @@ export default class Trainer extends Phaser.GameObjects.Container {
|
||||||
}
|
}
|
||||||
|
|
||||||
getPartyMemberMatchupScores(trainerSlot: TrainerSlot = TrainerSlot.NONE, forSwitch: boolean = false): [integer, integer][] {
|
getPartyMemberMatchupScores(trainerSlot: TrainerSlot = TrainerSlot.NONE, forSwitch: boolean = false): [integer, integer][] {
|
||||||
if (Overrides.TRAINER_ALWAYS_SWITCHES) {
|
|
||||||
return [[1, 100], [1, 100]];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (trainerSlot && !this.isDouble()) {
|
if (trainerSlot && !this.isDouble()) {
|
||||||
trainerSlot = TrainerSlot.NONE;
|
trainerSlot = TrainerSlot.NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
const party = this.scene.getEnemyParty();
|
const party = this.scene.getEnemyParty();
|
||||||
const nonFaintedLegalPartyMembers = party.slice(this.scene.currentBattle.getBattlerCount()).filter(p => p.isAllowedInBattle()).filter(p => !trainerSlot || p.trainerSlot === trainerSlot);
|
const nonFaintedLegalPartyMembers = party.slice(this.scene.currentBattle.getBattlerCount()).filter(p => p.isAllowedInBattle()).filter(p => !trainerSlot || p.trainerSlot === trainerSlot);
|
||||||
|
|
||||||
|
if (Overrides.TRAINER_ALWAYS_SWITCHES) {
|
||||||
|
return nonFaintedLegalPartyMembers.map(p => [party.indexOf(p), 100]);
|
||||||
|
}
|
||||||
|
|
||||||
const partyMemberScores = nonFaintedLegalPartyMembers.map(p => {
|
const partyMemberScores = nonFaintedLegalPartyMembers.map(p => {
|
||||||
const playerField = this.scene.getPlayerField().filter(p => p.isAllowedInBattle());
|
const playerField = this.scene.getPlayerField().filter(p => p.isAllowedInBattle());
|
||||||
let score = 0;
|
let score = 0;
|
||||||
|
|
Loading…
Reference in New Issue