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

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

let battle;

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

	it('should double the base power of the next Electric attack', () => {
		battle = common.createBattle([[
			{ species: 'Kilowattrel', moves: ['charge', 'thunderbolt'] },
		], [
			{ species: 'Dondozo', ability: 'shellarmor', moves: ['sleeptalk'] },
		]]);

		battle.makeChoices();
		battle.makeChoices('move thunderbolt', 'auto');
		assert.fainted(battle.p2.active[0]);
	});

	it('should remain active until an Electric-type attack is used', () => {
		battle = common.createBattle([[
			{ species: 'Kilowattrel', moves: ['charge', 'agility', 'airslash', 'thunderbolt', 'naturepower'] },
		], [
			{ species: 'Baxcalibur', moves: ['sleeptalk', 'electricterrain'] },
		]]);

		battle.makeChoices();
		battle.makeChoices('move agility', 'auto');
		assert(battle.p1.active[0].volatiles['charge']);
		battle.makeChoices('move airslash', 'auto');
		assert(battle.p1.active[0].volatiles['charge']);
		battle.makeChoices('move thunderbolt', 'auto');
		assert.false(battle.p1.active[0].volatiles['charge']);
		battle.makeChoices('auto', 'move electricterrain');
		battle.makeChoices('move naturepower', 'auto');
		assert.false(battle.p1.active[0].volatiles['charge']);
	});

	it('should wear off after an Electric-type status move that is not Charge is used', () => {
		battle = common.createBattle([[
			{ species: 'Kilowattrel', moves: ['charge', 'thunderwave'] },
		], [
			{ species: 'Baxcalibur', moves: ['sleeptalk'] },
		]]);

		battle.makeChoices();
		battle.makeChoices();
		assert(battle.p1.active[0].volatiles['charge']);
		battle.makeChoices('move thunderwave', 'auto');
		assert.false(battle.p1.active[0].volatiles['charge']);
	});
});

describe('Charge [Gen 8]', () => {
	afterEach(() => {
		battle.destroy();
	});

	it('should wear off after a move of any type is used', () => {
		battle = common.gen(8).createBattle([[
			{ species: 'Pikachu', moves: ['charge', 'tackle', 'thundershock'] },
		], [
			{ species: 'Dragapult', moves: ['sleeptalk'] },
		]]);

		battle.makeChoices();
		battle.makeChoices('move tackle', 'auto');
		assert.false(battle.p1.active[0].volatiles['charge']);
		battle.makeChoices();
		battle.makeChoices('move thundershock', 'auto');
		assert.false(battle.p1.active[0].volatiles['charge']);
	});
});