@pkmn/sim 0.5.9 → 0.5.12

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 (73) hide show
  1. package/README.md +5 -0
  2. package/build/config/formats.js +364 -296
  3. package/build/config/formats.js.map +1 -1
  4. package/build/data/abilities.js +7 -7
  5. package/build/data/abilities.js.map +1 -1
  6. package/build/data/aliases.js +3 -0
  7. package/build/data/aliases.js.map +1 -1
  8. package/build/data/conditions.js +8 -12
  9. package/build/data/conditions.js.map +1 -1
  10. package/build/data/formats-data.js +36 -35
  11. package/build/data/formats-data.js.map +1 -1
  12. package/build/data/items.js +1 -1
  13. package/build/data/items.js.map +1 -1
  14. package/build/data/learnsets.js +5 -4
  15. package/build/data/learnsets.js.map +1 -1
  16. package/build/data/mods/gen1/moves.js +2 -4
  17. package/build/data/mods/gen1/moves.js.map +1 -1
  18. package/build/data/mods/gen3/formats-data.js +2 -2
  19. package/build/data/mods/gen3/formats-data.js.map +1 -1
  20. package/build/data/mods/gen7/formats-data.js +1 -1
  21. package/build/data/mods/gen7/formats-data.js.map +1 -1
  22. package/build/data/moves.js +14 -12
  23. package/build/data/moves.js.map +1 -1
  24. package/build/data/pokedex.js +2 -2
  25. package/build/data/pokedex.js.map +1 -1
  26. package/build/data/tags.js +4 -4
  27. package/build/data/tags.js.map +1 -1
  28. package/build/data/text/moves.js +1 -0
  29. package/build/data/text/moves.js.map +1 -1
  30. package/build/lib/index.js +5 -1
  31. package/build/lib/index.js.map +1 -1
  32. package/build/lib/streams.js +5 -1
  33. package/build/lib/streams.js.map +1 -1
  34. package/build/sim/battle-actions.js +0 -6
  35. package/build/sim/battle-actions.js.map +1 -1
  36. package/build/sim/battle-queue.js +1 -3
  37. package/build/sim/battle-queue.js.map +1 -1
  38. package/build/sim/battle.js +13 -11
  39. package/build/sim/battle.js.map +1 -1
  40. package/build/sim/dex-conditions.js +10 -3
  41. package/build/sim/dex-conditions.js.map +1 -1
  42. package/build/sim/dex.js +5 -1
  43. package/build/sim/dex.js.map +1 -1
  44. package/build/sim/index.js +5 -1
  45. package/build/sim/index.js.map +1 -1
  46. package/build/sim/team-validator.js +1 -1
  47. package/build/sim/team-validator.js.map +1 -1
  48. package/build/sim/teams.js +5 -1
  49. package/build/sim/teams.js.map +1 -1
  50. package/build/sim/tools/index.js +5 -1
  51. package/build/sim/tools/index.js.map +1 -1
  52. package/build/sim/tools/runner.js +5 -1
  53. package/build/sim/tools/runner.js.map +1 -1
  54. package/config/formats.ts +350 -280
  55. package/data/abilities.ts +7 -7
  56. package/data/aliases.ts +3 -0
  57. package/data/conditions.ts +8 -10
  58. package/data/formats-data.ts +36 -35
  59. package/data/items.ts +1 -1
  60. package/data/learnsets.ts +5 -4
  61. package/data/mods/gen1/moves.ts +2 -4
  62. package/data/mods/gen3/formats-data.ts +2 -2
  63. package/data/mods/gen7/formats-data.ts +1 -1
  64. package/data/moves.ts +13 -12
  65. package/data/pokedex.ts +2 -2
  66. package/data/tags.ts +4 -4
  67. package/data/text/moves.ts +2 -0
  68. package/package.json +2 -2
  69. package/sim/battle-actions.ts +0 -7
  70. package/sim/battle-queue.ts +1 -3
  71. package/sim/battle.ts +4 -1
  72. package/sim/dex-conditions.ts +9 -3
  73. package/sim/team-validator.ts +1 -1
@@ -154,7 +154,7 @@ exports.Formats = [
154
154
  mod: 'gen8',
155
155
  ruleset: ['Little Cup', 'Standard', 'Dynamax Clause'],
156
156
  banlist: [
157
- 'Corsola-Galar', 'Cutiefly', 'Drifloon', 'Gastly', 'Gothita', 'Rufflet', 'Scraggy', 'Scyther', 'Sneasel', 'Swirlix', 'Tangela', 'Vullaby', 'Vulpix-Alola', 'Woobat', 'Zigzagoon-Base',
157
+ 'Corsola-Galar', 'Drifloon', 'Rufflet', 'Scraggy', 'Scyther', 'Sneasel', 'Swirlix', 'Tangela', 'Vulpix-Alola', 'Woobat', 'Zigzagoon-Base',
158
158
  'Chlorophyll', 'Moody', 'Baton Pass', 'Sticky Web',
159
159
  ],
160
160
  },
@@ -173,7 +173,7 @@ exports.Formats = [
173
173
  'Kartana', 'Kyogre', 'Kyurem-Black', 'Kyurem-White', 'Landorus-Base', 'Lugia', 'Lunala', 'Magearna', 'Marshadow', 'Mewtwo', 'Naganadel',
174
174
  'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane', 'Palkia', 'Pheromosa', 'Rayquaza', 'Reshiram', 'Solgaleo', 'Urshifu-Base', 'Xerneas', 'Yveltal',
175
175
  'Zacian', 'Zacian-Crowned', 'Zamazenta', 'Zamazenta-Crowned', 'Zekrom', 'Zygarde-Base', 'Moody', 'Power Construct', 'Shadow Tag', 'Bright Powder',
176
- 'Damp Rock', 'Focus Band', 'King\'s Rock', 'Lax Incense', 'Quick Claw', 'Smooth Rock', 'Terrain Extender', 'Baton Pass',
176
+ 'Damp Rock', 'Focus Band', 'King\'s Rock', 'Lax Incense', 'Quick Claw', 'Smooth Rock', 'Terrain Extender', 'Acupressure', 'Baton Pass',
177
177
  ],
178
178
  },
