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

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

let battle;

describe('Dazzling', () => {
	afterEach(() => {
		battle.destroy();
	});

	it('should block moves with positive priority', () => {
		battle = common.createBattle([
			[{ species: "Sableye", ability: 'prankster', moves: ['taunt'] }],
			[{ species: "Bruxish", ability: 'dazzling', moves: ['swordsdance'] }],
		]);

		battle.makeChoices('move taunt', 'move swordsdance');
		assert.equal(battle.p2.active[0].boosts.atk, 2);
	});

	it('should not block moves that target all Pokemon, except Perish Song, Rototiller, and Flower Shield', () => {
		battle = common.createBattle([
			[{ species: "Bruxish", ability: 'dazzling', moves: ['swordsdance', 'sleeptalk'] }],
			[{ species: "Mew", ability: 'prankster', moves: ['perishsong', 'haze'] }],
		]);

		battle.makeChoices('move swordsdance', 'move perishsong');
		battle.makeChoices('move sleeptalk', 'move haze');
		assert.equal(battle.p1.active[0].boosts.atk, 0);
		assert.false(battle.p1.active[0].volatiles['perishsong']);
	});
});