mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-09-11 18:55:38 -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.
104 lines
4.5 KiB
JavaScript
104 lines
4.5 KiB
JavaScript
'use strict';
|
|
|
|
const assert = require('./../../assert');
|
|
const common = require('./../../common');
|
|
|
|
let battle;
|
|
|
|
describe('Storm Drain', () => {
|
|
afterEach(() => {
|
|
battle.destroy();
|
|
});
|
|
|
|
it('should grant immunity to Water-type moves and boost Special Attack by 1 stage', () => {
|
|
battle = common.createBattle();
|
|
battle.setPlayer('p1', { team: [{ species: 'Gastrodon', ability: 'stormdrain', moves: ['sleeptalk'] }] });
|
|
battle.setPlayer('p2', { team: [{ species: 'Azumarill', ability: 'thickfat', moves: ['aquajet'] }] });
|
|
battle.makeChoices('move sleeptalk', 'move aquajet');
|
|
assert.fullHP(battle.p1.active[0]);
|
|
assert.statStage(battle.p1.active[0], 'spa', 1);
|
|
});
|
|
|
|
it('should redirect Max Geyser', () => {
|
|
battle = common.gen(8).createBattle({ gameType: 'doubles' });
|
|
battle.setPlayer('p1', { team: [
|
|
{ species: 'Gastrodon', ability: 'stormdrain', moves: ['sleep talk'] },
|
|
{ species: 'Manaphy', ability: 'hydration', moves: ['scald'] },
|
|
] });
|
|
battle.setPlayer('p2', { team: [
|
|
{ species: 'Igglybuff', ability: 'cute charm', moves: ['sleep talk'] },
|
|
{ species: 'Igglybuff', ability: 'cute charm', moves: ['sleep talk'] },
|
|
] });
|
|
battle.makeChoices('move sleeptalk, move scald dynamax 1', 'move sleep talk, move sleep talk');
|
|
assert.fullHP(battle.p1.active[0]);
|
|
assert.statStage(battle.p1.active[0], 'spa', 1);
|
|
});
|
|
|
|
it('should redirect single-target Water-type attacks to the user if it is a valid target', () => {
|
|
battle = common.gen(5).createBattle({ gameType: 'triples' });
|
|
battle.setPlayer('p1', { team: [
|
|
{ species: 'Gastrodon', ability: 'stormdrain', moves: ['sleeptalk'] },
|
|
{ species: 'Azumarill', ability: 'thickfat', moves: ['aquajet'] },
|
|
{ species: 'Azumarill', ability: 'thickfat', moves: ['aquajet'] },
|
|
] });
|
|
battle.setPlayer('p2', { team: [
|
|
{ species: 'Azumarill', ability: 'thickfat', moves: ['aquajet'] },
|
|
{ species: 'Azumarill', ability: 'thickfat', moves: ['aquajet'] },
|
|
{ species: 'Azumarill', ability: 'thickfat', moves: ['aquajet'] },
|
|
] });
|
|
battle.makeChoices('move sleeptalk, move aquajet 1, move aquajet 1', 'move aquajet 3, move aquajet 3, move aquajet 2');
|
|
assert.statStage(battle.p1.active[0], 'spa', 3);
|
|
assert.false.fullHP(battle.p1.active[2]);
|
|
assert.false.fullHP(battle.p2.active[0]);
|
|
});
|
|
|
|
it('should redirect to the fastest Pokemon with the ability', () => {
|
|
battle = common.createBattle({ gameType: 'doubles' });
|
|
battle.setPlayer('p1', { team: [
|
|
{ species: 'Gastrodon', ability: 'stormdrain', moves: ['sleeptalk'] },
|
|
{ species: 'Gastrodon', ability: 'stormdrain', moves: ['sleeptalk'] },
|
|
] });
|
|
battle.setPlayer('p2', { team: [
|
|
{ species: 'Azumarill', ability: 'thickfat', moves: ['waterfall'] },
|
|
{ species: 'Azumarill', ability: 'thickfat', moves: ['waterfall'] },
|
|
] });
|
|
const [fastGastrodon, slowGastrodon] = battle.p1.active;
|
|
fastGastrodon.boostBy({ spe: 6 });
|
|
battle.makeChoices('move sleeptalk, move sleeptalk', 'move waterfall 1, move waterfall 2');
|
|
assert.statStage(fastGastrodon, 'spa', 2);
|
|
assert.statStage(slowGastrodon, 'spa', 0);
|
|
});
|
|
|
|
it('should not redirect if another Pokemon has used Follow Me', () => {
|
|
battle = common.createBattle({ gameType: 'doubles' });
|
|
battle.setPlayer('p1', { team: [
|
|
{ species: 'Gastrodon', ability: 'stormdrain', moves: ['sleeptalk'] },
|
|
{ species: 'Azumarill', ability: 'thickfat', moves: ['followme'] },
|
|
] });
|
|
battle.setPlayer('p2', { team: [
|
|
{ species: 'Azumarill', ability: 'thickfat', moves: ['aquajet'] },
|
|
{ species: 'Azumarill', ability: 'thickfat', moves: ['aquajet'] },
|
|
] });
|
|
const [stormDrainMon, defender] = battle.p1.active;
|
|
battle.makeChoices('move sleeptalk, move followme', 'move aquajet 2, move aquajet 1');
|
|
assert.statStage(stormDrainMon, 'spa', 0);
|
|
assert.false.fullHP(defender);
|
|
});
|
|
|
|
it('should have its Water-type immunity and its ability to redirect moves suppressed by Mold Breaker', () => {
|
|
battle = common.createBattle({ gameType: 'doubles' });
|
|
battle.setPlayer('p1', { team: [
|
|
{ species: 'Gastrodon', ability: 'stormdrain', moves: ['endure'] },
|
|
{ species: 'Manaphy', ability: 'hydration', moves: ['tailglow'] },
|
|
] });
|
|
battle.setPlayer('p2', { team: [
|
|
{ species: 'Haxorus', ability: 'moldbreaker', moves: ['waterfall'] },
|
|
{ species: 'Reshiram', ability: 'turboblaze', moves: ['waterpulse'] },
|
|
] });
|
|
const [stormDrainMon, ally] = battle.p1.active;
|
|
battle.makeChoices('move endure, move tailglow', 'move waterfall 1, move waterpulse 2');
|
|
assert.false.fullHP(stormDrainMon);
|
|
assert.false.fullHP(ally);
|
|
});
|
|
});
|