@pkmn/sim 0.5.5 → 0.5.6

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 (38) hide show
  1. package/build/config/formats.js +260 -239
  2. package/build/config/formats.js.map +1 -1
  3. package/build/data/aliases.js +4 -4
  4. package/build/data/aliases.js.map +1 -1
  5. package/build/data/formats-data.js +118 -5
  6. package/build/data/formats-data.js.map +1 -1
  7. package/build/data/mods/gen3/formats-data.js +1 -1
  8. package/build/data/mods/gen3/formats-data.js.map +1 -1
  9. package/build/data/mods/gen5/formats-data.js +1 -1
  10. package/build/data/mods/gen5/formats-data.js.map +1 -1
  11. package/build/data/mods/gen6/formats-data.js +3 -2
  12. package/build/data/mods/gen6/formats-data.js.map +1 -1
  13. package/build/data/mods/gen7/formats-data.js +2 -1
  14. package/build/data/mods/gen7/formats-data.js.map +1 -1
  15. package/build/data/pokedex.js +479 -10
  16. package/build/data/pokedex.js.map +1 -1
  17. package/build/data/rulesets.js +3 -1
  18. package/build/data/rulesets.js.map +1 -1
  19. package/build/sim/battle.js +23 -22
  20. package/build/sim/battle.js.map +1 -1
  21. package/build/sim/dex-species.js +5 -2
  22. package/build/sim/dex-species.js.map +1 -1
  23. package/build/sim/exported-global-types.d.ts +1 -0
  24. package/build/sim/global-types.d.ts +1 -0
  25. package/config/formats.ts +263 -242
  26. package/data/aliases.ts +4 -4
  27. package/data/formats-data.ts +118 -5
  28. package/data/mods/gen3/formats-data.ts +1 -1
  29. package/data/mods/gen5/formats-data.ts +1 -1
  30. package/data/mods/gen6/formats-data.ts +3 -2
  31. package/data/mods/gen7/formats-data.ts +2 -1
  32. package/data/pokedex.ts +479 -10
  33. package/data/rulesets.ts +2 -1
  34. package/package.json +2 -2
  35. package/sim/battle.ts +24 -23
  36. package/sim/dex-species.ts +5 -2
  37. package/sim/exported-global-types.ts +1 -0
  38. package/sim/global-types.ts +1 -0
