File size: 1,351 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
38
39
40
41
'use strict';

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

let battle;

describe(`Defiant`, () => {
	afterEach(() => {
		battle.destroy();
	});

	it(`should raise the user's attack when lowered by an opponent`, () => {
		battle = common.createBattle([[
			{ species: 'pawniard', ability: 'defiant', moves: ['sleeptalk', 'tackle'] },
		], [
			{ species: 'wynaut', moves: ['faketears', 'firelash', 'silktrap'] },
		]]);
		battle.makeChoices('auto', 'move faketears');
		battle.makeChoices('auto', 'move firelash');
		battle.makeChoices('move tackle', 'move silktrap');

		assert.statStage(battle.p1.active[0], 'atk', 6);
	});

	it(`should not raise the user's attack when lowered by itself or an ally`, () => {
		battle = common.createBattle({ gameType: 'doubles' }, [[
			{ species: 'pawniard', ability: 'defiant', moves: ['closecombat', 'sleeptalk'] },
			{ species: 'wynaut', moves: ['faketears', 'firelash', 'silktrap'] },
		], [
			{ species: 'screamtail', moves: ['sleeptalk'] },
			{ species: 'jigglypuff', moves: ['sleeptalk'] },
		]]);
		battle.makeChoices('move sleeptalk, move firelash -1', 'auto');
		battle.makeChoices('move closecombat 1, move faketears -1', 'auto');
		battle.makeChoices('move closecombat -2, move silktrap', 'auto');

		assert.statStage(battle.p1.active[0], 'atk', 0);
	});
});