mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-08 08:02:19 -05:00
Not having prefer-const on the JS side makes JS -> TS refactors really unreadable. This commit just auto-fixes it so we're using `prefer-const` everywhere.
39 lines
1.4 KiB
JavaScript
39 lines
1.4 KiB
JavaScript
'use strict';
|
|
|
|
const assert = require('./../../assert');
|
|
const common = require('./../../common');
|
|
|
|
let battle;
|
|
|
|
describe('Multiscale', function () {
|
|
afterEach(function () {
|
|
battle.destroy();
|
|
});
|
|
|
|
it('should halve damage when it is at full health', function () {
|
|
battle = common.createBattle();
|
|
battle.setPlayer('p1', {team: [{species: "Dragonite", ability: 'multiscale', moves: ['splash']}]});
|
|
battle.setPlayer('p2', {team: [{species: "Gyarados", ability: 'moxie', moves: ['incinerate']}]});
|
|
const pokemon = battle.p1.active[0];
|
|
battle.makeChoices('move splash', 'move incinerate');
|
|
const damage = pokemon.maxhp - pokemon.hp;
|
|
const curhp = pokemon.hp;
|
|
battle.resetRNG();
|
|
battle.makeChoices('move splash', 'move incinerate');
|
|
assert.equal(damage, battle.modify(curhp - pokemon.hp, 0.5));
|
|
});
|
|
|
|
it('should be suppressed by Mold Breaker', function () {
|
|
battle = common.createBattle();
|
|
battle.setPlayer('p1', {team: [{species: "Dragonite", ability: 'multiscale', moves: ['splash']}]});
|
|
battle.setPlayer('p2', {team: [{species: "Gyarados", ability: 'moldbreaker', moves: ['incinerate']}]});
|
|
const pokemon = battle.p1.active[0];
|
|
battle.makeChoices('move splash', 'move incinerate');
|
|
const damage = pokemon.maxhp - pokemon.hp;
|
|
const curhp = pokemon.hp;
|
|
battle.resetRNG();
|
|
battle.makeChoices('move splash', 'move incinerate');
|
|
assert.equal(curhp - pokemon.hp, damage);
|
|
});
|
|
});
|