@pkmn/sim 0.7.11 → 0.7.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 (71) hide show
  1. package/build/cjs/config/formats.js +10 -8
  2. package/build/cjs/config/formats.js.map +1 -1
  3. package/build/cjs/data/abilities.js +22 -14
  4. package/build/cjs/data/abilities.js.map +1 -1
  5. package/build/cjs/data/items.js +5 -10
  6. package/build/cjs/data/items.js.map +1 -1
  7. package/build/cjs/data/mods/gen1/moves.js +18 -60
  8. package/build/cjs/data/mods/gen1/moves.js.map +1 -1
  9. package/build/cjs/data/mods/gen4/moves.js +32 -24
  10. package/build/cjs/data/mods/gen4/moves.js.map +1 -1
  11. package/build/cjs/data/mods/gen5/formats-data.js +14 -14
  12. package/build/cjs/data/mods/gen5/formats-data.js.map +1 -1
  13. package/build/cjs/data/mods/gen8/formats-data.js +1 -1
  14. package/build/cjs/data/mods/gen8/formats-data.js.map +1 -1
  15. package/build/cjs/data/moves.js +70 -45
  16. package/build/cjs/data/moves.js.map +1 -1
  17. package/build/cjs/data/rulesets.js +1 -1
  18. package/build/cjs/data/rulesets.js.map +1 -1
  19. package/build/cjs/data/text/abilities.js +61 -47
  20. package/build/cjs/data/text/abilities.js.map +1 -1
  21. package/build/cjs/data/text/items.js +14 -6
  22. package/build/cjs/data/text/items.js.map +1 -1
  23. package/build/cjs/data/text/moves.js +178 -103
  24. package/build/cjs/data/text/moves.js.map +1 -1
  25. package/build/cjs/sim/battle-actions.js +2 -7
  26. package/build/cjs/sim/battle-actions.js.map +1 -1
  27. package/build/cjs/sim/battle-queue.js +1 -0
  28. package/build/cjs/sim/battle-queue.js.map +1 -1
  29. package/build/cjs/sim/battle.js +37 -2
  30. package/build/cjs/sim/battle.js.map +1 -1
  31. package/build/cjs/sim/pokemon.js +12 -6
  32. package/build/cjs/sim/pokemon.js.map +1 -1
  33. package/build/cjs/sim/side.js +7 -12
  34. package/build/cjs/sim/side.js.map +1 -1
  35. package/build/esm/config/formats.mjs +10 -8
  36. package/build/esm/config/formats.mjs.map +1 -1
  37. package/build/esm/data/abilities.mjs +22 -14
  38. package/build/esm/data/abilities.mjs.map +1 -1
  39. package/build/esm/data/items.mjs +5 -10
  40. package/build/esm/data/items.mjs.map +1 -1
  41. package/build/esm/data/mods/gen1/moves.mjs +18 -60
  42. package/build/esm/data/mods/gen1/moves.mjs.map +1 -1
  43. package/build/esm/data/mods/gen4/moves.mjs +32 -24
  44. package/build/esm/data/mods/gen4/moves.mjs.map +1 -1
  45. package/build/esm/data/mods/gen5/formats-data.mjs +14 -14
  46. package/build/esm/data/mods/gen5/formats-data.mjs.map +1 -1
  47. package/build/esm/data/mods/gen8/formats-data.mjs +1 -1
  48. package/build/esm/data/mods/gen8/formats-data.mjs.map +1 -1
  49. package/build/esm/data/moves.mjs +70 -45
  50. package/build/esm/data/moves.mjs.map +1 -1
  51. package/build/esm/data/rulesets.mjs +1 -1
  52. package/build/esm/data/rulesets.mjs.map +1 -1
  53. package/build/esm/data/text/abilities.mjs +61 -47
  54. package/build/esm/data/text/abilities.mjs.map +1 -1
  55. package/build/esm/data/text/items.mjs +14 -6
  56. package/build/esm/data/text/items.mjs.map +1 -1
  57. package/build/esm/data/text/moves.mjs +178 -103
  58. package/build/esm/data/text/moves.mjs.map +1 -1
  59. package/build/esm/sim/battle-actions.mjs +2 -7
  60. package/build/esm/sim/battle-actions.mjs.map +1 -1
  61. package/build/esm/sim/battle-queue.mjs +1 -0
  62. package/build/esm/sim/battle-queue.mjs.map +1 -1
  63. package/build/esm/sim/battle.mjs +37 -2
  64. package/build/esm/sim/battle.mjs.map +1 -1
  65. package/build/esm/sim/pokemon.mjs +12 -6
  66. package/build/esm/sim/pokemon.mjs.map +1 -1
  67. package/build/esm/sim/side.mjs +7 -12
  68. package/build/esm/sim/side.mjs.map +1 -1
  69. package/build/types/sim/battle-queue.d.ts +2 -2
  70. package/build/types/sim/side.d.ts +1 -1
  71. package/package.json +1 -1
