From ad26883309286782fd811c692c945aedd3264b59 Mon Sep 17 00:00:00 2001 From: Christopher Schmidt Date: Fri, 19 Jul 2024 18:05:12 -0400 Subject: [PATCH] Clearer implementation of combining user and teammates' moves --- src/data/move.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index 122f93c5dd8..e2a08d1d1e9 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -5000,9 +5000,10 @@ export class RandomMovesetMoveAttr extends OverrideMoveEffectAttr { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { const moveset = (!this.enemyMoveset ? user : target).getMoveset(); - const allies = moveset.concat(user.scene.getParty().map(p => p.moveset).flat()); + const allies = user.scene.getParty().filter(p => p !== user); + const partyMoveset = moveset.concat(allies.map(p => p.moveset).flat()); - const moves = allies.filter(m => !m.getMove().hasFlag(MoveFlags.IGNORE_VIRTUAL)); + const moves = partyMoveset.filter(m => !m.getMove().hasFlag(MoveFlags.IGNORE_VIRTUAL)); if (moves.length) { const move = moves[user.randSeedInt(moves.length)]; const moveIndex = moveset.findIndex(m => m.moveId === move.moveId);