@pkmn/sim 0.7.42 → 0.7.44

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 (79) hide show
  1. package/build/cjs/config/formats.js +57 -13
  2. package/build/cjs/config/formats.js.map +1 -1
  3. package/build/cjs/data/abilities.js +6 -8
  4. package/build/cjs/data/abilities.js.map +1 -1
  5. package/build/cjs/data/formats-data.js +12 -12
  6. package/build/cjs/data/formats-data.js.map +1 -1
  7. package/build/cjs/data/items.js +1 -1
  8. package/build/cjs/data/learnsets.js +1 -1
  9. package/build/cjs/data/learnsets.js.map +1 -1
  10. package/build/cjs/data/legality.js +19 -3
  11. package/build/cjs/data/legality.js.map +1 -1
  12. package/build/cjs/data/mods/gen1/moves.js +15 -9
  13. package/build/cjs/data/mods/gen1/moves.js.map +1 -1
  14. package/build/cjs/data/mods/gen4/rulesets.js +1 -1
  15. package/build/cjs/data/mods/gen4/rulesets.js.map +1 -1
  16. package/build/cjs/data/mods/gen5/rulesets.js +1 -1
  17. package/build/cjs/data/mods/gen5/rulesets.js.map +1 -1
  18. package/build/cjs/data/mods/gen7/formats-data.js +1 -1
  19. package/build/cjs/data/mods/gen7/formats-data.js.map +1 -1
  20. package/build/cjs/data/mods/gen7/rulesets.js +1 -1
  21. package/build/cjs/data/mods/gen7/rulesets.js.map +1 -1
  22. package/build/cjs/data/mods/gen8/abilities.js +1 -1
  23. package/build/cjs/data/mods/gen8/abilities.js.map +1 -1
  24. package/build/cjs/data/mods/gen8/formats-data.js +4 -1
  25. package/build/cjs/data/mods/gen8/formats-data.js.map +1 -1
  26. package/build/cjs/data/mods/gen8/rulesets.js +13 -0
  27. package/build/cjs/data/mods/gen8/rulesets.js.map +1 -1
  28. package/build/cjs/data/moves.js +84 -62
  29. package/build/cjs/data/moves.js.map +1 -1
  30. package/build/cjs/data/pokedex.js +18 -4
  31. package/build/cjs/data/pokedex.js.map +1 -1
  32. package/build/cjs/data/rulesets.js +1 -1
  33. package/build/cjs/data/rulesets.js.map +1 -1
  34. package/build/cjs/sim/pokemon.js +4 -1
  35. package/build/cjs/sim/pokemon.js.map +1 -1
  36. package/build/cjs/sim/team-validator.js +13 -17
  37. package/build/cjs/sim/team-validator.js.map +1 -1
  38. package/build/cjs/sim/tools/exhaustive-runner.js +2 -1
  39. package/build/cjs/sim/tools/exhaustive-runner.js.map +1 -1
  40. package/build/esm/config/formats.mjs +57 -13
  41. package/build/esm/config/formats.mjs.map +1 -1
  42. package/build/esm/data/abilities.mjs +6 -8
  43. package/build/esm/data/abilities.mjs.map +1 -1
  44. package/build/esm/data/formats-data.mjs +12 -12
  45. package/build/esm/data/formats-data.mjs.map +1 -1
  46. package/build/esm/data/items.mjs +1 -1
  47. package/build/esm/data/learnsets.mjs +1 -1
  48. package/build/esm/data/learnsets.mjs.map +1 -1
  49. package/build/esm/data/legality.mjs +19 -3
  50. package/build/esm/data/legality.mjs.map +1 -1
  51. package/build/esm/data/mods/gen1/moves.mjs +15 -9
  52. package/build/esm/data/mods/gen1/moves.mjs.map +1 -1
  53. package/build/esm/data/mods/gen4/rulesets.mjs +1 -1
  54. package/build/esm/data/mods/gen4/rulesets.mjs.map +1 -1
  55. package/build/esm/data/mods/gen5/rulesets.mjs +1 -1
  56. package/build/esm/data/mods/gen5/rulesets.mjs.map +1 -1
  57. package/build/esm/data/mods/gen7/formats-data.mjs +1 -1
  58. package/build/esm/data/mods/gen7/formats-data.mjs.map +1 -1
  59. package/build/esm/data/mods/gen7/rulesets.mjs +1 -1
  60. package/build/esm/data/mods/gen7/rulesets.mjs.map +1 -1
  61. package/build/esm/data/mods/gen8/abilities.mjs +1 -1
  62. package/build/esm/data/mods/gen8/abilities.mjs.map +1 -1
  63. package/build/esm/data/mods/gen8/formats-data.mjs +4 -1
  64. package/build/esm/data/mods/gen8/formats-data.mjs.map +1 -1
  65. package/build/esm/data/mods/gen8/rulesets.mjs +13 -0
  66. package/build/esm/data/mods/gen8/rulesets.mjs.map +1 -1
  67. package/build/esm/data/moves.mjs +84 -62
  68. package/build/esm/data/moves.mjs.map +1 -1
  69. package/build/esm/data/pokedex.mjs +18 -4
  70. package/build/esm/data/pokedex.mjs.map +1 -1
  71. package/build/esm/data/rulesets.mjs +1 -1
  72. package/build/esm/data/rulesets.mjs.map +1 -1
  73. package/build/esm/sim/pokemon.mjs +4 -1
  74. package/build/esm/sim/pokemon.mjs.map +1 -1
  75. package/build/esm/sim/team-validator.mjs +13 -17
  76. package/build/esm/sim/team-validator.mjs.map +1 -1
  77. package/build/esm/sim/tools/exhaustive-runner.mjs +2 -1
  78. package/build/esm/sim/tools/exhaustive-runner.mjs.map +1 -1
  79. package/package.json +1 -1
