@pkmn/sim 0.5.11 → 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 (44) hide show
  1. package/README.md +5 -0
  2. package/build/config/formats.js +346 -281
  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 +2 -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 +33 -32
  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/mods/gen1/moves.js +2 -4
  15. package/build/data/mods/gen1/moves.js.map +1 -1
  16. package/build/data/mods/gen3/formats-data.js +1 -1
  17. package/build/data/mods/gen3/formats-data.js.map +1 -1
  18. package/build/data/moves.js +14 -12
  19. package/build/data/moves.js.map +1 -1
  20. package/build/data/pokedex.js +2 -2
  21. package/build/data/pokedex.js.map +1 -1
  22. package/build/data/text/moves.js +1 -0
  23. package/build/data/text/moves.js.map +1 -1
  24. package/build/sim/battle.js +13 -11
  25. package/build/sim/battle.js.map +1 -1
  26. package/build/sim/dex-conditions.js +10 -3
  27. package/build/sim/dex-conditions.js.map +1 -1
  28. package/build/sim/team-validator.js +1 -1
  29. package/build/sim/team-validator.js.map +1 -1
  30. package/config/formats.ts +332 -265
  31. package/data/abilities.ts +7 -7
  32. package/data/aliases.ts +2 -0
  33. package/data/conditions.ts +8 -10
  34. package/data/formats-data.ts +33 -32
  35. package/data/items.ts +1 -1
  36. package/data/mods/gen1/moves.ts +2 -4
  37. package/data/mods/gen3/formats-data.ts +1 -1
  38. package/data/moves.ts +13 -12
  39. package/data/pokedex.ts +2 -2
  40. package/data/text/moves.ts +2 -0
  41. package/package.json +1 -1
  42. package/sim/battle.ts +4 -1
  43. package/sim/dex-conditions.ts +9 -3
  44. 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
  {
@@ -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,7 +442,7 @@ 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',
445
+ 'Alakazam-Mega', 'Arceus', 'Blastoise-Mega', 'Calyrex-Ice', 'Calyrex-Shadow', 'Cinderace', 'Darkrai',
446
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',
@@ -472,6 +472,8 @@ exports.Formats = [
472
472
  'Drizzle', 'Drought',
473
473
  // Slowbronite is banned so it doesn't validate on Galarian Slowbro
474
474
  'Slowbronite',
475
+ // Ban for ou suspect
476
+ 'Blaziken-Mega',
475
477
  ],
476
478
  // Used to distinguish UU from below UU in the client
477
479
  restricted: [
@@ -589,218 +591,41 @@ exports.Formats = [
589
591
  column: 2,
590
592
  },
591
593
  {
592
- name: "[Gen 8] Shared Power",
593
- 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.`,
594
596
  threads: [
595
- `&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>`,
596
598
  ],
597
- mod: 'sharedpower',
598
- // searchShow: false,
599
- ruleset: ['Standard', 'Dynamax Clause'],
599
+ mod: 'gen8',
600
+ ruleset: ['Standard', 'Sketchmons Move Legality', 'Dynamax Clause'],
600
601
  banlist: [
601
- 'Calyrex-Ice', 'Calyrex-Shadow', 'Darmanitan-Galar', 'Dialga', 'Dracovish', 'Eternatus', 'Genesect', 'Giratina',
602
- 'Giratina-Origin', 'Groudon', 'Ho-Oh', 'Kyogre', 'Kyurem-Black', 'Kyurem-White', 'Lugia', 'Lunala', 'Magearna',
603
- 'Marshadow', 'Melmetal', 'Mewtwo', 'Naganadel', 'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane', 'Palkia',
604
- 'Pheromosa', 'Rayquaza', 'Reshiram', 'Shedinja', 'Solgaleo', 'Urshifu-Base', 'Urshifu-Rapid-Strike',
605
- 'Xerneas', 'Yveltal', 'Zacian', 'Zacian-Crowned', 'Zamazenta', 'Zamazenta-Crowned', 'Zekrom',
606
- 'Arena Trap', 'Contrary', 'Drizzle ++ Swift Swim', 'Drought ++ Chlorophyll', 'Electric Surge ++ Surge Surfer',
607
- 'Fur Coat', 'Guts', 'Harvest', 'Huge Power', 'Imposter', 'Innards Out', 'Libero', 'Magic Bounce', 'Magic Guard',
608
- 'Magnet Pull', 'Mold Breaker', 'Moody', 'Neutralizing Gas', 'Power Construct', 'Queenly Majesty', 'Quick Draw',
609
- 'Regenerator', 'Sand Rush', 'Sand Veil', 'Shadow Tag', 'Simple', 'Snow Cloak', 'Snow Warning ++ Slush Rush',
610
- 'Speed Boost', 'Stakeout', 'Steelworker ++ Steely Spirit', 'Stench', 'Tinted Lens', 'Triage', 'Unaware',
611
- 'Unburden', 'Water Bubble', 'King\'s Rock', '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',
612
613
  ],
613
- getSharedPower(pokemon) {
614
- const sharedPower = new Set();
615
- for (const ally of pokemon.side.pokemon) {
616
- if (ally.previouslySwitchedIn > 0) {
617
- if (pokemon.battle.dex.currentMod !== 'sharedpower' && ['trace', 'mirrorarmor'].includes(ally.baseAbility)) {
618
- sharedPower.add('noability');
619
- continue;
620
- }
621
- sharedPower.add(ally.baseAbility);
622
- }
623
- }
624
- sharedPower.delete(pokemon.baseAbility);
625
- return sharedPower;
626
- },
627
- onBeforeSwitchIn(pokemon) {
628
- let format = this.format;
629
- if (!format.getSharedPower)
630
- format = this.dex.formats.get('gen8sharedpower');
631
- for (const ability of format.getSharedPower(pokemon)) {
632
- const effect = 'ability:' + ability;
633
- pokemon.volatiles[effect] = { id: this.toID(effect), target: pokemon };
634
- if (!pokemon.m.abils)
635
- pokemon.m.abils = [];
636
- if (!pokemon.m.abils.includes(effect))
637
- pokemon.m.abils.push(effect);
638
- }
639
- },
640
- onSwitchInPriority: 2,
641
- onSwitchIn(pokemon) {
642
- let format = this.format;
643
- if (!format.getSharedPower)
644
- format = this.dex.formats.get('gen8sharedpower');
645
- for (const ability of format.getSharedPower(pokemon)) {
646
- if (ability === 'noability') {
647
- 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.`);
648
- }
649
- const effect = 'ability:' + ability;
650
- delete pokemon.volatiles[effect];
651
- pokemon.addVolatile(effect);
652
- }
653
- },
654
614
  },