@@ -2651,7 +2651,7 @@ export const Moves = {
2651
2651
  if (target.runEffectiveness(move) > 0) {
2652
2652
  // Placeholder
2653
2653
  this.debug(`collision course super effective buff`);
2654
- return this.chainModify(1.5);
2654
+ return this.chainModify([5461, 4096]);
2655
2655
  }
2656
2656
  },
2657
2657
  secondary: null,
@@ -4715,7 +4715,7 @@ export const Moves = {
4715
4715
  if (target.runEffectiveness(move) > 0) {
4716
4716
  // Placeholder
4717
4717
  this.debug(`electro drift super effective buff`);
4718
- return this.chainModify(1.5);
4718
+ return this.chainModify([5461, 4096]);
4719
4719
  }
4720
4720
  },
4721
4721
  secondary: null,
@@ -6757,6 +6757,11 @@ export const Moves = {
6757
6757
  if (pokemon.lastMove?.id === 'gigatonhammer')
6758
6758
  pokemon.disableMove('gigatonhammer');
6759
6759
  },
6760
+ onUseMoveMessage(source) {
6761
+ if (source.lastMove?.id === 'gigatonhammer') {
6762
+ this.add('-hint', "Some effects can force a Pokemon to use Gigaton Hammer again in a row.");
6763
+ }
6764
+ },
6760
6765
  secondary: null,
6761
6766
  target: "normal",
6762
6767
  type: "Steel",
@@ -6828,17 +6833,11 @@ export const Moves = {
6828
6833
  onRestart() {
6829
6834
  this.effectState.duration = 2;
6830
6835
  },
6831
- onBeforeTurn() {
6832
- this.effectState.turnPassed = true;
6833
- },
6834
6836
  onAccuracy() {
6835
- if (this.effectState.turnPassed)
6836
- return true;
6837
+ return true;
6837
6838
  },
6838
6839
  onSourceModifyDamage() {
6839
- if (this.effectState.turnPassed) {
6840
- return this.chainModify(2);
6841
- }
6840
+ return this.chainModify(2);
6842
6841
  },
6843
6842
  },
6844
6843
  secondary: null,
