mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-09-10 02:05:35 -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.
102 lines
4.2 KiB
JavaScript
102 lines
4.2 KiB
JavaScript
'use strict';
|
|
|
|
const assert = require('./../../assert');
|
|
const common = require('./../../common');
|
|
|
|
let battle;
|
|
|
|
describe('Prankster', () => {
|
|
afterEach(() => {
|
|
battle.destroy();
|
|
});
|
|
|
|
it('should increase the priority of Status moves', () => {
|
|
battle = common.createBattle([
|
|
[{ species: "Murkrow", ability: 'prankster', moves: ['taunt'] }],
|
|
[{ species: "Deoxys-Speed", ability: 'pressure', moves: ['calmmind'] }],
|
|
]);
|
|
battle.makeChoices('move taunt', 'move calmmind');
|
|
assert.statStage(battle.p2.active[0], 'spa', 0);
|
|
});
|
|
|
|
it('should cause Status moves to fail against Dark Pokémon', () => {
|
|
battle = common.createBattle([
|
|
[{ species: "Sableye", ability: 'prankster', moves: ['willowisp'] }],
|
|
[{ species: "Sableye", ability: 'keeneye', moves: ['willowisp'] }],
|
|
]);
|
|
assert.constant(() => battle.p2.active[0].status, () => battle.makeChoices('move willowisp', 'move willowisp'));
|
|
});
|
|
|
|
it('should cause bounced Status moves to fail against Dark Pokémon', () => {
|
|
battle = common.createBattle([
|
|
[{ species: "Klefki", ability: 'prankster', moves: ['magiccoat'] }],
|
|
[{ species: "Spiritomb", ability: 'pressure', moves: ['willowisp'] }],
|
|
]);
|
|
assert.constant(() => battle.p2.active[0].status, () => battle.makeChoices('move magiccoat', 'move willowisp'));
|
|
});
|
|
|
|
it('should not cause bounced Status moves to fail against Dark Pokémon if it is removed', () => {
|
|
battle = common.createBattle({ gameType: 'doubles' });
|
|
battle.setPlayer('p1', { team: [
|
|
{ species: "Alakazam", ability: 'synchronize', moves: ['skillswap'] },
|
|
{ species: "Sableye", ability: 'prankster', moves: ['magiccoat'] },
|
|
] });
|
|
battle.setPlayer('p2', { team: [
|
|
{ species: "Pyukumuku", ability: 'unaware', moves: ['curse'] },
|
|
{ species: "Houndoom", ability: 'flashfire', moves: ['confide'] },
|
|
] });
|
|
const darkPokemon = battle.p2.active[1];
|
|
battle.makeChoices('move skillswap -2, move magiccoat', 'move curse, move confide 2');
|
|
assert.statStage(darkPokemon, 'spa', -1);
|
|
});
|
|
|
|
it('should not cause Status moves forced by Encore to fail against Dark Pokémon', () => {
|
|
battle = common.createBattle([
|
|
[{ species: "Liepard", ability: 'prankster', moves: ['encore'] }],
|
|
[{ species: "Riolu", ability: 'prankster', moves: ['confide', 'return'] }],
|
|
]);
|
|
battle.makeChoices('move encore', 'move confide');
|
|
battle.makeChoices('move encore', 'move return');
|
|
assert.statStage(battle.p1.active[0], 'spa', -1);
|
|
});
|
|
|
|
it('should cause moves forced by Encore to fail against Dark Pokémon if the attacker intended to use a Status move', () => {
|
|
// https://www.smogon.com/forums/threads/3469932/page-396#post-7736003
|
|
battle = common.createBattle({ gameType: 'doubles' }, [
|
|
[{ species: "Liepard", ability: 'prankster', moves: ['encore', 'nastyplot'] }, { species: "Tapu Fini", ability: 'mistysurge', moves: ['calmmind'] }],
|
|
[{ species: "Meowstic", ability: 'prankster', moves: ['frustration', 'leer'] }, { species: "Lopunny", ability: 'limber', moves: ['agility'] }],
|
|
]);
|
|
|
|
battle.makeChoices('move encore 1, move calmmind', 'move frustration 2, move agility');
|
|
battle.makeChoices('move encore 1, move calmmind', 'move leer, move agility');
|
|
assert(battle.p2.active[0].volatiles['encore'], `Meowstic should be encored`);
|
|
assert.fullHP(battle.p1.active[0]);
|
|
});
|
|
|
|
it('should not leak the ability via hint if the target is immune to the Status move', () => {
|
|
battle = common.createBattle([
|
|
[{ species: "Sableye", ability: 'prankster', moves: ['willowisp'] }],
|
|
[{ species: "Houndoom", ability: 'pressure', moves: ['willowisp'] }],
|
|
]);
|
|
battle.makeChoices('move willowisp', 'move willowisp');
|
|
assert.false(battle.log.some(line => line.includes('hint')), `Prankster should not leak the ability via hint`);
|
|
});
|
|
});
|
|
|
|
describe('Prankster [Gen 6]', () => {
|
|
afterEach(() => {
|
|
battle.destroy();
|
|
});
|
|
|
|
it(`should not cause Status moves to fail against Dark Pokémon`, () => {
|
|
battle = common.gen(6).createBattle([[
|
|
{ species: 'Sableye', ability: 'prankster', moves: ['willowisp'] },
|
|
], [
|
|
{ species: 'Sableye', ability: 'noguard', moves: ['willowisp'] },
|
|
]]);
|
|
battle.makeChoices();
|
|
assert.equal(battle.p1.active[0].status, 'brn');
|
|
assert.equal(battle.p2.active[0].status, 'brn');
|
|
});
|
|
});
|