@@ -2210,12 +2210,19 @@ exports.Moves = {
2210
2210
  pp: 15,
2211
2211
  priority: 0,
2212
2212
  flags: { contact: 1, protect: 1, mirror: 1, slicing: 1 },
2213
- self: {
2214
- onHit(source) {
2213
+ onAfterHit(target, source, move) {
2214
+ if (!move.hasSheerForce && source.hp) {
2215
2215
  for (const side of source.side.foeSidesWithConditions()) {
2216
2216
  side.addSideCondition('spikes');
2217
2217
  }
2218
- },
2218
+ }
2219
+ },
2220
+ onAfterSubDamage(damage, target, source, move) {
2221
+ if (!move.hasSheerForce && source.hp) {
2222
+ for (const side of source.side.foeSidesWithConditions()) {
2223
+ side.addSideCondition('spikes');
2224
+ }
2225
+ }
2219
2226
  },
2220
2227
  secondary: {},
2221
2228
  target: "normal",
@@ -12660,32 +12667,36 @@ exports.Moves = {
12660
12667
  pp: 15,
12661
12668
  priority: 0,
12662
12669
  flags: { contact: 1, protect: 1, mirror: 1 },
12663
- onAfterHit(target, pokemon) {
12664
- if (pokemon.hp && pokemon.removeVolatile('leechseed')) {
12665
- this.add('-end', pokemon, 'Leech Seed', '[from] move: Mortal Spin', '[of] ' + pokemon);
12666
- }
12667
- const sideConditions = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge'];
12668
- for (const condition of sideConditions) {
12669
- if (pokemon.hp && pokemon.side.removeSideCondition(condition)) {
12670
- this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Mortal Spin', '[of] ' + pokemon);
12670
+ onAfterHit(target, pokemon, move) {
12671
+ if (!move.hasSheerForce) {
12672
+ if (pokemon.hp && pokemon.removeVolatile('leechseed')) {
12673
+ this.add('-end', pokemon, 'Leech Seed', '[from] move: Mortal Spin', '[of] ' + pokemon);
12674
+ }
12675
+ const sideConditions = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge'];
12676
+ for (const condition of sideConditions) {
12677
+ if (pokemon.hp && pokemon.side.removeSideCondition(condition)) {
12678
+ this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Mortal Spin', '[of] ' + pokemon);
12679
+ }
12680
+ }
12681
+ if (pokemon.hp && pokemon.volatiles['partiallytrapped']) {
12682
+ pokemon.removeVolatile('partiallytrapped');
12671
12683
  }
12672
- }
12673
- if (pokemon.hp && pokemon.volatiles['partiallytrapped']) {
12674
- pokemon.removeVolatile('partiallytrapped');
12675
12684
  }
12676
12685
  },
12677
- onAfterSubDamage(damage, target, pokemon) {
12678
- if (pokemon.hp && pokemon.removeVolatile('leechseed')) {
12679
- this.add('-end', pokemon, 'Leech Seed', '[from] move: Mortal Spin', '[of] ' + pokemon);
12680
- }
12681
- const sideConditions = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge'];
12682
- for (const condition of sideConditions) {
12683
- if (pokemon.hp && pokemon.side.removeSideCondition(condition)) {
12684
- this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Mortal Spin', '[of] ' + pokemon);
12686
+ onAfterSubDamage(damage, target, pokemon, move) {
12687
+ if (!move.hasSheerForce) {
12688
+ if (pokemon.hp && pokemon.removeVolatile('leechseed')) {
12689
+ this.add('-end', pokemon, 'Leech Seed', '[from] move: Mortal Spin', '[of] ' + pokemon);
12690
+ }
12691
+ const sideConditions = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge'];
12692
+ for (const condition of sideConditions) {
12693
+ if (pokemon.hp && pokemon.side.removeSideCondition(condition)) {
12694
+ this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Mortal Spin', '[of] ' + pokemon);
12695
+ }
12696
+ }
12697
+ if (pokemon.hp && pokemon.volatiles['partiallytrapped']) {
12698
+ pokemon.removeVolatile('partiallytrapped');
12685
12699
  }
12686
- }
12687
- if (pokemon.hp && pokemon.volatiles['partiallytrapped']) {
12688
- pokemon.removeVolatile('partiallytrapped');
12689
12700
  }
12690
12701
  },
12691
12702
  secondary: {
@@ -14146,23 +14157,23 @@ exports.Moves = {
14146
14157
  condition: {
14147
14158
  onStart(pokemon) {
14148
14159
  this.add('-start', pokemon, 'Power Shift');
14149
- [pokemon.storedStats.atk, pokemon.storedStats.spa,
14150
- pokemon.storedStats.def, pokemon.storedStats.spd] =
14151
- [pokemon.storedStats.def, pokemon.storedStats.spd,
14152
- pokemon.storedStats.atk, pokemon.storedStats.spa];
14160
+ const newatk = pokemon.storedStats.def;
14161
+ const newdef = pokemon.storedStats.atk;
14162
+ pokemon.storedStats.atk = newatk;
14163
+ pokemon.storedStats.def = newdef;
14153
14164
  },
14154
14165
  onCopy(pokemon) {
14155
- [pokemon.storedStats.atk, pokemon.storedStats.spa,
14156
- pokemon.storedStats.def, pokemon.storedStats.spd] =
14157
- [pokemon.storedStats.def, pokemon.storedStats.spd,
14158
- pokemon.storedStats.atk, pokemon.storedStats.spa];
14166
+ const newatk = pokemon.storedStats.def;
14167
+ const newdef = pokemon.storedStats.atk;
14168
+ pokemon.storedStats.atk = newatk;
14169
+ pokemon.storedStats.def = newdef;
14159
14170
  },
14160
14171
  onEnd(pokemon) {
14161
14172
  this.add('-end', pokemon, 'Power Shift');
14162
- [pokemon.storedStats.atk, pokemon.storedStats.spa,
14163
- pokemon.storedStats.def, pokemon.storedStats.spd] =
14164
- [pokemon.storedStats.def, pokemon.storedStats.spd,
14165
- pokemon.storedStats.atk, pokemon.storedStats.spa];
14173
+ const newatk = pokemon.storedStats.def;
14174
+ const newdef = pokemon.storedStats.atk;
14175
+ pokemon.storedStats.atk = newatk;
14176
+ pokemon.storedStats.def = newdef;
14166
14177
  },
14167
14178
  onRestart(pokemon) {
14168
14179
  pokemon.removeVolatile('Power Shift');
@@ -15157,32 +15168,36 @@ exports.Moves = {
15157
15168
  pp: 40,
15158
15169
  priority: 0,
15159
15170
  flags: { contact: 1, protect: 1, mirror: 1 },
15160
- onAfterHit(target, pokemon) {
15161
- if (pokemon.hp && pokemon.removeVolatile('leechseed')) {
15162
- this.add('-end', pokemon, 'Leech Seed', '[from] move: Rapid Spin', '[of] ' + pokemon);
15163
- }
15164
- const sideConditions = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge'];
15165
- for (const condition of sideConditions) {
15166
- if (pokemon.hp && pokemon.side.removeSideCondition(condition)) {
15167
- this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Rapid Spin', '[of] ' + pokemon);
15171
+ onAfterHit(target, pokemon, move) {
15172
+ if (!move.hasSheerForce) {
15173
+ if (pokemon.hp && pokemon.removeVolatile('leechseed')) {
15174
+ this.add('-end', pokemon, 'Leech Seed', '[from] move: Rapid Spin', '[of] ' + pokemon);
15175
+ }
15176
+ const sideConditions = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge'];
15177
+ for (const condition of sideConditions) {
15178
+ if (pokemon.hp && pokemon.side.removeSideCondition(condition)) {
15179
+ this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Rapid Spin', '[of] ' + pokemon);
15180
+ }
15181
+ }
15182
+ if (pokemon.hp && pokemon.volatiles['partiallytrapped']) {
15183
+ pokemon.removeVolatile('partiallytrapped');
15168
15184
  }
15169
- }
15170
- if (pokemon.hp && pokemon.volatiles['partiallytrapped']) {
15171
- pokemon.removeVolatile('partiallytrapped');
15172
15185
  }
15173
15186
  },
15174
- onAfterSubDamage(damage, target, pokemon) {
15175
- if (pokemon.hp && pokemon.removeVolatile('leechseed')) {
15176
- this.add('-end', pokemon, 'Leech Seed', '[from] move: Rapid Spin', '[of] ' + pokemon);
15177
- }
15178
- const sideConditions = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge'];
15179
- for (const condition of sideConditions) {
15180
- if (pokemon.hp && pokemon.side.removeSideCondition(condition)) {
15181
- this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Rapid Spin', '[of] ' + pokemon);
15187
+ onAfterSubDamage(damage, target, pokemon, move) {
15188
+ if (!move.hasSheerForce) {
15189
+ if (pokemon.hp && pokemon.removeVolatile('leechseed')) {
15190
+ this.add('-end', pokemon, 'Leech Seed', '[from] move: Rapid Spin', '[of] ' + pokemon);
15191
+ }
15192
+ const sideConditions = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge'];
15193
+ for (const condition of sideConditions) {
15194
+ if (pokemon.hp && pokemon.side.removeSideCondition(condition)) {
15195
+ this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Rapid Spin', '[of] ' + pokemon);
15196
+ }
15197
+ }
15198
+ if (pokemon.hp && pokemon.volatiles['partiallytrapped']) {
15199
+ pokemon.removeVolatile('partiallytrapped');
15182
15200
  }
15183
- }
15184
- if (pokemon.hp && pokemon.volatiles['partiallytrapped']) {
15185
- pokemon.removeVolatile('partiallytrapped');
15186
15201
  }
15187
15202
  },
15188
15203
  secondary: {
@@ -18779,12 +18794,19 @@ exports.Moves = {
18779
18794
  pp: 15,
18780
18795
  priority: 0,
18781
18796
  flags: { contact: 1, protect: 1, mirror: 1, slicing: 1 },
18782
- self: {
18783
- onHit(source) {
18797
+ onAfterHit(target, source, move) {
18798
+ if (!move.hasSheerForce && source.hp) {
18784
18799
  for (const side of source.side.foeSidesWithConditions()) {
18785
18800
  side.addSideCondition('stealthrock');
18786
18801
  }
18787
- },
18802
+ }
18803
+ },
18804
+ onAfterSubDamage(damage, target, source, move) {
18805
+ if (!move.hasSheerForce && source.hp) {
18806
+ for (const side of source.side.foeSidesWithConditions()) {
18807
+ side.addSideCondition('stealthrock');
18808
+ }
18809
+ }
18788
18810
  },
18789
18811
  secondary: {},
18790
18812
  target: "normal",