File size: 2,459 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
'use strict';

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

let battle;

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

	it(`should only increase the user's Attack stat once per game`, () => {
		battle = common.createBattle([[
			{ species: 'Zacian', ability: 'intrepidsword', moves: ['sleeptalk'] },
			{ species: 'Wynaut', moves: ['sleeptalk'] },
		], [
			{ species: 'Mew', moves: ['sleeptalk'] },
		]]);

		const zacian = battle.p1.active[0];
		assert.statStage(zacian, 'atk', 1);
		battle.makeChoices('switch 2', 'auto');
		battle.makeChoices('switch 2', 'auto');
		assert.statStage(zacian, 'atk', 0);
	});

	it(`should use up its once-per-game boost if it switches in with +6 Attack`, () => {
		battle = common.createBattle([[
			{ species: 'Wynaut', moves: ['bellydrum', 'batonpass'] },
			{ species: 'Zacian', ability: 'intrepidsword', moves: ['sleeptalk'] },
		], [
			{ species: 'Mew', moves: ['sleeptalk'] },
		]]);

		battle.makeChoices('move bellydrum', 'auto');
		battle.makeChoices('move batonpass', 'auto');
		battle.makeChoices('switch 2');
		battle.makeChoices('switch 2', 'auto');
		battle.makeChoices('switch 2', 'auto');
		const zacian = battle.p1.active[0];
		assert.statStage(zacian, 'atk', 0);
	});

	it(`should not use up its once-per-game boost if it switches in while its Ability is suppressed`, () => {
		battle = common.createBattle([[
			{ species: 'Wynaut', moves: ['batonpass'] },
			{ species: 'Zacian', ability: 'intrepidsword', moves: ['sleeptalk'] },
		], [
			{ species: 'Mew', moves: ['sleeptalk', 'gastroacid'] },
		]]);

		battle.makeChoices('move batonpass', 'move gastroacid');
		battle.makeChoices('switch 2');
		const zacian = battle.p1.active[0];
		assert.statStage(zacian, 'atk', 0);

		battle.makeChoices('switch 2', 'auto');
		battle.makeChoices('switch 2', 'auto');
		assert.statStage(zacian, 'atk', 1);
	});

	it(`should be able to increase the user's Attack stat multiple times per game [Gen 8]`, () => {
		battle = common.gen(8).createBattle([[
			{ species: 'Zacian', ability: 'intrepidsword', moves: ['sleeptalk'] },
			{ species: 'Wynaut', moves: ['sleeptalk'] },
		], [
			{ species: 'Mew', moves: ['sleeptalk'] },
		]]);

		const zacian = battle.p1.active[0];
		assert.statStage(zacian, 'atk', 1);
		battle.makeChoices('switch 2', 'auto');
		battle.makeChoices('switch 2', 'auto');
		assert.statStage(zacian, 'atk', 1);
	});
});