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

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

let battle;

describe("Mirror Herb", () => {
	afterEach(() => battle.destroy());

	it("should copy Anger Point", () => {
		battle = common.createBattle([[
			{ species: 'Snorlax', item: 'Mirror Herb', moves: ['stormthrow'] },
		], [
			{ species: 'Primeape', ability: 'Anger Point', moves: ['sleeptalk'] },
		]]);
		battle.makeChoices();
		assert.statStage(battle.p1.active[0], 'atk', 6);
	});

	it("should only copy the effective boost after the +6 cap", () => {
		battle = common.createBattle({ gameType: 'doubles' }, [[
			{ species: 'Snorlax', item: 'Mirror Herb', moves: ['sleeptalk'] },
			{ species: 'Froslass', ability: 'Snow Cloak', moves: ['frostbreath'] },
		], [
			{ species: 'Primeape', ability: 'Anger Point', moves: ['sleeptalk'] },
			{ species: 'Gyarados', ability: 'Intimidate', moves: ['sleeptalk'] },
		]]);
		assert.statStage(battle.p1.active[0], 'atk', -1);
		battle.makeChoices();
		assert.statStage(battle.p1.active[0], 'atk', -1 + 6);
	});

	it("should copy all 'simultaneous' boosts from multiple opponents", () => {
		battle = common.createBattle({ gameType: 'doubles' }, [[
			{ species: 'Electrode', ability: 'No Guard', item: 'Mirror Herb', moves: ['recycle'] },
			{ species: 'Gyarados', ability: 'Intimidate', item: 'Wide Lens', moves: ['sleeptalk', 'air cutter'] },
		], [
			{ species: 'Primeape', ability: 'Defiant', item: 'Weakness Policy', moves: ['sleeptalk', 'haze'] },
			{ species: 'Annihilape', ability: 'Defiant', item: 'Weakness Policy', moves: ['sleeptalk', 'howl'] },
		]]);
		const electrode = battle.p1.active[0];
		assert.statStage(electrode, 'atk', 4, `Mirror Herb should have copied both Defiant boosts but only boosted atk by ${electrode.boosts.atk}`);
		battle.makeChoices('auto', 'move haze, move howl');
		assert.statStage(electrode, 'atk', 2, `Mirror Herb should have copied both Howl boosts but only boosted atk by ${electrode.boosts.atk}`);
		battle.makeChoices('move recycle, move air cutter', 'auto');
		assert.statStage(electrode, 'spa', 4, `Mirror Herb should have copied all Weakness Policy boosts but only boosted spa by ${electrode.boosts.spa}`);
	});

	it("should wait for most entrance abilities before copying all their (opposing) boosts", () => {
		battle = common.createBattle({ gameType: 'doubles' }, [[
			{ species: 'Electrode', item: 'Mirror Herb', moves: ['recycle'] },
			{ species: 'Gyarados', ability: 'Intimidate', moves: ['sleeptalk'] },
		], [
			{ species: 'Zacian', ability: 'Intrepid Sword', moves: ['sleeptalk'] },
			{ species: 'Annihilape', ability: 'Defiant', moves: ['sleeptalk'] },
		]]);
		assert.statStage(battle.p1.active[0], 'atk', 3);
	});
});