mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-08-21 16:44:27 -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.
57 lines
2.2 KiB
JavaScript
57 lines
2.2 KiB
JavaScript
'use strict';
|
|
|
|
const assert = require('./../../assert');
|
|
const common = require('./../../common');
|
|
|
|
let battle;
|
|
|
|
describe('Pledge Moves', () => {
|
|
beforeEach(() => {
|
|
battle = common.createBattle({ gameType: 'doubles' });
|
|
});
|
|
|
|
afterEach(() => battle.destroy());
|
|
|
|
it('should not combine if one of the users is forced to use a non-pledge move on its turn', () => {
|
|
battle.setPlayer('p1', { team: [
|
|
{ species: 'Venusaur', level: 90, moves: ['sludge', 'grasspledge'] },
|
|
{ species: 'Charizard', level: 99, moves: ['sleeptalk', 'firepledge'] },
|
|
] });
|
|
battle.setPlayer('p2', { team: [
|
|
{ species: 'Whimsicott', ability: 'prankster', moves: ['encore'] },
|
|
{ species: 'Blastoise', moves: ['sleeptalk'] },
|
|
] });
|
|
|
|
battle.makeChoices('move sludge 2, move sleeptalk', 'move encore 1, move sleeptalk');
|
|
battle.makeChoices('move grasspledge 2, move firepledge 2', 'move encore 1, move sleeptalk');
|
|
assert(!battle.p2.active[0].side.sideConditions['firepledge'], "Fire Pledge should not be active on the opponent's side of the field.");
|
|
assert(!battle.p1.active[1].moveThisTurn, "Charizard should not have moved this turn.");
|
|
});
|
|
|
|
it("should not start a Pledge combo for Z-moves", () => {
|
|
battle = common.gen(7).createBattle({ gameType: 'doubles' }, [[
|
|
{ species: 'Weedle', ability: 'sapsipper', moves: ['sleeptalk'] },
|
|
{ species: 'Wynaut', moves: ['sleeptalk'] },
|
|
], [
|
|
{ species: 'Venusaur', moves: ['grasspledge'] },
|
|
{ species: 'Charizard', level: 1, item: 'firiumz', moves: ['firepledge'] },
|
|
]]);
|
|
battle.makeChoices('auto', 'move grasspledge +1, move firepledge +1 zmove');
|
|
const weedle = battle.p1.active[0];
|
|
assert.statStage(weedle, 'atk', +1);
|
|
});
|
|
|
|
it("should not start a Pledge combo for Max Moves", () => {
|
|
battle = common.gen(8).createBattle({ gameType: 'doubles' }, [[
|
|
{ species: 'Weedle', ability: 'sapsipper', moves: ['sleeptalk'] },
|
|
{ species: 'Wynaut', moves: ['sleeptalk'] },
|
|
], [
|
|
{ species: 'Venusaur', moves: ['grasspledge'] },
|
|
{ species: 'Charizard', level: 1, moves: ['firepledge'], gigantamax: true },
|
|
]]);
|
|
battle.makeChoices('auto', 'move grasspledge +1, move firepledge +1 dynamax');
|
|
const weedle = battle.p1.active[0];
|
|
assert.statStage(weedle, 'atk', +1);
|
|
});
|
|
});
|