From 002bf047ac7c57eccd964626a3aeaaedd476f935 Mon Sep 17 00:00:00 2001 From: Alexander B <4866817+MathyFurret@users.noreply.github.com> Date: Sun, 19 May 2024 12:45:47 -0500 Subject: [PATCH] Endless Battle Clause: Skill Swap should remove the user's staleness (#10302) --- data/moves.ts | 1 + test/sim/misc/endlessbattleclause.js | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/data/moves.ts b/data/moves.ts index 333b841ac699..46787df2257c 100644 --- a/data/moves.ts +++ b/data/moves.ts @@ -17247,6 +17247,7 @@ export const Moves: {[moveid: string]: MoveData} = { target.ability = sourceAbility.id; source.abilityState = {id: this.toID(source.ability), target: source}; target.abilityState = {id: this.toID(target.ability), target: target}; + source.volatileStaleness = undefined; if (!target.isAlly(source)) target.volatileStaleness = 'external'; this.singleEvent('Start', targetAbility, source.abilityState, source); this.singleEvent('Start', sourceAbility, target.abilityState, target); diff --git a/test/sim/misc/endlessbattleclause.js b/test/sim/misc/endlessbattleclause.js index 3075a33a880c..5bf58477860b 100644 --- a/test/sim/misc/endlessbattleclause.js +++ b/test/sim/misc/endlessbattleclause.js @@ -190,6 +190,17 @@ describe('Endless Battle Clause (slow)', () => { battle.makeChoices('switch 2', 'switch 2'); assert(battle.ended); }); + + it('Skill Swap should remove the user\'s staleness', () => { + battle = common.createBattle({endlessBattleClause: true}, [[ + {species: "Furret", moves: ['skillswap']}, + ], [ + {species: "Ampharos", moves: ['skillswap']}, + ]]); + skipTurns(battle, 100); + for (let i = 0; i < 8; i++) battle.makeChoices(); + assert.false(battle.ended); + }); }); // Endless Battle Clause doesn't take effect for 100 turns, so we artificially skip turns