@pkmn/sim 0.5.15 → 0.5.18

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 (80) hide show
  1. package/build/config/formats.js +39 -57
  2. package/build/config/formats.js.map +1 -1
  3. package/build/data/formats-data.js +1 -1
  4. package/build/data/formats-data.js.map +1 -1
  5. package/build/data/items.js +1 -3
  6. package/build/data/items.js.map +1 -1
  7. package/build/data/learnsets.js +2 -2
  8. package/build/data/learnsets.js.map +1 -1
  9. package/build/data/mods/gen1/formats-data.js +1 -1
  10. package/build/data/mods/gen1/formats-data.js.map +1 -1
  11. package/build/data/mods/gen1/moves.js +1 -4
  12. package/build/data/mods/gen1/moves.js.map +1 -1
  13. package/build/data/mods/gen2/moves.js +0 -3
  14. package/build/data/mods/gen2/moves.js.map +1 -1
  15. package/build/data/mods/gen3/moves.js +0 -10
  16. package/build/data/mods/gen3/moves.js.map +1 -1
  17. package/build/data/mods/gen3/scripts.js +2 -2
  18. package/build/data/mods/gen3/scripts.js.map +1 -1
  19. package/build/data/mods/gen4/moves.js +4 -5
  20. package/build/data/mods/gen4/moves.js.map +1 -1
  21. package/build/data/mods/gen4/rulesets.js +2 -1
  22. package/build/data/mods/gen4/rulesets.js.map +1 -1
  23. package/build/data/mods/gen5/rulesets.js +2 -1
  24. package/build/data/mods/gen5/rulesets.js.map +1 -1
  25. package/build/data/mods/gen7/formats-data.js +4 -4
  26. package/build/data/mods/gen7/formats-data.js.map +1 -1
  27. package/build/data/mods/gen7/rulesets.js +2 -1
  28. package/build/data/mods/gen7/rulesets.js.map +1 -1
  29. package/build/data/moves.js +59 -79
  30. package/build/data/moves.js.map +1 -1
  31. package/build/data/pokedex.js +2 -2
  32. package/build/data/pokedex.js.map +1 -1
  33. package/build/data/rulesets.js +3 -4
  34. package/build/data/rulesets.js.map +1 -1
  35. package/build/data/text/items.js +1 -0
  36. package/build/data/text/items.js.map +1 -1
  37. package/build/data/text/moves.js +5 -3
  38. package/build/data/text/moves.js.map +1 -1
  39. package/build/sim/battle-actions.js +12 -4
  40. package/build/sim/battle-actions.js.map +1 -1
  41. package/build/sim/battle.js +43 -5
  42. package/build/sim/battle.js.map +1 -1
  43. package/build/sim/dex-conditions.d.ts +1 -0
  44. package/build/sim/dex-conditions.js.map +1 -1
  45. package/build/sim/dex-moves.d.ts +1 -1
  46. package/build/sim/exported-global-types.d.ts +1 -0
  47. package/build/sim/global-types.d.ts +1 -0
  48. package/build/sim/team-validator.js +15 -4
  49. package/build/sim/team-validator.js.map +1 -1
  50. package/build/sim/tools/exhaustive-runner.d.ts +9 -0
  51. package/build/sim/tools/exhaustive-runner.js +18 -7
  52. package/build/sim/tools/exhaustive-runner.js.map +1 -1
  53. package/config/formats.ts +39 -57
  54. package/data/formats-data.ts +1 -1
  55. package/data/items.ts +1 -3
  56. package/data/learnsets.ts +2 -2
  57. package/data/mods/gen1/formats-data.ts +1 -1
  58. package/data/mods/gen1/moves.ts +1 -4
  59. package/data/mods/gen2/moves.ts +0 -3
  60. package/data/mods/gen3/moves.ts +0 -10
  61. package/data/mods/gen3/scripts.ts +3 -3
  62. package/data/mods/gen4/moves.ts +3 -5
  63. package/data/mods/gen4/rulesets.ts +2 -1
  64. package/data/mods/gen5/rulesets.ts +2 -1
  65. package/data/mods/gen7/formats-data.ts +4 -4
  66. package/data/mods/gen7/rulesets.ts +2 -1
  67. package/data/moves.ts +59 -70
  68. package/data/pokedex.ts +2 -2
  69. package/data/rulesets.ts +3 -6
  70. package/data/text/items.ts +2 -0
  71. package/data/text/moves.ts +6 -3
  72. package/package.json +1 -1
  73. package/sim/battle-actions.ts +16 -5
  74. package/sim/battle.ts +42 -5
  75. package/sim/dex-conditions.ts +1 -0
  76. package/sim/dex-moves.ts +1 -1
  77. package/sim/exported-global-types.ts +3 -0
  78. package/sim/global-types.ts +3 -0
  79. package/sim/team-validator.ts +16 -4
  80. package/sim/tools/exhaustive-runner.ts +30 -11
