properly bounce multi targeted attacks

pull/468/head
Reldnahc 2024-05-04 17:17:49 -05:00
parent 9eec2c3e3a
commit 1e28f95453
1 changed files with 7 additions and 2 deletions

View File

@ -2414,8 +2414,13 @@ export class MoveEffectPhase extends PokemonPhase {
if (isBounced) { if (isBounced) {
this.scene.queueMessage(getPokemonMessage(targets[0], '\nbounced the move back!')); this.scene.queueMessage(getPokemonMessage(targets[0], '\nbounced the move back!'));
const tempTargets = targets; const tempTargets = targets;
targets = [user]; this.targets = getMoveTargets(tempTargets[0], this.move.moveId).targets;
this.targets = [user.getBattlerIndex()]; targets = [];
for (let index of this.targets){
const target = this.scene.getField()[index];
if (target)
targets.push(target);
}
user = tempTargets[0]; user = tempTargets[0];
if (!this.move.getMove().applyConditions(user, targets[0], this.move.getMove())) { if (!this.move.getMove().applyConditions(user, targets[0], this.move.getMove())) {
this.scene.queueMessage(i18next.t('menu:attackFailed')); this.scene.queueMessage(i18next.t('menu:attackFailed'));