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

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

let battle;

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

	it('should boost Attack when its user KOs a Pokemon', () => {
		battle = common.createBattle();
		battle.setPlayer('p1', { team: [{ species: "Krookodile", ability: 'moxie', moves: ['crunch'] }] });
		battle.setPlayer('p2', { team: [{ species: "Shedinja", moves: ['sleeptalk'] }, { species: 'Magikarp', moves: ['splash'] }] });
		battle.makeChoices('move crunch', 'move sleeptalk');
		assert.statStage(battle.p1.active[0], 'atk', 1);
	});

	it('should not boost Attack when its user KOs the last Pokemon', () => {
		battle = common.createBattle();
		battle.setPlayer('p1', { team: [{ species: "Krookodile", ability: 'moxie', moves: ['crunch'] }] });
		battle.setPlayer('p2', { team: [{ species: "Shedinja", moves: ['sleeptalk'] }] });
		battle.makeChoices('move crunch', 'move sleeptalk');
		assert.statStage(battle.p1.active[0], 'atk', 0);
	});

	it('should not boost Attack when its user KOs several last Pokemon', () => {
		battle = common.createBattle({ gameType: "doubles" });
		battle.setPlayer('p1', { team: [{ species: "Krookodile", ability: 'moxie', moves: ['earthquake'] }, { species: "Shedinja", moves: ['sleeptalk'] }] });
		battle.setPlayer('p2', { team: [{ species: "Shedinja", moves: ['sleeptalk'] }, { species: "Shedinja", moves: ['sleeptalk'] }] });
		battle.makeChoices('move earthquake, move sleeptalk', 'move sleeptalk, move sleeptalk');
		assert.statStage(battle.p1.active[0], 'atk', 0);
	});
});