@pkmn/sim 0.7.17 → 0.7.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 (94) hide show
  1. package/build/cjs/data/abilities.js +21 -21
  2. package/build/cjs/data/abilities.js.map +1 -1
  3. package/build/cjs/data/aliases.js +3 -0
  4. package/build/cjs/data/aliases.js.map +1 -1
  5. package/build/cjs/data/formats-data.js +3 -3
  6. package/build/cjs/data/formats-data.js.map +1 -1
  7. package/build/cjs/data/items.js +6 -8
  8. package/build/cjs/data/items.js.map +1 -1
  9. package/build/cjs/data/learnsets.js +3 -3
  10. package/build/cjs/data/learnsets.js.map +1 -1
  11. package/build/cjs/data/mods/gen1/moves.js +1 -1
  12. package/build/cjs/data/mods/gen1/moves.js.map +1 -1
  13. package/build/cjs/data/mods/gen1/scripts.js +1 -1
  14. package/build/cjs/data/mods/gen1/scripts.js.map +1 -1
  15. package/build/cjs/data/mods/gen2/moves.js +1 -1
  16. package/build/cjs/data/mods/gen2/moves.js.map +1 -1
  17. package/build/cjs/data/mods/gen4/moves.js +1 -1
  18. package/build/cjs/data/mods/gen4/moves.js.map +1 -1
  19. package/build/cjs/data/mods/gen7/abilities.js +4 -4
  20. package/build/cjs/data/mods/gen7/abilities.js.map +1 -1
  21. package/build/cjs/data/moves.js +4 -4
  22. package/build/cjs/data/moves.js.map +1 -1
  23. package/build/cjs/data/pokedex.js +11 -11
  24. package/build/cjs/data/pokedex.js.map +1 -1
  25. package/build/cjs/sim/battle.js +4 -2
  26. package/build/cjs/sim/battle.js.map +1 -1
  27. package/build/cjs/sim/dex-conditions.js.map +1 -1
  28. package/build/cjs/sim/dex.js +0 -1
  29. package/build/cjs/sim/dex.js.map +1 -1
  30. package/build/cjs/sim/pokemon.js +12 -8
  31. package/build/cjs/sim/pokemon.js.map +1 -1
  32. package/build/esm/data/abilities.mjs +21 -21
  33. package/build/esm/data/abilities.mjs.map +1 -1
  34. package/build/esm/data/aliases.mjs +3 -0
  35. package/build/esm/data/aliases.mjs.map +1 -1
  36. package/build/esm/data/formats-data.mjs +3 -3
  37. package/build/esm/data/formats-data.mjs.map +1 -1
  38. package/build/esm/data/index.mjs +11 -11
  39. package/build/esm/data/items.mjs +6 -8
  40. package/build/esm/data/items.mjs.map +1 -1
  41. package/build/esm/data/learnsets.mjs +3 -3
  42. package/build/esm/data/learnsets.mjs.map +1 -1
  43. package/build/esm/data/mods/gen1/index.mjs +7 -7
  44. package/build/esm/data/mods/gen1/moves.mjs +1 -1
  45. package/build/esm/data/mods/gen1/moves.mjs.map +1 -1
  46. package/build/esm/data/mods/gen1/scripts.mjs +1 -1
  47. package/build/esm/data/mods/gen1/scripts.mjs.map +1 -1
  48. package/build/esm/data/mods/gen2/index.mjs +8 -8
  49. package/build/esm/data/mods/gen2/moves.mjs +1 -1
  50. package/build/esm/data/mods/gen2/moves.mjs.map +1 -1
  51. package/build/esm/data/mods/gen3/index.mjs +7 -7
  52. package/build/esm/data/mods/gen4/index.mjs +8 -8
  53. package/build/esm/data/mods/gen4/moves.mjs +1 -1
  54. package/build/esm/data/mods/gen4/moves.mjs.map +1 -1
  55. package/build/esm/data/mods/gen5/index.mjs +9 -9
  56. package/build/esm/data/mods/gen6/index.mjs +8 -8
  57. package/build/esm/data/mods/gen7/abilities.mjs +4 -4
  58. package/build/esm/data/mods/gen7/abilities.mjs.map +1 -1
  59. package/build/esm/data/mods/gen7/index.mjs +7 -7
  60. package/build/esm/data/mods/gen8/index.mjs +7 -7
  61. package/build/esm/data/moves.mjs +4 -4
  62. package/build/esm/data/moves.mjs.map +1 -1
  63. package/build/esm/data/pokedex.mjs +11 -11
  64. package/build/esm/data/pokedex.mjs.map +1 -1
  65. package/build/esm/lib/index.mjs +2 -2
  66. package/build/esm/sim/battle-actions.mjs +1 -1
  67. package/build/esm/sim/battle-stream.mjs +3 -3
  68. package/build/esm/sim/battle.mjs +14 -12
  69. package/build/esm/sim/battle.mjs.map +1 -1
  70. package/build/esm/sim/dex-abilities.mjs +1 -1
  71. package/build/esm/sim/dex-conditions.mjs +1 -1
  72. package/build/esm/sim/dex-conditions.mjs.map +1 -1
  73. package/build/esm/sim/dex-data.mjs +1 -1
  74. package/build/esm/sim/dex-formats.mjs +4 -4
  75. package/build/esm/sim/dex-items.mjs +1 -1
  76. package/build/esm/sim/dex-moves.mjs +2 -2
  77. package/build/esm/sim/dex-species.mjs +1 -1
  78. package/build/esm/sim/dex.mjs +30 -31
  79. package/build/esm/sim/dex.mjs.map +1 -1
  80. package/build/esm/sim/field.mjs +2 -2
  81. package/build/esm/sim/index.mjs +13 -13
  82. package/build/esm/sim/pokemon.mjs +14 -10
  83. package/build/esm/sim/pokemon.mjs.map +1 -1
  84. package/build/esm/sim/side.mjs +4 -4
  85. package/build/esm/sim/state.mjs +6 -6
  86. package/build/esm/sim/team-validator.mjs +5 -5
  87. package/build/esm/sim/teams.mjs +1 -1
  88. package/build/esm/sim/tools/exhaustive-runner.mjs +4 -4
  89. package/build/esm/sim/tools/index.mjs +2 -2
  90. package/build/esm/sim/tools/random-player-ai.mjs +2 -2
  91. package/build/esm/sim/tools/runner.mjs +6 -6
  92. package/build/types/sim/dex-conditions.d.ts +7 -6
  93. package/build/types/sim/pokemon.d.ts +1 -0
  94. package/package.json +1 -1