@@ -8000,13 +7999,18 @@ export const Moves = {
8000
7999
  duration: 5,
8001
8000
  durationCallback(source, effect) {
8002
8001
  if (source?.hasAbility('persistent')) {
8003
- this.add('-activate', source, 'ability: Persistent', effect);
8002
+ this.add('-activate', source, 'ability: Persistent', '[move] Gravity');
8004
8003
  return 7;
8005
8004
  }
8006
8005
  return 5;
8007
8006
  },
8008
- onFieldStart() {
8009
- this.add('-fieldstart', 'move: Gravity');
8007
+ onFieldStart(target, source) {
8008
+ if (source?.hasAbility('persistent')) {
8009
+ this.add('-fieldstart', 'move: Gravity', '[persistent]');
8010
+ }
8011
+ else {
8012
+ this.add('-fieldstart', 'move: Gravity');
8013
+ }
8010
8014
  for (const pokemon of this.getAllActive()) {
8011
8015
  let applies = false;
8012
8016
  if (pokemon.removeVolatile('bounce') || pokemon.removeVolatile('fly')) {
@@ -8507,7 +8511,7 @@ export const Moves = {
8507
8511
  duration: 5,
8508
8512
  durationCallback(target, source, effect) {
8509
8513
  if (source?.hasAbility('persistent')) {
8510
- this.add('-activate', source, 'ability: Persistent', effect);
8514
+ this.add('-activate', source, 'ability: Persistent', '[move] Heal Block');
8511
8515
  return 7;
8512
8516
  }
8513
8517
  return 5;
@@ -11052,13 +11056,18 @@ export const Moves = {
11052
11056
  duration: 5,
11053
11057
  durationCallback(source, effect) {
11054
11058
  if (source?.hasAbility('persistent')) {
11055
- this.add('-activate', source, 'ability: Persistent', effect);
11059
+ this.add('-activate', source, 'ability: Persistent', '[move] Magic Room');
11056
11060
  return 7;
11057
11061
  }
11058
11062
  return 5;
11059
11063
  },
11060
11064
  onFieldStart(target, source) {
11061
- this.add('-fieldstart', 'move: Magic Room', '[of] ' + source);
11065
+ if (source?.hasAbility('persistent')) {
11066
+ this.add('-fieldstart', 'move: Magic Room', '[of] ' + source, '[persistent]');
11067
+ }
11068
+ else {
11069
+ this.add('-fieldstart', 'move: Magic Room', '[of] ' + source);
11070
+ }
11062
11071
  for (const mon of this.getAllActive()) {
11063
11072
  this.singleEvent('End', mon.getItem(), mon.itemState, mon);
11064
11073
  }
@@ -15078,7 +15087,7 @@ export const Moves = {
15078
15087
  pokemon.side.removeSideCondition('auroraveil');
15079
15088
  },
15080
15089
  onModifyType(move, pokemon) {
15081
- switch (pokemon.baseSpecies.name) {
15090
+ switch (pokemon.species.name) {
15082
15091
  case 'Tauros-Paldea':
15083
15092
  move.type = 'Fighting';
15084
15093
  break;
@@ -16080,7 +16089,7 @@ export const Moves = {
16080
16089
  duration: 5,
16081
16090
  durationCallback(target, source, effect) {
16082
16091
  if (source?.hasAbility('persistent')) {
16083
- this.add('-activate', source, 'ability: Persistent', effect);
16092
+ this.add('-activate', source, 'ability: Persistent', '[move] Safeguard');
16084
16093
  return 7;
16085
16094
  }
16086
16095
  return 5;
@@ -16111,8 +16120,13 @@ export const Moves = {
16111
16120
  return null;
16112
16121
  }
16113
16122
  },
16114
- onSideStart(side) {
16115
- this.add('-sidestart', side, 'Safeguard');
16123
+ onSideStart(side, source) {
16124
+ if (source?.hasAbility('persistent')) {
16125
+ this.add('-sidestart', side, 'Safeguard', '[persistent]');
16126
+ }
16127
+ else {
16128
+ this.add('-sidestart', side, 'Safeguard');
16129
+ }
16116
16130
  },
16117
16131
  onSideResidualOrder: 26,
16118
16132
  onSideResidualSubOrder: 3,
@@ -19539,13 +19553,18 @@ export const Moves = {
19539
19553
  duration: 4,
19540
19554
  durationCallback(target, source, effect) {
19541
19555
  if (source?.hasAbility('persistent')) {
19542
- this.add('-activate', source, 'ability: Persistent', effect);
19556
+ this.add('-activate', source, 'ability: Persistent', '[move] Tailwind');
19543
19557
  return 6;
19544
19558
  }
19545
19559
  return 4;
19546
19560
  },
19547
- onSideStart(side) {
19548
- this.add('-sidestart', side, 'move: Tailwind');
19561
+ onSideStart(side, source) {
19562
+ if (source?.hasAbility('persistent')) {
19563
+ this.add('-sidestart', side, 'move: Tailwind', '[persistent]');
19564
+ }
19565
+ else {
19566
+ this.add('-sidestart', side, 'move: Tailwind');
19567
+ }
19549
19568
  },
19550
19569
  onModifySpe(spe, pokemon) {
19551
19570
  return this.chainModify(2);
@@ -20239,29 +20258,25 @@ export const Moves = {
20239
20258
  pp: 10,
20240
20259
  priority: 0,
20241
20260
  flags: {},
20242
- boosts: {
20243
- atk: 1,
20244
- spe: 1,
20245
- },
20246
- onHit(source) {
20261
+ onHit(pokemon) {
20247
20262
  let success = false;
20248
- const removeAll = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge'];
20249
- for (const sideCondition of removeAll) {
20250
- if (source.side.removeSideCondition(sideCondition)) {
20251
- this.add('-sideend', source.side, this.dex.conditions.get(sideCondition).name, '[from] move: Tidy Up', '[of] ' + source);
20252
- success = true;
20253
- }
20254
- if (source.side.foe.removeSideCondition(sideCondition)) {
20255
- this.add('-sideend', source.side.foe, this.dex.conditions.get(sideCondition).name, '[from] move: Tidy Up', '[of] ' + source);
20263
+ for (const active of this.getAllActive()) {
20264
+ if (active.removeVolatile('substitute'))
20256
20265
  success = true;
20257
- }
20258
20266
  }
20259
- for (const pokemon of this.getAllActive()) {
20260
- if (pokemon.removeVolatile('substitute'))
20261
- success = true;
20267
+ const removeAll = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge'];
20268
+ const sides = [pokemon.side, ...pokemon.side.foeSidesWithConditions()];
20269
+ for (const side of sides) {
20270
+ for (const sideCondition of removeAll) {
20271
+ if (side.removeSideCondition(sideCondition)) {
20272
+ this.add('-sideend', side, this.dex.conditions.get(sideCondition).name);
20273
+ success = true;
20274
+ }
20275
+ }
20262
20276
  }
20263
20277
  if (success)
20264
- this.add('-activate', source, 'move: Tidy Up');
20278
+ this.add('-activate', pokemon, 'move: Tidy Up');
20279
+ return !!this.boost({ atk: 1, spe: 1 }, pokemon, pokemon, null, false, true) || success;
20265
20280
  },
20266
20281
  secondary: null,
20267
20282
  target: "self",
@@ -20600,13 +20615,18 @@ export const Moves = {
20600
20615
  duration: 5,
20601
20616
  durationCallback(source, effect) {
20602
20617
  if (source?.hasAbility('persistent')) {
20603
- this.add('-activate', source, 'ability: Persistent', effect);
20618
+ this.add('-activate', source, 'ability: Persistent', '[move] Trick Room');
20604
20619
  return 7;
20605
20620
  }
20606
20621
  return 5;
20607
20622
  },
20608
20623
  onFieldStart(target, source) {
20609
- this.add('-fieldstart', 'move: Trick Room', '[of] ' + source);
20624
+ if (source?.hasAbility('persistent')) {
20625
+ this.add('-fieldstart', 'move: Trick Room', '[of] ' + source, '[persistent]');
20626
+ }
20627
+ else {
20628
+ this.add('-fieldstart', 'move: Trick Room', '[of] ' + source);
20629
+ }
20610
20630
  },
20611
20631
  onFieldRestart(target, source) {
20612
20632
  this.field.removePseudoWeather('trickroom');
@@ -21638,7 +21658,7 @@ export const Moves = {
21638
21658
  duration: 5,
21639
21659
  durationCallback(source, effect) {
21640
21660
  if (source?.hasAbility('persistent')) {
21641
- this.add('-activate', source, 'ability: Persistent', effect);
21661
+ this.add('-activate', source, 'ability: Persistent', '[move] Wonder Room');
21642
21662
  return 7;
21643
21663
  }
21644
21664
  return 5;
@@ -21654,7 +21674,12 @@ export const Moves = {
21654
21674
  this.hint(`${move.name} uses ${statAndBoosts === 'def' ? '' : 'Sp. '}Def boosts when Wonder Room is active.`);
21655
21675
  },
21656
21676
  onFieldStart(field, source) {
21657
- this.add('-fieldstart', 'move: Wonder Room', '[of] ' + source);
21677
+ if (source?.hasAbility('persistent')) {
21678
+ this.add('-fieldstart', 'move: Wonder Room', '[of] ' + source, '[persistent]');
21679
+ }
21680
+ else {
21681
+ this.add('-fieldstart', 'move: Wonder Room', '[of] ' + source);
21682
+ }
21658
21683
  },
21659
21684
  onFieldRestart(target, source) {
21660
21685
  this.field.removePseudoWeather('wonderroom');