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

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

let battle;

describe('Partners in Crime', () => {
	afterEach(() => battle.destroy());

	it('should activate shared abilities at the same time as other abilities', () => {
		battle = common.createBattle({ formatid: 'gen9partnersincrime' }, [[
			{ species: 'Incineroar', ability: 'intimidate', item: 'whiteherb', moves: ['sleeptalk'] },
			{ species: 'Pincurchin', ability: 'electricsurge', moves: ['sleeptalk'] },
		], [
			{ species: 'Rampardos', ability: 'sheerforce', moves: ['sleeptalk'] },
			{ species: 'Iron Valiant', ability: 'quarkdrive', moves: ['sleeptalk'] },
			{ species: 'Litten', ability: 'intimidate', moves: ['sleeptalk'] },
		]]);
		// team preview
		battle.makeChoices();
		const rampardos = battle.p2.active[0];
		assert.statStage(rampardos, 'atk', -2);
		assert.equal(rampardos.volatiles.quarkdrive.bestStat, 'atk',
			`Rampardos should be Intimidated exactly once before Quark Drive activates`);
		const ironvaliant = battle.p2.active[1];
		assert.statStage(ironvaliant, 'atk', -2);
		assert.equal(ironvaliant.volatiles.quarkdrive.bestStat, 'spa',
			`Iron Valiant should be Intimidated exactly once before Quark Drive activates`);
		assert.equal(battle.field.terrainState.source.name, 'Incineroar', `Incineroar should set Electric Terrain`);

		battle.makeChoices('auto', 'move sleeptalk, switch 3');
		const incineroar = battle.p1.active[0];
		assert.false.holdsItem(incineroar);
		assert.statStage(incineroar, 'atk', 0, `Incineroar's White Herb should have activated after both Litten and Rampardos's Intimidates`);
	});

	it('should activate shared abilities for each ally when only the original holder switches in', () => {
		battle = common.createBattle({ formatid: 'gen9partnersincrime' }, [[
			{ species: 'Pyukumuku', ability: 'innardsout', moves: ['sleeptalk'] },
			{ species: 'Pincurchin', ability: 'electricsurge', moves: ['sleeptalk'] },
			{ species: 'Incineroar', ability: 'intimidate', moves: ['sleeptalk'] },
		], [
			{ species: 'Corviknight', ability: 'mirrorarmor', moves: ['sleeptalk'] },
			{ species: 'Iron Valiant', ability: 'quarkdrive', moves: ['sleeptalk'] },
		]]);
		// team preview
		battle.makeChoices();
		// swap Pyukumuku for Incineroar
		battle.makeChoices('switch 3, move sleeptalk', 'auto');
		const pincurchin = battle.p1.active[1];
		assert.statStage(pincurchin, 'atk', -2, 'Pincurchin should have had its innate Intimidate activate, triggering Mirror Armor');
	});

	it('should not activate ally\'s innates if the partner faints on switch-in', () => {
		battle = common.createBattle({ formatid: 'gen9partnersincrime' }, [[
			{ species: 'Shedinja', ability: 'download', moves: ['sleeptalk'] },
			{ species: 'Cresselia', ability: 'levitate', moves: ['sleeptalk'] },
			{ species: 'Chansey', ability: 'healer', moves: ['sleeptalk'] },
		], [
			{ species: 'Stonjourner', ability: 'powerspot', moves: ['stealthrock'] },
			{ species: 'Iron Hands', ability: 'quarkdrive', moves: ['sleeptalk'] },
		]]);
		battle.makeChoices();
		const cresselia = battle.p1.active[1];
		assert.statStage(cresselia, 'spa', 1);
		battle.makeChoices('switch 3, move sleeptalk', 'auto');
		battle.makeChoices('switch 3, move sleeptalk', 'auto');
		assert.statStage(cresselia, 'spa', 1, 'Cresselia should not have gained another Download boost after Shedinja fainted');
	});
});