forked from smogon/pokemon-showdown-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathev-optimizer.test.js
118 lines (108 loc) · 3.14 KB
/
ev-optimizer.test.js
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
const assert = require('assert').strict;
try {
global.BattlePokedex = require('../play.pokemonshowdown.com/data/pokedex.js').BattlePokedex;
} catch (err) {}
require('../play.pokemonshowdown.com/js/battle-dex-data.js');
require('../play.pokemonshowdown.com/js/battle-dex.js');
require('../play.pokemonshowdown.com/js/battle-tooltips.js');
describe('EV Optimizer', () => {
(global.BattlePokedex ? it : it.skip)('should find the spreads that saves the most EVs', () => {
const trapinch = BattleStatOptimizer({
species: "Trapinch",
nature: "Lax",
evs: {hp: 204, atk: 252, def: 52},
level: 100
}, 'gen9');
assert.deepStrictEqual(trapinch, {
evs: {hp: 204, atk: 144, def: 104},
plus: 'atk',
minus: 'spd',
savedEVs: 56,
});
const groudon = BattleStatOptimizer({
species: "Groudon-Primal",
nature: "Serious",
evs: {atk: 252, spa: 156, spe: 100},
level: 100
}, 'gen7');
assert.deepStrictEqual(groudon, {
evs: {atk: 88, spa: 156, spd: 96, spe: 100},
plus: 'atk',
minus: 'spd',
savedEVs: 68,
});
const thundurus = BattleStatOptimizer({
species: "Thundurus",
nature: "Timid",
evs: {hp: 252, spa: 232, spe: 24},
ivs: {hp: 31, atk: 2, def: 31, spa: 30, spd: 31, spe: 30},
level: 50
}, 'gen5');
assert.deepStrictEqual(thundurus, {
evs: {hp: 252, spa: 112, spe: 128},
plus: 'spa',
minus: 'atk',
savedEVs: 16,
});
const amoonguss = BattleStatOptimizer({
species: "Amoonguss",
nature: "Bold",
evs: {hp: 252, def: 100, spd: 156},
level: 50
}, 'gen9');
assert.deepStrictEqual(amoonguss, {
evs: {hp: 252, def: 180, spd: 76},
plus: 'spd',
minus: 'atk',
savedEVs: 0,
});
const avalugg = BattleStatOptimizer({
species: "Avalugg",
nature: "Hasty",
evs: {hp: 56, atk: 200, def: 252},
level: 100
}, 'gen9');
assert.deepStrictEqual(avalugg, {
evs: {hp: 56, atk: 84, def: 64, spe: 84},
plus: 'atk',
minus: 'spe',
savedEVs: 220,
});
const mew = BattleStatOptimizer({
species: "Mew",
nature: "Sassy",
evs: {hp: 24, atk: 92, def: 92, spa: 92, spd: 104, spe: 104},
level: 100
}, 'gen9');
assert.deepStrictEqual(mew, {
evs: {hp: 24, atk: 92, def: 92, spa: 92, spd: 208},
savedEVs: 0,
});
const mew2 = BattleStatOptimizer({
species: "Mew",
nature: "Sassy",
evs: {hp: 24, atk: 92, def: 92, spa: 92, spd: 144, spe: 64},
level: 100
}, 'gen9');
assert.equal(mew2, null);
const greatTusk = BattleStatOptimizer({
species: "Great Tusk",
nature: "Jolly",
evs: {hp: 136, atk: 92, def: 100, spd: 72, spe: 108},
level: 100
}, 'gen9');
assert.deepStrictEqual(greatTusk, {
evs: {hp: 136, atk: 92, spd: 72, spe: 200},
plus: 'def',
minus: 'spa',
savedEVs: 8,
});
const mienfoo = BattleStatOptimizer({
species: "Mienfoo",
nature: "Jolly",
evs: {atk: 236, def: 116, spe: 156},
level: 5
}, 'gen9');
assert.equal(mienfoo, null);
});
});