Skip to content

Commit

Permalink
Endless Battle Clause: Skill Swap should remove the user's staleness (s…
Browse files Browse the repository at this point in the history
  • Loading branch information
MathyFurret authored May 19, 2024
1 parent f0b9da8 commit 002bf04
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions data/moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
11 changes: 11 additions & 0 deletions test/sim/misc/endlessbattleclause.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 002bf04

Please sign in to comment.