mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-09-08 17:25: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.
68 lines
2.4 KiB
JavaScript
68 lines
2.4 KiB
JavaScript
'use strict';
|
|
|
|
const assert = require('./../../assert');
|
|
const common = require('./../../common');
|
|
|
|
let battle;
|
|
|
|
describe('Dry Skin', () => {
|
|
afterEach(() => {
|
|
battle.destroy();
|
|
});
|
|
|
|
it('should take 1/8 max HP every turn that Sunny Day is active', () => {
|
|
battle = common.createBattle([[
|
|
{ species: 'Toxicroak', ability: 'dryskin', moves: ['bulkup'] },
|
|
], [
|
|
{ species: 'Ninetales', ability: 'flashfire', moves: ['sunnyday'] },
|
|
]]);
|
|
const dryMon = battle.p1.active[0];
|
|
assert.hurtsBy(dryMon, Math.floor(dryMon.maxhp / 8), () => battle.makeChoices('move bulkup', 'move sunnyday'));
|
|
});
|
|
|
|
it('should heal 1/8 max HP every turn that Rain Dance is active', () => {
|
|
battle = common.createBattle([[
|
|
{ species: 'Toxicroak', ability: 'dryskin', moves: ['substitute'] },
|
|
], [
|
|
{ species: 'Politoed', ability: 'damp', moves: ['encore', 'raindance'] },
|
|
]]);
|
|
const dryMon = battle.p1.active[0];
|
|
battle.makeChoices('move substitute', 'move encore');
|
|
assert.hurtsBy(dryMon, -Math.floor(dryMon.maxhp / 8), () => battle.makeChoices('move substitute', 'move raindance'));
|
|
});
|
|
|
|
it('should grant immunity to Water-type moves and heal 1/4 max HP', () => {
|
|
battle = common.createBattle([[
|
|
{ species: 'Toxicroak', ability: 'dryskin', moves: ['substitute'] },
|
|
], [
|
|
{ species: 'Politoed', ability: 'damp', moves: ['watergun'] },
|
|
]]);
|
|
battle.makeChoices('move substitute', 'move watergun');
|
|
assert.fullHP(battle.p1.active[0]);
|
|
});
|
|
|
|
it('should cause the user to take 1.25x damage from Fire-type attacks', () => {
|
|
battle = common.createBattle([[
|
|
{ species: 'Toxicroak', ability: 'dryskin', moves: ['bulkup'] },
|
|
], [
|
|
{ species: 'Haxorus', ability: 'unnerve', moves: ['incinerate'] },
|
|
]]);
|
|
battle.makeChoices('move bulkup', 'move incinerate');
|
|
const damage = battle.p1.active[0].maxhp - battle.p1.active[0].hp;
|
|
assert.bounded(damage, [51, 61]);
|
|
});
|
|
|
|
it('should be suppressed by Mold Breaker', () => {
|
|
battle = common.createBattle([[
|
|
{ species: 'Toxicroak', ability: 'dryskin', moves: ['bulkup'] },
|
|
], [
|
|
{ species: 'Haxorus', ability: 'moldbreaker', moves: ['incinerate', 'surf'] },
|
|
]]);
|
|
battle.makeChoices('move bulkup', 'move incinerate');
|
|
const target = battle.p1.active[0];
|
|
const damage = target.maxhp - target.hp;
|
|
assert.bounded(damage, [41, 49]);
|
|
assert.hurts(target, () => battle.makeChoices('move bulkup', 'move surf'));
|
|
});
|
|
});
|