Spaces:
Running
Running
File size: 2,408 Bytes
5c2ed06 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
'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'));
});
});
|