File size: 1,012 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
'use strict';

const assert = require('../../assert');
const common = require('../../common');

let battle;

const ates = { Refrigerate: 'Ice', Pixilate: 'Fairy', Aerilate: 'Flying', Galvanize: 'Electric' };

for (const ate in ates) {
	describe(ate, () => {
		afterEach(() => {
			battle.destroy();
		});

		it(`should make most Normal type moves become ${ates[ate]} type`, () => {
			battle = common.createBattle([[
				{ species: 'Genesect', ability: ate, moves: ['hypervoice'] },
			], [
				{ species: 'Gengar', moves: ['sleeptalk'] },
			]]);
			battle.makeChoices();
			assert.false.fullHP(battle.p2.active[0]);
		});

		it('should boost the power of Normal type attacks by 20% when changing their type', () => {
			battle = common.createBattle([[
				{ species: 'Genesect', ability: ate, moves: ['hypervoice'] },
			], [
				{ species: 'Blissey', ability: 'shellarmor', moves: ['sleeptalk'] },
			]]);
			battle.makeChoices();
			assert.bounded(battle.p2.active[0].hp, [651 - 83, 651 - 70]);
		});
	});
}