mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-20 14:08:15 -05:00
43 lines
1.5 KiB
JavaScript
43 lines
1.5 KiB
JavaScript
var assert = require('assert');
|
|
var 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']}]);
|
|
var damage;
|
|
var pokemon = battle.p1.active[0];
|
|
battle.seed = [0, 0, 0, 1];
|
|
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 ignored 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']}]);
|
|
var damage;
|
|
var pokemon = battle.p1.active[0];
|
|
battle.seed = [0, 0, 0, 1];
|
|
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);
|
|
});
|
|
});
|