@pkmn/sim 0.5.16 → 0.5.17

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 (72) hide show
  1. package/build/config/formats.js +32 -51
  2. package/build/config/formats.js.map +1 -1
  3. package/build/data/items.js +1 -3
  4. package/build/data/items.js.map +1 -1
  5. package/build/data/learnsets.js +2 -2
  6. package/build/data/learnsets.js.map +1 -1
  7. package/build/data/mods/gen1/formats-data.js +1 -1
  8. package/build/data/mods/gen1/formats-data.js.map +1 -1
  9. package/build/data/mods/gen1/moves.js +1 -4
  10. package/build/data/mods/gen1/moves.js.map +1 -1
  11. package/build/data/mods/gen3/moves.js +0 -7
  12. package/build/data/mods/gen3/moves.js.map +1 -1
  13. package/build/data/mods/gen3/scripts.js +2 -2
  14. package/build/data/mods/gen3/scripts.js.map +1 -1
  15. package/build/data/mods/gen4/moves.js +1 -1
  16. package/build/data/mods/gen4/moves.js.map +1 -1
  17. package/build/data/mods/gen4/rulesets.js +2 -1
  18. package/build/data/mods/gen4/rulesets.js.map +1 -1
  19. package/build/data/mods/gen5/rulesets.js +2 -1
  20. package/build/data/mods/gen5/rulesets.js.map +1 -1
  21. package/build/data/mods/gen7/formats-data.js +4 -4
  22. package/build/data/mods/gen7/formats-data.js.map +1 -1
  23. package/build/data/mods/gen7/rulesets.js +2 -1
  24. package/build/data/mods/gen7/rulesets.js.map +1 -1
  25. package/build/data/moves.js +55 -74
  26. package/build/data/moves.js.map +1 -1
  27. package/build/data/pokedex.js +2 -2
  28. package/build/data/pokedex.js.map +1 -1
  29. package/build/data/rulesets.js +3 -4
  30. package/build/data/rulesets.js.map +1 -1
  31. package/build/data/text/items.js +1 -0
  32. package/build/data/text/items.js.map +1 -1
  33. package/build/data/text/moves.js +5 -3
  34. package/build/data/text/moves.js.map +1 -1
  35. package/build/sim/battle-actions.js +9 -1
  36. package/build/sim/battle-actions.js.map +1 -1
  37. package/build/sim/battle.js +39 -1
  38. package/build/sim/battle.js.map +1 -1
  39. package/build/sim/dex-conditions.d.ts +1 -0
  40. package/build/sim/dex-conditions.js.map +1 -1
  41. package/build/sim/exported-global-types.d.ts +1 -0
  42. package/build/sim/global-types.d.ts +1 -0
  43. package/build/sim/team-validator.js +15 -4
  44. package/build/sim/team-validator.js.map +1 -1
  45. package/build/sim/tools/exhaustive-runner.d.ts +8 -0
  46. package/build/sim/tools/exhaustive-runner.js +18 -7
  47. package/build/sim/tools/exhaustive-runner.js.map +1 -1
  48. package/config/formats.ts +32 -51
  49. package/data/items.ts +1 -3
  50. package/data/learnsets.ts +2 -2
  51. package/data/mods/gen1/formats-data.ts +1 -1
  52. package/data/mods/gen1/moves.ts +1 -4
  53. package/data/mods/gen3/moves.ts +0 -7
  54. package/data/mods/gen3/scripts.ts +3 -3
  55. package/data/mods/gen4/moves.ts +1 -1
  56. package/data/mods/gen4/rulesets.ts +2 -1
  57. package/data/mods/gen5/rulesets.ts +2 -1
  58. package/data/mods/gen7/formats-data.ts +4 -4
  59. package/data/mods/gen7/rulesets.ts +2 -1
  60. package/data/moves.ts +55 -65
  61. package/data/pokedex.ts +2 -2
  62. package/data/rulesets.ts +3 -6
  63. package/data/text/items.ts +2 -0
  64. package/data/text/moves.ts +6 -3
  65. package/package.json +1 -1
  66. package/sim/battle-actions.ts +13 -1
  67. package/sim/battle.ts +38 -1
  68. package/sim/dex-conditions.ts +1 -0
  69. package/sim/exported-global-types.ts +3 -0
  70. package/sim/global-types.ts +3 -0
  71. package/sim/team-validator.ts +16 -4
  72. package/sim/tools/exhaustive-runner.ts +29 -11
