@pkmn/sim 0.5.16 → 0.5.19

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/config/formats.js +97 -114
  2. package/build/config/formats.js.map +1 -1
  3. package/build/data/aliases.js +2 -2
  4. package/build/data/aliases.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 +50 -11
  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 +3 -10
  12. package/build/data/mods/gen1/moves.js.map +1 -1
  13. package/build/data/mods/gen3/moves.js +0 -7
  14. package/build/data/mods/gen3/moves.js.map +1 -1
  15. package/build/data/mods/gen3/scripts.js +2 -2
  16. package/build/data/mods/gen3/scripts.js.map +1 -1
  17. package/build/data/mods/gen4/moves.js +1 -1
  18. package/build/data/mods/gen4/moves.js.map +1 -1
  19. package/build/data/mods/gen4/rulesets.js +2 -1
  20. package/build/data/mods/gen4/rulesets.js.map +1 -1
  21. package/build/data/mods/gen5/rulesets.js +2 -1
  22. package/build/data/mods/gen5/rulesets.js.map +1 -1
  23. package/build/data/mods/gen7/formats-data.js +5 -5
  24. package/build/data/mods/gen7/formats-data.js.map +1 -1
  25. package/build/data/mods/gen7/rulesets.js +2 -1
  26. package/build/data/mods/gen7/rulesets.js.map +1 -1
  27. package/build/data/moves.js +57 -78
  28. package/build/data/moves.js.map +1 -1
  29. package/build/data/pokedex.js +10 -3
  30. package/build/data/pokedex.js.map +1 -1
  31. package/build/data/rulesets.js +3 -4
  32. package/build/data/rulesets.js.map +1 -1
  33. package/build/data/text/items.js +1 -0
  34. package/build/data/text/items.js.map +1 -1
  35. package/build/data/text/moves.js +5 -3
  36. package/build/data/text/moves.js.map +1 -1
  37. package/build/sim/battle-actions.js +9 -1
  38. package/build/sim/battle-actions.js.map +1 -1
  39. package/build/sim/battle.js +39 -1
  40. package/build/sim/battle.js.map +1 -1
  41. package/build/sim/dex-conditions.d.ts +1 -0
  42. package/build/sim/dex-conditions.js.map +1 -1
  43. package/build/sim/exported-global-types.d.ts +1 -0
  44. package/build/sim/global-types.d.ts +1 -0
  45. package/build/sim/state.d.ts +1 -1
  46. package/build/sim/state.js +6 -6
  47. package/build/sim/state.js.map +1 -1
  48. package/build/sim/team-validator.js +15 -4
  49. package/build/sim/team-validator.js.map +1 -1
  50. package/build/sim/teams.d.ts +2 -2
  51. package/build/sim/tools/exhaustive-runner.d.ts +9 -0
  52. package/build/sim/tools/exhaustive-runner.js +18 -7
  53. package/build/sim/tools/exhaustive-runner.js.map +1 -1
  54. package/config/formats.ts +100 -117
  55. package/data/aliases.ts +2 -2
  56. package/data/items.ts +1 -3
  57. package/data/learnsets.ts +50 -11
  58. package/data/mods/gen1/formats-data.ts +1 -1
  59. package/data/mods/gen1/moves.ts +3 -10
  60. package/data/mods/gen3/moves.ts +0 -7
  61. package/data/mods/gen3/scripts.ts +3 -3
  62. package/data/mods/gen4/moves.ts +1 -1
  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 +5 -5
  66. package/data/mods/gen7/rulesets.ts +2 -1
  67. package/data/moves.ts +57 -69
  68. package/data/pokedex.ts +10 -3
  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 +13 -1
  74. package/sim/battle.ts +38 -1
  75. package/sim/dex-conditions.ts +1 -0
  76. package/sim/exported-global-types.ts +3 -0
  77. package/sim/global-types.ts +3 -0
  78. package/sim/team-validator.ts +16 -4
  79. 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;QAC3B,IAAI,EAAE,sBAAsB;QAC5B,IAAI,EAAE,gDAAgD;QACtD,OAAO,EAAE,CAAC,0BAA0B,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,yBAAyB,CAAC;QACpI,OAAO;YACN,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,8GAA8G,CAAC,CAAC;QAClI,CAAC;KACD;IACD,WAAW,EAAE;QACZ,OAAO,EAAE,IAAI;QACb,aAAa;YACZ,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;YACtB,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,aAAa,EAAE,EAAE;gBAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;qBACpD,OAAO,CAAC,yFAAyF,EAAE,MAAM,CAAC,CAAC;gBAC7G,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;aACvE;YACD,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;QACjC,CAAC;KACD;CACD,CAAC"}
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;QAC3B,IAAI,EAAE,sBAAsB;QAC5B,IAAI,EAAE,gDAAgD;QACtD,OAAO,EAAE,CAAC,0BAA0B,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,yBAAyB,CAAC;QACpI,OAAO;YACN,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,8GAA8G,CAAC,CAAC;QAClI,CAAC;KACD;IACD,WAAW,EAAE;QACZ,OAAO,EAAE,IAAI;QACb,aAAa;YACZ,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;YACtB,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,aAAa,EAAE,EAAE;gBAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;qBACpD,OAAO,CAAC,uEAAuE,EAAE,MAAM,CAAC;qBACxF,OAAO,CAAC,iCAAiC,EAAE,MAAM,CAAC,CAAC,CAAC,4CAA4C;gBAClG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;aACvE;YACD,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;QACjC,CAAC;KACD;CACD,CAAC"}
@@ -2731,60 +2731,55 @@ exports.Moves = {
2731
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)
@@ -6813,7 +6808,7 @@ exports.Moves = {
6813
6808
  onSideStart(side) {
6814
6809
  this.add('-sidestart', side, 'move: G-Max Steelsurge');
6815
6810
  },
6816
- onSwitchIn(pokemon) {
6811
+ onEntryHazard(pokemon) {
6817
6812
  if (pokemon.hasItem('heavydutyboots'))
6818
6813
  return;
6819
6814
  // Ice Face and Disguise correctly get typed damage from Stealth Rock
@@ -7921,9 +7916,8 @@ exports.Moves = {
7921
7916
  pp: 10,
7922
7917
  priority: 0,
7923
7918
  flags: { snatch: 1, heal: 1 },
7924
- onHit(target, source, move) {
7919
+ onTryHit(source) {
7925
7920
  if (!this.canSwitch(source.side)) {
7926
- delete move.selfdestruct;
7927
7921
  this.attrLastMove('[still]');
7928
7922
  this.add('-fail', source);
7929
7923
  return this.NOT_FAIL;
@@ -10032,9 +10026,8 @@ exports.Moves = {
10032
10026
  pp: 10,
10033
10027
  priority: 0,
10034
10028
  flags: { snatch: 1, heal: 1, dance: 1 },
10035
- onHit(target, source, move) {
10029
+ onTryHit(source) {
10036
10030
  if (!this.canSwitch(source.side)) {
10037
- delete move.selfdestruct;
10038
10031
  this.attrLastMove('[still]');
10039
10032
  this.add('-fail', source);
10040
10033
  return this.NOT_FAIL;
@@ -11208,30 +11201,20 @@ exports.Moves = {
11208
11201
  priority: 0,
11209
11202
  flags: {},
11210
11203
  noMetronome: [
11211
- "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",
11204
+ "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",
11212
11205
  ],
11213
11206
  onHit(target, source, effect) {
11214
- const moves = [];
11215
- for (const id in exports.Moves) {
11216
- const move = exports.Moves[id];
11217
- if (move.realMove)
11218
- continue;
11219
- if (move.isZ || move.isMax || move.isNonstandard)
11220
- continue;
11221
- if (effect.noMetronome.includes(move.name))
11222
- continue;
11223
- if (this.dex.moves.get(id).gen > this.gen)
11224
- continue;
11225
- moves.push(move);
11226
- }
11207
+ const moves = this.dex.moves.all().filter(move => ((![2, 4].includes(this.gen) || !source.moves.includes(move.id)) &&
11208
+ !move.realMove && !move.isZ && !move.isMax &&
11209
+ (!move.isNonstandard || move.isNonstandard === 'Unobtainable') &&
11210
+ !effect.noMetronome.includes(move.name)));
11227
11211
  let randomMove = '';
11228
11212
  if (moves.length) {
11229
11213
  moves.sort((a, b) => a.num - b.num);
11230
- randomMove = this.sample(moves).name;
11214
+ randomMove = this.sample(moves).id;
11231
11215
  }
11232
- if (!randomMove) {
11216
+ if (!randomMove)
11233
11217
  return false;
11234
- }
11235
11218
  this.actions.useMove(randomMove, target);
11236
11219
  },
11237
11220
  secondary: null,
@@ -16653,10 +16636,8 @@ exports.Moves = {
16653
16636
  this.add('-sidestart', side, 'Spikes');
16654
16637
  this.effectState.layers++;
16655
16638
  },
16656
- onSwitchIn(pokemon) {
16657
- if (!pokemon.isGrounded())
16658
- return;
16659
- if (pokemon.hasItem('heavydutyboots'))
16639
+ onEntryHazard(pokemon) {
16640
+ if (!pokemon.isGrounded() || pokemon.hasItem('heavydutyboots'))
16660
16641
  return;
16661
16642
  const damageAmounts = [0, 3, 4, 6]; // 1/8, 1/6, 1/4
16662
16643
  this.damage(damageAmounts[this.effectState.layers] * pokemon.maxhp / 24);
@@ -16948,7 +16929,7 @@ exports.Moves = {
16948
16929
  onSideStart(side) {
16949
16930
  this.add('-sidestart', side, 'move: Stealth Rock');
16950
16931
  },
16951
- onSwitchIn(pokemon) {
16932
+ onEntryHazard(pokemon) {
16952
16933
  if (pokemon.hasItem('heavydutyboots'))
16953
16934
  return;
16954
16935
  const typeMod = this.clampIntRange(pokemon.runEffectiveness(this.dex.getActiveMove('stealthrock')), -6, 6);
@@ -17073,10 +17054,8 @@ exports.Moves = {
17073
17054
  onSideStart(side) {
17074
17055
  this.add('-sidestart', side, 'move: Sticky Web');
17075
17056
  },
17076
- onSwitchIn(pokemon) {
17077
- if (!pokemon.isGrounded())
17078
- return;
17079
- if (pokemon.hasItem('heavydutyboots'))
17057
+ onEntryHazard(pokemon) {
17058
+ if (!pokemon.isGrounded() || pokemon.hasItem('heavydutyboots'))
17080
17059
  return;
17081
17060
  this.add('-activate', pokemon, 'move: Sticky Web');
17082
17061
  this.boost({ spe: -1 }, pokemon, this.effectState.source, this.dex.getActiveMove('stickyweb'));
@@ -18716,7 +18695,7 @@ exports.Moves = {
18716
18695
  this.add('-sidestart', side, 'move: Toxic Spikes');
18717
18696
  this.effectState.layers++;
18718
18697
  },
18719
- onSwitchIn(pokemon) {
18698
+ onEntryHazard(pokemon) {
18720
18699
  if (!pokemon.isGrounded())
18721
18700
  return;
18722
18701
  if (pokemon.hasType('Poison')) {