655
615
  {
656
- name: "[Gen 8] Cross Evolution",
657
- 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.`,
658
618
  threads: [
659
- `&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>`,
660
620
  ],
661
621
  mod: 'gen8',
662
- // searchShow: false,
663
- ruleset: ['Standard', 'Overflow Stat Mod', 'Dynamax Clause', '2 Ability Clause'],
664
- banlist: ['Corsola-Galar', 'Sneasel', 'Type: Null', 'Arena Trap', 'Ice Scales', 'Moody', 'King\'s Rock', 'Baton Pass'],
665
- restricted: ['Chansey', 'Lunala', 'Shedinja', 'Solgaleo', 'Gorilla Tactics', 'Huge Power', 'Pure Power', 'Shadow Tag'],
666
- onValidateTeam(team) {
667
- const names = new Set();
668
- for (const set of team) {
669
- const name = set.name;
670
- if (names.has(this.dex.toID(name))) {
671
- return [
672
- `Your Pok\u00e9mon must have different nicknames.`,
673
- `(You have more than one Pok\u00e9mon named '${name}')`,
674
- ];
675
- }
676
- names.add(this.dex.toID(name));
677
- }
678
- if (!names.size) {
679
- return [
680
- `${this.format.name} works using nicknames; your team has 0 nicknamed Pok\u00e9mon.`,
681
- `(If this was intentional, add a nickname to one Pok\u00e9mon that isn't the name of a Pok\u00e9mon species.)`,
682
- ];
683
- }
684
- },
685
- checkCanLearn(move, species, lsetData, set) {
686
- // @ts-ignore
687
- if (!set.sp?.exists || !set.crossSpecies?.exists) {
688
- return this.checkCanLearn(move, species, lsetData, set);
689
- }
690
- // @ts-ignore
691
- const problem = this.checkCanLearn(move, set.sp);
692
- if (!problem)
693
- return null;
694
- // @ts-ignore
695
- if (!set.crossMovesLeft)
696
- return problem;
697
- // @ts-ignore
698
- if (this.checkCanLearn(move, set.crossSpecies))
699
- return problem;
700
- // @ts-ignore
701
- set.crossMovesLeft--;
702
- return null;
703
- },
704
- validateSet(set, teamHas) {
705
- const crossSpecies = this.dex.species.get(set.name);
706
- let problems = this.dex.formats.get('Pokemon').onChangeSet?.call(this, set, this.format) || null;
707
- if (Array.isArray(problems) && problems.length)
708
- return problems;
709
- const crossNonstandard = (!this.ruleTable.has('standardnatdex') && crossSpecies.isNonstandard === 'Past') ||
710
- crossSpecies.isNonstandard === 'Future';
711
- const crossIsCap = !this.ruleTable.has('+pokemontag:cap') && crossSpecies.isNonstandard === 'CAP';
712
- if (!crossSpecies.exists || crossNonstandard || crossIsCap)
713
- return this.validateSet(set, teamHas);
714
- const species = this.dex.species.get(set.species);
715
- const check = this.checkSpecies(set, species, species, {});
716
- if (check)
717
- return [check];
718
- const nonstandard = !this.ruleTable.has('standardnatdex') && species.isNonstandard === 'Past';
719
- const isCap = !this.ruleTable.has('+pokemontag:cap') && species.isNonstandard === 'CAP';
720
- if (!species.exists || nonstandard || isCap || species === crossSpecies)
721
- return this.validateSet(set, teamHas);
722
- if (!species.nfe)
723
- return [`${species.name} cannot cross evolve because it doesn't evolve.`];
724
- const crossIsUnreleased = (crossSpecies.tier === "Unreleased" && crossSpecies.isNonstandard === "Unobtainable");
725
- if (crossSpecies.battleOnly || crossIsUnreleased || !crossSpecies.prevo) {
726
- return [`${species.name} cannot cross evolve into ${crossSpecies.name} because it isn't an evolution.`];
727
- }
728
- if (this.ruleTable.isRestrictedSpecies(crossSpecies)) {
729
- return [`${species.name} cannot cross evolve into ${crossSpecies.name} because it is banned.`];
730
- }
731
- const crossPrevoSpecies = this.dex.species.get(crossSpecies.prevo);
732
- if (!crossPrevoSpecies.prevo !== !species.prevo) {
733
- return [
734
- `${species.name} cannot cross evolve into ${crossSpecies.name} because they are not consecutive evolution stages.`,
735
- ];
736
- }
737
- const item = this.dex.items.get(set.item);
738
- if (item.itemUser?.length) {
739
- if (!item.itemUser.includes(crossSpecies.name) || crossSpecies.name !== species.name) {
740
- return [`${species.name} cannot use ${item.name} because it is cross evolved into ${crossSpecies.name}.`];
741
- }
742
- }
743
- const ability = this.dex.abilities.get(set.ability);
744
- if (!this.ruleTable.isRestricted(`ability:${ability.id}`) || Object.values(species.abilities).includes(ability.name)) {
745
- set.species = crossSpecies.name;
746
- }
747
- // @ts-ignore
748
- set.sp = species;
749
- // @ts-ignore
750
- set.crossSpecies = crossSpecies;
751
- // @ts-ignore
752
- set.crossMovesLeft = 2;
753
- problems = this.validateSet(set, teamHas);
754
- set.name = crossSpecies.name;
755
- set.species = species.name;
756
- return problems;
757
- },
758
- onModifySpecies(species, target, source, effect) {
759
- if (!target)
760
- return; // chat
761
- if (effect && ['imposter', 'transform'].includes(effect.id))
762
- return;
763
- if (target.set.name === target.set.species)
764
- return;
765
- const crossSpecies = this.dex.species.get(target.set.name);
766
- if (!crossSpecies.exists)
767
- return;
768
- if (species.battleOnly || !species.nfe)
769
- return;
770
- const crossIsUnreleased = (crossSpecies.tier === "Unreleased" && crossSpecies.isNonstandard === "Unobtainable");
771
- if (crossSpecies.battleOnly || crossIsUnreleased || !crossSpecies.prevo)
772
- return;
773
- const crossPrevoSpecies = this.dex.species.get(crossSpecies.prevo);
774
- if (!crossPrevoSpecies.prevo !== !species.prevo)
775
- return;
776
- const mixedSpecies = this.dex.deepClone(species);
777
- mixedSpecies.weightkg =
778
- Math.max(0.1, +(species.weightkg + crossSpecies.weightkg - crossPrevoSpecies.weightkg)).toFixed(1);
779
- mixedSpecies.nfe = false;
780
- mixedSpecies.evos = [];
781
- mixedSpecies.eggGroups = crossSpecies.eggGroups;
782
- mixedSpecies.abilities = crossSpecies.abilities;
783
- mixedSpecies.bst = 0;
784
- let i;
785
- for (i in species.baseStats) {
786
- const statChange = crossSpecies.baseStats[i] - crossPrevoSpecies.baseStats[i];
787
- mixedSpecies.baseStats[i] = this.clampIntRange(species.baseStats[i] + statChange, 1, 255);
788
- mixedSpecies.bst += mixedSpecies.baseStats[i];
789
- }
790
- if (crossSpecies.types[0] !== crossPrevoSpecies.types[0])
791
- mixedSpecies.types[0] = crossSpecies.types[0];
792
- if (crossSpecies.types[1] !== crossPrevoSpecies.types[1]) {
793
- mixedSpecies.types[1] = crossSpecies.types[1] || crossSpecies.types[0];
794
- }
795
- if (mixedSpecies.types[0] === mixedSpecies.types[1])
796
- mixedSpecies.types = [mixedSpecies.types[0]];
797
- return mixedSpecies;
798
- },
799
- onBegin() {
800
- for (const pokemon of this.getAllPokemon()) {
801
- pokemon.baseSpecies = pokemon.species;
802
- }
803
- },
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
+ ],
804
629
  },
