Fix for single battle trainer summoning issue
This commit is contained in:
parent
945236f760
commit
918a0d77f1
|
@ -2104,7 +2104,7 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
|
|||
switchOutTarget.scene.field.remove(switchOutTarget);
|
||||
|
||||
if (switchOutTarget.hp)
|
||||
user.scene.unshiftPhase(new SwitchSummonPhase(user.scene, switchOutTarget.getFieldIndex(), user.scene.currentBattle.trainer.getNextSummonIndex(), false, this.batonPass, false));
|
||||
user.scene.unshiftPhase(new SwitchSummonPhase(user.scene, switchOutTarget.getFieldIndex(), user.scene.currentBattle.trainer.getNextSummonIndex((switchOutTarget as EnemyPokemon).trainerSlot), false, this.batonPass, false));
|
||||
} else {
|
||||
switchOutTarget.setVisible(false);
|
||||
|
||||
|
|
|
@ -302,6 +302,9 @@ export default class Trainer extends Phaser.GameObjects.Container {
|
|||
}
|
||||
|
||||
getNextSummonIndex(trainerSlot: TrainerSlot = TrainerSlot.NONE, partyMemberScores: [integer, integer][] = this.getPartyMemberMatchupScores(trainerSlot)): integer {
|
||||
if (trainerSlot && !this.isDouble())
|
||||
trainerSlot = TrainerSlot.NONE;
|
||||
|
||||
const sortedPartyMemberScores = this.getSortedPartyMemberMatchupScores(partyMemberScores);
|
||||
|
||||
const maxScorePartyMemberIndexes = partyMemberScores.filter(pms => pms[1] === sortedPartyMemberScores[0][1]).map(pms => pms[0]);
|
||||
|
|
Loading…
Reference in New Issue