@pkmn/sim 0.5.24 → 0.5.25

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.
Files changed (54) hide show
  1. package/build/config/formats.js +202 -88
  2. package/build/config/formats.js.map +1 -1
  3. package/build/data/aliases.js +7 -3
  4. package/build/data/aliases.js.map +1 -1
  5. package/build/data/formats-data.js +823 -20
  6. package/build/data/formats-data.js.map +1 -1
  7. package/build/data/learnsets.js +64 -39
  8. package/build/data/learnsets.js.map +1 -1
  9. package/build/data/mods/gen2/moves.js +0 -5
  10. package/build/data/mods/gen2/moves.js.map +1 -1
  11. package/build/data/mods/gen2/rulesets.js +7 -1
  12. package/build/data/mods/gen2/rulesets.js.map +1 -1
  13. package/build/data/mods/gen3/rulesets.js +1 -1
  14. package/build/data/mods/gen3/rulesets.js.map +1 -1
  15. package/build/data/mods/gen4/rulesets.js +1 -1
  16. package/build/data/mods/gen4/rulesets.js.map +1 -1
  17. package/build/data/mods/gen5/rulesets.js +1 -1
  18. package/build/data/mods/gen5/rulesets.js.map +1 -1
  19. package/build/data/mods/gen7/rulesets.js +1 -1
  20. package/build/data/mods/gen7/rulesets.js.map +1 -1
  21. package/build/data/rulesets.js +1 -0
  22. package/build/data/rulesets.js.map +1 -1
  23. package/build/data/tags.js +26 -9
  24. package/build/data/tags.js.map +1 -1
  25. package/build/sim/battle.d.ts +1 -1
  26. package/build/sim/battle.js.map +1 -1
  27. package/build/sim/dex-conditions.d.ts +1 -0
  28. package/build/sim/dex-conditions.js.map +1 -1
  29. package/build/sim/dex-species.d.ts +5 -0
  30. package/build/sim/dex-species.js +11 -3
  31. package/build/sim/dex-species.js.map +1 -1
  32. package/build/sim/exported-global-types.d.ts +2 -0
  33. package/build/sim/global-types.d.ts +2 -0
  34. package/build/sim/team-validator.js +5 -1
  35. package/build/sim/team-validator.js.map +1 -1
  36. package/config/formats.ts +204 -89
  37. package/data/aliases.ts +7 -3
  38. package/data/formats-data.ts +823 -20
  39. package/data/learnsets.ts +64 -39
  40. package/data/mods/gen2/moves.ts +0 -5
  41. package/data/mods/gen2/rulesets.ts +8 -1
  42. package/data/mods/gen3/rulesets.ts +1 -1
  43. package/data/mods/gen4/rulesets.ts +1 -1
  44. package/data/mods/gen5/rulesets.ts +1 -1
  45. package/data/mods/gen7/rulesets.ts +1 -1
  46. package/data/rulesets.ts +1 -0
  47. package/data/tags.ts +27 -9
  48. package/package.json +2 -2
  49. package/sim/battle.ts +1 -1
  50. package/sim/dex-conditions.ts +1 -0
  51. package/sim/dex-species.ts +15 -3
  52. package/sim/exported-global-types.ts +2 -0
  53. package/sim/global-types.ts +2 -0
  54. package/sim/team-validator.ts +6 -1
@@ -42,6 +42,7 @@ export interface SpeciesFormatsData {
42
42
  exclusiveMoves?: readonly string[];
43
43
  gmaxUnreleased?: boolean;
44
44
  isNonstandard?: Nonstandard | null;
45
+ natDexTier?: TierTypes.Singles | TierTypes.Other;
45
46
  randomBattleMoves?: readonly string[];
46
47
  randomBattleLevel?: number;
47
48
  randomDoubleBattleMoves?: readonly string[];
@@ -231,6 +232,10 @@ export class Species extends BasicEffect implements Readonly<BasicEffect & Speci
231
232
  * Doubles Tier. The Pokemon's location in the Smogon doubles tier system.
232
233
  */
233
234
  readonly doublesTier: TierTypes.Doubles | TierTypes.Other;
235
+ /**
236
+ * National Dex Tier. The Pokemon's location in the Smogon National Dex tier system.
237
+ */
238
+ readonly natDexTier: TierTypes.Singles | TierTypes.Other;
234
239
  declare readonly randomBattleMoves?: readonly ID[];
235
240
  declare readonly randomBattleLevel?: number;
236
241
  declare readonly randomDoubleBattleMoves?: readonly ID[];
@@ -261,6 +266,7 @@ export class Species extends BasicEffect implements Readonly<BasicEffect & Speci
261
266
  this.prevo = data.prevo || '';
262
267
  this.tier = data.tier || '';
263
268
  this.doublesTier = data.doublesTier || '';
269
+ this.natDexTier = data.natDexTier || '';
264
270
  this.evos = data.evos || [];
265
271
  this.evoType = data.evoType || undefined;
266
272
  this.evoMove = data.evoMove || undefined;
@@ -451,16 +457,19 @@ export class DexSpecies {
451
457
  if (!(key in species)) (species as any)[key] = baseSpeciesStatuses[key];
452
458
  }
453
459
  }
