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.
100 lines
3.8 KiB
JavaScript
100 lines
3.8 KiB
JavaScript
'use strict';
|
|
|
|
const assert = require('./../../assert');
|
|
const common = require('./../../common');
|
|
|
|
let battle;
|
|
|
|
describe(`Photon Geyser`, () => {
|
|
afterEach(() => battle.destroy());
|
|
|
|
it(`should become physical when Attack stat is higher than Special Attack stat`, () => {
|
|
battle = common.createBattle([[
|
|
{ species: 'Necrozma-Dusk-Mane', moves: ['photongeyser'] },
|
|
], [
|
|
{ species: 'Mew', item: 'keeberry', moves: ['counter'] },
|
|
]]);
|
|
|
|
battle.makeChoices();
|
|
assert.statStage(battle.p2.active[0], 'def', 1, `physical Photon Geyser should trigger Kee Berry`);
|
|
assert.false.fullHP(battle.p1.active[0], `physical Photon Geyser should be susceptible to Counter`);
|
|
});
|
|
|
|
it(`should determine which attack stat is higher after factoring in stat stages, but no other kind of modifier`, () => {
|
|
battle = common.createBattle([[
|
|
{ species: 'Latias', ability: 'hugepower', item: 'choiceband', moves: ['photongeyser'] },
|
|
], [
|
|
{ species: 'Scizor-Mega', item: 'keeberry', moves: ['strugglebug', 'sleeptalk'] },
|
|
]]);
|
|
|
|
const scizor = battle.p2.active[0];
|
|
battle.makeChoices(); // should be special this turn (196 vs. 256)
|
|
assert.statStage(scizor, 'def', 0, `incorrectly swayed by Choice Band and/or Huge Power`);
|
|
battle.makeChoices(); // should be special this turn (196 vs. 256)
|
|
assert.statStage(scizor, 'def', 1, `the stat drop should have turned Photon Geyser into a special move`);
|
|
});
|
|
|
|
it(`should always be a special Max Move, never physical`, () => {
|
|
battle = common.gen(8).createBattle([[
|
|
{ species: 'conkeldurr', moves: ['photongeyser'] },
|
|
], [
|
|
{ species: 'cresselia', item: 'marangaberry', moves: ['sleeptalk'] },
|
|
]]);
|
|
|
|
battle.makeChoices('move photongeyser dynamax', 'auto');
|
|
assert.statStage(battle.p2.active[0], 'spd', 1, `Photon Geyser behaved as a physical Max move, when it shouldn't`);
|
|
});
|
|
|
|
it(`should always be a special Z-move, never physical`, () => {
|
|
battle = common.gen(7).createBattle([[
|
|
{ species: 'conkeldurr', item: 'psychiumz', moves: ['photongeyser'] },
|
|
], [
|
|
{ species: 'cresselia', item: 'marangaberry', moves: ['sleeptalk'] },
|
|
]]);
|
|
|
|
battle.makeChoices('move photongeyser zmove', 'auto');
|
|
assert.statStage(battle.p2.active[0], 'spd', 1, `Photon Geyser behaved as a physical Z-move, when it shouldn't`);
|
|
});
|
|
|
|
it(`should ignore abilities the same way as Mold Breaker`, () => {
|
|
battle = common.createBattle([[
|
|
{ species: 'Necrozma', moves: ['photongeyser'] },
|
|
], [
|
|
{ species: 'Zeraora', ability: 'voltabsorb', moves: ['electrify'] },
|
|
]]);
|
|
|
|
battle.makeChoices();
|
|
assert.false.fullHP(battle.p2.active[0], `Electrified Photon Geyser should damage through Volt Absorb`);
|
|
});
|
|
|
|
it(`should not ignore abilities when called as a submove of another move`, () => {
|
|
battle = common.createBattle([[
|
|
{ species: 'Liepard', ability: 'prankster', moves: ['assist', 'copycat', 'sleeptalk', 'photongeyser'] },
|
|
{ species: 'Necrozma', moves: ['photongeyser'] },
|
|
], [
|
|
{ species: 'Bruxish', ability: 'dazzling', moves: ['photongeyser', 'spore'] },
|
|
]]);
|
|
|
|
const bruxish = battle.p2.active[0];
|
|
battle.makeChoices('move assist', 'move photongeyser');
|
|
assert.fullHP(bruxish, `incorrectly ignores abilities through Assist`);
|
|
bruxish.hp = bruxish.maxhp;
|
|
battle.makeChoices('move copycat', 'move spore');
|
|
assert.fullHP(bruxish, `incorrectly ignores abilities through Copycat`);
|
|
bruxish.hp = bruxish.maxhp;
|
|
battle.makeChoices('move sleeptalk', 'move photongeyser');
|
|
assert.fullHP(bruxish, `incorrectly ignores abilities through Sleep Talk`);
|
|
});
|
|
|
|
it(`should ignore abilities when called as a submove by a Pokemon that also has Mold Breaker`, () => {
|
|
battle = common.createBattle([[
|
|
{ species: 'Shuckle', ability: 'moldbreaker', moves: ['sleeptalk', 'photongeyser'] },
|
|
], [
|
|
{ species: 'Shedinja', ability: 'disguise', moves: ['spore'] },
|
|
]]);
|
|
|
|
battle.makeChoices();
|
|
assert.fainted(battle.p2.active[0]);
|
|
});
|
|
});
|