pokemon-showdown/test/simulator/abilities/thickfat.js
Juanma Serrano c4ac8d6e2f Use strict mode and let and const instead of var
This commit also fixes some duplicated variable declarations.
2015-11-06 21:56:52 -05:00

43 lines
1.5 KiB
JavaScript

'use strict';
const assert = require('assert');
let battle;
describe('Thick Fat', function () {
afterEach(function () {
battle.destroy();
});
it('should halve damage from Fire- or Ice-type attacks', function () {
battle = BattleEngine.Battle.construct();
battle.join('p1', 'Guest 1', 1, [{species: "Hariyama", ability: 'thickfat', moves: ['splash']}]);
battle.join('p2', 'Guest 2', 1, [{species: "Nidoking", ability: 'sheerforce', moves: ['incinerate', 'icebeam']}]);
let damage;
let pokemon = battle.p1.active[0];
battle.commitDecisions();
damage = pokemon.maxhp - pokemon.hp;
assert.ok(damage >= 29 && damage <= 35);
pokemon.hp = pokemon.maxhp;
battle.choose('p2', 'move 2');
battle.commitDecisions();
damage = pokemon.maxhp - pokemon.hp;
assert.ok(damage >= 56 && damage <= 66);
});
it('should be suppressed by Mold Breaker', function () {
battle = BattleEngine.Battle.construct();
battle.join('p1', 'Guest 1', 1, [{species: "Hariyama", ability: 'thickfat', moves: ['splash']}]);
battle.join('p2', 'Guest 2', 1, [{species: "Nidoking", ability: 'moldbreaker', moves: ['incinerate', 'icebeam']}]);
let damage;
let pokemon = battle.p1.active[0];
battle.commitDecisions();
damage = pokemon.maxhp - pokemon.hp;
assert.ok(damage >= 57 && damage <= 68);
pokemon.hp = pokemon.maxhp;
battle.choose('p2', 'move 2');
battle.commitDecisions();
damage = pokemon.maxhp - pokemon.hp;
assert.ok(damage >= 85 && damage <= 101);
});
});