454
- if (!species.tier && !species.doublesTier && species.baseSpecies !== species.name) {
460
+ if (!species.tier && !species.doublesTier && !species.natDexTier && species.baseSpecies !== species.name) {
455
461
  if (species.baseSpecies === 'Mimikyu') {
456
462
  species.tier = this.dex.data.FormatsData[toID(species.baseSpecies)].tier || 'Illegal';
457
463
  species.doublesTier = this.dex.data.FormatsData[toID(species.baseSpecies)].doublesTier || 'Illegal';
464
+ species.natDexTier = this.dex.data.FormatsData[toID(species.baseSpecies)].natDexTier || 'Illegal';
458
465
  } else if (species.id.endsWith('totem')) {
459
466
  species.tier = this.dex.data.FormatsData[species.id.slice(0, -5)].tier || 'Illegal';
460
467
  species.doublesTier = this.dex.data.FormatsData[species.id.slice(0, -5)].doublesTier || 'Illegal';
468
+ species.natDexTier = this.dex.data.FormatsData[species.id.slice(0, -5)].natDexTier || 'Illegal';
461
469
  } else if (species.battleOnly) {
462
470
  species.tier = this.dex.data.FormatsData[toID(species.battleOnly)].tier || 'Illegal';
463
471
  species.doublesTier = this.dex.data.FormatsData[toID(species.battleOnly)].doublesTier || 'Illegal';
472
+ species.natDexTier = this.dex.data.FormatsData[toID(species.battleOnly)].natDexTier || 'Illegal';
464
473
  } else {
465
474
  const baseFormatsData = this.dex.data.FormatsData[toID(species.baseSpecies)];
466
475
  if (!baseFormatsData) {
@@ -468,13 +477,16 @@ export class DexSpecies {
468
477
  }
469
478
  species.tier = baseFormatsData.tier || 'Illegal';
470
479
  species.doublesTier = baseFormatsData.doublesTier || 'Illegal';
480
+ species.natDexTier = baseFormatsData.natDexTier || 'Illegal';
471
481
  }
472
482
  }
473
483
  if (!species.tier) species.tier = 'Illegal';
474
484
  if (!species.doublesTier) species.doublesTier = species.tier as any;
485
+ if (!species.natDexTier) species.natDexTier = species.tier;
475
486
  if (species.gen > this.dex.gen) {
476
487
  species.tier = 'Illegal';
477
488
  species.doublesTier = 'Illegal';
489
+ species.natDexTier = 'Illegal';
478
490
  species.isNonstandard = 'Future';
479
491
  }
480
492
  if (this.dex.currentMod === 'gen7letsgo' && !species.isNonstandard) {
@@ -490,7 +502,7 @@ export class DexSpecies {
490
502
  if (species.gen > 4 || (species.num < 1 && species.isNonstandard !== 'CAP') ||
491
503
  species.id === 'pichuspikyeared') {
492
504
  species.isNonstandard = 'Future';
493
- species.tier = species.doublesTier = 'Illegal';
505
+ species.tier = species.doublesTier = species.natDexTier = 'Illegal';
494
506
  }
495
507
  }
496
508
  species.nfe = species.evos.some(evo => {
@@ -505,7 +517,7 @@ export class DexSpecies {
505
517
  } else {
506
518
  species = new Species({
507
519
  id, name: id,
508
- exists: false, tier: 'Illegal', doublesTier: 'Illegal', isNonstandard: 'Custom',
520
+ exists: false, tier: 'Illegal', doublesTier: 'Illegal', natDexTier: 'Illegal', isNonstandard: 'Custom',
509
521
  });
510
522
  }
511
523
  (species as any).kind = 'Species';
@@ -312,6 +312,7 @@ export interface ModdedBattlePokemon {
312
312
  clearBoosts?: (this: Pokemon) => void;
313
313
  calculateStat?: (this: Pokemon, statName: StatIDExceptHP, boost: number, modifier?: number) => number;
314
314
  cureStatus?: (this: Pokemon, silent?: boolean) => boolean;
315
+ eatItem?: (this: Pokemon, force?: boolean, source?: Pokemon, sourceEffect?: Effect) => boolean;
315
316
  formeChange?: (
316
317
  this: Pokemon, speciesId: string | Species, source: Effect, isPermanent?: boolean, message?: string
317
318
  ) => boolean;
@@ -344,6 +345,7 @@ export interface ModdedBattlePokemon {
344
345
  ) => boolean;
345
346
  takeItem?: (this: Pokemon, source: Pokemon | undefined) => boolean | Item;
346
347
  transformInto?: (this: Pokemon, pokemon: Pokemon, effect: Effect | null) => boolean;
348
+ useItem?: (this: Pokemon, source?: Pokemon, sourceEffect?: Effect) => boolean;
347
349
  ignoringAbility?: (this: Pokemon) => boolean;
348
350
  ignoringItem?: (this: Pokemon) => boolean;
349
351
 
@@ -312,6 +312,7 @@ interface ModdedBattlePokemon {
312
312
  clearBoosts?: (this: Pokemon) => void;
313
313
  calculateStat?: (this: Pokemon, statName: StatIDExceptHP, boost: number, modifier?: number) => number;
314
314
  cureStatus?: (this: Pokemon, silent?: boolean) => boolean;
315
+ eatItem?: (this: Pokemon, force?: boolean, source?: Pokemon, sourceEffect?: Effect) => boolean;
315
316
  formeChange?: (
316
317
  this: Pokemon, speciesId: string | Species, source: Effect, isPermanent?: boolean, message?: string
317
318
  ) => boolean;
@@ -344,6 +345,7 @@ interface ModdedBattlePokemon {
344
345
  ) => boolean;
345
346
  takeItem?: (this: Pokemon, source: Pokemon | undefined) => boolean | Item;
346
347
  transformInto?: (this: Pokemon, pokemon: Pokemon, effect: Effect | null) => boolean;
348
+ useItem?: (this: Pokemon, source?: Pokemon, sourceEffect?: Effect) => boolean;
347
349
  ignoringAbility?: (this: Pokemon) => boolean;
348
350
  ignoringItem?: (this: Pokemon) => boolean;
349
351
 
@@ -1366,6 +1366,11 @@ export class TeamValidator {
1366
1366
  const doublesTierTag = 'pokemontag:' + toID(doublesTier);
1367
1367
  setHas[doublesTierTag] = true;
1368
1368
 
1369
+ const ndTier = tierSpecies.natDexTier === '(PU)' ? 'ZU' :
1370
+ tierSpecies.natDexTier === '(NU)' ? 'PU' : tierSpecies.natDexTier;
1371
+ const ndTierTag = 'pokemontag:nd' + toID(ndTier);
1372
+ setHas[ndTierTag] = true;
1373
+
1369
1374
  // Only pokemon that can gigantamax should have the Gmax flag
1370
1375
  if (!tierSpecies.canGigantamax && set.gigantamax) {
1371
1376
  return `${tierSpecies.name} cannot Gigantamax but is flagged as being able to.`;
@@ -2206,7 +2211,7 @@ export class TeamValidator {
2206
2211
  // different learnsets. To prevent a leak, we make them show up as their
2207
2212
  // base forme, but hardcode their learnsets into Rockruff-Dusk and
2208
2213
  // Greninja-Ash
2209
- if ((species.baseSpecies === 'Gastrodon' || species.baseSpecies === 'Pumpkaboo') && species.forme) {
2214
+ if (['Gastrodon', 'Pumpkaboo', 'Sinistea'].includes(species.baseSpecies) && species.forme) {
2210
2215
  return this.dex.species.get(species.baseSpecies);
2211
2216
  } else if (species.name === 'Lycanroc-Dusk') {
2212
2217
  return this.dex.species.get('Rockruff-Dusk');