805
630
  // Other Metagames
806
631
  ///////////////////////////////////////////////////////////////////
@@ -852,15 +677,16 @@ exports.Formats = [
852
677
  `&bullet; <a href="https://www.smogon.com/forums/threads/3682690/">AAA Resources</a>`,
853
678
  ],
854
679
  mod: 'gen8',
855
- 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'],
856
681
  banlist: [
857
- 'Archeops', 'Blacephalon', 'Buzzwole', 'Calyrex-Ice', 'Calyrex-Shadow', 'Dialga', 'Dracovish', 'Dragapult', 'Dragonite', 'Eternatus', 'Gengar', 'Giratina',
858
- 'Giratina-Origin', 'Groudon', 'Ho-Oh', 'Kartana', 'Keldeo', 'Kyogre', 'Kyurem', 'Kyurem-Black', 'Kyurem-White', 'Lugia', 'Lunala', 'Magearna', 'Marshadow',
859
- 'Melmetal', 'Mewtwo', 'Naganadel', 'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane', 'Noivern', 'Palkia', 'Pheromosa', 'Rayquaza', 'Regigigas', 'Reshiram', 'Shedinja',
860
- 'Solgaleo', 'Spectrier', 'Urshifu-Base', 'Urshifu-Rapid-Strike', 'Victini', 'Weavile', 'Xerneas', 'Yveltal', 'Zacian', 'Zacian-Crowned', 'Zamazenta-Base', 'Zekrom',
861
- 'Zeraora', 'Zygarde-Base', 'Arena Trap', 'Comatose', 'Contrary', 'Fluffy', 'Fur Coat', 'Gorilla Tactics', 'Huge Power', 'Ice Scales', 'Illusion', 'Imposter',
862
- 'Innards Out', 'Intrepid Sword', 'Libero', 'Magnet Pull', 'Moody', 'Neutralizing Gas', 'Parental Bond', 'Poison Heal', 'Protean', 'Pure Power', 'Shadow Tag',
863
- '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',
864
690
  ],
