@robsonbittencourt/calc 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +2 -0
- package/.eslintrc +12 -0
- package/bundle +107 -0
- package/dist/adaptable.d.ts +6 -0
- package/dist/adaptable.js +28 -0
- package/dist/adaptable.js.map +1 -0
- package/dist/calc.d.ts +6 -0
- package/dist/calc.js +26 -0
- package/dist/calc.js.map +1 -0
- package/dist/data/abilities.d.ts +15 -0
- package/dist/data/abilities.js +448 -0
- package/dist/data/abilities.js.map +1 -0
- package/dist/data/index.d.ts +2 -0
- package/dist/data/index.js +30 -0
- package/dist/data/index.js.map +1 -0
- package/dist/data/interface.d.ts +150 -0
- package/dist/data/interface.js +3 -0
- package/dist/data/interface.js.map +1 -0
- package/dist/data/items.d.ts +24 -0
- package/dist/data/items.js +708 -0
- package/dist/data/items.js.map +1 -0
- package/dist/data/moves.d.ts +86 -0
- package/dist/data/moves.js +5014 -0
- package/dist/data/moves.js.map +1 -0
- package/dist/data/natures.d.ts +17 -0
- package/dist/data/natures.js +127 -0
- package/dist/data/natures.js.map +1 -0
- package/dist/data/production.min.js +1 -0
- package/dist/data/species.d.ts +48 -0
- package/dist/data/species.js +10126 -0
- package/dist/data/species.js.map +1 -0
- package/dist/data/types.d.ts +23 -0
- package/dist/data/types.js +538 -0
- package/dist/data/types.js.map +1 -0
- package/dist/desc.d.ts +65 -0
- package/dist/desc.js +866 -0
- package/dist/desc.js.map +1 -0
- package/dist/field.d.ts +49 -0
- package/dist/field.js +111 -0
- package/dist/field.js.map +1 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +99 -0
- package/dist/index.js.map +1 -0
- package/dist/items.d.ts +13 -0
- package/dist/items.js +434 -0
- package/dist/items.js.map +1 -0
- package/dist/mechanics/gen12.d.ts +6 -0
- package/dist/mechanics/gen12.js +271 -0
- package/dist/mechanics/gen12.js.map +1 -0
- package/dist/mechanics/gen3.d.ts +11 -0
- package/dist/mechanics/gen3.js +371 -0
- package/dist/mechanics/gen3.js.map +1 -0
- package/dist/mechanics/gen4.d.ts +11 -0
- package/dist/mechanics/gen4.js +596 -0
- package/dist/mechanics/gen4.js.map +1 -0
- package/dist/mechanics/gen56.d.ts +13 -0
- package/dist/mechanics/gen56.js +836 -0
- package/dist/mechanics/gen56.js.map +1 -0
- package/dist/mechanics/gen789.d.ts +14 -0
- package/dist/mechanics/gen789.js +1325 -0
- package/dist/mechanics/gen789.js.map +1 -0
- package/dist/mechanics/util.d.ts +39 -0
- package/dist/mechanics/util.js +675 -0
- package/dist/mechanics/util.js.map +1 -0
- package/dist/move.d.ts +50 -0
- package/dist/move.js +324 -0
- package/dist/move.js.map +1 -0
- package/dist/pokemon.d.ts +55 -0
- package/dist/pokemon.js +240 -0
- package/dist/pokemon.js.map +1 -0
- package/dist/production.min.js +1 -0
- package/dist/result.d.ts +34 -0
- package/dist/result.js +94 -0
- package/dist/result.js.map +1 -0
- package/dist/state.d.ts +77 -0
- package/dist/state.js +3 -0
- package/dist/state.js.map +1 -0
- package/dist/stats.d.ts +26 -0
- package/dist/stats.js +183 -0
- package/dist/stats.js.map +1 -0
- package/dist/test/calc.test.d.ts +1 -0
- package/dist/test/calc.test.js +1297 -0
- package/dist/test/calc.test.js.map +1 -0
- package/dist/test/data.test.d.ts +1 -0
- package/dist/test/data.test.js +368 -0
- package/dist/test/data.test.js.map +1 -0
- package/dist/test/gen.d.ts +135 -0
- package/dist/test/gen.js +636 -0
- package/dist/test/gen.js.map +1 -0
- package/dist/test/helper.d.ts +55 -0
- package/dist/test/helper.js +174 -0
- package/dist/test/helper.js.map +1 -0
- package/dist/test/move.test.d.ts +1 -0
- package/dist/test/move.test.js +14 -0
- package/dist/test/move.test.js.map +1 -0
- package/dist/test/pokemon.test.d.ts +1 -0
- package/dist/test/pokemon.test.js +102 -0
- package/dist/test/pokemon.test.js.map +1 -0
- package/dist/test/stats.test.d.ts +1 -0
- package/dist/test/stats.test.js +64 -0
- package/dist/test/stats.test.js.map +1 -0
- package/dist/test/utils.test.d.ts +1 -0
- package/dist/test/utils.test.js +19 -0
- package/dist/test/utils.test.js.map +1 -0
- package/dist/util.d.ts +17 -0
- package/dist/util.js +115 -0
- package/dist/util.js.map +1 -0
- package/jest.config.js +11 -0
- package/package.json +40 -0
- package/src/adaptable.ts +12 -0
- package/src/calc.ts +40 -0
- package/src/data/abilities.ts +383 -0
- package/src/data/index.ts +36 -0
- package/src/data/interface.ts +176 -0
- package/src/data/items.ts +632 -0
- package/src/data/moves.ts +5028 -0
- package/src/data/natures.ts +65 -0
- package/src/data/species.ts +10098 -0
- package/src/data/types.ts +478 -0
- package/src/desc.ts +1063 -0
- package/src/field.ts +124 -0
- package/src/index.ts +156 -0
- package/src/items.ts +423 -0
- package/src/mechanics/gen12.ts +297 -0
- package/src/mechanics/gen3.ts +444 -0
- package/src/mechanics/gen4.ts +702 -0
- package/src/mechanics/gen56.ts +1134 -0
- package/src/mechanics/gen789.ts +1788 -0
- package/src/mechanics/util.ts +676 -0
- package/src/move.ts +337 -0
- package/src/pokemon.ts +244 -0
- package/src/result.ts +106 -0
- package/src/state.ts +81 -0
- package/src/stats.ts +213 -0
- package/src/test/calc.test.ts +1588 -0
- package/src/test/data.test.ts +129 -0
- package/src/test/gen.ts +514 -0
- package/src/test/helper.ts +185 -0
- package/src/test/move.test.ts +13 -0
- package/src/test/pokemon.test.ts +121 -0
- package/src/test/stats.test.ts +84 -0
- package/src/test/utils.test.ts +18 -0
- package/src/util.ts +153 -0
- package/tsconfig.json +10 -0
|
@@ -0,0 +1,632 @@
|
|
|
1
|
+
import type * as I from './interface';
|
|
2
|
+
import {toID} from '../util';
|
|
3
|
+
|
|
4
|
+
const RBY: string[] = [];
|
|
5
|
+
|
|
6
|
+
const GSC = [
|
|
7
|
+
'Berry Juice',
|
|
8
|
+
'Berry',
|
|
9
|
+
'Berserk Gene',
|
|
10
|
+
'Bitter Berry',
|
|
11
|
+
'Black Belt',
|
|
12
|
+
'Black Glasses',
|
|
13
|
+
'Bright Powder',
|
|
14
|
+
'Burnt Berry',
|
|
15
|
+
'Charcoal',
|
|
16
|
+
'Dragon Fang',
|
|
17
|
+
'Dragon Scale',
|
|
18
|
+
'Fast Ball',
|
|
19
|
+
'Fire Stone',
|
|
20
|
+
'Focus Band',
|
|
21
|
+
'Friend Ball',
|
|
22
|
+
'Gold Berry',
|
|
23
|
+
'Great Ball',
|
|
24
|
+
'Hard Stone',
|
|
25
|
+
'Heavy Ball',
|
|
26
|
+
'Ice Berry',
|
|
27
|
+
'King\'s Rock',
|
|
28
|
+
'Leaf Stone',
|
|
29
|
+
'Leftovers',
|
|
30
|
+
'Level Ball',
|
|
31
|
+
'Light Ball',
|
|
32
|
+
'Love Ball',
|
|
33
|
+
'Lucky Punch',
|
|
34
|
+
'Lure Ball',
|
|
35
|
+
'Magnet',
|
|
36
|
+
'Mail',
|
|
37
|
+
'Master Ball',
|
|
38
|
+
'Metal Coat',
|
|
39
|
+
'Metal Powder',
|
|
40
|
+
'Mint Berry',
|
|
41
|
+
'Miracle Berry',
|
|
42
|
+
'Miracle Seed',
|
|
43
|
+
'Moon Ball',
|
|
44
|
+
'Moon Stone',
|
|
45
|
+
'Mystery Berry',
|
|
46
|
+
'Mystic Water',
|
|
47
|
+
'Never-Melt Ice',
|
|
48
|
+
'Pink Bow',
|
|
49
|
+
'Poison Barb',
|
|
50
|
+
'Poke Ball',
|
|
51
|
+
'Polkadot Bow',
|
|
52
|
+
'PRZ Cure Berry',
|
|
53
|
+
'PSN Cure Berry',
|
|
54
|
+
'Quick Claw',
|
|
55
|
+
'Safari Ball',
|
|
56
|
+
'Scope Lens',
|
|
57
|
+
'Sharp Beak',
|
|
58
|
+
'Silver Powder',
|
|
59
|
+
'Soft Sand',
|
|
60
|
+
'Spell Tag',
|
|
61
|
+
'Sport Ball',
|
|
62
|
+
'Stick',
|
|
63
|
+
'Sun Stone',
|
|
64
|
+
'Thick Club',
|
|
65
|
+
'Thunder Stone',
|
|
66
|
+
'Twisted Spoon',
|
|
67
|
+
'Ultra Ball',
|
|
68
|
+
'Up-Grade',
|
|
69
|
+
'Water Stone',
|
|
70
|
+
];
|
|
71
|
+
|
|
72
|
+
const GSC_ONLY = [
|
|
73
|
+
'Berry',
|
|
74
|
+
'Berserk Gene',
|
|
75
|
+
'Bitter Berry',
|
|
76
|
+
'Burnt Berry',
|
|
77
|
+
'Ice Berry',
|
|
78
|
+
'Mint Berry',
|
|
79
|
+
'Miracle Berry',
|
|
80
|
+
'Mystery Berry',
|
|
81
|
+
'PRZ Cure Berry',
|
|
82
|
+
'Gold Berry',
|
|
83
|
+
'Pink Bow',
|
|
84
|
+
'Polkadot Bow',
|
|
85
|
+
'PSN Cure Berry',
|
|
86
|
+
];
|
|
87
|
+
|
|
88
|
+
const ADV = GSC.filter(i => !GSC_ONLY.includes(i)).concat([
|
|
89
|
+
'Aguav Berry',
|
|
90
|
+
'Apicot Berry',
|
|
91
|
+
'Aspear Berry',
|
|
92
|
+
'Belue Berry',
|
|
93
|
+
'Bluk Berry',
|
|
94
|
+
'Cheri Berry',
|
|
95
|
+
'Chesto Berry',
|
|
96
|
+
'Choice Band',
|
|
97
|
+
'Claw Fossil',
|
|
98
|
+
'Cornn Berry',
|
|
99
|
+
'Deep Sea Scale',
|
|
100
|
+
'Deep Sea Tooth',
|
|
101
|
+
'Dive Ball',
|
|
102
|
+
'Dome Fossil',
|
|
103
|
+
'Durin Berry',
|
|
104
|
+
'Enigma Berry',
|
|
105
|
+
'Figy Berry',
|
|
106
|
+
'Ganlon Berry',
|
|
107
|
+
'Grepa Berry',
|
|
108
|
+
'Helix Fossil',
|
|
109
|
+
'Hondew Berry',
|
|
110
|
+
'Iapapa Berry',
|
|
111
|
+
'Kelpsy Berry',
|
|
112
|
+
'Lansat Berry',
|
|
113
|
+
'Lax Incense',
|
|
114
|
+
'Leppa Berry',
|
|
115
|
+
'Liechi Berry',
|
|
116
|
+
'Lum Berry',
|
|
117
|
+
'Luxury Ball',
|
|
118
|
+
'Macho Brace',
|
|
119
|
+
'Mago Berry',
|
|
120
|
+
'Magost Berry',
|
|
121
|
+
'Mental Herb',
|
|
122
|
+
'Nanab Berry',
|
|
123
|
+
'Nest Ball',
|
|
124
|
+
'Net Ball',
|
|
125
|
+
'Nomel Berry',
|
|
126
|
+
'Old Amber',
|
|
127
|
+
'Oran Berry',
|
|
128
|
+
'Pamtre Berry',
|
|
129
|
+
'Pecha Berry',
|
|
130
|
+
'Persim Berry',
|
|
131
|
+
'Petaya Berry',
|
|
132
|
+
'Pinap Berry',
|
|
133
|
+
'Pomeg Berry',
|
|
134
|
+
'Premier Ball',
|
|
135
|
+
'Qualot Berry',
|
|
136
|
+
'Rabuta Berry',
|
|
137
|
+
'Rawst Berry',
|
|
138
|
+
'Razz Berry',
|
|
139
|
+
'Repeat Ball',
|
|
140
|
+
'Root Fossil',
|
|
141
|
+
'Salac Berry',
|
|
142
|
+
'Sea Incense',
|
|
143
|
+
'Shell Bell',
|
|
144
|
+
'Silk Scarf',
|
|
145
|
+
'Sitrus Berry',
|
|
146
|
+
'Soul Dew',
|
|
147
|
+
'Spelon Berry',
|
|
148
|
+
'Starf Berry',
|
|
149
|
+
'Tamato Berry',
|
|
150
|
+
'Timer Ball',
|
|
151
|
+
'Watmel Berry',
|
|
152
|
+
'Wepear Berry',
|
|
153
|
+
'White Herb',
|
|
154
|
+
'Wiki Berry',
|
|
155
|
+
]);
|
|
156
|
+
|
|
157
|
+
const DPP = ADV.concat([
|
|
158
|
+
'Adamant Orb',
|
|
159
|
+
'Armor Fossil',
|
|
160
|
+
'Babiri Berry',
|
|
161
|
+
'Big Root',
|
|
162
|
+
'Black Sludge',
|
|
163
|
+
'Charti Berry',
|
|
164
|
+
'Cherish Ball',
|
|
165
|
+
'Chilan Berry',
|
|
166
|
+
'Choice Scarf',
|
|
167
|
+
'Choice Specs',
|
|
168
|
+
'Chople Berry',
|
|
169
|
+
'Coba Berry',
|
|
170
|
+
'Colbur Berry',
|
|
171
|
+
'Custap Berry',
|
|
172
|
+
'Damp Rock',
|
|
173
|
+
'Dawn Stone',
|
|
174
|
+
'Destiny Knot',
|
|
175
|
+
'Draco Plate',
|
|
176
|
+
'Dread Plate',
|
|
177
|
+
'Dubious Disc',
|
|
178
|
+
'Dusk Ball',
|
|
179
|
+
'Dusk Stone',
|
|
180
|
+
'Earth Plate',
|
|
181
|
+
'Electirizer',
|
|
182
|
+
'Expert Belt',
|
|
183
|
+
'Fist Plate',
|
|
184
|
+
'Flame Orb',
|
|
185
|
+
'Flame Plate',
|
|
186
|
+
'Focus Sash',
|
|
187
|
+
'Full Incense',
|
|
188
|
+
'Grip Claw',
|
|
189
|
+
'Griseous Orb',
|
|
190
|
+
'Haban Berry',
|
|
191
|
+
'Heal Ball',
|
|
192
|
+
'Heat Rock',
|
|
193
|
+
'Icicle Plate',
|
|
194
|
+
'Icy Rock',
|
|
195
|
+
'Insect Plate',
|
|
196
|
+
'Iron Ball',
|
|
197
|
+
'Iron Plate',
|
|
198
|
+
'Jaboca Berry',
|
|
199
|
+
'Kasib Berry',
|
|
200
|
+
'Kebia Berry',
|
|
201
|
+
'Lagging Tail',
|
|
202
|
+
'Life Orb',
|
|
203
|
+
'Light Clay',
|
|
204
|
+
'Lustrous Orb',
|
|
205
|
+
'Magmarizer',
|
|
206
|
+
'Meadow Plate',
|
|
207
|
+
'Metronome',
|
|
208
|
+
'Micle Berry',
|
|
209
|
+
'Mind Plate',
|
|
210
|
+
'Muscle Band',
|
|
211
|
+
'Occa Berry',
|
|
212
|
+
'Odd Incense',
|
|
213
|
+
'Oval Stone',
|
|
214
|
+
'Park Ball',
|
|
215
|
+
'Passho Berry',
|
|
216
|
+
'Payapa Berry',
|
|
217
|
+
'Power Anklet',
|
|
218
|
+
'Power Band',
|
|
219
|
+
'Power Belt',
|
|
220
|
+
'Power Bracer',
|
|
221
|
+
'Power Herb',
|
|
222
|
+
'Power Lens',
|
|
223
|
+
'Power Weight',
|
|
224
|
+
'Protector',
|
|
225
|
+
'Quick Ball',
|
|
226
|
+
'Quick Powder',
|
|
227
|
+
'Rare Bone',
|
|
228
|
+
'Razor Claw',
|
|
229
|
+
'Razor Fang',
|
|
230
|
+
'Reaper Cloth',
|
|
231
|
+
'Rindo Berry',
|
|
232
|
+
'Rock Incense',
|
|
233
|
+
'Rose Incense',
|
|
234
|
+
'Rowap Berry',
|
|
235
|
+
'Shed Shell',
|
|
236
|
+
'Shiny Stone',
|
|
237
|
+
'Shuca Berry',
|
|
238
|
+
'Skull Fossil',
|
|
239
|
+
'Sky Plate',
|
|
240
|
+
'Smooth Rock',
|
|
241
|
+
'Splash Plate',
|
|
242
|
+
'Spooky Plate',
|
|
243
|
+
'Sticky Barb',
|
|
244
|
+
'Stone Plate',
|
|
245
|
+
'Tanga Berry',
|
|
246
|
+
'Toxic Orb',
|
|
247
|
+
'Toxic Plate',
|
|
248
|
+
'Wacan Berry',
|
|
249
|
+
'Wave Incense',
|
|
250
|
+
'Wide Lens',
|
|
251
|
+
'Wise Glasses',
|
|
252
|
+
'Yache Berry',
|
|
253
|
+
'Zap Plate',
|
|
254
|
+
'Zoom Lens',
|
|
255
|
+
]);
|
|
256
|
+
|
|
257
|
+
const BW = DPP.concat([
|
|
258
|
+
'Absorb Bulb',
|
|
259
|
+
'Air Balloon',
|
|
260
|
+
'Big Nugget',
|
|
261
|
+
'Binding Band',
|
|
262
|
+
'Bug Gem',
|
|
263
|
+
'Burn Drive',
|
|
264
|
+
'Cell Battery',
|
|
265
|
+
'Chill Drive',
|
|
266
|
+
'Cover Fossil',
|
|
267
|
+
'Dark Gem',
|
|
268
|
+
'Douse Drive',
|
|
269
|
+
'Dragon Gem',
|
|
270
|
+
'Dream Ball',
|
|
271
|
+
'Eject Button',
|
|
272
|
+
'Electric Gem',
|
|
273
|
+
'Eviolite',
|
|
274
|
+
'Fighting Gem',
|
|
275
|
+
'Fire Gem',
|
|
276
|
+
'Float Stone',
|
|
277
|
+
'Flying Gem',
|
|
278
|
+
'Ghost Gem',
|
|
279
|
+
'Grass Gem',
|
|
280
|
+
'Ground Gem',
|
|
281
|
+
'Ice Gem',
|
|
282
|
+
'Normal Gem',
|
|
283
|
+
'Plume Fossil',
|
|
284
|
+
'Poison Gem',
|
|
285
|
+
'Prism Scale',
|
|
286
|
+
'Psychic Gem',
|
|
287
|
+
'Red Card',
|
|
288
|
+
'Ring Target',
|
|
289
|
+
'Rock Gem',
|
|
290
|
+
'Rocky Helmet',
|
|
291
|
+
'Shock Drive',
|
|
292
|
+
'Steel Gem',
|
|
293
|
+
'Water Gem',
|
|
294
|
+
]);
|
|
295
|
+
|
|
296
|
+
export const MEGA_STONES: {[species: string]: string} = {
|
|
297
|
+
Absolite: 'Absol',
|
|
298
|
+
Abomasite: 'Abomasnow',
|
|
299
|
+
Aerodactylite: 'Aerodactyl',
|
|
300
|
+
Aggronite: 'Aggron',
|
|
301
|
+
Alakazite: 'Alakazam',
|
|
302
|
+
Altarianite: 'Altaria',
|
|
303
|
+
Ampharosite: 'Ampharos',
|
|
304
|
+
Audinite: 'Audino',
|
|
305
|
+
Banettite: 'Banette',
|
|
306
|
+
Beedrillite: 'Beedrill',
|
|
307
|
+
Blastoisinite: 'Blastoise',
|
|
308
|
+
Blazikenite: 'Blaziken',
|
|
309
|
+
Cameruptite: 'Camerupt',
|
|
310
|
+
'Charizardite X': 'Charizard',
|
|
311
|
+
'Charizardite Y': 'Charizard',
|
|
312
|
+
Crucibellite: 'Crucibelle',
|
|
313
|
+
Diancite: 'Diancie',
|
|
314
|
+
Galladite: 'Gallade',
|
|
315
|
+
Garchompite: 'Garchomp',
|
|
316
|
+
Gardevoirite: 'Gardevoir',
|
|
317
|
+
Gengarite: 'Gengar',
|
|
318
|
+
Glalitite: 'Glalie',
|
|
319
|
+
Gyaradosite: 'Gyarados',
|
|
320
|
+
Heracronite: 'Heracross',
|
|
321
|
+
Houndoominite: 'Houndoom',
|
|
322
|
+
Kangaskhanite: 'Kangaskhan',
|
|
323
|
+
Latiasite: 'Latias',
|
|
324
|
+
Latiosite: 'Latios',
|
|
325
|
+
Lopunnite: 'Lopunny',
|
|
326
|
+
Lucarionite: 'Lucario',
|
|
327
|
+
Manectite: 'Manectric',
|
|
328
|
+
Mawilite: 'Mawile',
|
|
329
|
+
Medichamite: 'Medicham',
|
|
330
|
+
Metagrossite: 'Metagross',
|
|
331
|
+
'Mewtwonite X': 'Mewtwo',
|
|
332
|
+
'Mewtwonite Y': 'Mewtwo',
|
|
333
|
+
Pidgeotite: 'Pidgeot',
|
|
334
|
+
Pinsirite: 'Pinsir',
|
|
335
|
+
Sablenite: 'Sableye',
|
|
336
|
+
Salamencite: 'Salamence',
|
|
337
|
+
Sceptilite: 'Sceptile',
|
|
338
|
+
Scizorite: 'Scizor',
|
|
339
|
+
Sharpedonite: 'Sharpedo',
|
|
340
|
+
Slowbronite: 'Slowbro',
|
|
341
|
+
Steelixite: 'Steelix',
|
|
342
|
+
Swampertite: 'Swampert',
|
|
343
|
+
Tyranitarite: 'Tyranitar',
|
|
344
|
+
Venusaurite: 'Venusaur',
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
const XY = BW.concat(
|
|
348
|
+
[
|
|
349
|
+
...Object.keys(MEGA_STONES),
|
|
350
|
+
'Assault Vest',
|
|
351
|
+
'Blue Orb',
|
|
352
|
+
'Fairy Gem',
|
|
353
|
+
'Jaw Fossil',
|
|
354
|
+
'Kee Berry',
|
|
355
|
+
'Luminous Moss',
|
|
356
|
+
'Maranga Berry',
|
|
357
|
+
'Pixie Plate',
|
|
358
|
+
'Red Orb',
|
|
359
|
+
'Roseli Berry',
|
|
360
|
+
'Sachet',
|
|
361
|
+
'Safety Goggles',
|
|
362
|
+
'Sail Fossil',
|
|
363
|
+
'Snowball',
|
|
364
|
+
'Weakness Policy',
|
|
365
|
+
'Whipped Dream',
|
|
366
|
+
].sort()
|
|
367
|
+
);
|
|
368
|
+
|
|
369
|
+
const SM = XY.filter(i => i !== 'Old Amber').concat([
|
|
370
|
+
'Adrenaline Orb',
|
|
371
|
+
'Aloraichium Z',
|
|
372
|
+
'Beast Ball',
|
|
373
|
+
'Bottle Cap',
|
|
374
|
+
'Bug Memory',
|
|
375
|
+
'Buginium Z',
|
|
376
|
+
'Dark Memory',
|
|
377
|
+
'Darkinium Z',
|
|
378
|
+
'Decidium Z',
|
|
379
|
+
'Dragon Memory',
|
|
380
|
+
'Dragonium Z',
|
|
381
|
+
'Eevium Z',
|
|
382
|
+
'Electric Memory',
|
|
383
|
+
'Electric Seed',
|
|
384
|
+
'Electrium Z',
|
|
385
|
+
'Fairium Z',
|
|
386
|
+
'Fairy Memory',
|
|
387
|
+
'Fighting Memory',
|
|
388
|
+
'Fightinium Z',
|
|
389
|
+
'Fire Memory',
|
|
390
|
+
'Firium Z',
|
|
391
|
+
'Flying Memory',
|
|
392
|
+
'Flyinium Z',
|
|
393
|
+
'Ghost Memory',
|
|
394
|
+
'Ghostium Z',
|
|
395
|
+
'Gold Bottle Cap',
|
|
396
|
+
'Grass Memory',
|
|
397
|
+
'Grassium Z',
|
|
398
|
+
'Grassy Seed',
|
|
399
|
+
'Ground Memory',
|
|
400
|
+
'Groundium Z',
|
|
401
|
+
'Ice Memory',
|
|
402
|
+
'Ice Stone',
|
|
403
|
+
'Icium Z',
|
|
404
|
+
'Incinium Z',
|
|
405
|
+
'Kommonium Z',
|
|
406
|
+
'Lunalium Z',
|
|
407
|
+
'Lycanium Z',
|
|
408
|
+
'Marshadium Z',
|
|
409
|
+
'Mewnium Z',
|
|
410
|
+
'Mimikium Z',
|
|
411
|
+
'Misty Seed',
|
|
412
|
+
'Normalium Z',
|
|
413
|
+
'Pikanium Z',
|
|
414
|
+
'Pikashunium Z',
|
|
415
|
+
'Poison Memory',
|
|
416
|
+
'Poisonium Z',
|
|
417
|
+
'Primarium Z',
|
|
418
|
+
'Protective Pads',
|
|
419
|
+
'Psychic Memory',
|
|
420
|
+
'Psychic Seed',
|
|
421
|
+
'Psychium Z',
|
|
422
|
+
'Rock Memory',
|
|
423
|
+
'Rockium Z',
|
|
424
|
+
'Snorlium Z',
|
|
425
|
+
'Solganium Z',
|
|
426
|
+
'Steel Memory',
|
|
427
|
+
'Steelium Z',
|
|
428
|
+
'Tapunium Z',
|
|
429
|
+
'Terrain Extender',
|
|
430
|
+
'Ultranecrozium Z',
|
|
431
|
+
'Water Memory',
|
|
432
|
+
'Waterium Z',
|
|
433
|
+
]);
|
|
434
|
+
|
|
435
|
+
const SS = SM.concat([
|
|
436
|
+
'Berry Sweet',
|
|
437
|
+
'Blunder Policy',
|
|
438
|
+
'Chipped Pot',
|
|
439
|
+
'Clover Sweet',
|
|
440
|
+
'Cracked Pot',
|
|
441
|
+
'Eject Pack',
|
|
442
|
+
'Flower Sweet',
|
|
443
|
+
'Fossilized Bird',
|
|
444
|
+
'Fossilized Dino',
|
|
445
|
+
'Fossilized Drake',
|
|
446
|
+
'Fossilized Fish',
|
|
447
|
+
'Galarica Cuff',
|
|
448
|
+
'Galarica Wreath',
|
|
449
|
+
'Heavy-Duty Boots',
|
|
450
|
+
'Leek',
|
|
451
|
+
'Love Sweet',
|
|
452
|
+
'Ribbon Sweet',
|
|
453
|
+
'Room Service',
|
|
454
|
+
'Rusted Shield',
|
|
455
|
+
'Rusted Sword',
|
|
456
|
+
'Star Sweet',
|
|
457
|
+
'Strawberry Sweet',
|
|
458
|
+
'Sweet Apple',
|
|
459
|
+
'Tart Apple',
|
|
460
|
+
'Throat Spray',
|
|
461
|
+
]);
|
|
462
|
+
|
|
463
|
+
for (let i = 0; i < 100; i++) {
|
|
464
|
+
SS.push(`TR${i < 10 ? `0${i}` : i}`);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
// Added after the TRs to maintain sort order
|
|
468
|
+
SS.push('Utility Umbrella', 'Vile Vial');
|
|
469
|
+
|
|
470
|
+
// Because we support National Dex all Past items are added back in
|
|
471
|
+
SS.push(...GSC_ONLY, 'Old Amber');
|
|
472
|
+
|
|
473
|
+
const SV = SS.concat([
|
|
474
|
+
'Adamant Crystal',
|
|
475
|
+
'Auspicious Armor',
|
|
476
|
+
'Ability Shield',
|
|
477
|
+
'Booster Energy',
|
|
478
|
+
'Clear Amulet',
|
|
479
|
+
'Cornerstone Mask',
|
|
480
|
+
'Covert Cloak',
|
|
481
|
+
'Fairy Feather',
|
|
482
|
+
'Hearthflame Mask',
|
|
483
|
+
'Loaded Dice',
|
|
484
|
+
'Malicious Armor',
|
|
485
|
+
'Masterpiece Teacup',
|
|
486
|
+
'Metal Alloy',
|
|
487
|
+
'Mirror Herb',
|
|
488
|
+
'Punching Glove',
|
|
489
|
+
'Lustrous Globe',
|
|
490
|
+
'Griseous Core',
|
|
491
|
+
'Strange Ball',
|
|
492
|
+
'Syrupy Apple',
|
|
493
|
+
'Unremarkable Teacup',
|
|
494
|
+
'Wellspring Mask',
|
|
495
|
+
]);
|
|
496
|
+
|
|
497
|
+
const BERRIES: {[berry: string]: {t: I.TypeName; p: number}} = {
|
|
498
|
+
'Aguav Berry': {t: 'Dragon', p: 80},
|
|
499
|
+
'Apicot Berry': {t: 'Ground', p: 100},
|
|
500
|
+
'Aspear Berry': {t: 'Ice', p: 80},
|
|
501
|
+
'Babiri Berry': {t: 'Steel', p: 80},
|
|
502
|
+
'Belue Berry': {t: 'Electric', p: 100},
|
|
503
|
+
Berry: {t: 'Poison', p: 80},
|
|
504
|
+
'Bitter Berry': {t: 'Ground', p: 80},
|
|
505
|
+
'Bluk Berry': {t: 'Fire', p: 90},
|
|
506
|
+
'Burnt Berry': {t: 'Ice', p: 80},
|
|
507
|
+
'Charti Berry': {t: 'Rock', p: 80},
|
|
508
|
+
'Cheri Berry': {t: 'Fire', p: 80},
|
|
509
|
+
'Chesto Berry': {t: 'Water', p: 80},
|
|
510
|
+
'Chilan Berry': {t: 'Normal', p: 80},
|
|
511
|
+
'Chople Berry': {t: 'Fighting', p: 80},
|
|
512
|
+
'Coba Berry': {t: 'Flying', p: 80},
|
|
513
|
+
'Colbur Berry': {t: 'Dark', p: 80},
|
|
514
|
+
'Cornn Berry': {t: 'Bug', p: 90},
|
|
515
|
+
'Custap Berry': {t: 'Ghost', p: 100},
|
|
516
|
+
'Durin Berry': {t: 'Water', p: 100},
|
|
517
|
+
'Enigma Berry': {t: 'Bug', p: 100},
|
|
518
|
+
'Figy Berry': {t: 'Bug', p: 80},
|
|
519
|
+
'Ganlon Berry': {t: 'Ice', p: 100},
|
|
520
|
+
'Gold Berry': {t: 'Psychic', p: 80},
|
|
521
|
+
'Grepa Berry': {t: 'Flying', p: 90},
|
|
522
|
+
'Haban Berry': {t: 'Dragon', p: 80},
|
|
523
|
+
'Hondew Berry': {t: 'Ground', p: 90},
|
|
524
|
+
'Iapapa Berry': {t: 'Dark', p: 80},
|
|
525
|
+
'Ice Berry': {t: 'Grass', p: 80},
|
|
526
|
+
'Jaboca Berry': {t: 'Dragon', p: 100},
|
|
527
|
+
'Kasib Berry': {t: 'Ghost', p: 80},
|
|
528
|
+
'Kebia Berry': {t: 'Poison', p: 80},
|
|
529
|
+
'Kee Berry': {t: 'Fairy', p: 100},
|
|
530
|
+
'Kelpsy Berry': {t: 'Fighting', p: 90},
|
|
531
|
+
'Lansat Berry': {t: 'Flying', p: 100},
|
|
532
|
+
'Leppa Berry': {t: 'Fighting', p: 80},
|
|
533
|
+
'Liechi Berry': {t: 'Grass', p: 100},
|
|
534
|
+
'Lum Berry': {t: 'Flying', p: 80},
|
|
535
|
+
'Mago Berry': {t: 'Ghost', p: 80},
|
|
536
|
+
'Magost Berry': {t: 'Rock', p: 90},
|
|
537
|
+
'Maranga Berry': {t: 'Dark', p: 100},
|
|
538
|
+
'Micle Berry': {t: 'Rock', p: 100},
|
|
539
|
+
'Mint Berry': {t: 'Water', p: 80},
|
|
540
|
+
'Miracle Berry': {t: 'Flying', p: 80},
|
|
541
|
+
'Mystery Berry': {t: 'Fighting', p: 80},
|
|
542
|
+
'Nanab Berry': {t: 'Water', p: 90},
|
|
543
|
+
'Nomel Berry': {t: 'Dragon', p: 90},
|
|
544
|
+
'Occa Berry': {t: 'Fire', p: 80},
|
|
545
|
+
'Oran Berry': {t: 'Poison', p: 80},
|
|
546
|
+
'Pamtre Berry': {t: 'Steel', p: 90},
|
|
547
|
+
'Passho Berry': {t: 'Water', p: 80},
|
|
548
|
+
'Payapa Berry': {t: 'Psychic', p: 80},
|
|
549
|
+
'Pecha Berry': {t: 'Electric', p: 80},
|
|
550
|
+
'Persim Berry': {t: 'Ground', p: 80},
|
|
551
|
+
'Petaya Berry': {t: 'Poison', p: 100},
|
|
552
|
+
'Pinap Berry': {t: 'Grass', p: 90},
|
|
553
|
+
'Pomeg Berry': {t: 'Ice', p: 90},
|
|
554
|
+
'PRZ Cure Berry': {t: 'Fire', p: 80},
|
|
555
|
+
'PSN Cure Berry': {t: 'Electric', p: 80},
|
|
556
|
+
'Qualot Berry': {t: 'Poison', p: 90},
|
|
557
|
+
'Rabuta Berry': {t: 'Ghost', p: 90},
|
|
558
|
+
'Rawst Berry': {t: 'Grass', p: 80},
|
|
559
|
+
'Razz Berry': {t: 'Steel', p: 80},
|
|
560
|
+
'Rindo Berry': {t: 'Grass', p: 80},
|
|
561
|
+
'Roseli Berry': {t: 'Fairy', p: 80},
|
|
562
|
+
'Rowap Berry': {t: 'Dark', p: 100},
|
|
563
|
+
'Salac Berry': {t: 'Fighting', p: 100},
|
|
564
|
+
'Shuca Berry': {t: 'Ground', p: 80},
|
|
565
|
+
'Sitrus Berry': {t: 'Psychic', p: 80},
|
|
566
|
+
'Spelon Berry': {t: 'Dark', p: 90},
|
|
567
|
+
'Starf Berry': {t: 'Psychic', p: 100},
|
|
568
|
+
'Tamato Berry': {t: 'Psychic', p: 90},
|
|
569
|
+
'Tanga Berry': {t: 'Bug', p: 80},
|
|
570
|
+
'Wacan Berry': {t: 'Electric', p: 80},
|
|
571
|
+
'Watmel Berry': {t: 'Fire', p: 100},
|
|
572
|
+
'Wepear Berry': {t: 'Electric', p: 90},
|
|
573
|
+
'Wiki Berry': {t: 'Rock', p: 80},
|
|
574
|
+
'Yache Berry': {t: 'Ice', p: 80},
|
|
575
|
+
};
|
|
576
|
+
|
|
577
|
+
export const ITEMS = [[], RBY, GSC, ADV, DPP, BW, XY, SM, SS, SV];
|
|
578
|
+
|
|
579
|
+
export class Items implements I.Items {
|
|
580
|
+
private readonly gen: I.GenerationNum;
|
|
581
|
+
|
|
582
|
+
constructor(gen: I.GenerationNum) {
|
|
583
|
+
this.gen = gen;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
get(id: I.ID) {
|
|
587
|
+
return ITEMS_BY_ID[this.gen][id];
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
*[Symbol.iterator]() {
|
|
591
|
+
for (const id in ITEMS_BY_ID[this.gen]) {
|
|
592
|
+
yield this.get(id as I.ID)!;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
class Item implements I.Item {
|
|
598
|
+
readonly kind: 'Item';
|
|
599
|
+
readonly id: I.ID;
|
|
600
|
+
readonly name: I.ItemName;
|
|
601
|
+
readonly megaEvolves?: I.SpeciesName;
|
|
602
|
+
readonly isBerry?: boolean;
|
|
603
|
+
readonly naturalGift?: Readonly<{basePower: number; type: I.TypeName}>;
|
|
604
|
+
|
|
605
|
+
constructor(name: string, gen: number) {
|
|
606
|
+
this.kind = 'Item';
|
|
607
|
+
this.id = toID(name);
|
|
608
|
+
this.name = name as I.ItemName;
|
|
609
|
+
this.megaEvolves = MEGA_STONES[name] as I.SpeciesName;
|
|
610
|
+
const berry = BERRIES[name];
|
|
611
|
+
if (berry) {
|
|
612
|
+
this.isBerry = true;
|
|
613
|
+
this.naturalGift = {
|
|
614
|
+
basePower: gen < 6 ? berry.p - 20 : berry.p,
|
|
615
|
+
type: berry.t,
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
const ITEMS_BY_ID: Array<{[id: string]: Item}> = [];
|
|
622
|
+
|
|
623
|
+
let gen = 0;
|
|
624
|
+
for (const items of ITEMS) {
|
|
625
|
+
const map: {[id: string]: Item} = {};
|
|
626
|
+
for (const item of items) {
|
|
627
|
+
const i = new Item(item, gen);
|
|
628
|
+
map[i.id] = i;
|
|
629
|
+
}
|
|
630
|
+
ITEMS_BY_ID.push(map);
|
|
631
|
+
gen++;
|
|
632
|
+
}
|