mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-08-22 09:04:50 -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.
90 lines
3.0 KiB
JavaScript
90 lines
3.0 KiB
JavaScript
'use strict';
|
|
|
|
const assert = require('./../../assert');
|
|
const common = require('./../../common');
|
|
|
|
let battle;
|
|
|
|
describe('Fusion Bolt + Fusion Flare', () => {
|
|
afterEach(() => {
|
|
battle.destroy();
|
|
});
|
|
|
|
it(`should boost the second move if the first was used immediately before it`, () => {
|
|
battle = common.createBattle({ gameType: 'doubles' }, [[
|
|
{ species: 'Wynaut', moves: ['fusionbolt'] },
|
|
{ species: 'Wobbuffet', moves: ['fusionflare'] },
|
|
], [
|
|
{ species: 'Dragonite', item: 'laggingtail', moves: ['roost'] },
|
|
{ species: 'Lugia', moves: ['fusionbolt'] },
|
|
]]);
|
|
|
|
const bpModifiers = new Map();
|
|
battle.onEvent('BasePower', battle.format, -100, function (bp, attacker, defender, move) {
|
|
bpModifiers.set(move.id, this.event.modifier);
|
|
});
|
|
battle.makeChoices('move fusionbolt 1, move fusionflare 1', 'auto');
|
|
assert.equal(bpModifiers.get('fusionbolt'), 2);
|
|
assert.equal(bpModifiers.get('fusionflare'), 2);
|
|
});
|
|
|
|
it(`should boost the second move if the first was used by the same Pokemon`, () => {
|
|
battle = common.createBattle({ gameType: 'doubles' }, [[
|
|
{ species: 'Magikarp', item: 'laggingtail', moves: ['fusionbolt', 'fusionflare'] },
|
|
{ species: 'Oranguru', moves: ['sleeptalk', 'instruct'] },
|
|
], [
|
|
{ species: 'Dragonite', moves: ['roost'] },
|
|
{ species: 'Lugia', moves: ['roost'] },
|
|
]]);
|
|
|
|
battle.makeChoices();
|
|
|
|
const bpModifiers = new Map();
|
|
battle.onEvent('BasePower', battle.format, -100, function (bp, attacker, defender, move) {
|
|
bpModifiers.set(move.id, this.event.modifier);
|
|
});
|
|
battle.makeChoices('move fusionflare 2, move instruct -1', 'default');
|
|
|
|
assert.equal(bpModifiers.get('fusionbolt'), 1);
|
|
assert.equal(bpModifiers.get('fusionflare'), 2);
|
|
});
|
|
|
|
it(`should not boost the second move if another move was used between them`, () => {
|
|
battle = common.createBattle({ gameType: 'doubles' }, [[
|
|
{ species: 'Zekrom', moves: ['fusionbolt'] },
|
|
{ species: 'Reshiram', item: 'laggingtail', moves: ['fusionflare'] },
|
|
], [
|
|
{ species: 'Dragonite', ability: 'shellarmor', moves: ['roost'] },
|
|
{ species: 'Lugia', moves: ['roost'] },
|
|
]]);
|
|
|
|
battle.makeChoices();
|
|
|
|
const bpModifiers = new Map();
|
|
battle.onEvent('BasePower', battle.format, -100, function (bp, attacker, defender, move) {
|
|
bpModifiers.set(move.id, this.event.modifier);
|
|
});
|
|
battle.makeChoices('move fusionbolt 1, move fusionflare 1', 'auto');
|
|
|
|
assert.equal(bpModifiers.get('fusionflare'), 1);
|
|
});
|
|
|
|
it(`should not boost the second move if the first move failed`, () => {
|
|
battle = common.createBattle({ gameType: 'doubles' }, [[
|
|
{ species: 'Regieleki', moves: ['fusionbolt'] },
|
|
{ species: 'Reshiram', moves: ['fusionflare'] },
|
|
], [
|
|
{ species: 'Stunfisk', moves: ['roost'] },
|
|
{ species: 'Stunfisk', moves: ['roost'] },
|
|
]]);
|
|
|
|
const bpModifiers = new Map();
|
|
battle.onEvent('BasePower', battle.format, -100, function (bp, attacker, defender, move) {
|
|
bpModifiers.set(move.id, this.event.modifier);
|
|
});
|
|
battle.makeChoices('move fusionbolt 1, move fusionflare 1', 'default');
|
|
|
|
assert.equal(bpModifiers.get('fusionflare'), 1);
|
|
});
|
|
});
|