865
691
  onValidateSet(set) {
866
692
  // Temporary fix until battle-only is implemented properly
@@ -880,15 +706,15 @@ exports.Formats = [
880
706
  `&bullet; <a href="https://www.smogon.com/forums/threads/3659028/">M&amp;M Resources</a>`,
881
707
  ],
882
708
  mod: 'mixandmega',
883
- 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'],
884
710
  banlist: [
885
711
  'Calyrex-Shadow', 'Eternatus', 'Kyogre', 'Zacian',
886
712
  'Beedrillite', 'Blazikenite', 'Gengarite', 'Kangaskhanite', 'Mawilite', 'Medichamite', 'Pidgeotite',
887
713
  'Moody', 'Shadow Tag', 'Baton Pass', 'Electrify',
888
714
  ],
889
715
  restricted: [
890
- 'Calyrex-Ice', 'Dialga', 'Gengar', 'Giratina', 'Groudon', 'Ho-Oh', 'Kyurem-Black', 'Kyurem-White',
891
- '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',
892
718
  'Palkia', 'Pheromosa', 'Rayquaza', 'Regigigas', 'Reshiram', 'Urshifu', 'Urshifu-Rapid-Strike', 'Xerneas',
893
719
  'Yveltal', 'Zekrom', 'Zygarde-Complete',
894
720
  ],
@@ -898,9 +724,16 @@ exports.Formats = [
898
724
  const item = this.dex.items.get(set.item);
899
725
  if (!item.megaStone)
900
726
  continue;
727
+ const natdex = this.ruleTable.has('standardnatdex');
728
+ if (natdex && item.id !== 'ultranecroziumz')
729
+ continue;
901
730
  const species = this.dex.species.get(set.species);
902
- if (species.isNonstandard)
731
+ if (species.isNonstandard && !this.ruleTable.has(`+${this.toID(species.isNonstandard)}`)) {
903
732
  return [`${species.baseSpecies} does not exist in gen 8.`];
733
+ }
734
+ if (natdex && species.name.startsWith('Necrozma-') && item.id === 'ultranecroziumz') {
735
+ continue;
736
+ }
904
737
  if (this.ruleTable.isRestrictedSpecies(species) || this.toID(set.ability) === 'powerconstruct') {
905
738
  return [`${species.name} is not allowed to hold ${item.name}.`];
906
739
  }
@@ -968,8 +801,8 @@ exports.Formats = [
968
801
  mod: 'gen8',
969
802
  ruleset: ['Not Fully Evolved', 'Standard', 'Dynamax Clause'],
970
803
  banlist: [
971
- 'Chansey', 'Doublade', 'Haunter', 'Kadabra', 'Magneton', 'Mr. Mime-Galar', 'Pawniard', 'Pikachu', 'Porygon2',
972
- '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',
973
806
  ],
974
807
  },
975
808
  {
@@ -992,8 +825,21 @@ exports.Formats = [
992
825
  let species = this.dex.species.get(set.species);
993
826
  if (typeof species.battleOnly === 'string')
994
827
  species = this.dex.species.get(species.battleOnly);
995
- if (['ag', 'uber'].includes(this.toID(species.tier)) || this.toID(set.ability) === 'powerconstruct') {
996
- 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
+ }
997
843
  }
998
844
  }
999
845
  if (gods.size > 1) {
@@ -1006,7 +852,8 @@ exports.Formats = [
1006
852
  return;
1007
853
  const god = target.side.team.find(set => {
1008
854
  let godSpecies = this.dex.species.get(set.species);
1009
- 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'}`));
1010
857
  if (this.toID(set.ability) === 'powerconstruct') {
1011
858
  return true;
1012
859
  }
@@ -1024,6 +871,9 @@ exports.Formats = [
1024
871
  if (godSpecies.forme === 'Crowned') {
1025
872
  godSpecies = this.dex.species.get(godSpecies.changesFrom || godSpecies.baseSpecies);
1026
873
  }
874
+ if (typeof godSpecies.battleOnly === 'string') {
875
+ godSpecies = this.dex.species.get(godSpecies.battleOnly);
876
+ }
1027
877
  newSpecies.bst -= newSpecies.baseStats[stat];
1028
878
  newSpecies.baseStats[stat] = godSpecies.baseStats[stat];
1029
879
  newSpecies.bst += newSpecies.baseStats[stat];
@@ -1129,7 +979,7 @@ exports.Formats = [
1129
979
  mod: 'gen8bdsp',
1130
980
  ruleset: ['Standard', 'Same Type Clause'],
1131
981
  banlist: [
1132
- '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',
1133
983
  'Arena Trap', 'Moody', 'Shadow Tag', 'Damp Rock', 'King\'s Rock', 'Razor Fang', 'Baton Pass',
1134
984
  ],
1135
985
  },
@@ -1148,6 +998,7 @@ exports.Formats = [
1148
998
  `&bullet; <a href="https://www.smogon.com/forums/threads/3695092/">BDSP 3v3 Singles</a>`,
1149
999
  ],
1150
1000
  mod: 'gen8bdsp',
1001
+ searchShow: false,
1151
1002
  ruleset: ['Flat Rules', 'Min Source Gen = 8'],
1152
1003
  },
1153
1004
  {
@@ -1200,6 +1051,156 @@ exports.Formats = [
1200
1051
  'Zygarde-Base', 'Arena Trap', 'Moody', 'Power Construct', 'Shadow Tag', 'Baton Pass', 'Calm Mind',
1201
1052
  ],
1202
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>`,
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
+ },
1203
+ },
1203
1204
  {
1204
1205
  name: "[Gen 8] Inheritance",
1205
1206
  desc: `Pok&eacute;mon may use the ability and moves of another, as long as they forfeit their own learnset.`,
@@ -1742,6 +1743,70 @@ exports.Formats = [
1742
1743
  pokemon.m.innates = undefined;
1743
1744
  },
1744
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
+ },
1745
1810
  {
1746
1811
  name: "[Gen 8] Trademarked",
1747
1812
  desc: `Sacrifice your Pok&eacute;mon's ability for a status move that activates on switch-in.`,
@@ -2283,42 +2348,37 @@ exports.Formats = [
2283
2348
  column: 3,
2284
2349
  },
2285
2350
  {
2286
- name: "[Gen 4] UU",
2351
+ name: "[Gen 5] UU",
2287
2352
  threads: [
2288
- `&bullet; <a href="https://www.smogon.com/forums/threads/3532624/">DPP UU Metagame Discussion</a>`,
2289
- `&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>`,
2290
2355
  ],
2291
- mod: 'gen4',
2356
+ mod: 'gen5',
2292
2357
  // searchShow: false,
2293
- ruleset: ['[Gen 4] OU'],
2294
- banlist: ['OU', 'UUBL'],
2295
- 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'],
2296
2360
  },
2297
2361
  {
2298
- name: "[Gen 7] LC",
2362
+ name: "[Gen 5] NU",
2299
2363
  threads: [
2300
- `&bullet; <a href="https://www.smogon.com/dex/sm/formats/lc/">USM LC Banlist</a>`,
2301
- `&bullet; <a href="https://www.smogon.com/forums/threads/3639319/">USM LC Sample Teams</a>`,
2302
- `&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>`,
2303
2366
  ],
2304
- mod: 'gen7',
2367
+ mod: 'gen5',
2305
2368
  // searchShow: false,
2306
- ruleset: ['Little Cup', 'Standard', 'Swagger Clause'],
2307
- banlist: [
2308
- 'Aipom', 'Cutiefly', 'Drifloon', 'Gligar', 'Gothita', 'Meditite', 'Misdreavus', 'Murkrow', 'Porygon',
2309
- 'Scyther', 'Sneasel', 'Swirlix', 'Tangela', 'Trapinch', 'Vulpix-Base', 'Wingull', 'Yanma',
2310
- 'Eevium Z', 'Baton Pass', 'Dragon Rage', 'Sonic Boom', 'Sticky Web',
2311
- ],
2369
+ ruleset: ['[Gen 5] RU', '!Sleep Moves Clause', 'Sleep Clause Mod'],
2370
+ banlist: ['RU', 'NUBL', 'Assist', 'Copycat'],
2312
2371
  },
2313
2372
  {
2314
- name: "[Gen 5] PU",
2373
+ name: "[Gen 6] PU",
2315
2374
  threads: [
2316
- `&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>`,
2317
2377
  ],
2318
- mod: 'gen5',
2378
+ mod: 'gen6',
2319
2379
  // searchShow: false,
2320
- ruleset: ['[Gen 5] NU', 'Sleep Moves Clause'],
2321
- banlist: ['NU', 'PUBL'],
2380
+ ruleset: ['[Gen 6] NU'],
2381
+ banlist: ['NU', 'PUBL', 'Chatter'],
2322
2382
  },
2323
2383
  // Past Gens OU
2324
2384
  ///////////////////////////////////////////////////////////////////
@@ -2591,6 +2651,22 @@ exports.Formats = [
2591
2651
  ruleset: ['[Gen 7] NU'],
2592
2652
  banlist: ['NU', 'PUBL'],
2593
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
+ },
2594
2670
  {
2595
2671
  name: "[Gen 7] Monotype",
2596
2672
  desc: `All the Pok&eacute;mon on a team must share a type.`,
@@ -2855,17 +2931,6 @@ exports.Formats = [
2855
2931
  ruleset: ['[Gen 6] RU'],
2856
2932
  banlist: ['RU', 'NUBL'],
2857
2933
  },
2858
- {
2859
- name: "[Gen 6] PU",
2860
- threads: [
2861
- `&bullet; <a href="https://www.smogon.com/dex/xy/tags/pu/">ORAS PU Banlist</a>`,
2862
- `&bullet; <a href="https://www.smogon.com/forums/threads/3528743/">ORAS PU Viability Rankings</a>`,
2863
- ],
2864
- mod: 'gen6',
2865
- searchShow: false,
2866
- ruleset: ['[Gen 6] NU'],
2867
- banlist: ['NU', 'PUBL', 'Chatter'],
2868
- },
2869
2934
  {
2870
2935
  name: "[Gen 6] LC",
2871
2936
  threads: [
@@ -3074,17 +3139,6 @@ exports.Formats = [
3074
3139
  searchShow: false,
3075
3140
  ruleset: ['Standard', 'Sleep Clause Mod'],
3076
3141
  },
3077
- {
3078
- name: "[Gen 5] UU",
3079
- threads: [
3080
- `&bullet; <a href="https://www.smogon.com/forums/threads/3474024/">BW2 UU Viability Rankings</a>`,
3081
- `&bullet; <a href="https://www.smogon.com/forums/posts/6431094/">BW2 Sample Teams</a>`,
3082
- ],
3083
- mod: 'gen5',
3084
- searchShow: false,
3085
- ruleset: ['Standard', 'Evasion Abilities Clause', 'Swagger Clause', 'Sleep Clause Mod'],
3086
- banlist: ['Uber', 'OU', 'UUBL', 'Arena Trap', 'Drought', 'Sand Stream', 'Snow Warning', 'Prankster + Assist', 'Prankster + Copycat', 'Baton Pass'],
3087
- },
3088
3142
  {
3089
3143
  name: "[Gen 5] RU",
3090
3144
  threads: [
@@ -3098,15 +3152,14 @@ exports.Formats = [
3098
3152
  unbanlist: ['Prankster + Assist', 'Prankster + Copycat', 'Baton Pass'],
3099
3153
  },
3100
3154
  {
3101
- name: "[Gen 5] NU",
3155
+ name: "[Gen 5] PU",
3102
3156
  threads: [
3103
- `&bullet; <a href="https://www.smogon.com/forums/posts/6431094/">BW2 Sample Teams</a>`,
3104
- `&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>`,
3105
3158
  ],
3106
3159
  mod: 'gen5',
3107
3160
  searchShow: false,
3108
- ruleset: ['[Gen 5] RU', '!Sleep Moves Clause', 'Sleep Clause Mod'],
3109
- banlist: ['RU', 'NUBL', 'Assist', 'Copycat'],
3161
+ ruleset: ['[Gen 5] NU', 'Sleep Moves Clause'],
3162
+ banlist: ['NU', 'PUBL'],
3110
3163
  },
3111
3164
  {
3112
3165
  name: "[Gen 5] LC",
@@ -3188,7 +3241,7 @@ exports.Formats = [
3188
3241
  gameType: 'doubles',
3189
3242
  searchShow: false,
3190
3243
  ruleset: ['Flat Rules'],
3191
- banlist: ['Dark Void', 'Sky Drop', 'Soul Dew'],
3244
+ banlist: ['Chatot', 'Dark Void', 'Sky Drop', 'Soul Dew'],
3192
3245
  },
3193
3246
  {
3194
3247
  name: "[Gen 5] VGC 2012",
@@ -3242,6 +3295,18 @@ exports.Formats = [
3242
3295
  ruleset: ['Standard'],
3243
3296
  banlist: ['AG'],
3244
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
+ },
3245
3310
  {
3246
3311
  name: "[Gen 4] NU",
3247
3312
  threads: [
@@ -3345,7 +3410,7 @@ exports.Formats = [
3345
3410
  gameType: 'doubles',
3346
3411
  searchShow: false,
3347
3412
  ruleset: ['Flat Rules', '! Adjust Level Down', 'Max Level = 50', 'Max Team Size = 4'],
3348
- banlist: ['Soul Dew', 'Rotom-Heat', 'Rotom-Wash', 'Rotom-Frost', 'Rotom-Fan', 'Rotom-Mow'],
3413
+ banlist: ['Tyranitar', 'Rotom', 'Judgment', 'Soul Dew'],
3349
3414
  },
3350
3415
  {
3351
3416
  name: "[Gen 4] Doubles Custom Game",