File size: 905 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
'use strict';

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

let battle;

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

	it(`should heal and damage itself if it ends up in the same slot via Ally Switch`, () => {
		battle = common.createBattle({ gameType: 'doubles' }, [[
			{ species: 'celesteela', ability: 'noguard', moves: ['sleeptalk', 'leechseed'] },
			{ species: 'comfey', moves: ['sleeptalk', 'allyswitch'] },
		], [
			{ species: 'wynaut', moves: ['sleeptalk'] },
			{ species: 'wynaut', moves: ['sleeptalk'] },
		]]);
		battle.makeChoices('move leech seed -2, move sleeptalk', 'auto');
		const comfey = battle.p1.active[1];
		battle.makeChoices('move sleeptalk, move allyswitch', 'auto');
		assert.equal(comfey.hp, comfey.maxhp - Math.floor(comfey.maxhp / 8), 'Comfey should damage and heal itself from Leech Seed');
	});
});