@@ -236,7 +236,7 @@ exports.Formats = [
236
236
  'Larvesta', 'Magby', 'Magnemite', 'Mareanie', 'Mienfoo', 'Mudbray', 'Munchlax', 'Natu', 'Onix', 'Pawniard',
237
237
  'Ponyta', 'Ponyta-Galar', 'Porygon', 'Slowpoke-Base', 'Staryu', 'Timburr', 'Trapinch', 'Tyrunt',
238
238
  // LC UUBL
239
- 'Farfetch\u2019d-Galar', 'Scorbunny', 'Shellder', 'Wingull',
239
+ 'Archen', 'Farfetch\u2019d-Galar', 'Scorbunny', 'Shellder', 'Wingull',
240
240
  ],
241
241
  },
242
242
  {
@@ -330,7 +330,7 @@ exports.Formats = [
330
330
  gameType: 'doubles',
331
331
  searchShow: false,
332
332
  ruleset: ['Standard Doubles', 'Little Cup', 'Dynamax Clause', 'Swagger Clause', 'Sleep Clause Mod'],
333
- banlist: ['Corsola-Galar', 'Cutiefly', 'Ponyta-Base', 'Scyther', 'Sneasel', 'Swirlix', 'Tangela', 'Vulpix', 'Vulpix-Alola', 'Ally Switch'],
333
+ banlist: ['Corsola-Galar', 'Cutiefly', 'Ponyta-Base', 'Scyther', 'Sneasel', 'Swirlix', 'Tangela', 'Vulpix-Base', 'Ally Switch'],
334
334
  },
335
335
  {
336
336
  name: "[Gen 8] VGC 2022",
@@ -596,17 +596,18 @@ exports.Formats = [
596
596
  mod: 'pokebilities',
597
597
  ruleset: ['[Gen 8] Pokebilities', '!Obtainable Abilities', 'AAA Restricted Abilities', '2 Ability Clause', 'Sleep Moves Clause', '!Sleep Clause Mod'],
598
598
  banlist: [
599
- 'Blacephalon', 'Buzzwole', 'Clefable', 'Dragapult', 'Dragonite', 'Kartana', 'Keldeo', 'Kyurem', 'Melmetal', 'Mienshao',
600
- 'Obstagoon', 'Noivern', 'Pangoro', 'Perrserker', 'Rillaboom', 'Tapu Bulu', 'Tapu Lele', 'Urshifu', 'Urshifu-Rapid-Strike',
601
- 'Victini', 'Weavile', 'Zamazenta-Crowned', 'Arena Trap', 'Moody', 'Shadow Tag', 'Wonder Guard', 'Chlorophyll + Desolate Land',
602
- 'Chlorophyll + Drought', 'Electric Surge + Surge Surfer', 'Regenerator + Emergency Exit', 'Regenerator + Multiscale',
603
- 'Regenerator + Shadow Shield', 'Regenerator + Wimp Out', 'Sand Rush + Sand Stream', 'Slush Rush + Snow Warning', 'Swift Swim + Drizzle',
604
- 'Swift Swim + Primordial Sea', 'Regenerator > 2',
599
+ 'Alakazam', 'Blacephalon', 'Buzzwole', 'Clefable', 'Dragapult', 'Dragonite', 'Gengar', 'Kartana', 'Keldeo', 'Kyurem', 'Melmetal', 'Mienshao',
600
+ 'Noivern', 'Obstagoon', 'Perrserker', 'Rillaboom', 'Tapu Lele', 'Urshifu', 'Urshifu-Rapid-Strike', 'Victini', 'Weavile', 'Zamazenta-Crowned',
601
+ 'Zapdos-Galar', 'Arena Trap', 'Moody', 'Shadow Tag', 'Wonder Guard', 'Chlorophyll + Desolate Land', 'Chlorophyll + Drought', 'Electric Surge + Surge Surfer',
602
+ 'Regenerator + Emergency Exit', 'Regenerator + Multiscale', 'Regenerator + Shadow Shield', 'Regenerator + Wimp Out', 'Sand Rush + Sand Stream',
603
+ 'Slush Rush + Snow Warning', 'Swift Swim + Drizzle', 'Swift Swim + Primordial Sea', 'Snow Cloak + Snow Warning', 'Sand Veil + Sand Stream',
604
+ 'Regenerator > 2', 'Bright Powder', 'Lax Incense', 'Quick Claw',
605
605
  ],
606
606
  restricted: [
607
607
  'Comatose', 'Contrary', 'Fluffy', 'Fur Coat', 'Gorilla Tactics', 'Huge Power', 'Ice Scales', 'Illusion', 'Imposter', 'Innards Out',
608
- 'Intrepid Sword', 'Libero', 'Magnet Pull', 'Neutralizing Gas', 'Parental Bond', 'Poison Heal', 'Prankster', 'Protean',
609
- 'Pure Power', 'Simple', 'Stakeout', 'Stench', 'Speed Boost', 'Tinted Lens', 'Unburden', 'Water Bubble',
608
+ 'Intrepid Sword', 'Libero', 'Magnet Pull', 'Neutralizing Gas', 'Parental Bond', 'Poison Heal', 'Prankster', 'Protean', 'Pure Power',
609
+ 'Quick Draw', 'Sand Veil', 'Serene Grace', 'Simple', 'Snow Cloak', 'Speed Boost', 'Stakeout', 'Stench', 'Tinted Lens', 'Triage',
610
+ 'Unburden', 'Water Bubble',
610
611
  ],
611
612
  },
612
613
  // Other Metagames
@@ -631,25 +632,6 @@ exports.Formats = [
631
632
  'Water Bubble', 'Wonder Guard', 'Comatose + Sleep Talk', 'Rusted Sword', 'Court Change', 'Bolt Beak', 'Double Iron Bash',
632
633
  'Octolock', 'Shell Smash',
633
634
  ],
634
- onChangeSet(set) {
635
- const item = this.dex.toID(set.item);
636
- if (set.species === 'Zacian' && item === 'rustedsword') {
637
- set.species = 'Zacian-Crowned';
638
- set.ability = 'Intrepid Sword';
639
- const ironHead = set.moves.indexOf('ironhead');
640
- if (ironHead >= 0) {
641
- set.moves[ironHead] = 'behemothblade';
642
- }
643
- }
644
- if (set.species === 'Zamazenta' && item === 'rustedshield') {
645
- set.species = 'Zamazenta-Crowned';
646
- set.ability = 'Dauntless Shield';
647
- const ironHead = set.moves.indexOf('ironhead');
648
- if (ironHead >= 0) {
649
- set.moves[ironHead] = 'behemothbash';
650
- }
651
- }
652
- },
653
635
  },
654
636
  {
655
637
  name: "[Gen 8] Almost Any Ability",
@@ -670,15 +652,6 @@ exports.Formats = [
670
652
  'Innards Out', 'Intrepid Sword', 'Libero', 'Magnet Pull', 'Moody', 'Neutralizing Gas', 'Parental Bond', 'Poison Heal', 'Protean',
671
653
  'Pure Power', 'Shadow Tag', 'Simple', 'Stakeout', 'Speed Boost', 'Water Bubble', 'Wonder Guard', 'King\'s Rock', 'Baton Pass',
672
654
  ],
673
- onValidateSet(set) {
674
- // Temporary fix until battle-only is implemented properly
675
- if (this.toID(set.species) === 'zamazentacrowned' && this.toID(set.ability) !== 'dauntlessshield') {
676
- return [`Zamazenta-Crowned can only use Dauntless Shield because it is a battle-only forme.`];
677
- }
678
- if (this.toID(set.species) === 'zaciancrowned' && this.toID(set.ability) !== 'intrepidsword') {
679
- return [`Zacian-Crowned can only use Intrepid Sword because it is a battle-only forme.`];
680
- }
681
- },
682
655
  },
683
656
  {
684
657
  name: "[Gen 8] Mix and Mega",
@@ -850,9 +823,6 @@ exports.Formats = [
850
823
  const stat = Dex.stats.ids()[target.side.team.indexOf(target.set)];
851
824
  const newSpecies = this.dex.deepClone(species);
852
825
  let godSpecies = this.dex.species.get(god.species);
853
- if (godSpecies.forme === 'Crowned') {
854
- godSpecies = this.dex.species.get(godSpecies.changesFrom || godSpecies.baseSpecies);
855
- }
856
826
  if (typeof godSpecies.battleOnly === 'string') {
857
827
  godSpecies = this.dex.species.get(godSpecies.battleOnly);
858
828
  }
@@ -1723,6 +1693,17 @@ exports.Formats = [
1723
1693
  }
1724
1694
  }
1725
1695
  },
1696
+ onSwitchOut(pokemon) {
1697
+ for (const innate of Object.keys(pokemon.volatiles).filter(i => i.startsWith('ability:'))) {
1698
+ pokemon.removeVolatile(innate);
1699
+ }
1700
+ },
1701
+ onFaint(pokemon) {
1702
+ for (const innate of Object.keys(pokemon.volatiles).filter(i => i.startsWith('ability:'))) {
1703
+ const innateEffect = this.dex.conditions.get(innate);
1704
+ this.singleEvent('End', innateEffect, null, pokemon);
1705
+ }
1706
+ },
1726
1707
  onAfterMega(pokemon) {
1727
1708
  for (const innate of Object.keys(pokemon.volatiles).filter(i => i.startsWith('ability:'))) {
1728
1709
  pokemon.removeVolatile(innate);
@@ -2420,7 +2401,7 @@ exports.Formats = [
2420
2401
  ],
2421
2402
  mod: 'gen3',
2422
2403
  ruleset: ['Standard', 'One Boost Passer Clause'],
2423
- banlist: ['Uber', 'Sand Veil', 'Soundproof', 'Assist', 'Baton Pass + Mean Look', 'Baton Pass + Spider Web', 'Smeargle + Ingrain'],
2404
+ banlist: ['Uber', 'Sand Veil', 'Soundproof', 'Assist', 'Baton Pass + Block', 'Baton Pass + Mean Look', 'Baton Pass + Spider Web', 'Smeargle + Ingrain'],
2424
2405
  },
2425
2406
  {
2426
2407
  name: "[Gen 2] OU",
@@ -2917,8 +2898,8 @@ exports.Formats = [
2917
2898
  searchShow: false,
2918
2899
  ruleset: ['Standard', 'Swagger Clause', 'Same Type Clause'],
2919
2900
  banlist: [
2920
- 'Aegislash', 'Altaria-Mega', 'Arceus', 'Blaziken', 'Darkrai', 'Deoxys-Base', 'Deoxys-Attack', 'Dialga', 'Genesect', 'Gengar-Mega',
2921
- 'Giratina', 'Giratina-Origin', 'Greninja', 'Groudon', 'Ho-Oh', 'Hoopa-Unbound', 'Kangaskhan-Mega', 'Kyogre', 'Kyurem-White',
2901
+ 'Aegislash', 'Altaria-Mega', 'Arceus', 'Blaziken', 'Darkrai', 'Deoxys-Base', 'Deoxys-Attack', 'Deoxys-Speed', 'Dialga', 'Genesect',
2902
+ 'Gengar-Mega', 'Giratina', 'Giratina-Origin', 'Greninja', 'Groudon', 'Ho-Oh', 'Hoopa-Unbound', 'Kangaskhan-Mega', 'Kyogre', 'Kyurem-White',
2922
2903
  'Lucario-Mega', 'Lugia', 'Mawile-Mega', 'Medicham-Mega', 'Metagross-Mega', 'Mewtwo', 'Palkia', 'Rayquaza', 'Reshiram', 'Sableye-Mega',
2923
2904
  'Salamence-Mega', 'Shaymin-Sky', 'Slowbro-Mega', 'Talonflame', 'Xerneas', 'Yveltal', 'Zekrom',
2924
2905
  'Shadow Tag', 'Bright Powder', 'Damp Rock', 'Focus Band', 'King\'s Rock', 'Lax Incense', 'Quick Claw', 'Razor Fang', 'Smooth Rock',
@@ -2941,8 +2922,8 @@ exports.Formats = [
2941
2922
  banlist: [
2942
2923
  'Arceus', 'Blaziken', 'Darkrai', 'Deoxys-Base', 'Deoxys-Attack', 'Deoxys-Defense', 'Dialga', 'Giratina',
2943
2924
  'Giratina-Origin', 'Groudon', 'Ho-Oh', 'Kangaskhan-Mega', 'Kyogre', 'Kyurem-White', 'Lugia', 'Mewtwo',
2944
- 'Palkia', 'Rayquaza', 'Reshiram', 'Salamence-Mega', 'Shaymin-Sky', 'Xerneas', 'Yveltal', 'Zekrom',
2945
- 'Focus Sash', 'Soul Dew', 'Grass Whistle', 'Hypnosis', 'Perish Song', 'Sing', 'Yawn',
2925
+ 'Palkia', 'Rayquaza', 'Reshiram', 'Salamence-Mega', 'Shaymin-Sky', 'Snorlax', 'Xerneas', 'Yveltal',
2926
+ 'Zekrom', 'Focus Sash', 'Soul Dew', 'Grass Whistle', 'Hypnosis', 'Perish Song', 'Sing', 'Yawn',
2946
2927
  ],
2947
2928
  },
2948
2929
  {
@@ -3378,11 +3359,11 @@ exports.Formats = [
3378
3359
  searchShow: false,
3379
3360
  ruleset: ['[Gen 4] PU'],
3380
3361
  banlist: [
3381
- 'Ampharos', 'Armaldo', 'Bellossom', 'Dragonair', 'Gabite', 'Gastrodon', 'Glaceon', 'Glalie', 'Golduck',
3382
- 'Gorebyss', 'Hippopotas', 'Kadabra', 'Machoke', 'Magmar', 'Mantine', 'Marowak', 'Metang', 'Misdreavus',
3383
- 'Monferno', 'Mr. Mime', 'Muk', 'Murkrow', 'Pinsir', 'Politoed', 'Purugly', 'Quagsire', 'Raichu',
3384
- 'Rampardos', 'Rapidash', 'Regigigas', 'Relicanth', 'Rhydon', 'Scyther', 'Sneasel', 'Snover', 'Solrock',
3385
- 'Tangela', 'Torkoal', 'Victreebel', 'Xatu', 'Zangoose', 'Damp Rock',
3362
+ 'Ampharos', 'Armaldo', 'Bellossom', 'Dragonair', 'Electabuzz', 'Gabite', 'Gastrodon', 'Glaceon', 'Glalie',
3363
+ 'Golduck', 'Gorebyss', 'Hippopotas', 'Kadabra', 'Machoke', 'Magmar', 'Mantine', 'Marowak', 'Metang',
3364
+ 'Misdreavus', 'Monferno', 'Mr. Mime', 'Muk', 'Murkrow', 'Pinsir', 'Politoed', 'Purugly', 'Quagsire',
3365
+ 'Raichu', 'Rampardos', 'Rapidash', 'Regigigas', 'Relicanth', 'Rhydon', 'Scyther', 'Sneasel', 'Snover',
3366
+ 'Solrock', 'Tangela', 'Torkoal', 'Victreebel', 'Xatu', 'Zangoose', 'Damp Rock',
3386
3367
  ],
3387
3368
  },
3388
3369
  {