File size: 4,190 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
'use strict';

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

let battle;

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

	it(`should activate even if an Ability stopped Intimidate`, () => {
		battle = common.createBattle([[
			{ species: "Mamoswine", ability: 'oblivious', item: 'adrenalineorb', moves: ['sleeptalk'] },
		], [
			{ species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk'] },
		]]);

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

	it(`should activate even if Mist stopped Intimidate`, () => {
		battle = common.createBattle([[
			{ species: "Wynaut", item: 'adrenalineorb', moves: ['mist'] },
		], [
			{ species: "Shedinja", moves: ['finalgambit'] },
			{ species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk'] },
		]]);

		battle.makeChoices();
		battle.makeChoices();
		assert.statStage(battle.p1.active[0], 'spe', 1);
	});

	it(`should not activate if Substitute stopped Intimidate`, () => {
		battle = common.createBattle([[
			{ species: "Wynaut", item: 'adrenalineorb', moves: ['substitute'] },
		], [
			{ species: "Shedinja", moves: ['finalgambit'] },
			{ species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk'] },
		]]);

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

	it(`should not activate if the holder is at -6 Attack`, () => {
		battle = common.createBattle([[
			{ species: "Dugtrio", item: 'adrenalineorb', moves: ['bellydrum'] },
		], [
			{ species: "Shedinja", item: 'stickybarb', moves: ['topsyturvy'] },
			{ species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk'] },
		]]);

		battle.makeChoices();
		battle.makeChoices();
		assert.statStage(battle.p1.active[0], 'spe', 0);
		assert.holdsItem(battle.p1.active[0]);
	});

	it(`should activate if the holder is at -5 Attack`, () => {
		battle = common.createBattle([[
			{ species: "Dugtrio", item: 'adrenalineorb', moves: ['bellydrum', 'curse', 'splash'] },
		], [
			{ species: "Shedinja", moves: ['splash', 'topsyturvy'] },
			{ species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk'] },
		]]);

		battle.makeChoices(); // dugtrio +6 atk
		battle.makeChoices('move splash', 'move topsyturvy'); // dugtrio -6 atk
		battle.makeChoices('move curse', 'move splash'); // dugtrio -5 atk and -1 speed
		assert.statStage(battle.p1.active[0], 'spe', -1);
		battle.makeChoices('move splash', 'switch 2'); // now dugtrio is at -6 and should use orb to be back at 0 speed
		assert.statStage(battle.p1.active[0], 'spe', 0);
		assert.false.holdsItem(battle.p1.active[0]);
	});

	it(`should not activate if the holder is at +6 Speed`, () => {
		battle = common.createBattle([[
			{ species: "Dugtrio", item: 'adrenalineorb', ability: 'steamengine', moves: ['sleeptalk'] },
		], [
			{ species: "Shedinja", item: 'stickybarb', moves: ['ember'] },
			{ species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk'] },
		]]);

		battle.makeChoices();
		battle.makeChoices();
		assert.holdsItem(battle.p1.active[0]);
	});

	it(`should not activate if the Contrary holder is at +6 Attack`, () => {
		battle = common.createBattle([[
			{ species: "Dugtrio", item: 'adrenalineorb', ability: 'contrary', moves: ['bellydrum'] },
		], [
			{ species: "Shedinja", item: 'stickybarb', moves: ['topsyturvy'] },
			{ species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk'] },
		]]);

		// Set Contrary Belly Drum (-6) and Topsy-Turvy to +6
		battle.makeChoices();
		battle.makeChoices();
		assert.statStage(battle.p1.active[0], 'spe', 0);
		assert.holdsItem(battle.p1.active[0]);
	});

	it(`should not activate if the Contrary holder is at -6 Speed`, () => {
		battle = common.createBattle([[
			{ species: "Dugtrio", item: 'adrenalineorb', moves: ['sleeptalk'] },
		], [
			{ species: "Shedinja", item: 'stickybarb', moves: ['ember'] },
			{ species: "Shedinja", item: 'stickybarb', moves: ['topsyturvy'] },
			{ species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk'] },
		]]);

		battle.makeChoices();
		battle.makeChoices();
		battle.makeChoices();
		assert.holdsItem(battle.p1.active[0]);
	});
});