mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-04-26 10:48:53 -05:00
ESLint has a whole new config format, so I figure it's a good time to make the config system saner. - First, we no longer have separate eslint-no-types configs. Lint performance shouldn't be enough of a problem to justify the relevant maintenance complexity. - Second, our base config should work out-of-the-box now. `npx eslint` will work as expected, without any CLI flags. You should still use `npm run lint` which adds the `--cached` flag for performance. - Third, whatever updates I did fixed style linting, which apparently has been bugged for quite some time, considering all the obvious mixed-tabs-and-spaces issues I found in the upgrade. Also here are some changes to our style rules. In particular: - Curly brackets (for objects etc) now have spaces inside them. Sorry for the huge change. ESLint doesn't support our old style, and most projects use Prettier style, so we might as well match them in this way. See https://github.com/eslint-stylistic/eslint-stylistic/issues/415 - String + number concatenation is no longer allowed. We now consistently use template strings for this.
59 lines
2.6 KiB
JavaScript
59 lines
2.6 KiB
JavaScript
'use strict';
|
|
|
|
const assert = require('./../../assert');
|
|
const common = require('./../../common');
|
|
|
|
let battle;
|
|
|
|
describe(`Parting Shot`, () => {
|
|
afterEach(() => {
|
|
battle.destroy();
|
|
});
|
|
|
|
it(`should not switch the user out if the target's stats are not changed`, () => {
|
|
battle = common.createBattle([[
|
|
{ species: 'Silvally', ability: 'prankster', moves: ['partingshot', 'splash'] },
|
|
{ species: 'Type: Null', ability: 'battlearmor', moves: ['return'] },
|
|
], [
|
|
{ species: 'Registeel', ability: 'clearbody', moves: ['splash'] },
|
|
{ species: 'Solgaleo', ability: 'fullmetalbody', moves: ['splash'] },
|
|
{ species: 'Torkoal', ability: 'whitesmoke', moves: ['splash'] },
|
|
{ species: 'Shaymin', ability: 'flowerveil', moves: ['splash'] },
|
|
{ species: 'Kingler', ability: 'hypercutter', moves: ['splash'] },
|
|
{ species: 'Spinda', ability: 'contrary', moves: ['splash', 'partingshot'] },
|
|
]]);
|
|
battle.makeChoices('move partingshot', 'move splash');
|
|
assert.equal(battle.requestState, 'move');
|
|
battle.makeChoices('move partingshot', 'switch 2'); // Solgaleo
|
|
assert.equal(battle.requestState, 'move');
|
|
battle.makeChoices('move partingshot', 'switch 3'); // Torkoal
|
|
assert.equal(battle.requestState, 'move');
|
|
battle.makeChoices('move partingshot', 'switch 4'); // Shaymin
|
|
assert.equal(battle.requestState, 'move');
|
|
battle.makeChoices('move splash', 'switch 5'); // Kingler
|
|
battle.p2.active[0].boostBy({ spa: -6 }); // hack Kingler's Sp. Atk to -6; Hyper Cutter & -6 Sp. Atk
|
|
battle.makeChoices('move partingshot', 'move splash');
|
|
assert.equal(battle.requestState, 'move');
|
|
battle.makeChoices('move splash', 'switch 6'); // Spinda
|
|
battle.p2.active[0].boostBy({ atk: 6, spa: 6 }); // hack Contrary Spinda to +6 Atk / +6 Sp. Atk
|
|
battle.makeChoices('move partingshot', 'move splash');
|
|
assert.equal(battle.requestState, 'move');
|
|
battle.p1.active[0].boostBy({ atk: -6, spa: -6 });
|
|
battle.makeChoices('move splash', 'move partingshot'); // Spinda's Parting Shot against Silvally this time
|
|
assert.equal(battle.requestState, 'move');
|
|
});
|
|
|
|
it(`should set the Z-Parting Shot healing flag even if the Parting Shot itself was not successful`, () => {
|
|
battle = common.createBattle([[
|
|
{ species: 'landorus', ability: 'noguard', moves: ['sleeptalk'] },
|
|
{ species: 'persian-alola', ability: 'noguard', item: 'darkiniumz', moves: ['partingshot'] },
|
|
], [
|
|
{ species: 'wynaut', ability: 'clearbody', moves: ['circlethrow'] },
|
|
]]);
|
|
battle.makeChoices();
|
|
battle.makeChoices('move partingshot zmove', 'auto');
|
|
const landorus = battle.p1.active[0];
|
|
assert.fullHP(landorus);
|
|
});
|
|
});
|