@@ -264,13 +264,6 @@ exports.Formats = [
264
264
  {
265
265
  name: "[Gen 8] Battle Stadium Singles",
266
266
  mod: 'gen8',
267
- ruleset: ['Flat Rules', '!! Adjust Level = 50', 'Min Source Gen = 8', 'Limit One Restricted'],
268
- restricted: ['Restricted Legendary'],
269
- },
270
- {
271
- name: "[Gen 8] Battle Stadium Singles Series 12",
272
- mod: 'gen8',
273
- searchShow: false,
274
267
  ruleset: ['Flat Rules', '!! Adjust Level = 50', 'Min Source Gen = 8', 'Limit Two Restricted'],
275
268
  restricted: ['Restricted Legendary'],
276
269
  },
@@ -346,19 +339,7 @@ exports.Formats = [
346
339
  restricted: ['Restricted Legendary'],
347
340
  },
348
341
  {
349
- name: "[Gen 8] VGC 2021 Series 11",
350
- threads: [
351
- `&bullet; <a href="https://www.smogon.com/forums/threads/3677186/">VGC 2021 Series 11 Metagame Discussion</a>`,
352
- `&bullet; <a href="https://www.smogon.com/forums/threads/3693427/">VGC 2021 Series 11 Sample Teams</a>`,
353
- `&bullet; <a href="https://www.smogon.com/forums/threads/3693284/">VGC 2021 Series 11 Viability Rankings</a>`,
354
- ],
355
- mod: 'gen8',
356
- gameType: 'doubles',
357
- ruleset: ['Flat Rules', '!! Adjust Level = 50', 'Min Source Gen = 8', 'VGC Timer', 'Limit One Restricted'],
358
- restricted: ['Restricted Legendary'],
359
- },
360
- {
361
- name: "[Gen 8] VGC 2021 Series 9",
342
+ name: "[Gen 8] VGC 2021",
362
343
  mod: 'gen8',
363
344
  gameType: 'doubles',
364
345
  searchShow: false,
@@ -461,7 +442,7 @@ exports.Formats = [
461
442
  'Genesect', 'Gengar-Mega', 'Giratina', 'Giratina-Origin', 'Groudon', 'Ho-Oh', 'Kangaskhan-Mega', 'Kyogre', 'Kyurem-Black',
462
443
  'Kyurem-White', 'Landorus-Base', 'Lucario-Mega', 'Lugia', 'Lunala', 'Magearna', 'Marshadow', 'Metagross-Mega', 'Mewtwo',
463
444
  'Naganadel', 'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane', 'Necrozma-Ultra', 'Palkia', 'Pheromosa', 'Rayquaza', 'Reshiram',
464
- 'Salamence-Mega', 'Shaymin-Sky', 'Solgaleo', 'Spectrier', 'Tornadus-Therian', 'Urshifu-Base', 'Xerneas', 'Yveltal', 'Zacian',
445
+ 'Salamence-Mega', 'Shaymin-Sky', 'Solgaleo', 'Spectrier', 'Urshifu-Base', 'Xerneas', 'Yveltal', 'Zacian',
465
446
  'Zacian-Crowned', 'Zamazenta', 'Zamazenta-Crowned', 'Zekrom', 'Zygarde-Base', 'Zygarde-Complete', 'Arena Trap', 'Moody',
466
447
  'Power Construct', 'Sand Veil', 'Shadow Tag', 'Snow Cloak', 'Bright Powder', 'King\'s Rock', 'Lax Incense', 'Razor Fang',
467
448
  'Quick Claw', 'Baton Pass',
@@ -486,6 +467,8 @@ exports.Formats = [
486
467
  'Drizzle', 'Drought',
487
468
  // Slowbronite is banned so it doesn't validate on Galarian Slowbro
488
469
  'Slowbronite',
470
+ // NatDex suspect
471
+ 'Tornadus-Therian',
489
472
  ],
490
473
  // Used to distinguish UU from below UU in the client
491
474
  restricted: [
@@ -604,81 +587,133 @@ exports.Formats = [
604
587
  column: 2,
605
588
  },
606
589
  {
607
- name: "[Gen 8] Pokebilities",
608
- desc: `Pok&eacute;mon have all of their released abilities simultaneously.`,
590
+ name: "[Gen 8] Trademarked",
591
+ desc: `Sacrifice your Pok&eacute;mon's ability for a status move that activates on switch-in.`,
609
592
  threads: [
610
- `&bullet; <a href="https://www.smogon.com/forums/threads/3679692/">Pok&eacute;bilities</a>`,
593
+ `&bullet; <a href="https://www.smogon.com/forums/threads/3656980/">Trademarked</a>`,
611
594
  ],
612
- mod: 'pokebilities',
595
+ mod: 'gen8',
596
+ // searchShow: false,
613
597
  ruleset: ['Standard', 'Dynamax Clause'],
614
598
  banlist: [
615
- 'Calyrex-Ice', 'Calyrex-Shadow', 'Cinderace', 'Conkeldurr', 'Darmanitan-Galar', 'Dialga', 'Dracovish', 'Dracozolt',
616
- 'Eternatus', 'Excadrill', 'Genesect', 'Giratina', 'Giratina-Origin', 'Groudon', 'Ho-Oh', 'Kyogre', 'Kyurem-Black',
617
- 'Kyurem-White', 'Landorus-Base', 'Lugia', 'Lunala', 'Magearna', 'Marshadow', 'Mewtwo', 'Naganadel', 'Necrozma-Dawn-Wings',
618
- 'Necrozma-Dusk-Mane', 'Palkia', 'Pheromosa', 'Porygon-Z', 'Rayquaza', 'Reshiram', 'Solgaleo', 'Spectrier', 'Urshifu-Base',
619
- 'Xerneas', 'Yveltal', 'Zacian', 'Zacian-Crowned', 'Zamazenta-Base', 'Zekrom', 'Zygarde-Base', 'Power Construct',
620
- 'Baton Pass', 'King\'s Rock',
621
- // Moody users
622
- 'Glalie', 'Octillery', 'Remoraid', 'Snorunt',
623
- // Shadow Tag/Arena Trap
624
- 'Diglett-Base', 'Dugtrio-Base', 'Gothita', 'Gothitelle', 'Gothorita', 'Trapinch', 'Wobbuffet', 'Wynaut',
599
+ 'Calyrex-Ice', 'Calyrex-Shadow', 'Darmanitan-Galar', 'Dialga', 'Dracovish', 'Dragapult', 'Eternatus', 'Kyurem-Black', 'Kyurem-White',
600
+ 'Giratina', 'Giratina-Origin', 'Genesect', 'Groudon', 'Ho-Oh', 'Kartana', 'Kyogre', 'Lugia', 'Lunala', 'Magearna', 'Marowak-Alola',
601
+ 'Marshadow', 'Melmetal', 'Mewtwo', 'Naganadel', 'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane', 'Palkia', 'Pheromosa', 'Rayquaza',
602
+ 'Reshiram', 'Solgaleo', 'Urshifu-Base', 'Xerneas', 'Yveltal', 'Zacian', 'Zacian-Crowned', 'Zamazenta', 'Zamazenta-Crowned', 'Zekrom',
603
+ 'Zygarde-Base', 'Arena Trap', 'Moody', 'Power Construct', 'Shadow Tag', 'Baton Pass',
625
604
  ],
626
- onBegin() {
627
- for (const pokemon of this.getAllPokemon()) {
628
- if (pokemon.ability === this.toID(pokemon.species.abilities['S'])) {
629
- continue;
605
+ restricted: [
606
+ 'Baneful Bunker', 'Block', 'Copycat', 'Corrosive Gas', 'Detect', 'Destiny Bond', 'Disable', 'Encore', 'Fairy Lock', 'Hypnosis', 'Ingrain',
607
+ 'Instruct', 'Lovely Kiss', 'King\'s Shield', 'Mat Block', 'Mean Look', 'Memento', 'move:Metronome', 'Obstruct', 'Octolock', 'Nature Power',
608
+ 'Parting Shot', 'Psycho Shift', 'Protect', 'Roar', 'Sing', 'Skill Swap', 'Sleep Powder', 'Sleep Talk', 'Spiky Shield', 'Spore', 'Substitute',
609
+ 'Teleport', 'Whirlwind', 'Wish', 'Yawn',
610
+ ],
611
+ onValidateTeam(team, format, teamHas) {
612
+ const problems = [];
613
+ for (const trademark in teamHas.trademarks) {
614
+ if (teamHas.trademarks[trademark] > 1) {
615
+ problems.push(`You are limited to 1 of each Trademark.`, `(You have ${teamHas.trademarks[trademark]} Pok\u00e9mon with ${trademark} as a Trademark.)`);
630
616
  }
631
- pokemon.m.innates = Object.keys(pokemon.species.abilities)
632
- .filter(key => key !== 'S' && (key !== 'H' || !pokemon.species.unreleasedHidden))
633
- .map(key => this.toID(pokemon.species.abilities[key]))
634
- .filter(ability => ability !== pokemon.ability);
635
617
  }
618
+ return problems;
636
619
  },
637
- onSwitchInPriority: 2,
638
- onSwitchIn(pokemon) {
639
- if (pokemon.m.innates) {
640
- for (const innate of pokemon.m.innates) {
641
- pokemon.addVolatile("ability:" + innate, pokemon);
642
- }
620
+ validateSet(set, teamHas) {
621
+ const dex = this.dex;
622
+ const ability = dex.moves.get(set.ability);
623
+ if (!ability.exists) { // Not even a real move
624
+ return this.validateSet(set, teamHas);
643
625
  }
644
- },
645
- onAfterMega(pokemon) {
646
- for (const innate of Object.keys(pokemon.volatiles).filter(i => i.startsWith('ability:'))) {
647
- pokemon.removeVolatile(innate);
626
+ // Absolute trademark bans
627
+ if (ability.category !== 'Status') {
628
+ return [`${ability.name} is not a status move, and cannot be used as a trademark.`];
648
629
  }
649
- pokemon.m.innates = undefined;
630
+ if (ability.forceSwitch || ability.selfSwitch) {
631
+ return [
632
+ `Force-switching and self-switching moves are banned from being used as trademarks.`,
633
+ `(${ability.name} is a ${ability.forceSwitch ? 'force' : 'self'}-switching move.)`,
634
+ ];
635
+ }
636
+ const irrevokablyRestricted = [
637
+ 'Assist', 'Copycat', 'Metronome', 'Mirror Move', 'Sleep Talk',
638
+ 'Skill Swap', // Self-propagates indefinitely
639
+ ];
640
+ if (irrevokablyRestricted.includes(ability.name)) {
641
+ return [`${ability.name} cannot safely function as a trademark.`];
642
+ }
643
+ // Contingent trademark bans
644
+ if (this.ruleTable.isRestricted(`move:${ability.id}`)) {
645
+ return [`${ability.name} is restricted from being used as a trademark.`];
646
+ }
647
+ if (set.moves.map(this.toID).includes(ability.id)) {
648
+ return [`${set.name} may not use ${ability.name} as both a trademark and one of its moves simultaneously.`];
649
+ }
650
+ const customRules = this.format.customRules || [];
651
+ if (!customRules.includes('!obtainableabilities'))
652
+ customRules.push('!obtainableabilities');
653
+ const TeamValidator = require('../sim/team-validator').TeamValidator;
654
+ const validator = new TeamValidator(dex.formats.get(`${this.format.id}@@@${customRules.join(',')}`));
655
+ const moves = set.moves;
656
+ set.moves = [ability.id];
657
+ set.ability = dex.species.get(set.species).abilities['0'];
658
+ let problems = validator.validateSet(set, {}) || [];
659
+ if (problems.length)
660
+ return problems;
661
+ set.moves = moves;
662
+ set.ability = dex.species.get(set.species).abilities['0'];
663
+ problems = problems.concat(validator.validateSet(set, teamHas) || []);
664
+ set.ability = ability.id;
665
+ if (!teamHas.trademarks)
666
+ teamHas.trademarks = {};
667
+ teamHas.trademarks[ability.name] = (teamHas.trademarks[ability.name] || 0) + 1;
668
+ return problems.length ? problems : null;
669
+ },
670
+ pokemon: {
671
+ getAbility() {
672
+ const move = this.battle.dex.moves.get(this.battle.toID(this.ability));
673
+ if (!move.exists)
674
+ return Object.getPrototypeOf(this).getAbility.call(this);
675
+ return {
676
+ id: move.id,
677
+ name: move.name,
678
+ onStart(pokemon) {
679
+ this.add('-activate', pokemon, 'ability: ' + move.name);
680
+ this.actions.useMove(move, pokemon);
681
+ },
682
+ toString() {
683
+ return "";
684
+ },
685
+ };
686
+ },
650
687
  },
651
688
  },
652
689
  {
653
- name: "[Gen 8] Camomons",
654
- desc: `Pok&eacute;mon change type to match their first two moves.`,
690
+ name: "[Gen 8] Linked",
691
+ desc: `The first two moves in a Pok&eacute;mon's moveset are used simultaneously.`,
655
692
  threads: [
656
- `&bullet; <a href="https://www.smogon.com/forums/threads/3656413/">Camomons</a>`,
693
+ `&bullet; <a href="https://www.smogon.com/forums/threads/3660421/">Linked</a>`,
657
694
  ],
658
- mod: 'gen8',
659
- // searchShow: false,
660
- ruleset: ['Obtainable', 'Species Clause', 'Nickname Clause', 'OHKO Clause', 'Evasion Moves Clause', 'Team Preview', 'HP Percentage Mod', 'Cancel Mod', 'Dynamax Clause', 'Sleep Clause Mod', 'Endless Battle Clause'],
695
+ mod: 'linked',
696
+ ruleset: ['Standard', 'Dynamax Clause'],
661
697
  banlist: [
662
- 'Calyrex-Ice', 'Calyrex-Shadow', 'Darmanitan-Galar', 'Dialga', 'Dracovish', 'Dragonite', 'Eternatus', 'Genesect', 'Giratina', 'Giratina-Origin',
663
- 'Groudon', 'Ho-Oh', 'Hydreigon', 'Kartana', 'Kyogre', 'Kyurem', 'Kyurem-Black', 'Kyurem-White', 'Landorus-Base', 'Latias', 'Latios', 'Lugia',
664
- 'Lunala', 'Marshadow', 'Mew', 'Mewtwo', 'Naganadel', 'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane', 'Palkia', 'Pheromosa', 'Rayquaza', 'Reshiram',
665
- 'Reuniclus', 'Shedinja', 'Slowking-Galar', 'Solgaleo', 'Spectrier', 'Tornadus-Therian', 'Volcarona', 'Xerneas', 'Yveltal', 'Zacian', 'Zacian-Crowned',
666
- 'Zamazenta', 'Zamazenta-Crowned', 'Zekrom', 'Zeraora', 'Zygarde-Base', 'Arena Trap', 'Moody', 'Power Construct', 'Shadow Tag', 'Baton Pass',
698
+ 'Calyrex-Ice', 'Calyrex-Shadow', 'Cinderace', 'Darmanitan-Galar', 'Dialga', 'Dracovish', 'Eternatus', 'Genesect', 'Giratina', 'Giratina-Origin', 'Groudon', 'Ho-Oh',
699
+ 'Kyogre', 'Kyurem', 'Kyurem-Black', 'Kyurem-White', 'Landorus-Base', 'Lugia', 'Lunala', 'Magearna', 'Marshadow', 'Mewtwo', 'Naganadel', 'Necrozma-Dawn-Wings',
700
+ 'Necrozma-Dusk-Mane', 'Palkia', 'Pheromosa', 'Rayquaza', 'Reshiram', 'Solgaleo', 'Spectrier', 'Urshifu-Base', 'Xerneas', 'Yveltal', 'Zacian', 'Zacian-Crowned',
701
+ 'Zamazenta', 'Zamazenta-Crowned', 'Zekrom', 'Zygarde-Base', 'Zygarde-Complete', 'Arena Trap', 'Moody', 'Power Construct', 'Sand Veil', 'Shadow Tag', 'Snow Cloak',
702
+ 'Bright Powder', 'King\'s Rock', 'Lax Incense', 'Baton Pass',
667
703
  ],
668
- onModifySpeciesPriority: 2,
669
- onModifySpecies(species, target, source, effect) {
670
- if (!target)
671
- return; // Chat command
672
- if (effect && ['imposter', 'transform'].includes(effect.id))
673
- return;
674
- const types = [...new Set(target.baseMoveSlots.slice(0, 2).map(move => this.dex.moves.get(move.id).type))];
675
- return { ...species, types: types };
676
- },
677
- onSwitchIn(pokemon) {
678
- this.add('-start', pokemon, 'typechange', (pokemon.illusion || pokemon).getTypes(true).join('/'), '[silent]');
679
- },
680
- onAfterMega(pokemon) {
681
- this.add('-start', pokemon, 'typechange', (pokemon.illusion || pokemon).getTypes(true).join('/'), '[silent]');
704
+ restricted: [
705
+ 'Baneful Bunker', 'Bounce', 'Protect', 'Detect', 'Dig', 'Dive', 'Fly', 'King\'s Shield', 'Nature\'s Madness', 'Night Shade',
706
+ 'Obstruct', 'Phantom Force', 'Seismic Toss', 'Shadow Force', 'Sky Drop', 'Spiky Shield', 'Super Fang',
707
+ ],
708
+ onValidateSet(set) {
709
+ const problems = [];
710
+ for (const [i, moveid] of set.moves.entries()) {
711
+ const move = this.dex.moves.get(moveid);
712
+ if ([0, 1].includes(i) && this.ruleTable.isRestricted(`move:${move.id}`)) {
713
+ problems.push(`${set.name || set.species}'s move ${move.name} cannot be linked.`);
714
+ }
715
+ }
716
+ return problems;
682
717
  },
683
718
  },
684
719
  // Other Metagames
@@ -860,9 +895,9 @@ exports.Formats = [
860
895
  mod: 'gen8',
861
896
  ruleset: ['Standard', 'Dynamax Clause', 'Sleep Moves Clause'],
862
897
  banlist: [
863
- 'Blissey', 'Calyrex-Shadow', 'Chansey', 'Dragapult', 'Hawlucha', 'Marowak-Alola', 'Melmetal', 'Pikachu', 'Toxapex',
898
+ 'Blissey', 'Calyrex-Shadow', 'Chansey', 'Dragapult', 'Hawlucha', 'Mantine', 'Marowak-Alola', 'Melmetal', 'Pikachu', 'Toxapex',
864
899
  'Xerneas', 'Zacian', 'Zacian-Crowned', 'Uber > 1', 'AG ++ Uber > 1', 'Arena Trap', 'Huge Power', 'Moody', 'Pure Power',
865
- 'Shadow Tag', 'Baton Pass',
900
+ 'Shadow Tag', 'Bright Powder', 'Focus Band', 'King\'s Rock', 'Lax Incense', 'Quick Claw', 'Baton Pass',
866
901
  ],
867
902
  onValidateTeam(team) {
868
903
  const gods = new Set();
@@ -979,7 +1014,14 @@ exports.Formats = [
979
1014
  ],
980
1015
  mod: 'gen8bdsp',
981
1016
  ruleset: ['[Gen 8 BDSP] UU'],
982
- banlist: ['UU', 'RUBL'],
1017
+ banlist: ['UU', 'RUBL', 'Drought'],
1018
+ },
1019
+ {
1020
+ name: "[Gen 8 BDSP] NU",
1021
+ mod: 'gen8bdsp',
1022
+ searchShow: false,
1023
+ ruleset: ['[Gen 8 BDSP] RU'],
1024
+ banlist: ['RU', 'NUBL'],
983
1025
  },
984
1026
  {
985
1027
  name: "[Gen 8 BDSP] LC",
@@ -988,7 +1030,7 @@ exports.Formats = [
988
1030
  ],
989
1031
  mod: 'gen8bdsp',
990
1032
  ruleset: ['Little Cup', 'Standard'],
991
- banlist: ['Gligar', 'Meditite', 'Misdreavus', 'Murkrow', 'Scyther', 'Sneasel', 'Tangela', 'Vulpix', 'Yanma', 'Baton Pass'],
1033
+ banlist: ['Gligar', 'Meditite', 'Misdreavus', 'Murkrow', 'Scyther', 'Sneasel', 'Tangela', 'Vulpix', 'Yanma', 'Moody', 'Baton Pass'],
992
1034
  },
993
1035
  {
994
1036
  name: "[Gen 8 BDSP] Monotype",
@@ -1052,6 +1094,38 @@ exports.Formats = [
1052
1094
  section: "Challengeable OMs",
1053
1095
  column: 2,
1054
1096
  },
1097
+ {
1098
+ name: "[Gen 8] Camomons",
1099
+ desc: `Pok&eacute;mon change type to match their first two moves.`,
1100
+ threads: [
1101
+ `&bullet; <a href="https://www.smogon.com/forums/threads/3656413/">Camomons</a>`,
1102
+ ],
1103
+ mod: 'gen8',
1104
+ searchShow: false,
1105
+ ruleset: ['Obtainable', 'Species Clause', 'Nickname Clause', 'OHKO Clause', 'Evasion Moves Clause', 'Team Preview', 'HP Percentage Mod', 'Cancel Mod', 'Dynamax Clause', 'Sleep Clause Mod', 'Endless Battle Clause'],
1106
+ banlist: [
1107
+ 'Calyrex-Ice', 'Calyrex-Shadow', 'Darmanitan-Galar', 'Dialga', 'Dracovish', 'Dragonite', 'Eternatus', 'Genesect', 'Giratina', 'Giratina-Origin',
1108
+ 'Groudon', 'Ho-Oh', 'Hydreigon', 'Kartana', 'Kyogre', 'Kyurem', 'Kyurem-Black', 'Kyurem-White', 'Landorus-Base', 'Latias', 'Latios', 'Lugia',
1109
+ 'Lunala', 'Marshadow', 'Mew', 'Mewtwo', 'Naganadel', 'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane', 'Palkia', 'Pheromosa', 'Rayquaza', 'Reshiram',
1110
+ 'Reuniclus', 'Shedinja', 'Slowking-Galar', 'Solgaleo', 'Spectrier', 'Tornadus-Therian', 'Volcarona', 'Xerneas', 'Yveltal', 'Zacian', 'Zacian-Crowned',
1111
+ 'Zamazenta', 'Zamazenta-Crowned', 'Zekrom', 'Zeraora', 'Zygarde-Base', 'Arena Trap', 'Moody', 'Power Construct', 'Shadow Tag', 'Baton Pass',
1112
+ ],
1113
+ onModifySpeciesPriority: 2,
1114
+ onModifySpecies(species, target, source, effect) {
1115
+ if (!target)
1116
+ return; // Chat command
1117
+ if (effect && ['imposter', 'transform'].includes(effect.id))
1118
+ return;
1119
+ const types = [...new Set(target.baseMoveSlots.slice(0, 2).map(move => this.dex.moves.get(move.id).type))];
1120
+ return { ...species, types: types };
1121
+ },
1122
+ onSwitchIn(pokemon) {
1123
+ this.add('-start', pokemon, 'typechange', (pokemon.illusion || pokemon).getTypes(true).join('/'), '[silent]');
1124
+ },
1125
+ onAfterMega(pokemon) {
1126
+ this.add('-start', pokemon, 'typechange', (pokemon.illusion || pokemon).getTypes(true).join('/'), '[silent]');
1127
+ },
1128
+ },
1055
1129
  {
1056
1130
  name: "[Gen 8] Inheritance",
1057
1131
  desc: `Pok&eacute;mon may use the ability and moves of another, as long as they forfeit their own learnset.`,
@@ -1564,6 +1638,53 @@ exports.Formats = [
1564
1638
  }
1565
1639
  },
1566
1640
  },
1641
+ {
1642
+ name: "[Gen 8] Pokebilities",
1643
+ desc: `Pok&eacute;mon have all of their released abilities simultaneously.`,
1644
+ threads: [
1645
+ `&bullet; <a href="https://www.smogon.com/forums/threads/3679692/">Pok&eacute;bilities</a>`,
1646
+ ],
1647
+ mod: 'pokebilities',
1648
+ searchShow: false,
1649
+ ruleset: ['Standard', 'Dynamax Clause'],
1650
+ banlist: [
1651
+ 'Calyrex-Ice', 'Calyrex-Shadow', 'Cinderace', 'Conkeldurr', 'Darmanitan-Galar', 'Dialga', 'Dracovish', 'Dracozolt',
1652
+ 'Eternatus', 'Excadrill', 'Genesect', 'Giratina', 'Giratina-Origin', 'Groudon', 'Ho-Oh', 'Kyogre', 'Kyurem-Black',
1653
+ 'Kyurem-White', 'Landorus-Base', 'Lugia', 'Lunala', 'Magearna', 'Marshadow', 'Mewtwo', 'Naganadel', 'Necrozma-Dawn-Wings',
1654
+ 'Necrozma-Dusk-Mane', 'Palkia', 'Pheromosa', 'Porygon-Z', 'Rayquaza', 'Reshiram', 'Solgaleo', 'Spectrier', 'Urshifu-Base',
1655
+ 'Xerneas', 'Yveltal', 'Zacian', 'Zacian-Crowned', 'Zamazenta-Base', 'Zekrom', 'Zygarde-Base', 'Power Construct',
1656
+ 'Baton Pass', 'King\'s Rock',
1657
+ // Moody users
1658
+ 'Glalie', 'Octillery', 'Remoraid', 'Snorunt',
1659
+ // Shadow Tag/Arena Trap
1660
+ 'Diglett-Base', 'Dugtrio-Base', 'Gothita', 'Gothitelle', 'Gothorita', 'Trapinch', 'Wobbuffet', 'Wynaut',
1661
+ ],
1662
+ onBegin() {
1663
+ for (const pokemon of this.getAllPokemon()) {
1664
+ if (pokemon.ability === this.toID(pokemon.species.abilities['S'])) {
1665
+ continue;
1666
+ }
1667
+ pokemon.m.innates = Object.keys(pokemon.species.abilities)
1668
+ .filter(key => key !== 'S' && (key !== 'H' || !pokemon.species.unreleasedHidden))
1669
+ .map(key => this.toID(pokemon.species.abilities[key]))
1670
+ .filter(ability => ability !== pokemon.ability);
1671
+ }
1672
+ },
1673
+ onSwitchInPriority: 2,
1674
+ onSwitchIn(pokemon) {
1675
+ if (pokemon.m.innates) {
1676
+ for (const innate of pokemon.m.innates) {
1677
+ pokemon.addVolatile("ability:" + innate, pokemon);
1678
+ }
1679
+ }
1680
+ },
1681
+ onAfterMega(pokemon) {
1682
+ for (const innate of Object.keys(pokemon.volatiles).filter(i => i.startsWith('ability:'))) {
1683
+ pokemon.removeVolatile(innate);
1684
+ }
1685
+ pokemon.m.innates = undefined;
1686
+ },
1687
+ },
1567
1688
  {
1568
1689
  name: "[Gen 8] The Loser's Game",
1569
1690
  desc: `The first player to lose all of their Pok&eacute;mon wins.`,
@@ -1686,106 +1807,6 @@ exports.Formats = [
1686
1807
  },
1687
1808
  },
1688
1809
  },
1689
- {
1690
- name: "[Gen 8] Trademarked",
1691
- desc: `Sacrifice your Pok&eacute;mon's ability for a status move that activates on switch-in.`,
1692
- threads: [
1693
- `&bullet; <a href="https://www.smogon.com/forums/threads/3656980/">Trademarked</a>`,
1694
- ],
1695
- mod: 'gen8',
1696
- searchShow: false,
1697
- ruleset: ['Standard', 'Dynamax Clause'],
1698
- banlist: [
1699
- 'Calyrex-Ice', 'Calyrex-Shadow', 'Darmanitan-Galar', 'Dialga', 'Dracovish', 'Dragapult', 'Eternatus', 'Kyurem-Black', 'Kyurem-White',
1700
- 'Giratina', 'Giratina-Origin', 'Genesect', 'Groudon', 'Ho-Oh', 'Kartana', 'Kyogre', 'Lugia', 'Lunala', 'Magearna', 'Marshadow',
1701
- 'Melmetal', 'Mewtwo', 'Naganadel', 'Necrozma-Dawn-Wings', 'Necrozma-Dusk-Mane', 'Palkia', 'Pheromosa', 'Rayquaza', 'Reshiram',
1702
- 'Solgaleo', 'Urshifu-Base', 'Xerneas', 'Yveltal', 'Zacian', 'Zacian-Crowned', 'Zamazenta', 'Zamazenta-Crowned', 'Zekrom', 'Zygarde-Base',
1703
- 'Arena Trap', 'Moody', 'Power Construct', 'Shadow Tag', 'Baton Pass',
1704
- ],
1705
- restricted: [
1706
- 'Baneful Bunker', 'Block', 'Copycat', 'Corrosive Gas', 'Detect', 'Destiny Bond', 'Disable', 'Encore', 'Fairy Lock', 'Hypnosis', 'Ingrain',
1707
- 'Instruct', 'Lovely Kiss', 'King\'s Shield', 'Mat Block', 'Mean Look', 'move:Metronome', 'Obstruct', 'Octolock', 'Nature Power', 'Parting Shot',
1708
- 'Psycho Shift', 'Protect', 'Roar', 'Sing', 'Skill Swap', 'Sleep Powder', 'Sleep Talk', 'Spiky Shield', 'Spore', 'Substitute', 'Teleport',
1709
- 'Whirlwind', 'Wish', 'Yawn',
1710
- ],
1711
- onValidateTeam(team, format, teamHas) {
1712
- const problems = [];
1713
- for (const trademark in teamHas.trademarks) {
1714
- if (teamHas.trademarks[trademark] > 1) {
1715
- problems.push(`You are limited to 1 of each Trademark.`, `(You have ${teamHas.trademarks[trademark]} Pok\u00e9mon with ${trademark} as a Trademark.)`);
1716
- }
1717
- }
1718
- return problems;
1719
- },
1720
- validateSet(set, teamHas) {
1721
- const dex = this.dex;
1722
- const ability = dex.moves.get(set.ability);
1723
- if (!ability.exists) { // Not even a real move
1724
- return this.validateSet(set, teamHas);
1725
- }
1726
- // Absolute trademark bans
1727
- if (ability.category !== 'Status') {
1728
- return [`${ability.name} is not a status move, and cannot be used as a trademark.`];
1729
- }
1730
- if (ability.forceSwitch || ability.selfSwitch) {
1731
- return [
1732
- `Force-switching and self-switching moves are banned from being used as trademarks.`,
1733
- `(${ability.name} is a ${ability.forceSwitch ? 'force' : 'self'}-switching move.)`,
1734
- ];
1735
- }
1736
- const irrevokablyRestricted = [
1737
- 'Assist', 'Copycat', 'Metronome', 'Mirror Move', 'Sleep Talk',
1738
- 'Skill Swap', // Self-propagates indefinitely
1739
- ];
1740
- if (irrevokablyRestricted.includes(ability.name)) {
1741
- return [`${ability.name} cannot safely function as a trademark.`];
1742
- }
1743
- // Contingent trademark bans
1744
- if (this.ruleTable.isRestricted(`move:${ability.id}`)) {
1745
- return [`${ability.name} is restricted from being used as a trademark.`];
1746
- }
1747
- if (set.moves.map(this.toID).includes(ability.id)) {
1748
- return [`${set.name} may not use ${ability.name} as both a trademark and one of its moves simultaneously.`];
1749
- }
1750
- const customRules = this.format.customRules || [];
1751
- if (!customRules.includes('!obtainableabilities'))
1752
- customRules.push('!obtainableabilities');
1753
- const TeamValidator = require('../sim/team-validator').TeamValidator;
1754
- const validator = new TeamValidator(dex.formats.get(`${this.format.id}@@@${customRules.join(',')}`));
1755
- const moves = set.moves;
1756
- set.moves = [ability.id];
1757
- set.ability = dex.species.get(set.species).abilities['0'];
1758
- let problems = validator.validateSet(set, {}) || [];
1759
- if (problems.length)
1760
- return problems;
1761
- set.moves = moves;
1762
- set.ability = dex.species.get(set.species).abilities['0'];
1763
- problems = problems.concat(validator.validateSet(set, teamHas) || []);
1764
- set.ability = ability.id;
1765
- if (!teamHas.trademarks)
1766
- teamHas.trademarks = {};
1767
- teamHas.trademarks[ability.name] = (teamHas.trademarks[ability.name] || 0) + 1;
1768
- return problems.length ? problems : null;
1769
- },
1770
- pokemon: {
1771
- getAbility() {
1772
- const move = this.battle.dex.moves.get(this.battle.toID(this.ability));
1773
- if (!move.exists)
1774
- return Object.getPrototypeOf(this).getAbility.call(this);
1775
- return {
1776
- id: move.id,
1777
- name: move.name,
1778
- onStart(pokemon) {
1779
- this.add('-activate', pokemon, 'ability: ' + move.name);
1780
- this.actions.useMove(move, pokemon);
1781
- },
1782
- toString() {
1783
- return "";
1784
- },
1785
- };
1786
- },
1787
- },
1788
- },
1789
1810
  // Randomized Metas
1790
1811
  ///////////////////////////////////////////////////////////////////
1791
1812
  {
@@ -2061,37 +2082,36 @@ exports.Formats = [
2061
2082
  column: 3,
2062
2083
  },
2063
2084
  {
2064
- name: "[Gen 2] UU",
2065
- threads: [`&bullet; <a href="https://www.smogon.com/forums/threads/3576710/">GSC UU</a>`],
2066
- mod: 'gen2',
2085
+ name: "[Gen 3] UU",
2086
+ threads: [
2087
+ `&bullet; <a href="https://www.smogon.com/forums/threads/3585923/">ADV UU Metagame Discussion</a>`,
2088
+ `&bullet; <a href="https://www.smogon.com/forums/threads/3548578/">ADV UU Viability Rankings</a>`,
2089
+ ],
2090
+ mod: 'gen3',
2067
2091
  // searchShow: false,
2068
- ruleset: ['[Gen 2] OU'],
2069
- banlist: ['OU', 'UUBL'],
2092
+ ruleset: ['Standard', 'NFE Clause'],
2093
+ banlist: ['Uber', 'OU', 'UUBL', 'Smeargle + Ingrain', 'Baton Pass'],
2094
+ unbanlist: ['Scyther', 'Sand Veil'],
2070
2095
  },
2071
2096
  {
2072
- name: "[Gen 5] NU",
2097
+ name: "[Gen 1] NU",
2073
2098
  threads: [
2074
- `&bullet; <a href="https://www.smogon.com/forums/posts/6431094/">BW2 Sample Teams</a>`,
2075
- `&bullet; <a href="https://www.smogon.com/forums/threads/3484121/">BW2 NU Viability Rankings</a>`,
2099
+ `&bullet; <a href="https://www.smogon.com/forums/threads/3668913/">RBY NU Viability Rankings</a>`,
2076
2100
  ],
2077
- mod: 'gen5',
2101
+ mod: 'gen1',
2078
2102
  // searchShow: false,
2079
- ruleset: ['[Gen 5] RU', '!Sleep Moves Clause', 'Sleep Clause Mod'],
2080
- banlist: ['RU', 'NUBL', 'Assist', 'Copycat'],
2103
+ ruleset: ['[Gen 1] UU'],
2104
+ banlist: ['UU', 'NUBL'],
2081
2105
  },
2082
2106
  {
2083
- name: "[Gen 5] LC",
2107
+ name: "[Gen 4] Ubers",
2084
2108
  threads: [
2085
- `&bullet; <a href="https://www.smogon.com/forums/posts/6431094/">BW2 Sample Teams</a>`,
2086
- `&bullet; <a href="https://www.smogon.com/forums/threads/3485860/">BW2 LC Viability Rankings</a>`,
2109
+ `&bullet; <a href="https://www.smogon.com/forums/posts/8286279/">DPP Ubers</a>`,
2087
2110
  ],
2088
- mod: 'gen5',
2111
+ mod: 'gen4',
2089
2112
  // searchShow: false,
2090
- ruleset: ['Standard', 'Little Cup', 'Sleep Moves Clause'],
2091
- banlist: [
2092
- 'Gligar', 'Meditite', 'Misdreavus', 'Murkrow', 'Scraggy', 'Scyther', 'Sneasel', 'Tangela', 'Vulpix', 'Yanma',
2093
- 'Sand Rush', 'Sand Veil', 'Berry Juice', 'Soul Dew', 'Baton Pass', 'Dragon Rage', 'Sonic Boom', 'Swagger',
2094
- ],
2113
+ ruleset: ['Standard'],
2114
+ banlist: ['AG'],
2095
2115
  },
2096
2116
  // Past Gens OU
2097
2117
  ///////////////////////////////////////////////////////////////////
@@ -2140,7 +2160,7 @@ exports.Formats = [
2140
2160
  ],
2141
2161
  mod: 'gen4',
2142
2162
  ruleset: ['Standard'],
2143
- banlist: ['AG', 'Uber', 'Arena Trap', 'Sand Veil', 'Swinub + Snow Cloak', 'Piloswine + Snow Cloak', 'Mamoswine + Snow Cloak', 'Soul Dew', 'Baton Pass'],
2163
+ banlist: ['AG', 'Uber', 'Arena Trap', 'Sand Veil', 'Swinub + Snow Cloak', 'Piloswine + Snow Cloak', 'Mamoswine + Snow Cloak', 'Soul Dew', 'Baton Pass', 'Swagger'],
2144
2164
  },
2145
2165
  {
2146
2166
  name: "[Gen 3] OU",
@@ -2885,6 +2905,17 @@ exports.Formats = [
2885
2905
  banlist: ['UU', 'RUBL', 'Shadow Tag', 'Shell Smash + Baton Pass'],
2886
2906
  unbanlist: ['Prankster + Assist', 'Prankster + Copycat', 'Baton Pass'],
2887
2907
  },
2908
+ {
2909
+ name: "[Gen 5] NU",
2910
+ threads: [
2911
+ `&bullet; <a href="https://www.smogon.com/forums/posts/6431094/">BW2 Sample Teams</a>`,
2912
+ `&bullet; <a href="https://www.smogon.com/forums/threads/3484121/">BW2 NU Viability Rankings</a>`,
2913
+ ],
2914
+ mod: 'gen5',
2915
+ searchShow: false,
2916
+ ruleset: ['[Gen 5] RU', '!Sleep Moves Clause', 'Sleep Clause Mod'],
2917
+ banlist: ['RU', 'NUBL', 'Assist', 'Copycat'],
2918
+ },
2888
2919
  {
2889
2920
  name: "[Gen 5] PU",
2890
2921
  threads: [
@@ -2895,6 +2926,20 @@ exports.Formats = [
2895
2926
  ruleset: ['[Gen 5] NU', 'Sleep Moves Clause'],
2896
2927
  banlist: ['NU', 'PUBL'],
2897
2928
  },
2929
+ {
2930
+ name: "[Gen 5] LC",
2931
+ threads: [
2932
+ `&bullet; <a href="https://www.smogon.com/forums/posts/6431094/">BW2 Sample Teams</a>`,
2933
+ `&bullet; <a href="https://www.smogon.com/forums/threads/3485860/">BW2 LC Viability Rankings</a>`,
2934
+ ],
2935
+ mod: 'gen5',
2936
+ searchShow: false,
2937
+ ruleset: ['Standard', 'Little Cup', 'Sleep Moves Clause'],
2938
+ banlist: [
2939
+ 'Gligar', 'Meditite', 'Misdreavus', 'Murkrow', 'Scraggy', 'Scyther', 'Sneasel', 'Tangela', 'Vulpix', 'Yanma',
2940
+ 'Sand Rush', 'Sand Veil', 'Berry Juice', 'Soul Dew', 'Baton Pass', 'Dragon Rage', 'Sonic Boom', 'Swagger',
2941
+ ],
2942
+ },
2898
2943
  {
2899
2944
  name: "[Gen 5] Monotype",
2900
2945
  desc: `All the Pok&eacute;mon on a team must share a type.`,
@@ -3005,16 +3050,6 @@ exports.Formats = [
3005
3050
  section: "DPP Singles",
3006
3051
  column: 5,
3007
3052
  },
3008
- {
3009
- name: "[Gen 4] Ubers",
3010
- threads: [
3011
- `&bullet; <a href="https://www.smogon.com/forums/posts/8286279/">DPP Ubers</a>`,
3012
- ],
3013
- mod: 'gen4',
3014
- searchShow: false,
3015
- ruleset: ['Standard'],
3016
- banlist: ['AG'],
3017
- },
3018
3053
  {
3019
3054
  name: "[Gen 4] UU",
3020
3055
  threads: [
@@ -3025,7 +3060,7 @@ exports.Formats = [
3025
3060
  searchShow: false,
3026
3061
  ruleset: ['[Gen 4] OU'],
3027
3062
  banlist: ['OU', 'UUBL'],
3028
- unbanlist: ['Arena Trap'],
3063
+ unbanlist: ['Arena Trap', 'Swagger'],
3029
3064
  },
3030
3065
  {
3031
3066
  name: "[Gen 4] NU",
@@ -3082,7 +3117,7 @@ exports.Formats = [
3082
3117
  '[Gen 4] OU', 'Accuracy Moves Clause', 'Sleep Moves Clause', 'Team Preview',
3083
3118
  ],
3084
3119
  banlist: ['Latias', 'Machamp', 'Porygon-Z', 'Shaymin', 'Snorlax', 'Togekiss', 'Focus Sash', 'Destiny Bond', 'Explosion', 'Perish Song', 'Self-Destruct'],
3085
- unbanlist: ['Wobbuffet', 'Wynaut', 'Sand Veil'],
3120
+ unbanlist: ['Wobbuffet', 'Wynaut', 'Sand Veil', 'Swagger'],
3086
3121
  },
3087
3122
  {
3088
3123
  name: "[Gen 4] Anything Goes",
@@ -3113,7 +3148,7 @@ exports.Formats = [
3113
3148
  searchShow: false,
3114
3149
  ruleset: ['[Gen 4] OU'],
3115
3150
  banlist: ['Explosion'],
3116
- unbanlist: ['Garchomp', 'Latias', 'Latios', 'Manaphy', 'Mew', 'Salamence', 'Wobbuffet', 'Wynaut'],
3151
+ unbanlist: ['Garchomp', 'Latias', 'Latios', 'Manaphy', 'Mew', 'Salamence', 'Wobbuffet', 'Wynaut', 'Swagger'],
3117
3152
  },
3118
3153
  {
3119
3154
  name: "[Gen 4] VGC 2010",
@@ -3158,18 +3193,6 @@ exports.Formats = [
3158
3193
  ruleset: ['Standard', 'Deoxys Camouflage Clause', 'One Baton Pass Clause'],
3159
3194
  banlist: ['Wobbuffet + Leftovers'],
3160
3195
  },
3161
- {
3162
- name: "[Gen 3] UU",
3163
- threads: [
3164
- `&bullet; <a href="https://www.smogon.com/forums/threads/3585923/">ADV UU Metagame Discussion</a>`,
3165
- `&bullet; <a href="https://www.smogon.com/forums/threads/3548578/">ADV UU Viability Rankings</a>`,
3166
- ],
3167
- mod: 'gen3',
3168
- searchShow: false,
3169
- ruleset: ['Standard', 'NFE Clause'],
3170
- banlist: ['Uber', 'OU', 'UUBL', 'Smeargle + Ingrain', 'Baton Pass'],
3171
- unbanlist: ['Scyther', 'Sand Veil'],
3172
- },
3173
3196
  {
3174
3197
  name: "[Gen 3] NU",
3175
3198
  threads: [
@@ -3233,6 +3256,14 @@ exports.Formats = [
3233
3256
  searchShow: false,
3234
3257
  ruleset: ['Standard'],
3235
3258
  },
3259
+ {
3260
+ name: "[Gen 2] UU",
3261
+ threads: [`&bullet; <a href="https://www.smogon.com/forums/threads/3576710/">GSC UU</a>`],
3262
+ mod: 'gen2',
3263
+ searchShow: false,
3264
+ ruleset: ['[Gen 2] OU'],
3265
+ banlist: ['OU', 'UUBL'],
3266
+ },
3236
3267
  {
3237
3268
  name: "[Gen 2] NU",
3238
3269
  threads: [`&bullet; <a href="https://www.smogon.com/forums/threads/3642565/">GSC NU</a>`],
@@ -3307,16 +3338,6 @@ exports.Formats = [
3307
3338
  ruleset: ['[Gen 1] OU'],
3308
3339
  banlist: ['OU', 'UUBL'],
3309
3340
  },
3310
- {
3311
- name: "[Gen 1] NU",
3312
- threads: [
3313
- `&bullet; <a href="https://www.smogon.com/forums/threads/3668913/">RBY NU Viability Rankings</a>`,
3314
- ],
3315
- mod: 'gen1',
3316
- searchShow: false,
3317
- ruleset: ['[Gen 1] UU'],
3318
- banlist: ['UU', 'NUBL'],
3319
- },
3320
3341
  {
3321
3342
  name: "[Gen 1] Japanese OU",
3322
3343
  desc: `Generation 1 with Japanese battle mechanics.`,