File size: 8,778 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
'use strict';

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

let team;

describe('Team Validator', () => {
	it("should validate Shedinja's egg moves correctly", () => {
		team = [
			{ species: 'shedinja', ability: 'wonderguard', moves: ['silverwind', 'gust'], evs: { hp: 1 } },
		];
		assert.legalTeam(team, 'gen3ou');
	});

	it("should properly exclude egg moves for Baby Pokemon and their evolutions", () => {
		team = [
			{ species: 'blissey', ability: 'naturalcure', moves: ['charm', 'seismictoss'], evs: { hp: 1 } },
		];
		assert.false.legalTeam(team, 'gen7ou');

		team = [
			{ species: 'marill', ability: 'hugepower', moves: ['splash', 'aquajet'], evs: { hp: 1 } },
		];
		assert.false.legalTeam(team, 'gen7ou');

		team = [
			{ species: 'azumarill', ability: 'thickfat', moves: ['futuresight', 'slam'], evs: { hp: 1 } },
		];
		assert.false.legalTeam(team, 'gen7ou');
	});

	it("should disallow 4 egg moves on move evolutions before gen 6", () => {
		team = [
			{ species: 'mamoswine', ability: 'oblivious', moves: ['tackle', 'iceshard', 'amnesia', 'furyattack'], evs: { hp: 1 } },
		];
		assert.false.legalTeam(team, 'gen5ou');
		assert.legalTeam(team, 'gen7ou');
	});

	it("should disallow egg moves with male-only Hidden Abilities", () => {
		team = [
			{ species: 'combusken', ability: 'speedboost', moves: ['batonpass'], evs: { hp: 1 } },
		];
		assert.false.legalTeam(team, 'gen5ou');
	});

	it("should disallow Pokemon in Little Cup that can't be bred to be level 5", () => {
		team = [
			{ species: 'kubfu', ability: 'innerfocus', moves: ['aerialace'], evs: { hp: 1 } },
		];
		assert.false.legalTeam(team, 'gen8lc');
	});

	it('should reject illegal egg move combinations', () => {
		team = [
			{ species: 'azumarill', ability: 'hugepower', moves: ['bellydrum', 'aquajet'], evs: { hp: 1 } },
		];
		assert.false.legalTeam(team, 'gen5ou');

		team = [
			{ species: 'cloyster', moves: ['rapidspin', 'explosion'] },
		];
		assert.false.legalTeam(team, 'gen2ou');

		team = [
			{ species: 'skarmory', ability: 'keeneye', moves: ['curse', 'drillpeck'], evs: { hp: 1 } },
		];
		assert.false.legalTeam(team, 'gen3ou');

		team = [
			{ species: 'skarmory', ability: 'keeneye', moves: ['whirlwind', 'drillpeck'], evs: { hp: 1 } },
		];
		assert.false.legalTeam(team, 'gen3ou');

		team = [
			{ species: 'armaldo', ability: 'battlearmor', moves: ['knockoff', 'rapidspin'], evs: { hp: 1 } },
		];
		assert.false.legalTeam(team, 'gen3ou');
	});

	it('should allow chain breeding', () => {
		// via duskull
		team = [
			{ species: 'weezing', ability: 'levitate', moves: ['painsplit', 'willowisp'], evs: { hp: 1 } },
		];
		assert.legalTeam(team, 'gen3ou');

		// via snubbull
		team = [
			{ species: 'blissey', moves: ['present', 'healbell'] },
		];
		assert.legalTeam(team, 'gen2ou');

		// combine different tyrogue evos
		team = [
			{ species: 'hitmontop', ability: 'intimidate', moves: ["highjumpkick", 'machpunch'], evs: { hp: 1 } },
		];
		assert.legalTeam(team, 'gen3ou');

		// via cranidos
		team = [
			{ species: 'snorlax', ability: 'immunity', moves: ['curse', 'pursuit'], evs: { hp: 1 } },
		];
		assert.legalTeam(team, 'gen4ou');
	});

	it('should accept this chainbreed on Snorlax', () => {
		// the weirdest chainbreed I've ever seen:
		// breed male Curse Snorlax in Gen 3, transfer to XD, teach Self-destruct
		// by tutor, breed with female Gluttony Snorlax
		team = [
			{ species: 'snorlax', ability: 'gluttony', moves: ['curse', 'selfdestruct'], evs: { hp: 1 } },
		];
		assert.legalTeam(team, 'gen5ou');
	});

	it('should allow trading back Gen 2 egg moves if compatible with Gen 1', () => {
		// HJK can be bred onto Tyrogue in Gen 2, evolved into Hitmonchan, transferred back to Gen 1, taught Body Slam via TM, and transferred back to Gen 2.
		team = [
			{ species: 'hitmonchan', moves: ['highjumpkick', 'bodyslam'] },
		];
		assert.legalTeam(team, 'gen2ou');

		team = [
			{ species: 'marowak', moves: ['swordsdance', 'rockslide', 'bodyslam'] },
		];
		assert.legalTeam(team, 'gen2ou');
		assert.legalTeam(team, 'gen1tradebacksou');
		assert.false.legalTeam(team, 'gen1ou');
	});

	it("should disallow trading back an egg move not in gen 1", () => {
		team = [
			{ species: 'marowak', moves: ['swordsdance', 'ancientpower', 'bodyslam'] },
		];
		assert.false.legalTeam(team, 'gen2ou');
	});

	it("should properly resolve egg moves for Pokemon with pre-evolutions that don't have Hidden Abilities", () => {
		team = [
			{ species: 'tyranitar', ability: 'unnerve', moves: ['dragondance'], evs: { hp: 1 } },
			{ species: 'staraptor', ability: 'reckless', moves: ['pursuit'], evs: { hp: 1 } },
		];
		assert.legalTeam(team, 'gen5ou');
	});

	it("should allow Nidoqueen to have egg moves", () => {
		team = [
			{ species: 'nidoqueen', ability: 'poisonpoint', moves: ['charm'], evs: { hp: 1 } },
		];
		assert.legalTeam(team, 'gen6ou');
	});

	it("should properly handle HA Dragonite with Extreme Speed", () => {
		team = [
			{ species: 'dragonite', ability: 'multiscale', moves: ['extremespeed'], evs: { hp: 1 } },
		];
		assert.legalTeam(team, 'gen5ou');

		team = [
			{ species: 'dragonite', ability: 'multiscale', moves: ['extremespeed', 'aquajet'], evs: { hp: 1 } },
		];
		assert.false.legalTeam(team, 'gen5ou');
	});

	it("should disallow low-level female-only Pokemon with illegal (level up) egg moves/egg move combinations", () => {
		team = [
			{ species: 'tinkatink', level: 5, ability: 'moldbreaker', moves: ['brutalswing'], evs: { hp: 1 } },
		];
		assert.false.legalTeam(team, 'gen9lc');

		team = [
			{ species: 'tinkatink', level: 5, ability: 'moldbreaker', moves: ['covet', 'fakeout'], evs: { hp: 1 } },
		];
		assert.false.legalTeam(team, 'gen9lc');
	});

	it("should disallow illegal (level up) egg move combinations involving moves that can't be tradebacked", () => {
		team = [
			{ species: 'chansey', level: 5, moves: ['healbell', 'softboiled'], evs: { hp: 1 } },
		];
		assert.false.legalTeam(team, 'gen2ou');
	});

	it("should disallow illegal (level up) egg moves/egg move combinations involving Pomeg glitch and Gen 4 abilities", () => {
		team = [
			{ species: 'smoochum', level: 5, ability: 'forewarn', moves: ['powdersnow'], evs: { hp: 1 } },
		];
		assert.false.legalTeam(team, 'gen4lc');
	});

	it("should allow previously illegal level up egg moves in Gen 7", () => {
		team = [
			{ species: 'smoochum', level: 5, ability: 'hydration', moves: ['powdersnow'], evs: { hp: 1 } },
		];
		assert.legalTeam(team, 'gen7lc');
	});

	it("should allow Pomeg glitch with event egg moves", () => {
		team = [
			{ species: 'zigzagoon', level: 5, ability: 'pickup', moves: ['bellydrum', 'extremespeed'], evs: { hp: 1 } },
		];
		assert.legalTeam(team, 'gen3ou');
	});

	it("should disallow illegal egg move combinations containing past gen universal moves", () => {
		team = [
			{ species: 'salamence', ability: 'intimidate', moves: ['defensecurl', 'thrash', 'dragonrage', 'dragonrush'], evs: { hp: 1 } },
		];
		assert.false.legalTeam(team, 'gen5ou');
	});

	it('should allow complex chainbred sets', () => {
		team = [
			{ species: 'toxicroak', ability: 'dryskin', moves: ['bulletpunch', 'crosschop', 'fakeout'], evs: { hp: 4 } },
		];
		assert.legalTeam(team, 'gen5ou');

		team = [
			{ species: 'corphish', ability: 'hypercutter', moves: ['dragondance', 'metalclaw'], evs: { hp: 1 } },
		];
		assert.legalTeam(team, 'gen4ou');
	});

	it('should reject Volbeat with both Lunge and Dizzy Punch in Gen 7', () => {
		team = [
			{ species: 'volbeat', ability: 'swarm', moves: ['lunge', 'dizzypunch'], evs: { hp: 1 } },
		];
		assert.false.legalTeam(team, 'gen7anythinggoes');
	});

	it('should allow level 5 Indeedee-M with Disarming Voice', () => {
		team = [
			{ species: 'indeedee', level: 5, ability: 'innerfocus', moves: ['disarmingvoice'], evs: { hp: 1 } },
		];
		assert.legalTeam(team, 'gen8ou');
	});

	it('should allow egg moves on event formes in Gen 9', () => {
		team = [
			{ species: 'ursalunabloodmoon', ability: 'mindseye', moves: ['yawn', 'bellydrum'], evs: { hp: 1 } },
			{ species: 'greninjabond', ability: 'battlebond', moves: ['counter', 'switcheroo'], evs: { hp: 1 } },
			{ species: 'pikachualola', ability: 'static', moves: ['wish', 'fakeout'], evs: { hp: 1 } },
		];
		assert.legalTeam(team, 'gen9anythinggoes');
	});

	it('should not allow egg moves on event formes before Gen 9', () => {
		team = [
			{ species: 'greninjabond', ability: 'battlebond', moves: ['toxicspikes'], evs: { hp: 1 } },
		];
		assert.false.legalTeam(team, 'gen7anythinggoes');
	});

	it('should not allow egg Pokemon below level 5 in Gens 2-3', () => {
		team = [
			{ species: 'totodile', level: 1, ability: 'torrent', moves: ['ancientpower'] },
		];
		assert.false.legalTeam(team, 'gen3ou');
	});
});