@@ -38,7 +38,8 @@ exports.Rulesets = {
38
38
  this.add('clearpoke');
39
39
  for (const pokemon of this.getAllPokemon()) {
40
40
  const details = pokemon.details.replace(', shiny', '')
41
- .replace(/(Arceus|Gourgeist|Genesect|Pumpkaboo|Silvally|Zacian|Zamazenta|Urshifu)(-[a-zA-Z?-]+)?/g, '$1-*');
41
+ .replace(/(Arceus|Gourgeist|Pumpkaboo|Xerneas|Silvally|Urshifu)(-[a-zA-Z?-]+)?/g, '$1-*')
42
+ .replace(/(Zacian|Zamazenta)(?!-Crowned)/g, '$1-*'); // Hacked-in Crowned formes will be revealed
42
43
  this.add('poke', pokemon.side.id, details, pokemon.item ? 'item' : '');
43
44
  }
44
45
  this.makeRequest('teampreview');
@@ -1 +1 @@
1
- {"version":3,"file":"rulesets.js","sourceRoot":"","sources":["../../../../data/mods/gen7/rulesets.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAoC;IACxD,QAAQ,EAAE;QACT,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,EAAE,cAAc,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,YAAY,CAAC;KACnN;IACD,eAAe,EAAE;QAChB,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,EAAE,cAAc,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,YAAY,CAAC;KACnP;IACD,eAAe,EAAE;QAChB,OAAO,EAAE,IAAI;QACb,OAAO,EAAE;YACR,sCAAsC;YACtC,oCAAoC;YACpC,qCAAqC;YAErC,4DAA4D;YAC5D,kDAAkD;YAClD,uCAAuC;YACvC,yCAAyC;YACzC,qCAAqC;SACrC;KACD;IACD,kBAAkB,EAAE;QACnB,UAAU,EAAE,eAAe;QA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731
2731
  const offset = this.random(3) + 1;
2732
2732
  // the list of all sides in counterclockwise order
2733
2733
  const sides = [this.sides[0], this.sides[2], this.sides[1], this.sides[3]];
2734
- for (const id of sideConditions) {
2735
- const effectName = this.dex.conditions.get(id).name;
2736
- const rotatedSides = [];
2737
- let someCondition = false;
2738
- for (let i = 0; i < 4; i++) {
2739
- const sourceSide = sides[i];
2740
- const targetSide = sides[(i + offset) % 4]; // the next side in rotation
2741
- rotatedSides.push(targetSide.sideConditions[id]);
2742
- if (sourceSide.sideConditions[id]) {
2743
- this.add('-sideend', sourceSide, effectName, '[silent]');
2744
- someCondition = true;
2745
- }
2734
+ const temp = { 0: {}, 1: {}, 2: {}, 3: {} };
2735
+ for (const side of sides) {
2736
+ for (const id in side.sideConditions) {
2737
+ if (!sideConditions.includes(id))
2738
+ continue;
2739
+ temp[side.n][id] = side.sideConditions[id];
2740
+ delete side.sideConditions[id];
2741
+ const effectName = this.dex.conditions.get(id).name;
2742
+ this.add('-sideend', side, effectName, '[silent]');
2743
+ success = true;
2746
2744
  }
2747
- if (!someCondition)
2748
- continue;
2749
- [
2750
- sides[0].sideConditions[id], sides[1].sideConditions[id],
2751
- sides[2].sideConditions[id], sides[3].sideConditions[id],
2752
- ] = [...rotatedSides];
2753
- for (const side of sides) {
2754
- if (side.sideConditions[id]) {
2755
- let layers = side.sideConditions[id].layers || 1;
2756
- for (; layers > 0; layers--)
2757
- this.add('-sidestart', side, effectName, '[silent]');
2758
- }
2759
- else {
2760
- delete side.sideConditions[id];
2761
- }
2745
+ }
2746
+ for (let i = 0; i < 4; i++) {
2747
+ const sourceSideConditions = temp[sides[i].n];
2748
+ const targetSide = sides[(i + offset) % 4]; // the next side in rotation
2749
+ for (const id in sourceSideConditions) {
2750
+ targetSide.sideConditions[id] = sourceSideConditions[id];
2751
+ const effectName = this.dex.conditions.get(id).name;
2752
+ let layers = sourceSideConditions[id].layers || 1;
2753
+ for (; layers > 0; layers--)
2754
+ this.add('-sidestart', targetSide, effectName, '[silent]');
2762
2755
  }
2763
- success = true;
2764
2756
  }
2765
2757
  }
2766
2758
  else {
2767
- const sourceSide = source.side;
2768
- const targetSide = source.side.foe;
2769
- for (const id of sideConditions) {
2770
- if (sourceSide.sideConditions[id] && targetSide.sideConditions[id]) {
2771
- [sourceSide.sideConditions[id], targetSide.sideConditions[id]] = [
2772
- targetSide.sideConditions[id], sourceSide.sideConditions[id],
2773
- ];
2774
- }
2775
- else if (sourceSide.sideConditions[id] && !targetSide.sideConditions[id]) {
2776
- targetSide.sideConditions[id] = sourceSide.sideConditions[id];
2777
- delete sourceSide.sideConditions[id];
2778
- }
2779
- else if (targetSide.sideConditions[id] && !sourceSide.sideConditions[id]) {
2780
- sourceSide.sideConditions[id] = targetSide.sideConditions[id];
2781
- delete targetSide.sideConditions[id];
2782
- }
2783
- else {
2759
+ const sourceSideConditions = source.side.sideConditions;
2760
+ const targetSideConditions = source.side.foe.sideConditions;
2761
+ const sourceTemp = {};
2762
+ const targetTemp = {};
2763
+ for (const id in sourceSideConditions) {
2764
+ if (!sideConditions.includes(id))
2784
2765
  continue;
2785
- }
2766
+ sourceTemp[id] = sourceSideConditions[id];
2767
+ delete sourceSideConditions[id];
2786
2768
  success = true;
2787
2769
  }
2770
+ for (const id in targetSideConditions) {
2771
+ if (!sideConditions.includes(id))
2772
+ continue;
2773
+ targetTemp[id] = targetSideConditions[id];
2774
+ delete targetSideConditions[id];
2775
+ success = true;
2776
+ }
2777
+ for (const id in sourceTemp) {
2778
+ targetSideConditions[id] = sourceTemp[id];
2779
+ }
2780
+ for (const id in targetTemp) {
2781
+ sourceSideConditions[id] = targetTemp[id];
2782
+ }
2788
2783
  this.add('-swapsideconditions');
2789
2784
  }
2790
2785
  if (!success)
@@ -4865,7 +4860,6 @@ exports.Moves = {
4865
4860
  pp: 5,
4866
4861
  priority: 0,
4867
4862
  flags: { protect: 1 },
4868
- selfdestruct: "ifHit",
4869
4863
  secondary: null,
4870
4864
  target: "normal",
4871
4865
  type: "Fighting",
@@ -6814,7 +6808,7 @@ exports.Moves = {
6814
6808
  onSideStart(side) {
6815
6809
  this.add('-sidestart', side, 'move: G-Max Steelsurge');
6816
6810
  },
6817
- onSwitchIn(pokemon) {
6811
+ onEntryHazard(pokemon) {
6818
6812
  if (pokemon.hasItem('heavydutyboots'))
6819
6813
  return;
6820
6814
  // Ice Face and Disguise correctly get typed damage from Stealth Rock
@@ -7923,10 +7917,10 @@ exports.Moves = {
7923
7917
  priority: 0,
7924
7918
  flags: { snatch: 1, heal: 1 },
7925
7919
  onHit(target, source, move) {
7926
- if (!this.canSwitch(target.side)) {
7920
+ if (!this.canSwitch(source.side)) {
7927
7921
  delete move.selfdestruct;
7928
7922
  this.attrLastMove('[still]');
7929
- this.add('-fail', target);
7923
+ this.add('-fail', source);
7930
7924
  return this.NOT_FAIL;
7931
7925
  }
7932
7926
  },
@@ -10034,10 +10028,10 @@ exports.Moves = {
10034
10028
  priority: 0,
10035
10029
  flags: { snatch: 1, heal: 1, dance: 1 },
10036
10030
  onHit(target, source, move) {
10037
- if (!this.canSwitch(target.side)) {
10031
+ if (!this.canSwitch(source.side)) {
10038
10032
  delete move.selfdestruct;
10039
10033
  this.attrLastMove('[still]');
10040
- this.add('-fail', target);
10034
+ this.add('-fail', source);
10041
10035
  return this.NOT_FAIL;
10042
10036
  }
10043
10037
  },
@@ -11209,30 +11203,20 @@ exports.Moves = {
11209
11203
  priority: 0,
11210
11204
  flags: {},
11211
11205
  noMetronome: [
11212
- "After You", "Apple Acid", "Assist", "Astral Barrage", "Aura Wheel", "Baneful Bunker", "Beak Blast", "Behemoth Bash", "Behemoth Blade", "Belch", "Bestow", "Body Press", "Branch Poke", "Breaking Swipe", "Celebrate", "Chatter", "Clangorous Soul", "Copycat", "Counter", "Covet", "Crafty Shield", "Decorate", "Destiny Bond", "Detect", "Diamond Storm", "Double Iron Bash", "Dragon Ascent", "Dragon Energy", "Drum Beating", "Dynamax Cannon", "Endure", "Eternabeam", "False Surrender", "Feint", "Fiery Wrath", "Fleur Cannon", "Focus Punch", "Follow Me", "Freeze Shock", "Freezing Glare", "Glacial Lance", "Grav Apple", "Helping Hand", "Hold Hands", "Hyperspace Fury", "Hyperspace Hole", "Ice Burn", "Instruct", "Jungle Healing", "King's Shield", "Life Dew", "Light of Ruin", "Mat Block", "Me First", "Meteor Assault", "Metronome", "Mimic", "Mind Blown", "Mirror Coat", "Mirror Move", "Moongeist Beam", "Nature Power", "Nature's Madness", "Obstruct", "Origin Pulse", "Overdrive", "Photon Geyser", "Plasma Fists", "Precipice Blades", "Protect", "Pyro Ball", "Quash", "Quick Guard", "Rage Powder", "Relic Song", "Secret Sword", "Shell Trap", "Sketch", "Sleep Talk", "Snap Trap", "Snarl", "Snatch", "Snore", "Spectral Thief", "Spiky Shield", "Spirit Break", "Spotlight", "Steam Eruption", "Steel Beam", "Strange Steam", "Struggle", "Sunsteel Strike", "Surging Strikes", "Switcheroo", "Techno Blast", "Thief", "Thousand Arrows", "Thousand Waves", "Thunder Cage", "Thunderous Kick", "Transform", "Trick", "V-create", "Wicked Blow", "Wide Guard",
11206
+ "After You", "Apple Acid", "Assist", "Astral Barrage", "Aura Wheel", "Baneful Bunker", "Beak Blast", "Behemoth Bash", "Behemoth Blade", "Belch", "Bestow", "Body Press", "Branch Poke", "Breaking Swipe", "Celebrate", "Chatter", "Clangorous Soul", "Copycat", "Counter", "Covet", "Crafty Shield", "Decorate", "Destiny Bond", "Detect", "Diamond Storm", "Double Iron Bash", "Dragon Ascent", "Dragon Energy", "Dragon Hammer", "Drum Beating", "Dynamax Cannon", "Endure", "Eternabeam", "False Surrender", "Feint", "Fiery Wrath", "Fleur Cannon", "Focus Punch", "Follow Me", "Freeze Shock", "Freezing Glare", "Glacial Lance", "Grav Apple", "Helping Hand", "Hold Hands", "Hyperspace Fury", "Hyperspace Hole", "Ice Burn", "Instruct", "Jungle Healing", "King's Shield", "Life Dew", "Light of Ruin", "Mat Block", "Me First", "Meteor Assault", "Metronome", "Mimic", "Mind Blown", "Mirror Coat", "Mirror Move", "Moongeist Beam", "Nature Power", "Nature's Madness", "Obstruct", "Origin Pulse", "Overdrive", "Photon Geyser", "Plasma Fists", "Precipice Blades", "Protect", "Pyro Ball", "Quash", "Quick Guard", "Rage Powder", "Relic Song", "Secret Sword", "Shell Trap", "Sketch", "Sleep Talk", "Snap Trap", "Snarl", "Snatch", "Snore", "Spectral Thief", "Spiky Shield", "Spirit Break", "Spotlight", "Steam Eruption", "Steel Beam", "Strange Steam", "Struggle", "Sunsteel Strike", "Surging Strikes", "Switcheroo", "Techno Blast", "Thief", "Thousand Arrows", "Thousand Waves", "Thunder Cage", "Thunderous Kick", "Transform", "Trick", "V-create", "Wicked Blow", "Wide Guard",
11213
11207
  ],
11214
11208
  onHit(target, source, effect) {
11215
- const moves = [];
11216
- for (const id in exports.Moves) {
11217
- const move = exports.Moves[id];
11218
- if (move.realMove)
11219
- continue;
11220
- if (move.isZ || move.isMax || move.isNonstandard)
11221
- continue;
11222
- if (effect.noMetronome.includes(move.name))
11223
- continue;
11224
- if (this.dex.moves.get(id).gen > this.gen)
11225
- continue;
11226
- moves.push(move);
11227
- }
11209
+ const moves = this.dex.moves.all().filter(move => ((![2, 4].includes(this.gen) || !source.moves.includes(move.id)) &&
11210
+ !move.realMove && !move.isZ && !move.isMax &&
11211
+ (!move.isNonstandard || move.isNonstandard === 'Unobtainable') &&
11212
+ !effect.noMetronome.includes(move.name)));
11228
11213
  let randomMove = '';
11229
11214
  if (moves.length) {
11230
11215
  moves.sort((a, b) => a.num - b.num);
11231
- randomMove = this.sample(moves).name;
11216
+ randomMove = this.sample(moves).id;
11232
11217
  }
11233
- if (!randomMove) {
11218
+ if (!randomMove)
11234
11219
  return false;
11235
- }
11236
11220
  this.actions.useMove(randomMove, target);
11237
11221
  },
11238
11222
  secondary: null,
@@ -16654,10 +16638,8 @@ exports.Moves = {
16654
16638
  this.add('-sidestart', side, 'Spikes');
16655
16639
  this.effectState.layers++;
16656
16640
  },
16657
- onSwitchIn(pokemon) {
16658
- if (!pokemon.isGrounded())
16659
- return;
16660
- if (pokemon.hasItem('heavydutyboots'))
16641
+ onEntryHazard(pokemon) {
16642
+ if (!pokemon.isGrounded() || pokemon.hasItem('heavydutyboots'))
16661
16643
  return;
16662
16644
  const damageAmounts = [0, 3, 4, 6]; // 1/8, 1/6, 1/4
16663
16645
  this.damage(damageAmounts[this.effectState.layers] * pokemon.maxhp / 24);
@@ -16949,7 +16931,7 @@ exports.Moves = {
16949
16931
  onSideStart(side) {
16950
16932
  this.add('-sidestart', side, 'move: Stealth Rock');
16951
16933
  },
16952
- onSwitchIn(pokemon) {
16934
+ onEntryHazard(pokemon) {
16953
16935
  if (pokemon.hasItem('heavydutyboots'))
16954
16936
  return;
16955
16937
  const typeMod = this.clampIntRange(pokemon.runEffectiveness(this.dex.getActiveMove('stealthrock')), -6, 6);
@@ -17074,10 +17056,8 @@ exports.Moves = {
17074
17056
  onSideStart(side) {
17075
17057
  this.add('-sidestart', side, 'move: Sticky Web');
17076
17058
  },
17077
- onSwitchIn(pokemon) {
17078
- if (!pokemon.isGrounded())
17079
- return;
17080
- if (pokemon.hasItem('heavydutyboots'))
17059
+ onEntryHazard(pokemon) {
17060
+ if (!pokemon.isGrounded() || pokemon.hasItem('heavydutyboots'))
17081
17061
  return;
17082
17062
  this.add('-activate', pokemon, 'move: Sticky Web');
17083
17063
  this.boost({ spe: -1 }, pokemon, this.effectState.source, this.dex.getActiveMove('stickyweb'));
@@ -18717,7 +18697,7 @@ exports.Moves = {
18717
18697
  this.add('-sidestart', side, 'move: Toxic Spikes');
18718
18698
  this.effectState.layers++;
18719
18699
  },
18720
- onSwitchIn(pokemon) {
18700
+ onEntryHazard(pokemon) {
18721
18701
  if (!pokemon.isGrounded())
18722
18702
  return;
18723
18703
  if (pokemon.hasType('Poison')) {