@@ -431,7 +431,7 @@ exports.Abilities = {
431
431
  num: 201,
432
432
  },
433
433
  bigpecks: {
434
- onBoost(boost, target, source, effect) {
434
+ onTryBoost(boost, target, source, effect) {
435
435
  if (source && target === source)
436
436
  return;
437
437
  if (boost.def && boost.def < 0) {
@@ -506,7 +506,7 @@ exports.Abilities = {
506
506
  num: 34,
507
507
  },
508
508
  clearbody: {
509
- onBoost(boost, target, source, effect) {
509
+ onTryBoost(boost, target, source, effect) {
510
510
  if (source && target === source)
511
511
  return;
512
512
  let showMsg = false;
@@ -652,7 +652,7 @@ exports.Abilities = {
652
652
  num: 14,
653
653
  },
654
654
  contrary: {
655
- onBoost(boost, target, source, effect) {
655
+ onChangeBoost(boost, target, source, effect) {
656
656
  if (effect && effect.id === 'zpower')
657
657
  return;
658
658
  let i;
@@ -1306,7 +1306,7 @@ exports.Abilities = {
1306
1306
  num: 122,
1307
1307
  },
1308
1308
  flowerveil: {
1309
- onAllyBoost(boost, target, source, effect) {
1309
+ onAllyTryBoost(boost, target, source, effect) {
1310
1310
  if ((source && target === source) || !target.hasType('Grass'))
1311
1311
  return;
1312
1312
  let showMsg = false;
@@ -1455,7 +1455,7 @@ exports.Abilities = {
1455
1455
  num: 119,
1456
1456
  },
1457
1457
  fullmetalbody: {
1458
- onBoost(boost, target, source, effect) {
1458
+ onTryBoost(boost, target, source, effect) {
1459
1459
  if (source && target === source)
1460
1460
  return;
1461
1461
  let showMsg = false;
@@ -1630,8 +1630,8 @@ exports.Abilities = {
1630
1630
  this.add('-activate', pokemon, 'ability: Guard Dog');
1631
1631
  return null;
1632
1632
  },
1633
- onBoost(boost, target, source, effect) {
1634
- if (effect.name === 'Intimidate') {
1633
+ onTryBoost(boost, target, source, effect) {
1634
+ if (effect.name === 'Intimidate' && boost.atk) {
1635
1635
  delete boost.atk;
1636
1636
  this.boost({ atk: 1 }, target, target, null, false, true);
1637
1637
  }
@@ -1819,7 +1819,7 @@ exports.Abilities = {
1819
1819
  num: 93,
1820
1820
  },
1821
1821
  hypercutter: {
1822
- onBoost(boost, target, source, effect) {
1822
+ onTryBoost(boost, target, source, effect) {
1823
1823
  if (source && target === source)
1824
1824
  return;
1825
1825
  if (boost.atk && boost.atk < 0) {
@@ -2028,8 +2028,8 @@ exports.Abilities = {
2028
2028
  if (status.id === 'flinch')
2029
2029
  return null;
2030
2030
  },
2031
- onBoost(boost, target, source, effect) {
2032
- if (effect.name === 'Intimidate') {
2031
+ onTryBoost(boost, target, source, effect) {
2032
+ if (effect.name === 'Intimidate' && boost.atk) {
2033
2033
  delete boost.atk;
2034
2034
  this.add('-fail', target, 'unboost', 'Attack', '[from] ability: Inner Focus', '[of] ' + target);
2035
2035
  }
@@ -2125,7 +2125,7 @@ exports.Abilities = {
2125
2125
  num: 154,
2126
2126
  },
2127
2127
  keeneye: {
2128
- onBoost(boost, target, source, effect) {
2128
+ onTryBoost(boost, target, source, effect) {
2129
2129
  if (source && target === source)
2130
2130
  return;
2131
2131
  if (boost.accuracy && boost.accuracy < 0) {
@@ -2488,7 +2488,7 @@ exports.Abilities = {
2488
2488
  num: 58,
2489
2489
  },
2490
2490
  mirrorarmor: {
2491
- onBoost(boost, target, source, effect) {
2491
+ onTryBoost(boost, target, source, effect) {
2492
2492
  // Don't bounce self stat changes, or boosts that have already bounced
2493
2493
  if (target === source || !boost || effect.name === 'Mirror Armor')
2494
2494
  return;
@@ -2853,8 +2853,8 @@ exports.Abilities = {
2853
2853
  return null;
2854
2854
  }
2855
2855
  },
2856
- onBoost(boost, target, source, effect) {
2857
- if (effect.name === 'Intimidate') {
2856
+ onTryBoost(boost, target, source, effect) {
2857
+ if (effect.name === 'Intimidate' && boost.atk) {
2858
2858
  delete boost.atk;
2859
2859
  this.add('-fail', target, 'unboost', 'Attack', '[from] ability: Oblivious', '[of] ' + target);
2860
2860
  }
@@ -2961,8 +2961,8 @@ exports.Abilities = {
2961
2961
  this.add('-immune', target, 'confusion', '[from] ability: Own Tempo');
2962
2962
  }
2963
2963
  },
2964
- onBoost(boost, target, source, effect) {
2965
- if (effect.name === 'Intimidate') {
2964
+ onTryBoost(boost, target, source, effect) {
2965
+ if (effect.name === 'Intimidate' && boost.atk) {
2966
2966
  delete boost.atk;
2967
2967
  this.add('-fail', target, 'unboost', 'Attack', '[from] ability: Own Tempo', '[of] ' + target);
2968
2968
  }
@@ -3668,7 +3668,7 @@ exports.Abilities = {
3668
3668
  if (effect.isBerry)
3669
3669
  return this.chainModify(2);
3670
3670
  },
3671
- onBoost(boost, target, source, effect) {
3671
+ onChangeBoost(boost, target, source, effect) {
3672
3672
  if (effect && effect.isBerry) {
3673
3673
  let b;
3674
3674
  for (b in boost) {
@@ -3906,8 +3906,8 @@ exports.Abilities = {
3906
3906
  move.ignoreImmunity['Normal'] = true;
3907
3907
  }
3908
3908
  },
3909
- onBoost(boost, target, source, effect) {
3910
- if (effect.name === 'Intimidate') {
3909
+ onTryBoost(boost, target, source, effect) {
3910
+ if (effect.name === 'Intimidate' && boost.atk) {
3911
3911
  delete boost.atk;
3912
3912
  this.add('-fail', target, 'unboost', 'Attack', '[from] ability: Scrappy', '[of] ' + target);
3913
3913
  }
@@ -4106,7 +4106,7 @@ exports.Abilities = {
4106
4106
  num: 197,
4107
4107
  },
4108
4108
  simple: {
4109
- onBoost(boost, target, source, effect) {
4109
+ onChangeBoost(boost, target, source, effect) {
4110
4110
  if (effect && effect.id === 'zpower')
4111
4111
  return;
4112
4112
  let i;
@@ -5211,7 +5211,7 @@ exports.Abilities = {
5211
5211
  num: 273,
5212
5212
  },
5213
5213
  whitesmoke: {
5214
- onBoost(boost, target, source, effect) {
5214
+ onTryBoost(boost, target, source, effect) {
5215
5215
  if (source && target === source)
5216
5216
  return;
5217
5217
  let showMsg = false;