From 1e28f9545338e54070a32ebf830b7e57176ffa46 Mon Sep 17 00:00:00 2001 From: Reldnahc Date: Sat, 4 May 2024 17:17:49 -0500 Subject: [PATCH] properly bounce multi targeted attacks --- src/phases.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/phases.ts b/src/phases.ts index 05bbb4913..aeba4fbef 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -2414,8 +2414,13 @@ export class MoveEffectPhase extends PokemonPhase { if (isBounced) { this.scene.queueMessage(getPokemonMessage(targets[0], '\nbounced the move back!')); const tempTargets = targets; - targets = [user]; - this.targets = [user.getBattlerIndex()]; + this.targets = getMoveTargets(tempTargets[0], this.move.moveId).targets; + targets = []; + for (let index of this.targets){ + const target = this.scene.getField()[index]; + if (target) + targets.push(target); + } user = tempTargets[0]; if (!this.move.getMove().applyConditions(user, targets[0], this.move.getMove())) { this.scene.queueMessage(i18next.t('menu:attackFailed'));