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

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

let battle;

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

	it('should heal a non-volatile status condition', () => {
		battle = common.createBattle();
		battle.setPlayer('p1', { team: [{ species: 'Rapidash', moves: ['inferno'] }] });
		battle.setPlayer('p2', { team: [{ species: 'Machamp', ability: 'noguard', item: 'lumberry', moves: ['sleeptalk'] }] });
		battle.makeChoices('move inferno', 'move sleeptalk');
		assert.equal(battle.p2.active[0].status, '');
	});

	it('should cure confusion', () => {
		battle = common.createBattle();
		battle.setPlayer('p1', { team: [{ species: 'Golurk', ability: 'noguard', moves: ['dynamicpunch'] }] });
		battle.setPlayer('p2', { team: [{ species: 'Shuckle', item: 'lumberry', moves: ['sleeptalk'] }] });
		battle.makeChoices('move dynamicpunch', 'move sleeptalk');
		assert(!battle.p2.active[0].volatiles['confusion']);
	});

	it('should be eaten immediately when the holder gains a status condition', () => {
		battle = common.createBattle();
		battle.setPlayer('p1', { team: [{ species: 'Charizard', item: 'lumberry', moves: ['outrage'] }] });
		battle.setPlayer('p2', { team: [{ species: 'Toxapex', moves: ['recover', 'banefulbunker'] }] });
		const attacker = battle.p1.active[0];
		battle.makeChoices('move outrage', 'move recover');
		attacker.volatiles['lockedmove'].duration = 2;
		battle.makeChoices('move outrage', 'move recover');
		battle.makeChoices('move outrage', 'move banefulbunker');
		assert.equal(attacker.status, '');
		assert(attacker.volatiles['confusion']);
	});
});