179
179
  {
@@ -191,7 +191,7 @@ exports.Formats = [
191
191
  ],
192
192
  banlist: [
193
193
  'Calyrex-Ice', 'Calyrex-Shadow', 'Cinderace', 'Dialga', 'Dragonite', 'Eternatus', 'Genesect', 'Giratina', 'Giratina-Origin', 'Groudon', 'Ho-Oh', 'Jirachi',
194
- 'Kyogre', 'Kyurem-Black', 'Kyurem-White', 'Lugia', 'Lunala', 'Magearna', 'Marshadow', 'Melmetal', 'Mew', 'Mewtwo', 'Mimikyu', 'Necrozma-Dawn-Wings',
194
+ 'Kyogre', 'Kyurem-Black', 'Kyurem-White', 'Lugia', 'Lunala', 'Magearna', 'Marshadow', 'Melmetal', 'Mew', 'Mewtwo', 'Mimikyu', 'Necrozma', 'Necrozma-Dawn-Wings',
195
195
  'Necrozma-Dusk-Mane', 'Palkia', 'Rayquaza', 'Reshiram', 'Sableye', 'Snorlax', 'Solgaleo', 'Victini', 'Xerneas', 'Yveltal', 'Zacian', 'Zacian-Crowned',
196
196
  'Zamazenta', 'Zamazenta-Crowned', 'Zekrom', 'Moody', 'Power Construct', 'Bright Powder', 'Focus Band', 'Focus Sash', 'Lax Incense', 'Quick Claw', 'Perish Song',
197
197
  ],
@@ -231,9 +231,9 @@ exports.Formats = [
231
231
  ruleset: ['[Gen 8] LC'],
232
232
  banlist: [
233
233
  // LC OU
234
- 'Abra', 'Carvanha', 'Croagunk', 'Diglett-Base', 'Dwebble', 'Ferroseed', 'Foongus', 'Frillish', 'Grookey',
235
- 'Koffing', 'Larvesta', 'Magnemite', 'Mareanie', 'Mienfoo', 'Mudbray', 'Munchlax', 'Natu', 'Onix', 'Pawniard',
236
- 'Ponyta', 'Ponyta-Galar', 'Porygon', 'Slowpoke-Base', 'Staryu', 'Timburr', 'Trapinch', 'Tyrunt', 'Vulpix',
234
+ 'Abra', 'Carvanha', 'Diglett-Base', 'Dwebble', 'Ferroseed', 'Foongus', 'Frillish', 'Grookey', 'Koffing',
235
+ 'Larvesta', 'Magby', 'Magnemite', 'Mareanie', 'Mienfoo', 'Mudbray', 'Munchlax', 'Natu', 'Onix', 'Pawniard',
236
+ 'Ponyta', 'Ponyta-Galar', 'Porygon', 'Slowpoke-Base', 'Staryu', 'Timburr', 'Trapinch', 'Tyrunt',
237
237
  // LC UUBL
238
238
  'Farfetch\u2019d-Galar', 'Scorbunny', 'Shellder', 'Wingull',
239
239
  ],
@@ -372,8 +372,8 @@ exports.Formats = [
372
372
  banlist: [
373
373
  'Calyrex-Ice', 'Calyrex-Shadow', 'Dialga', 'Eternatus', 'Giratina', 'Giratina-Origin', 'Groudon', 'Ho-Oh', 'Jirachi', 'Kyogre',
374
374
  'Kyurem-White', 'Lugia', 'Lunala', 'Magearna', 'Marshadow', 'Melmetal', 'Mewtwo', 'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane', 'Palkia',
375
- 'Rayquaza', 'Reshiram', 'Solgaleo', 'Urshifu-Base', 'Xerneas', 'Yveltal', 'Zacian', 'Zacian-Crowned', 'Zamazenta', 'Zamazenta-Crowned',
376
- 'Zekrom', 'Power Construct', 'Focus Sash', 'Ally Switch', 'Final Gambit', 'Perish Song', 'Swagger',
375
+ 'Rayquaza', 'Reshiram', 'Solgaleo', 'Tornadus-Base', 'Urshifu-Base', 'Urshifu-Rapid-Strike', 'Xerneas', 'Yveltal', 'Zacian', 'Zacian-Crowned',
376
+ 'Zamazenta', 'Zamazenta-Crowned', 'Zekrom', 'Moody', 'Power Construct', 'Focus Sash', 'Ally Switch', 'Final Gambit', 'Perish Song', 'Swagger',
377
377
  ],
378
378
  },
379
379
  {
@@ -442,8 +442,8 @@ exports.Formats = [
442
442
  mod: 'gen8',
443
443
  ruleset: ['Standard NatDex', 'OHKO Clause', 'Evasion Moves Clause', 'Species Clause', 'Dynamax Clause', 'Sleep Clause Mod'],
444
444
  banlist: [
445
- 'Alakazam-Mega', 'Arceus', 'Blastoise-Mega', 'Blaziken-Mega', 'Calyrex-Ice', 'Calyrex-Shadow', 'Cinderace', 'Darkrai',
446
- 'Darmanitan-Galar', 'Deoxys-Attack', 'Deoxys-Base', 'Deoxys-Speed', 'Dialga', 'Dracovish', 'Eternatus',
445
+ 'Alakazam-Mega', 'Arceus', 'Blastoise-Mega', 'Calyrex-Ice', 'Calyrex-Shadow', 'Cinderace', 'Darkrai',
446
+ 'Darmanitan-Galar', 'Deoxys-Attack', 'Deoxys-Base', 'Deoxys-Speed', 'Dialga', 'Dracovish', 'Dragapult', 'Eternatus',
447
447
  'Genesect', 'Gengar-Mega', 'Giratina', 'Giratina-Origin', 'Groudon', 'Ho-Oh', 'Kangaskhan-Mega', 'Kyogre', 'Kyurem-Black',
448
448
  'Kyurem-White', 'Landorus-Base', 'Lucario-Mega', 'Lugia', 'Lunala', 'Magearna', 'Marshadow', 'Metagross-Mega', 'Mewtwo',
449
449
  'Naganadel', 'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane', 'Necrozma-Ultra', 'Palkia', 'Pheromosa', 'Rayquaza', 'Reshiram',
@@ -472,16 +472,16 @@ exports.Formats = [
472
472
  'Drizzle', 'Drought',
473
473
  // Slowbronite is banned so it doesn't validate on Galarian Slowbro
474
474
  'Slowbronite',
475
- // NDOU suspect
476
- 'Dragapult',
475
+ // Ban for ou suspect
476
+ 'Blaziken-Mega',
477
477
  ],
478
478
  // Used to distinguish UU from below UU in the client
479
479
  restricted: [
480
- 'Aegislash', 'Alakazam-Base', 'Altaria-Mega', 'Amoonguss', 'Azumarill', 'Beedrill-Mega', 'Blaziken-Base', 'Breloom', 'Celesteela',
481
- 'Chandelure', 'Donphan', 'Dracozolt', 'Dragonite', 'Feraligatr', 'Gastrodon', 'Hatterene', 'Hippowdon', 'Infernape', 'Keldeo',
482
- 'Krookodile', 'Mamoswine', 'Mandibuzz', 'Manectric-Mega', 'Melmetal', 'Mienshao', 'Moltres-Base', 'Nidoking', 'Nidoqueen', 'Nihilego',
483
- 'Quagsire', 'Regieleki', 'Ribombee', 'Rotom-Heat', 'Rotom-Wash', 'Salamence', 'Scizor', 'Skarmory', 'Slowking-Base', 'Swampert-Base',
484
- 'Talonflame', 'Tangrowth', 'Tornadus-Base', 'Umbreon', 'Urshifu-Rapid-Strike',
480
+ 'Aegislash', 'Altaria-Mega', 'Amoonguss', 'Azumarill', 'Beedrill-Mega', 'Breloom', 'Celesteela', 'Chandelure', 'Donphan', 'Dracozolt',
481
+ 'Dragonite', 'Feraligatr', 'Gastrodon', 'Hatterene', 'Hippowdon', 'Infernape', 'Keldeo', 'Krookodile', 'Mamoswine', 'Mandibuzz',
482
+ 'Manectric-Mega', 'Melmetal', 'Mienshao', 'Moltres-Base', 'Nidoking', 'Nidoqueen', 'Nihilego', 'Quagsire', 'Regieleki', 'Ribombee',
483
+ 'Rotom-Heat', 'Rotom-Wash', 'Salamence', 'Scizor', 'Skarmory', 'Slowking-Base', 'Swampert-Base', 'Talonflame', 'Tangrowth', 'Tornadus-Base',
484
+ 'Umbreon', 'Urshifu-Rapid-Strike',
485
485
  ],
486
486
  },
487
487
  {
@@ -591,213 +591,41 @@ exports.Formats = [
591
591
  column: 2,
592
592
  },
593
593
  {
594
- name: "[Gen 8] Shared Power",
595
- desc: `Once a Pokémon switches in, its ability is shared with the rest of the team.`,
594
+ name: "[Gen 8] Sketchmons",
595
+ desc: `Every Pokémon gets a new move once.`,
596
596
  threads: [
597
- `&bullet; <a href="https://www.smogon.com/forums/threads/3660877/">Shared Power</a>`,
597
+ `&bullet; <a href="https://www.smogon.com/forums/threads/3680298/">Sketchmons</a>`,
598
598
  ],
599
- mod: 'sharedpower',
600
- // searchShow: false,
601
- ruleset: ['Standard', 'Dynamax Clause'],
599
+ mod: 'gen8',
600
+ ruleset: ['Standard', 'Sketchmons Move Legality', 'Dynamax Clause'],
602
601
  banlist: [
603
- 'Calyrex-Ice', 'Calyrex-Shadow', 'Darmanitan-Galar', 'Dialga', 'Dracovish', 'Eternatus', 'Genesect', 'Giratina',
604
- 'Giratina-Origin', 'Groudon', 'Ho-Oh', 'Kyogre', 'Kyurem-Black', 'Kyurem-White', 'Lugia', 'Lunala', 'Magearna',
605
- 'Marshadow', 'Melmetal', 'Mewtwo', 'Naganadel', 'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane', 'Palkia',
606
- 'Pheromosa', 'Rayquaza', 'Reshiram', 'Shedinja', 'Solgaleo', 'Urshifu-Base', 'Urshifu-Rapid-Strike',
607
- 'Xerneas', 'Yveltal', 'Zacian', 'Zacian-Crowned', 'Zamazenta', 'Zamazenta-Crowned', 'Zekrom',
608
- 'Arena Trap', 'Contrary', 'Drizzle ++ Swift Swim', 'Drought ++ Chlorophyll', 'Electric Surge ++ Surge Surfer',
609
- 'Fur Coat', 'Guts', 'Harvest', 'Huge Power', 'Imposter', 'Innards Out', 'Libero', 'Magic Bounce', 'Magic Guard',
610
- 'Magnet Pull', 'Mold Breaker', 'Moody', 'Neutralizing Gas', 'Power Construct', 'Queenly Majesty', 'Quick Draw',
611
- 'Regenerator', 'Sand Rush', 'Sand Veil', 'Shadow Tag', 'Simple', 'Snow Cloak', 'Snow Warning ++ Slush Rush', 'Speed Boost',
612
- 'Stakeout', 'Steelworker ++ Steely Spirit', 'Tinted Lens', 'Triage', 'Unaware', 'Unburden', 'Water Bubble',
613
- 'Baton Pass',
602
+ 'Calyrex-Ice', 'Calyrex-Shadow', 'Cinderace', 'Darmanitan-Galar', 'Dialga', 'Dracovish', 'Dragapult', 'Eternatus', 'Genesect', 'Giratina',
603
+ 'Giratina-Origin', 'Groudon', 'Hawlucha', 'Ho-Oh', 'Kartana', 'Kyogre', 'Kyurem-Black', 'Kyurem-White', 'Landorus-Base', 'Lugia', 'Lunala',
604
+ 'Marshadow', 'Mewtwo', 'Naganadel', 'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane', 'Palkia', 'Porygon-Z', 'Pheromosa', 'Rayquaza', 'Regieleki',
605
+ 'Reshiram', 'Rillaboom', 'Shedinja', 'Solgaleo', 'Spectrier', 'Swoobat', 'Urshifu-Base', 'Xerneas', 'Yveltal', 'Zacian', 'Zacian-Crowned',
606
+ 'Zamazenta', 'Zamazenta-Crowned', 'Zekrom', 'Zeraora', 'Zygarde-Base', 'Arena Trap', 'Magnet Pull', 'Moody', 'Power Construct', 'Sand Rush',
607
+ 'Shadow Tag', 'King\'s Rock', 'Baton Pass',
608
+ ],
609
+ restricted: [
610
+ 'Acupressure', 'Astral Barrage', 'Belly Drum', 'Bolt Beak', 'Clangorous Soul', 'Double Iron Bash', 'Electrify', 'Extreme Speed', 'Fishious Rend',
611
+ 'Geomancy', 'Glacial Lance', 'Lovely Kiss', 'No Retreat', 'Oblivion Wing', 'Octolock', 'Quiver Dance', 'Secret Sword', 'Shell Smash', 'Shift Gear',
612
+ 'Sleep Powder', 'Spore', 'Thousand Arrows', 'Transform', 'V-create', 'Wicked Blow',
614
613
  ],
615
- getSharedPower(pokemon) {
616
- const sharedPower = new Set();
617
- for (const ally of pokemon.side.pokemon) {
618
- if (ally.previouslySwitchedIn > 0) {
619
- if (pokemon.battle.dex.currentMod !== 'sharedpower' && ['trace', 'mirrorarmor'].includes(ally.baseAbility)) {
620
- sharedPower.add('noability');
621
- continue;
622
- }
623
- sharedPower.add(ally.baseAbility);
624
- }
625
- }
626
- sharedPower.delete(pokemon.baseAbility);
627
- return sharedPower;
628
- },
629
- onBeforeSwitchIn(pokemon) {
630
- let format = this.format;
631
- if (!format.getSharedPower)
632
- format = this.dex.formats.get('gen8sharedpower');
633
- for (const ability of format.getSharedPower(pokemon)) {
634
- const effect = 'ability:' + ability;
635
- pokemon.volatiles[effect] = { id: this.toID(effect), target: pokemon };
636
- if (!pokemon.m.abils)
637
- pokemon.m.abils = [];
638
- if (!pokemon.m.abils.includes(effect))
639
- pokemon.m.abils.push(effect);
640
- }
641
- },
642
- onSwitchInPriority: 2,
643
- onSwitchIn(pokemon) {
644
- let format = this.format;
645
- if (!format.getSharedPower)
646
- format = this.dex.formats.get('gen8sharedpower');
647
- for (const ability of format.getSharedPower(pokemon)) {
648
- if (ability === 'noability') {
649
- this.hint(`Mirror Armor and Trace break in Shared Power formats that don't use Shared Power as a base, so they get removed from non-base users.`);
650
- }
651
- const effect = 'ability:' + ability;
652
- delete pokemon.volatiles[effect];
653
- pokemon.addVolatile(effect);
654
- }
655
- },
656
614
  },
657
615
  {
658
- name: "[Gen 8] Cross Evolution",
659
- desc: `Give a Pok&eacute;mon a Pok&eacute;mon name of the next evolution stage as a nickname to inherit stat changes, typing, abilities, and up to 2 moves from the next stage Pok&eacute;mon.`,
616
+ name: "[Gen 8] Flipped",
617
+ desc: `Pok&eacute;mon have their base stats flipped.`,
660
618
  threads: [
661
- `&bullet; <a href="https://www.smogon.com/forums/threads/3657562/">Cross Evolution</a>`,
619
+ `&bullet; <a href="https://www.smogon.com/forums/threads/3662020/">Flipped</a>`,
662
620
  ],
663
621
  mod: 'gen8',
664
- // searchShow: false,
665
- ruleset: ['Standard', 'Overflow Stat Mod', 'Dynamax Clause'],
666
- banlist: ['Corsola-Galar', 'Sneasel', 'Type: Null', 'Arena Trap', 'Ice Scales', 'Moody', 'King\'s Rock', 'Baton Pass'],
667
- restricted: ['Chansey', 'Lunala', 'Shedinja', 'Solgaleo', 'Gorilla Tactics', 'Huge Power', 'Pure Power', 'Shadow Tag'],
668
- onValidateTeam(team) {
669
- const names = new Set();
670
- for (const set of team) {
671
- const name = set.name;
672
- if (names.has(this.dex.toID(name))) {
673
- return [
674
- `Your Pok\u00e9mon must have different nicknames.`,
675
- `(You have more than one Pok\u00e9mon named '${name}')`,
676
- ];
677
- }
678
- names.add(this.dex.toID(name));
679
- }
680
- if (!names.size) {
681
- return [
682
- `${this.format.name} works using nicknames; your team has 0 nicknamed Pok\u00e9mon.`,
683
- `(If this was intentional, add a nickname to one Pok\u00e9mon that isn't the name of a Pok\u00e9mon species.)`,
684
- ];
685
- }
686
- },
687
- checkCanLearn(move, species, lsetData, set) {
688
- // @ts-ignore
689
- if (!set.sp?.exists || !set.crossSpecies?.exists) {
690
- return this.checkCanLearn(move, species, lsetData, set);
691
- }
692
- // @ts-ignore
693
- const problem = this.checkCanLearn(move, set.sp);
694
- if (!problem)
695
- return null;
696
- // @ts-ignore
697
- if (!set.crossMovesLeft)
698
- return problem;
699
- // @ts-ignore
700
- if (this.checkCanLearn(move, set.crossSpecies))
701
- return problem;
702
- // @ts-ignore
703
- set.crossMovesLeft--;
704
- return null;
705
- },
706
- validateSet(set, teamHas) {
707
- const crossSpecies = this.dex.species.get(set.name);
708
- let problems = this.dex.formats.get('Pokemon').onChangeSet?.call(this, set, this.format) || null;
709
- if (Array.isArray(problems) && problems.length)
710
- return problems;
711
- const crossNonstandard = (!this.ruleTable.has('standardnatdex') && crossSpecies.isNonstandard === 'Past') ||
712
- crossSpecies.isNonstandard === 'Future';
713
- const crossIsCap = !this.ruleTable.has('+pokemontag:cap') && crossSpecies.isNonstandard === 'CAP';
714
- if (!crossSpecies.exists || crossNonstandard || crossIsCap)
715
- return this.validateSet(set, teamHas);
716
- const species = this.dex.species.get(set.species);
717
- const check = this.checkSpecies(set, species, species, {});
718
- if (check)
719
- return [check];
720
- const nonstandard = !this.ruleTable.has('standardnatdex') && species.isNonstandard === 'Past';
721
- const isCap = !this.ruleTable.has('+pokemontag:cap') && species.isNonstandard === 'CAP';
722
- if (!species.exists || nonstandard || isCap || species === crossSpecies)
723
- return this.validateSet(set, teamHas);
724
- if (!species.nfe)
725
- return [`${species.name} cannot cross evolve because it doesn't evolve.`];
726
- const crossIsUnreleased = (crossSpecies.tier === "Unreleased" && crossSpecies.isNonstandard === "Unobtainable");
727
- if (crossSpecies.battleOnly || crossIsUnreleased || !crossSpecies.prevo) {
728
- return [`${species.name} cannot cross evolve into ${crossSpecies.name} because it isn't an evolution.`];
729
- }
730
- if (this.ruleTable.isRestrictedSpecies(crossSpecies)) {
731
- return [`${species.name} cannot cross evolve into ${crossSpecies.name} because it is banned.`];
732
- }
733
- const crossPrevoSpecies = this.dex.species.get(crossSpecies.prevo);
734
- if (!crossPrevoSpecies.prevo !== !species.prevo) {
735
- return [
736
- `${species.name} cannot cross evolve into ${crossSpecies.name} because they are not consecutive evolution stages.`,
737
- ];
738
- }
739
- const ability = this.dex.abilities.get(set.ability);
740
- if (!this.ruleTable.isRestricted(`ability:${ability.id}`) || Object.values(species.abilities).includes(ability.name)) {
741
- set.species = crossSpecies.name;
742
- }
743
- // @ts-ignore
744
- set.sp = species;
745
- // @ts-ignore
746
- set.crossSpecies = crossSpecies;
747
- // @ts-ignore
748
- set.crossMovesLeft = 2;
749
- problems = this.validateSet(set, teamHas);
750
- set.name = crossSpecies.name;
751
- set.species = species.name;
752
- return problems;
753
- },
754
- onModifySpecies(species, target, source, effect) {
755
- if (!target)
756
- return; // chat
757
- if (effect && ['imposter', 'transform'].includes(effect.id))
758
- return;
759
- if (target.set.name === target.set.species)
760
- return;
761
- const crossSpecies = this.dex.species.get(target.set.name);
762
- if (!crossSpecies.exists)
763
- return;
764
- if (species.battleOnly || !species.nfe)
765
- return;
766
- const crossIsUnreleased = (crossSpecies.tier === "Unreleased" && crossSpecies.isNonstandard === "Unobtainable");
767
- if (crossSpecies.battleOnly || crossIsUnreleased || !crossSpecies.prevo)
768
- return;
769
- const crossPrevoSpecies = this.dex.species.get(crossSpecies.prevo);
770
- if (!crossPrevoSpecies.prevo !== !species.prevo)
771
- return;
772
- const mixedSpecies = this.dex.deepClone(species);
773
- mixedSpecies.baseSpecies = mixedSpecies.name = `${species.name}-${crossSpecies.name}`;
774
- mixedSpecies.weightkg =
775
- Math.max(0.1, +(species.weightkg + crossSpecies.weightkg - crossPrevoSpecies.weightkg)).toFixed(1);
776
- mixedSpecies.nfe = false;
777
- mixedSpecies.evos = [];
778
- mixedSpecies.eggGroups = crossSpecies.eggGroups;
779
- mixedSpecies.abilities = crossSpecies.abilities;
780
- mixedSpecies.bst = 0;
781
- let i;
782
- for (i in species.baseStats) {
783
- const statChange = crossSpecies.baseStats[i] - crossPrevoSpecies.baseStats[i];
784
- mixedSpecies.baseStats[i] = this.clampIntRange(species.baseStats[i] + statChange, 1, 255);
785
- mixedSpecies.bst += mixedSpecies.baseStats[i];
786
- }
787
- if (crossSpecies.types[0] !== crossPrevoSpecies.types[0])
788
- mixedSpecies.types[0] = crossSpecies.types[0];
789
- if (crossSpecies.types[1] !== crossPrevoSpecies.types[1]) {
790
- mixedSpecies.types[1] = crossSpecies.types[1] || crossSpecies.types[0];
791
- }
792
- if (mixedSpecies.types[0] === mixedSpecies.types[1])
793
- mixedSpecies.types = [mixedSpecies.types[0]];
794
- return mixedSpecies;
795
- },
796
- onBegin() {
797
- for (const pokemon of this.getAllPokemon()) {
798
- pokemon.baseSpecies = pokemon.species;
799
- }
800
- },
622
+ ruleset: ['Standard', 'Flipped Mod', 'Dynamax Clause'],
623
+ banlist: [
624
+ 'Azumarill', 'Blissey', 'Calyrex-Ice', 'Calyrex-Shadow', 'Dialga', 'Eternatus', 'Giratina', 'Giratina-Origin', 'Groudon', 'Ho-Oh', 'Kyogre',
625
+ 'Kyurem-Black', 'Kyurem-White', 'Lugia', 'Lunala', 'Marshadow', 'Mewtwo', 'Necrozma-Dawn Wings', 'Necrozma-Dusk Mane', 'Palkia', 'Rayquaza',
626
+ 'Reshiram', 'Solgaleo', 'Steelix', 'Xerneas', 'Yveltal', 'Zacian', 'Zacian-Crowned', 'Zamazenta', 'Zamazenta-Crowned', 'Zekrom', 'Zygarde-Base',
627
+ 'Psychic Surge', 'Psychic Terrain', 'Shell Smash',
628
+ ],
801
629
  },
802
630
  // Other Metagames
803
631
  ///////////////////////////////////////////////////////////////////
@@ -849,15 +677,16 @@ exports.Formats = [
849
677
  `&bullet; <a href="https://www.smogon.com/forums/threads/3682690/">AAA Resources</a>`,
850
678
  ],
851
679
  mod: 'gen8',
852
- ruleset: ['Obtainable', '!Obtainable Abilities', 'Species Clause', 'Nickname Clause', '2 Ability Clause', 'OHKO Clause', 'Evasion Moves Clause', 'Team Preview', 'HP Percentage Mod', 'Cancel Mod', 'Dynamax Clause', 'Sleep Moves Clause', 'Endless Battle Clause'],
680
+ ruleset: ['Standard', '!Obtainable Abilities', '2 Ability Clause', 'Dynamax Clause', 'Sleep Moves Clause', '!Sleep Clause Mod'],
853
681
  banlist: [
854
- 'Archeops', 'Blacephalon', 'Buzzwole', 'Calyrex-Ice', 'Calyrex-Shadow', 'Dialga', 'Dracovish', 'Dragapult', 'Dragonite', 'Eternatus', 'Gengar', 'Giratina',
855
- 'Giratina-Origin', 'Groudon', 'Ho-Oh', 'Kartana', 'Keldeo', 'Kyogre', 'Kyurem', 'Kyurem-Black', 'Kyurem-White', 'Lugia', 'Lunala', 'Magearna', 'Marshadow',
856
- 'Melmetal', 'Mewtwo', 'Naganadel', 'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane', 'Noivern', 'Palkia', 'Pheromosa', 'Rayquaza', 'Regigigas', 'Reshiram', 'Shedinja',
857
- 'Solgaleo', 'Spectrier', 'Urshifu-Base', 'Urshifu-Rapid-Strike', 'Victini', 'Weavile', 'Xerneas', 'Yveltal', 'Zacian', 'Zacian-Crowned', 'Zamazenta-Base', 'Zekrom',
858
- 'Zeraora', 'Zygarde-Base', 'Arena Trap', 'Comatose', 'Contrary', 'Fluffy', 'Fur Coat', 'Gorilla Tactics', 'Huge Power', 'Ice Scales', 'Illusion', 'Imposter',
859
- 'Innards Out', 'Intrepid Sword', 'Libero', 'Magnet Pull', 'Moody', 'Neutralizing Gas', 'Parental Bond', 'Poison Heal', 'Protean', 'Pure Power', 'Shadow Tag',
860
- 'Simple', 'Stakeout', 'Speed Boost', 'Water Bubble', 'Wonder Guard', 'King\'s Rock', 'Baton Pass',
682
+ 'Archeops', 'Blacephalon', 'Buzzwole', 'Calyrex-Ice', 'Calyrex-Shadow', 'Dialga', 'Dracovish', 'Dragapult', 'Dragonite', 'Eternatus',
683
+ 'Gengar', 'Giratina', 'Giratina-Origin', 'Groudon', 'Ho-Oh', 'Kartana', 'Keldeo', 'Kyogre', 'Kyurem', 'Kyurem-Black', 'Kyurem-White',
684
+ 'Lugia', 'Lunala', 'Magearna', 'Marshadow', 'Melmetal', 'Mewtwo', 'Naganadel', 'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane', 'Noivern',
685
+ 'Palkia', 'Pheromosa', 'Rayquaza', 'Regigigas', 'Reshiram', 'Shedinja', 'Solgaleo', 'Spectrier', 'Urshifu', 'Urshifu-Rapid-Strike',
686
+ 'Victini', 'Weavile', 'Xerneas', 'Yveltal', 'Zacian', 'Zacian-Crowned', 'Zamazenta-Base', 'Zekrom', 'Zeraora', 'Zygarde-Base',
687
+ 'Arena Trap', 'Comatose', 'Contrary', 'Fluffy', 'Fur Coat', 'Gorilla Tactics', 'Huge Power', 'Ice Scales', 'Illusion', 'Imposter',
688
+ 'Innards Out', 'Intrepid Sword', 'Libero', 'Magnet Pull', 'Moody', 'Neutralizing Gas', 'Parental Bond', 'Poison Heal', 'Protean',
689
+ 'Pure Power', 'Shadow Tag', 'Simple', 'Stakeout', 'Speed Boost', 'Water Bubble', 'Wonder Guard', 'King\'s Rock', 'Baton Pass',
861
690
  ],
862
691
  onValidateSet(set) {
863
692
  // Temporary fix until battle-only is implemented properly
@@ -877,15 +706,15 @@ exports.Formats = [
877
706
  `&bullet; <a href="https://www.smogon.com/forums/threads/3659028/">M&amp;M Resources</a>`,
878
707
  ],
879
708
  mod: 'mixandmega',
880
- ruleset: ['Obtainable', 'Species Clause', 'Nickname Clause', 'OHKO Clause', 'Evasion Moves Clause', 'Team Preview', 'HP Percentage Mod', 'Cancel Mod', 'Overflow Stat Mod', 'Dynamax Clause', 'Sleep Clause Mod', 'Endless Battle Clause'],
709
+ ruleset: ['Standard', 'Overflow Stat Mod', 'Dynamax Clause'],
881
710
  banlist: [
882
- 'Calyrex-Shadow', 'Kyogre', 'Zacian',
711
+ 'Calyrex-Shadow', 'Eternatus', 'Kyogre', 'Zacian',
883
712
  'Beedrillite', 'Blazikenite', 'Gengarite', 'Kangaskhanite', 'Mawilite', 'Medichamite', 'Pidgeotite',
884
713
  'Moody', 'Shadow Tag', 'Baton Pass', 'Electrify',
885
714
  ],
886
715
  restricted: [
887
- 'Calyrex-Ice', 'Dialga', 'Eternatus', 'Gengar', 'Giratina', 'Groudon', 'Ho-Oh', 'Kyurem-Black', 'Kyurem-White',
888
- 'Lugia', 'Lunala', 'Marshadow', 'Melmetal', 'Mewtwo', 'Naganadel', 'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane',
716
+ 'Calyrex-Ice', 'Dialga', 'Gengar', 'Giratina', 'Groudon', 'Ho-Oh', 'Kyurem-Black', 'Kyurem-White', 'Lugia',
717
+ 'Lunala', 'Marshadow', 'Melmetal', 'Mewtwo', 'Naganadel', 'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane',
889
718
  'Palkia', 'Pheromosa', 'Rayquaza', 'Regigigas', 'Reshiram', 'Urshifu', 'Urshifu-Rapid-Strike', 'Xerneas',
890
719
  'Yveltal', 'Zekrom', 'Zygarde-Complete',
891
720
  ],
@@ -895,9 +724,16 @@ exports.Formats = [
895
724
  const item = this.dex.items.get(set.item);
896
725
  if (!item.megaStone)
897
726
  continue;
727
+ const natdex = this.ruleTable.has('standardnatdex');
728
+ if (natdex && item.id !== 'ultranecroziumz')
729
+ continue;
898
730
  const species = this.dex.species.get(set.species);
899
- if (species.isNonstandard)
731
+ if (species.isNonstandard && !this.ruleTable.has(`+${this.toID(species.isNonstandard)}`)) {
900
732
  return [`${species.baseSpecies} does not exist in gen 8.`];
733
+ }
734
+ if (natdex && species.name.startsWith('Necrozma-') && item.id === 'ultranecroziumz') {
735
+ continue;
736
+ }
901
737
  if (this.ruleTable.isRestrictedSpecies(species) || this.toID(set.ability) === 'powerconstruct') {
902
738
  return [`${species.name} is not allowed to hold ${item.name}.`];
903
739
  }
@@ -965,8 +801,8 @@ exports.Formats = [
965
801
  mod: 'gen8',
966
802
  ruleset: ['Not Fully Evolved', 'Standard', 'Dynamax Clause'],
967
803
  banlist: [
968
- 'Chansey', 'Doublade', 'Haunter', 'Kadabra', 'Magneton', 'Mr. Mime-Galar', 'Pawniard', 'Pikachu', 'Porygon2',
969
- 'Rhydon', 'Scyther', 'Sneasel', 'Type: Null', 'Vulpix-Base', 'Arena Trap', 'Shadow Tag', 'Baton Pass',
804
+ 'Chansey', 'Doublade', 'Golbat', 'Haunter', 'Kadabra', 'Magmar', 'Magneton', 'Mr. Mime-Galar', 'Pawniard', 'Pikachu',
805
+ 'Porygon2', 'Rhydon', 'Scyther', 'Sneasel', 'Type: Null', 'Vulpix-Base', 'Arena Trap', 'Shadow Tag', 'Baton Pass',
970
806
  ],
971
807
  },
972
808
  {
@@ -978,9 +814,10 @@ exports.Formats = [
978
814
  mod: 'gen8',
979
815
  ruleset: ['Standard', 'Dynamax Clause', 'Sleep Moves Clause'],
980
816
  banlist: [
981
- 'Blissey', 'Calyrex-Shadow', 'Chansey', 'Dragapult', 'Hawlucha', 'Marowak-Alola', 'Melmetal', 'Pikachu', 'Toxapex',
982
- 'Xerneas', 'Zacian', 'Zacian-Crowned', 'Uber > 1', 'AG ++ Uber > 1', 'Arena Trap', 'Huge Power', 'Moody', 'Pure Power',
983
- 'Shadow Tag', 'Swift Swim', 'Bright Powder', 'Focus Band', 'King\'s Rock', 'Lax Incense', 'Quick Claw', 'Baton Pass',
817
+ 'Blissey', 'Calyrex-Shadow', 'Chansey', 'Dragapult', 'Eternatus', 'Hawlucha', 'Marowak-Alola', 'Melmetal', 'Pikachu',
818
+ 'Toxapex', 'Xerneas', 'Zacian', 'Zacian-Crowned', 'Uber > 1', 'AG ++ Uber > 1', 'Arena Trap', 'Huge Power', 'Moody',
819
+ 'Pure Power', 'Shadow Tag', 'Swift Swim', 'Bright Powder', 'Focus Band', 'King\'s Rock', 'Lax Incense', 'Quick Claw',
820
+ 'Baton Pass',
984
821
  ],
985
822
  onValidateTeam(team) {
986
823
  const gods = new Set();
@@ -988,8 +825,21 @@ exports.Formats = [
988
825
  let species = this.dex.species.get(set.species);
989
826
  if (typeof species.battleOnly === 'string')
990
827
  species = this.dex.species.get(species.battleOnly);
991
- if (['ag', 'uber'].includes(this.toID(species.tier)) || this.toID(set.ability) === 'powerconstruct') {
992
- gods.add(species.name);
828
+ if (set.item && this.dex.items.get(set.item).megaStone) {
829
+ const item = this.dex.items.get(set.item);
830
+ if (item.megaEvolves === species.baseSpecies) {
831
+ species = this.dex.species.get(item.megaStone);
832
+ }
833
+ }
834
+ if (this.ruleTable.has('standardnatdex')) {
835
+ const format = this.dex.formats.getRuleTable(this.dex.formats.get('gen8nationaldex'));
836
+ if (format.isBannedSpecies(species))
837
+ gods.add(species.name);
838
+ }
839
+ else {
840
+ if (['ag', 'uber'].includes(this.toID(species.tier)) || this.toID(set.ability) === 'powerconstruct') {
841
+ gods.add(species.name);
842
+ }
993
843
  }
994
844
  }
995
845
  if (gods.size > 1) {
@@ -1002,7 +852,8 @@ exports.Formats = [
1002
852
  return;
1003
853
  const god = target.side.team.find(set => {
1004
854
  let godSpecies = this.dex.species.get(set.species);
1005
- const validator = this.dex.formats.getRuleTable(this.dex.formats.get(`gen${this.gen}ou`));
855
+ const isNatDex = this.format.ruleTable?.has('standardnatdex');
856
+ const validator = this.dex.formats.getRuleTable(this.dex.formats.get(`gen${isNatDex && this.gen < 8 ? 8 : this.gen}${isNatDex ? 'nationaldex' : 'ou'}`));
1006
857
  if (this.toID(set.ability) === 'powerconstruct') {
1007
858
  return true;
1008
859
  }
@@ -1020,6 +871,9 @@ exports.Formats = [
1020
871
  if (godSpecies.forme === 'Crowned') {
1021
872
  godSpecies = this.dex.species.get(godSpecies.changesFrom || godSpecies.baseSpecies);
1022
873
  }
874
+ if (typeof godSpecies.battleOnly === 'string') {
875
+ godSpecies = this.dex.species.get(godSpecies.battleOnly);
876
+ }
1023
877
  newSpecies.bst -= newSpecies.baseStats[stat];
1024
878
  newSpecies.baseStats[stat] = godSpecies.baseStats[stat];
1025
879
  newSpecies.bst += newSpecies.baseStats[stat];
@@ -1106,7 +960,7 @@ exports.Formats = [
1106
960
  ],
1107
961
  mod: 'gen8bdsp',
1108
962
  ruleset: ['[Gen 8 BDSP] RU'],
1109
- banlist: ['RU', 'NUBL'],
963
+ banlist: ['RU', 'NUBL', 'Damp Rock', 'Heat Rock'],
1110
964
  },
1111
965
  {
1112
966
  name: "[Gen 8 BDSP] LC",
@@ -1115,7 +969,7 @@ exports.Formats = [
1115
969
  ],
1116
970
  mod: 'gen8bdsp',
1117
971
  ruleset: ['Little Cup', 'Standard'],
1118
- banlist: ['Gligar', 'Meditite', 'Misdreavus', 'Murkrow', 'Scyther', 'Sneasel', 'Tangela', 'Vulpix', 'Yanma', 'Moody', 'Baton Pass'],
972
+ banlist: ['Gligar', 'Meditite', 'Misdreavus', 'Murkrow', 'Scyther', 'Sneasel', 'Tangela', 'Vulpix', 'Yanma', 'Moody', 'Baton Pass', 'Sticky Web'],
1119
973
  },
1120
974
  {
1121
975
  name: "[Gen 8 BDSP] Monotype",
@@ -1125,7 +979,7 @@ exports.Formats = [
1125
979
  mod: 'gen8bdsp',
1126
980
  ruleset: ['Standard', 'Same Type Clause'],
1127
981
  banlist: [
1128
- 'Dialga', 'Giratina', 'Giratina-Origin', 'Groudon', 'Ho-Oh', 'Kyogre', 'Lugia', 'Mewtwo', 'Palkia', 'Rayquaza',
982
+ 'Arceus', 'Darkrai', 'Dialga', 'Giratina', 'Giratina-Origin', 'Groudon', 'Ho-Oh', 'Kyogre', 'Lugia', 'Mewtwo', 'Palkia', 'Rayquaza', 'Shaymin-Sky',
1129
983
  'Arena Trap', 'Moody', 'Shadow Tag', 'Damp Rock', 'King\'s Rock', 'Razor Fang', 'Baton Pass',
1130
984
  ],
1131
985
  },
@@ -1144,6 +998,7 @@ exports.Formats = [
1144
998
  `&bullet; <a href="https://www.smogon.com/forums/threads/3695092/">BDSP 3v3 Singles</a>`,
1145
999
  ],
1146
1000
  mod: 'gen8bdsp',
1001
+ searchShow: false,
1147
1002
  ruleset: ['Flat Rules', 'Min Source Gen = 8'],
1148
1003
  },
1149
1004
  {
@@ -1190,11 +1045,161 @@ exports.Formats = [
1190
1045
  ruleset: ['Standard', 'Dynamax Clause', 'Camomons Mod'],
1191
1046
  banlist: [
1192
1047
  'Calyrex-Ice', 'Calyrex-Shadow', 'Darmanitan-Galar', 'Dialga', 'Dracovish', 'Dragonite', 'Eternatus', 'Genesect', 'Giratina', 'Giratina-Origin',
1193
- 'Groudon', 'Ho-Oh', 'Hydreigon', 'Kartana', 'Kyogre', 'Kyurem', 'Kyurem-Black', 'Kyurem-White', 'Landorus-Base', 'Latias', 'Latios', 'Lugia',
1194
- 'Lunala', 'Marshadow', 'Mew', 'Mewtwo', 'Naganadel', 'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane', 'Palkia', 'Pheromosa', 'Rayquaza', 'Reshiram',
1195
- 'Reuniclus', 'Shedinja', 'Slowking-Galar', 'Solgaleo', 'Spectrier', 'Tornadus-Therian', 'Volcarona', 'Xerneas', 'Yveltal', 'Zacian', 'Zacian-Crowned',
1196
- 'Zamazenta', 'Zamazenta-Crowned', 'Zekrom', 'Zeraora', 'Zygarde-Base', 'Arena Trap', 'Moody', 'Power Construct', 'Shadow Tag', 'Baton Pass',
1048
+ 'Groudon', 'Ho-Oh', 'Hydreigon', 'Kartana', 'Kyogre', 'Kyurem', 'Kyurem-Black', 'Kyurem-White', 'Landorus-Base', 'Lugia', 'Lunala', 'Marshadow',
1049
+ 'Mew', 'Mewtwo', 'Naganadel', 'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane', 'Palkia', 'Pheromosa', 'Rayquaza', 'Reshiram', 'Shedinja', 'Solgaleo',
1050
+ 'Spectrier', 'Tornadus-Therian', 'Volcarona', 'Xerneas', 'Yveltal', 'Zacian', 'Zacian-Crowned', 'Zamazenta', 'Zamazenta-Crowned', 'Zekrom', 'Zeraora',
1051
+ 'Zygarde-Base', 'Arena Trap', 'Moody', 'Power Construct', 'Shadow Tag', 'Baton Pass', 'Calm Mind',
1052
+ ],
1053
+ },
1054
+ {
1055
+ name: "[Gen 8] Cross Evolution",
1056
+ desc: `Give a Pok&eacute;mon a Pok&eacute;mon name of the next evolution stage as a nickname to inherit stat changes, typing, abilities, and up to 2 moves from the next stage Pok&eacute;mon.`,
1057
+ threads: [
1058
+ `&bullet; <a href="https://www.smogon.com/forums/threads/3657562/">Cross Evolution</a>`,
1197
1059
  ],
1060
+ mod: 'gen8',
1061
+ searchShow: false,
1062
+ ruleset: ['Standard', 'Overflow Stat Mod', 'Dynamax Clause', '2 Ability Clause'],
1063
+ banlist: ['Corsola-Galar', 'Sneasel', 'Type: Null', 'Arena Trap', 'Ice Scales', 'Moody', 'King\'s Rock', 'Baton Pass'],
1064
+ restricted: ['Chansey', 'Lunala', 'Shedinja', 'Solgaleo', 'Gorilla Tactics', 'Huge Power', 'Pure Power', 'Shadow Tag'],
1065
+ onValidateTeam(team) {
1066
+ const names = new Set();
1067
+ for (const set of team) {
1068
+ const name = set.name;
1069
+ if (names.has(this.dex.toID(name))) {
1070
+ return [
1071
+ `Your Pok\u00e9mon must have different nicknames.`,
1072
+ `(You have more than one Pok\u00e9mon named '${name}')`,
1073
+ ];
1074
+ }
1075
+ names.add(this.dex.toID(name));
1076
+ }
1077
+ if (!names.size) {
1078
+ return [
1079
+ `${this.format.name} works using nicknames; your team has 0 nicknamed Pok\u00e9mon.`,
1080
+ `(If this was intentional, add a nickname to one Pok\u00e9mon that isn't the name of a Pok\u00e9mon species.)`,
1081
+ ];
1082
+ }
1083
+ },
1084
+ checkCanLearn(move, species, lsetData, set) {
1085
+ // @ts-ignore
1086
+ if (!set.sp?.exists || !set.crossSpecies?.exists) {
1087
+ return this.checkCanLearn(move, species, lsetData, set);
1088
+ }
1089
+ // @ts-ignore
1090
+ const problem = this.checkCanLearn(move, set.sp);
1091
+ if (!problem)
1092
+ return null;
1093
+ // @ts-ignore
1094
+ if (!set.crossMovesLeft)
1095
+ return problem;
1096
+ // @ts-ignore
1097
+ if (this.checkCanLearn(move, set.crossSpecies))
1098
+ return problem;
1099
+ // @ts-ignore
1100
+ set.crossMovesLeft--;
1101
+ return null;
1102
+ },
1103
+ validateSet(set, teamHas) {
1104
+ const crossSpecies = this.dex.species.get(set.name);
1105
+ let problems = this.dex.formats.get('Pokemon').onChangeSet?.call(this, set, this.format) || null;
1106
+ if (Array.isArray(problems) && problems.length)
1107
+ return problems;
1108
+ const crossNonstandard = (!this.ruleTable.has('standardnatdex') && crossSpecies.isNonstandard === 'Past') ||
1109
+ crossSpecies.isNonstandard === 'Future';
1110
+ const crossIsCap = !this.ruleTable.has('+pokemontag:cap') && crossSpecies.isNonstandard === 'CAP';
1111
+ if (!crossSpecies.exists || crossNonstandard || crossIsCap)
1112
+ return this.validateSet(set, teamHas);
1113
+ const species = this.dex.species.get(set.species);
1114
+ const check = this.checkSpecies(set, species, species, {});
1115
+ if (check)
1116
+ return [check];
1117
+ const nonstandard = !this.ruleTable.has('standardnatdex') && species.isNonstandard === 'Past';
1118
+ const isCap = !this.ruleTable.has('+pokemontag:cap') && species.isNonstandard === 'CAP';
1119
+ if (!species.exists || nonstandard || isCap || species === crossSpecies)
1120
+ return this.validateSet(set, teamHas);
1121
+ if (!species.nfe)
1122
+ return [`${species.name} cannot cross evolve because it doesn't evolve.`];
1123
+ const crossIsUnreleased = (crossSpecies.tier === "Unreleased" && crossSpecies.isNonstandard === "Unobtainable");
1124
+ if (crossSpecies.battleOnly || crossIsUnreleased || !crossSpecies.prevo) {
1125
+ return [`${species.name} cannot cross evolve into ${crossSpecies.name} because it isn't an evolution.`];
1126
+ }
1127
+ if (this.ruleTable.isRestrictedSpecies(crossSpecies)) {
1128
+ return [`${species.name} cannot cross evolve into ${crossSpecies.name} because it is banned.`];
1129
+ }
1130
+ const crossPrevoSpecies = this.dex.species.get(crossSpecies.prevo);
1131
+ if (!crossPrevoSpecies.prevo !== !species.prevo) {
1132
+ return [
1133
+ `${species.name} cannot cross evolve into ${crossSpecies.name} because they are not consecutive evolution stages.`,
1134
+ ];
1135
+ }
1136
+ const item = this.dex.items.get(set.item);
1137
+ if (item.itemUser?.length) {
1138
+ if (!item.itemUser.includes(crossSpecies.name) || crossSpecies.name !== species.name) {
1139
+ return [`${species.name} cannot use ${item.name} because it is cross evolved into ${crossSpecies.name}.`];
1140
+ }
1141
+ }
1142
+ const ability = this.dex.abilities.get(set.ability);
1143
+ if (!this.ruleTable.isRestricted(`ability:${ability.id}`) || Object.values(species.abilities).includes(ability.name)) {
1144
+ set.species = crossSpecies.name;
1145
+ }
1146
+ // @ts-ignore
1147
+ set.sp = species;
1148
+ // @ts-ignore
1149
+ set.crossSpecies = crossSpecies;
1150
+ // @ts-ignore
1151
+ set.crossMovesLeft = 2;
1152
+ problems = this.validateSet(set, teamHas);
1153
+ set.name = crossSpecies.name;
1154
+ set.species = species.name;
1155
+ return problems;
1156
+ },
1157
+ onModifySpecies(species, target, source, effect) {
1158
+ if (!target)
1159
+ return; // chat
1160
+ if (effect && ['imposter', 'transform'].includes(effect.id))
1161
+ return;
1162
+ if (target.set.name === target.set.species)
1163
+ return;
1164
+ const crossSpecies = this.dex.species.get(target.set.name);
1165
+ if (!crossSpecies.exists)
1166
+ return;
1167
+ if (species.battleOnly || !species.nfe)
1168
+ return;
1169
+ const crossIsUnreleased = (crossSpecies.tier === "Unreleased" && crossSpecies.isNonstandard === "Unobtainable");
1170
+ if (crossSpecies.battleOnly || crossIsUnreleased || !crossSpecies.prevo)
1171
+ return;
1172
+ const crossPrevoSpecies = this.dex.species.get(crossSpecies.prevo);
1173
+ if (!crossPrevoSpecies.prevo !== !species.prevo)
1174
+ return;
1175
+ const mixedSpecies = this.dex.deepClone(species);
1176
+ mixedSpecies.weightkg =
1177
+ Math.max(0.1, +(species.weightkg + crossSpecies.weightkg - crossPrevoSpecies.weightkg)).toFixed(1);
1178
+ mixedSpecies.nfe = false;
1179
+ mixedSpecies.evos = [];
1180
+ mixedSpecies.eggGroups = crossSpecies.eggGroups;
1181
+ mixedSpecies.abilities = crossSpecies.abilities;
1182
+ mixedSpecies.bst = 0;
1183
+ let i;
1184
+ for (i in species.baseStats) {
1185
+ const statChange = crossSpecies.baseStats[i] - crossPrevoSpecies.baseStats[i];
1186
+ mixedSpecies.baseStats[i] = this.clampIntRange(species.baseStats[i] + statChange, 1, 255);
1187
+ mixedSpecies.bst += mixedSpecies.baseStats[i];
1188
+ }
1189
+ if (crossSpecies.types[0] !== crossPrevoSpecies.types[0])
1190
+ mixedSpecies.types[0] = crossSpecies.types[0];
1191
+ if (crossSpecies.types[1] !== crossPrevoSpecies.types[1]) {
1192
+ mixedSpecies.types[1] = crossSpecies.types[1] || crossSpecies.types[0];
1193
+ }
1194
+ if (mixedSpecies.types[0] === mixedSpecies.types[1])
1195
+ mixedSpecies.types = [mixedSpecies.types[0]];
1196
+ return mixedSpecies;
1197
+ },
1198
+ onBegin() {
1199
+ for (const pokemon of this.getAllPokemon()) {
1200
+ pokemon.baseSpecies = pokemon.species;
1201
+ }
1202
+ },
1198
1203
  },
1199
1204
  {
1200
1205
  name: "[Gen 8] Inheritance",
@@ -1738,6 +1743,70 @@ exports.Formats = [
1738
1743
  pokemon.m.innates = undefined;
1739
1744
  },
1740
1745
  },
1746
+ {
1747
+ name: "[Gen 8] Shared Power",
1748
+ desc: `Once a Pok&eacute;mon switches in, its ability is shared with the rest of the team.`,
1749
+ threads: [
1750
+ `&bullet; <a href="https://www.smogon.com/forums/threads/3660877/">Shared Power</a>`,
1751
+ ],
1752
+ mod: 'sharedpower',
1753
+ searchShow: false,
1754
+ ruleset: ['Standard', 'Dynamax Clause'],
1755
+ banlist: [
1756
+ 'Calyrex-Ice', 'Calyrex-Shadow', 'Darmanitan-Galar', 'Dialga', 'Dracovish', 'Eternatus', 'Genesect', 'Giratina',
1757
+ 'Giratina-Origin', 'Groudon', 'Ho-Oh', 'Kyogre', 'Kyurem-Black', 'Kyurem-White', 'Lugia', 'Lunala', 'Magearna',
1758
+ 'Marshadow', 'Melmetal', 'Mewtwo', 'Naganadel', 'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane', 'Palkia',
1759
+ 'Pheromosa', 'Rayquaza', 'Reshiram', 'Shedinja', 'Solgaleo', 'Urshifu-Base', 'Urshifu-Rapid-Strike',
1760
+ 'Xerneas', 'Yveltal', 'Zacian', 'Zacian-Crowned', 'Zamazenta', 'Zamazenta-Crowned', 'Zekrom',
1761
+ 'Arena Trap', 'Contrary', 'Drizzle ++ Swift Swim', 'Drought ++ Chlorophyll', 'Electric Surge ++ Surge Surfer',
1762
+ 'Fur Coat', 'Guts', 'Harvest', 'Huge Power', 'Imposter', 'Innards Out', 'Libero', 'Magic Bounce', 'Magic Guard',
1763
+ 'Magnet Pull', 'Mold Breaker', 'Moody', 'Neutralizing Gas', 'Power Construct', 'Queenly Majesty', 'Quick Draw',
1764
+ 'Regenerator', 'Sand Rush', 'Sand Veil', 'Shadow Tag', 'Simple', 'Snow Cloak', 'Snow Warning ++ Slush Rush',
1765
+ 'Speed Boost', 'Stakeout', 'Steelworker ++ Steely Spirit', 'Stench', 'Tinted Lens', 'Triage', 'Unaware',
1766
+ 'Unburden', 'Water Bubble', 'King\'s Rock', 'Baton Pass',
1767
+ ],
1768
+ getSharedPower(pokemon) {
1769
+ const sharedPower = new Set();
1770
+ for (const ally of pokemon.side.pokemon) {
1771
+ if (ally.previouslySwitchedIn > 0) {
1772
+ if (pokemon.battle.dex.currentMod !== 'sharedpower' && ['trace', 'mirrorarmor'].includes(ally.baseAbility)) {
1773
+ sharedPower.add('noability');
1774
+ continue;
1775
+ }
1776
+ sharedPower.add(ally.baseAbility);
1777
+ }
1778
+ }
1779
+ sharedPower.delete(pokemon.baseAbility);
1780
+ return sharedPower;
1781
+ },
1782
+ onBeforeSwitchIn(pokemon) {
1783
+ let format = this.format;
1784
+ if (!format.getSharedPower)
1785
+ format = this.dex.formats.get('gen8sharedpower');
1786
+ for (const ability of format.getSharedPower(pokemon)) {
1787
+ const effect = 'ability:' + ability;
1788
+ pokemon.volatiles[effect] = { id: this.toID(effect), target: pokemon };
1789
+ if (!pokemon.m.abils)
1790
+ pokemon.m.abils = [];
1791
+ if (!pokemon.m.abils.includes(effect))
1792
+ pokemon.m.abils.push(effect);
1793
+ }
1794
+ },
1795
+ onSwitchInPriority: 2,
1796
+ onSwitchIn(pokemon) {
1797
+ let format = this.format;
1798
+ if (!format.getSharedPower)
1799
+ format = this.dex.formats.get('gen8sharedpower');
1800
+ for (const ability of format.getSharedPower(pokemon)) {
1801
+ if (ability === 'noability') {
1802
+ this.hint(`Mirror Armor and Trace break in Shared Power formats that don't use Shared Power as a base, so they get removed from non-base users.`);
1803
+ }
1804
+ const effect = 'ability:' + ability;
1805
+ delete pokemon.volatiles[effect];
1806
+ pokemon.addVolatile(effect);
1807
+ }
1808
+ },
1809
+ },
1741
1810
  {
1742
1811
  name: "[Gen 8] Trademarked",
1743
1812
  desc: `Sacrifice your Pok&eacute;mon's ability for a status move that activates on switch-in.`,
@@ -1994,7 +2063,6 @@ exports.Formats = [
1994
2063
  desc: `[Gen 8] Random Battle (No Dmax) with Team Preview and elements of Camomons, Inverse, Scalemons, and Shared Power.`,
1995
2064
  mod: 'sharedpower',
1996
2065
  team: 'random',
1997
- searchShow: false,
1998
2066
  ruleset: ['[Gen 8] Random Battle', 'Team Preview', 'Dynamax Clause', 'Camomons Mod', 'Inverse Mod', 'Scalemons Mod'],
1999
2067
  onBeforeSwitchIn(pokemon) {
2000
2068
  let format = this.format;
@@ -2280,42 +2348,37 @@ exports.Formats = [
2280
2348
  column: 3,
2281
2349
  },
2282
2350
  {
2283
- name: "[Gen 4] UU",
2351
+ name: "[Gen 5] UU",
2284
2352
  threads: [
2285
- `&bullet; <a href="https://www.smogon.com/forums/threads/3532624/">DPP UU Metagame Discussion</a>`,
2286
- `&bullet; <a href="https://www.smogon.com/forums/threads/3503638/">DPP UU Viability Rankings</a>`,
2353
+ `&bullet; <a href="https://www.smogon.com/forums/threads/3474024/">BW2 UU Viability Rankings</a>`,
2354
+ `&bullet; <a href="https://www.smogon.com/forums/posts/6431094/">BW2 Sample Teams</a>`,
2287
2355
  ],
2288
- mod: 'gen4',
2356
+ mod: 'gen5',
2289
2357
  // searchShow: false,
2290
- ruleset: ['[Gen 4] OU'],
2291
- banlist: ['OU', 'UUBL'],
2292
- unbanlist: ['Arena Trap', 'Swagger'],
2358
+ ruleset: ['Standard', 'Evasion Abilities Clause', 'Swagger Clause', 'Sleep Clause Mod'],
2359
+ banlist: ['Uber', 'OU', 'UUBL', 'Arena Trap', 'Drought', 'Sand Stream', 'Snow Warning', 'Prankster + Assist', 'Prankster + Copycat', 'Baton Pass'],
2293
2360
  },
2294
2361
  {
2295
- name: "[Gen 7] LC",
2362
+ name: "[Gen 5] NU",
2296
2363
  threads: [
2297
- `&bullet; <a href="https://www.smogon.com/dex/sm/formats/lc/">USM LC Banlist</a>`,
2298
- `&bullet; <a href="https://www.smogon.com/forums/threads/3639319/">USM LC Sample Teams</a>`,
2299
- `&bullet; <a href="https://www.smogon.com/forums/threads/3621440/">USM LC Viability Rankings</a>`,
2364
+ `&bullet; <a href="https://www.smogon.com/forums/posts/6431094/">BW2 Sample Teams</a>`,
2365
+ `&bullet; <a href="https://www.smogon.com/forums/threads/3484121/">BW2 NU Viability Rankings</a>`,
2300
2366
  ],
2301
- mod: 'gen7',
2367
+ mod: 'gen5',
2302
2368
  // searchShow: false,
2303
- ruleset: ['Little Cup', 'Standard', 'Swagger Clause'],
2304
- banlist: [
2305
- 'Aipom', 'Cutiefly', 'Drifloon', 'Gligar', 'Gothita', 'Meditite', 'Misdreavus', 'Murkrow', 'Porygon',
2306
- 'Scyther', 'Sneasel', 'Swirlix', 'Tangela', 'Trapinch', 'Vulpix-Base', 'Wingull', 'Yanma',
2307
- 'Eevium Z', 'Baton Pass', 'Dragon Rage', 'Sonic Boom', 'Sticky Web',
2308
- ],
2369
+ ruleset: ['[Gen 5] RU', '!Sleep Moves Clause', 'Sleep Clause Mod'],
2370
+ banlist: ['RU', 'NUBL', 'Assist', 'Copycat'],
2309
2371
  },
2310
2372
  {
2311
- name: "[Gen 5] PU",
2373
+ name: "[Gen 6] PU",
2312
2374
  threads: [
2313
- `&bullet; <a href="https://www.smogon.com/forums/posts/7326932/">BW2 PU</a>`,
2375
+ `&bullet; <a href="https://www.smogon.com/dex/xy/tags/pu/">ORAS PU Banlist</a>`,
2376
+ `&bullet; <a href="https://www.smogon.com/forums/threads/3528743/">ORAS PU Viability Rankings</a>`,
2314
2377
  ],
2315
- mod: 'gen5',
2378
+ mod: 'gen6',
2316
2379
  // searchShow: false,
2317
- ruleset: ['[Gen 5] NU', 'Sleep Moves Clause'],
2318
- banlist: ['NU', 'PUBL'],
2380
+ ruleset: ['[Gen 6] NU'],
2381
+ banlist: ['NU', 'PUBL', 'Chatter'],
2319
2382
  },
2320
2383
  // Past Gens OU
2321
2384
  ///////////////////////////////////////////////////////////////////
@@ -2588,6 +2651,22 @@ exports.Formats = [
2588
2651
  ruleset: ['[Gen 7] NU'],
2589
2652
  banlist: ['NU', 'PUBL'],
2590
2653
  },
2654
+ {
2655
+ name: "[Gen 7] LC",
2656
+ threads: [
2657
+ `&bullet; <a href="https://www.smogon.com/dex/sm/formats/lc/">USM LC Banlist</a>`,
2658
+ `&bullet; <a href="https://www.smogon.com/forums/threads/3639319/">USM LC Sample Teams</a>`,
2659
+ `&bullet; <a href="https://www.smogon.com/forums/threads/3621440/">USM LC Viability Rankings</a>`,
2660
+ ],
2661
+ mod: 'gen7',
2662
+ searchShow: false,
2663
+ ruleset: ['Little Cup', 'Standard', 'Swagger Clause'],
2664
+ banlist: [
2665
+ 'Aipom', 'Cutiefly', 'Drifloon', 'Gligar', 'Gothita', 'Meditite', 'Misdreavus', 'Murkrow', 'Porygon',
2666
+ 'Scyther', 'Sneasel', 'Swirlix', 'Tangela', 'Trapinch', 'Vulpix-Base', 'Wingull', 'Yanma',
2667
+ 'Eevium Z', 'Baton Pass', 'Dragon Rage', 'Sonic Boom', 'Sticky Web',
2668
+ ],
2669
+ },
2591
2670
  {
2592
2671
  name: "[Gen 7] Monotype",
2593
2672
  desc: `All the Pok&eacute;mon on a team must share a type.`,
@@ -2852,17 +2931,6 @@ exports.Formats = [
2852
2931
  ruleset: ['[Gen 6] RU'],
2853
2932
  banlist: ['RU', 'NUBL'],
2854
2933
  },
2855
- {
2856
- name: "[Gen 6] PU",
2857
- threads: [
2858
- `&bullet; <a href="https://www.smogon.com/dex/xy/tags/pu/">ORAS PU Banlist</a>`,
2859
- `&bullet; <a href="https://www.smogon.com/forums/threads/3528743/">ORAS PU Viability Rankings</a>`,
2860
- ],
2861
- mod: 'gen6',
2862
- searchShow: false,
2863
- ruleset: ['[Gen 6] NU'],
2864
- banlist: ['NU', 'PUBL', 'Chatter'],
2865
- },
2866
2934
  {
2867
2935
  name: "[Gen 6] LC",
2868
2936
  threads: [
@@ -3071,17 +3139,6 @@ exports.Formats = [
3071
3139
  searchShow: false,
3072
3140
  ruleset: ['Standard', 'Sleep Clause Mod'],
3073
3141
  },
3074
- {
3075
- name: "[Gen 5] UU",
3076
- threads: [
3077
- `&bullet; <a href="https://www.smogon.com/forums/threads/3474024/">BW2 UU Viability Rankings</a>`,
3078
- `&bullet; <a href="https://www.smogon.com/forums/posts/6431094/">BW2 Sample Teams</a>`,
3079
- ],
3080
- mod: 'gen5',
3081
- searchShow: false,
3082
- ruleset: ['Standard', 'Evasion Abilities Clause', 'Swagger Clause', 'Sleep Clause Mod'],
3083
- banlist: ['Uber', 'OU', 'UUBL', 'Arena Trap', 'Drought', 'Sand Stream', 'Snow Warning', 'Prankster + Assist', 'Prankster + Copycat', 'Baton Pass'],
3084
- },
3085
3142
  {
3086
3143
  name: "[Gen 5] RU",
3087
3144
  threads: [
@@ -3095,15 +3152,14 @@ exports.Formats = [
3095
3152
  unbanlist: ['Prankster + Assist', 'Prankster + Copycat', 'Baton Pass'],
3096
3153
  },
3097
3154
  {
3098
- name: "[Gen 5] NU",
3155
+ name: "[Gen 5] PU",
3099
3156
  threads: [
3100
- `&bullet; <a href="https://www.smogon.com/forums/posts/6431094/">BW2 Sample Teams</a>`,
3101
- `&bullet; <a href="https://www.smogon.com/forums/threads/3484121/">BW2 NU Viability Rankings</a>`,
3157
+ `&bullet; <a href="https://www.smogon.com/forums/posts/7326932/">BW2 PU</a>`,
3102
3158
  ],
3103
3159
  mod: 'gen5',
3104
3160
  searchShow: false,
3105
- ruleset: ['[Gen 5] RU', '!Sleep Moves Clause', 'Sleep Clause Mod'],
3106
- banlist: ['RU', 'NUBL', 'Assist', 'Copycat'],
3161
+ ruleset: ['[Gen 5] NU', 'Sleep Moves Clause'],
3162
+ banlist: ['NU', 'PUBL'],
3107
3163
  },
3108
3164
  {
3109
3165
  name: "[Gen 5] LC",
@@ -3185,7 +3241,7 @@ exports.Formats = [
3185
3241
  gameType: 'doubles',
3186
3242
  searchShow: false,
3187
3243
  ruleset: ['Flat Rules'],
3188
- banlist: ['Dark Void', 'Sky Drop', 'Soul Dew'],
3244
+ banlist: ['Chatot', 'Dark Void', 'Sky Drop', 'Soul Dew'],
3189
3245
  },
3190
3246
  {
3191
3247
  name: "[Gen 5] VGC 2012",
@@ -3239,6 +3295,18 @@ exports.Formats = [
3239
3295
  ruleset: ['Standard'],
3240
3296
  banlist: ['AG'],
3241
3297
  },
3298
+ {
3299
+ name: "[Gen 4] UU",
3300
+ threads: [
3301
+ `&bullet; <a href="https://www.smogon.com/forums/threads/3532624/">DPP UU Metagame Discussion</a>`,
3302
+ `&bullet; <a href="https://www.smogon.com/forums/threads/3503638/">DPP UU Viability Rankings</a>`,
3303
+ ],
3304
+ mod: 'gen4',
3305
+ searchShow: false,
3306
+ ruleset: ['[Gen 4] OU'],
3307
+ banlist: ['OU', 'UUBL'],
3308
+ unbanlist: ['Arena Trap', 'Swagger'],
3309
+ },
3242
3310
  {
3243
3311
  name: "[Gen 4] NU",
3244
3312
  threads: [
@@ -3342,7 +3410,7 @@ exports.Formats = [
3342
3410
  gameType: 'doubles',
3343
3411
  searchShow: false,
3344
3412
  ruleset: ['Flat Rules', '! Adjust Level Down', 'Max Level = 50', 'Max Team Size = 4'],
3345
- banlist: ['Soul Dew', 'Rotom-Heat', 'Rotom-Wash', 'Rotom-Frost', 'Rotom-Fan', 'Rotom-Mow'],
3413
+ banlist: ['Tyranitar', 'Rotom', 'Judgment', 'Soul Dew'],
3346
3414
  },
3347
3415
  {
3348
3416
  name: "[Gen 4] Doubles Custom Game",