@pkmn/sim 0.8.3 → 0.8.4

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 +92 -89
  2. package/build/cjs/config/formats.js.map +1 -1
  3. package/build/cjs/data/abilities.js +361 -163
  4. package/build/cjs/data/abilities.js.map +1 -1
  5. package/build/cjs/data/formats-data.js +326 -311
  6. package/build/cjs/data/formats-data.js.map +1 -1
  7. package/build/cjs/data/mods/gen3/abilities.js +6 -5
  8. package/build/cjs/data/mods/gen3/abilities.js.map +1 -1
  9. package/build/cjs/data/mods/gen4/abilities.js +8 -2
  10. package/build/cjs/data/mods/gen4/abilities.js.map +1 -1
  11. package/build/cjs/data/mods/gen4/moves.js +1 -2
  12. package/build/cjs/data/mods/gen4/moves.js.map +1 -1
  13. package/build/cjs/data/mods/gen5/abilities.js +1 -0
  14. package/build/cjs/data/mods/gen5/abilities.js.map +1 -1
  15. package/build/cjs/data/mods/gen6/abilities.js +1 -1
  16. package/build/cjs/data/mods/gen6/abilities.js.map +1 -1
  17. package/build/cjs/data/mods/gen7/abilities.js +2 -2
  18. package/build/cjs/data/mods/gen7/abilities.js.map +1 -1
  19. package/build/cjs/data/mods/gen8/abilities.js +3 -1
  20. package/build/cjs/data/mods/gen8/abilities.js.map +1 -1
  21. package/build/cjs/data/moves.js +27 -38
  22. package/build/cjs/data/moves.js.map +1 -1
  23. package/build/cjs/data/rulesets.js +10 -18
  24. package/build/cjs/data/rulesets.js.map +1 -1
  25. package/build/cjs/data/text/abilities.js +32 -11
  26. package/build/cjs/data/text/abilities.js.map +1 -1
  27. package/build/cjs/data/text/moves.js +8 -8
  28. package/build/cjs/data/text/moves.js.map +1 -1
  29. package/build/cjs/sim/battle-actions.js +2 -1
  30. package/build/cjs/sim/battle-actions.js.map +1 -1
  31. package/build/cjs/sim/battle.js +2 -2
  32. package/build/cjs/sim/battle.js.map +1 -1
  33. package/build/cjs/sim/dex-abilities.d.ts +11 -2
  34. package/build/cjs/sim/dex-abilities.js +1 -0
  35. package/build/cjs/sim/dex-abilities.js.map +1 -1
  36. package/build/cjs/sim/exported-global-types.d.ts +2 -2
  37. package/build/cjs/sim/global-types.d.ts +2 -2
  38. package/build/cjs/sim/pokemon.js +7 -4
  39. package/build/cjs/sim/pokemon.js.map +1 -1
  40. package/build/esm/config/formats.mjs +92 -89
  41. package/build/esm/config/formats.mjs.map +1 -1
  42. package/build/esm/data/abilities.mjs +361 -163
  43. package/build/esm/data/abilities.mjs.map +1 -1
  44. package/build/esm/data/formats-data.mjs +326 -311
  45. package/build/esm/data/formats-data.mjs.map +1 -1
  46. package/build/esm/data/mods/gen3/abilities.mjs +6 -5
  47. package/build/esm/data/mods/gen3/abilities.mjs.map +1 -1
  48. package/build/esm/data/mods/gen4/abilities.mjs +8 -2
  49. package/build/esm/data/mods/gen4/abilities.mjs.map +1 -1
  50. package/build/esm/data/mods/gen4/moves.mjs +1 -2
  51. package/build/esm/data/mods/gen4/moves.mjs.map +1 -1
  52. package/build/esm/data/mods/gen5/abilities.mjs +1 -0
  53. package/build/esm/data/mods/gen5/abilities.mjs.map +1 -1
  54. package/build/esm/data/mods/gen6/abilities.mjs +1 -1
  55. package/build/esm/data/mods/gen6/abilities.mjs.map +1 -1
  56. package/build/esm/data/mods/gen7/abilities.mjs +2 -2
  57. package/build/esm/data/mods/gen7/abilities.mjs.map +1 -1
  58. package/build/esm/data/mods/gen8/abilities.mjs +3 -1
  59. package/build/esm/data/mods/gen8/abilities.mjs.map +1 -1
  60. package/build/esm/data/moves.mjs +27 -38
  61. package/build/esm/data/moves.mjs.map +1 -1
  62. package/build/esm/data/rulesets.mjs +10 -18
  63. package/build/esm/data/rulesets.mjs.map +1 -1
  64. package/build/esm/data/text/abilities.mjs +32 -11
  65. package/build/esm/data/text/abilities.mjs.map +1 -1
  66. package/build/esm/data/text/moves.mjs +8 -8
  67. package/build/esm/data/text/moves.mjs.map +1 -1
  68. package/build/esm/sim/battle-actions.mjs +2 -1
  69. package/build/esm/sim/battle-actions.mjs.map +1 -1
  70. package/build/esm/sim/battle.mjs +2 -2
  71. package/build/esm/sim/battle.mjs.map +1 -1
  72. package/build/esm/sim/dex-abilities.d.mts +11 -2
  73. package/build/esm/sim/dex-abilities.mjs +1 -0
  74. package/build/esm/sim/dex-abilities.mjs.map +1 -1
  75. package/build/esm/sim/exported-global-types.d.mts +2 -2
  76. package/build/esm/sim/global-types.d.mts +2 -2
  77. package/build/esm/sim/pokemon.mjs +7 -4
  78. package/build/esm/sim/pokemon.mjs.map +1 -1
  79. package/package.json +1 -1
@@ -2972,14 +2972,14 @@ export const Moves = {
2972
2972
  priority: 0,
2973
2973
  flags: { protect: 1, mirror: 1 },
2974
2974
  onHit(target) {
2975
- if (target.getAbility().isPermanent)
2975
+ if (target.getAbility().flags['cantsuppress'])
2976
2976
  return;
2977
2977
  if (target.newlySwitched || this.queue.willMove(target))
2978
2978
  return;
2979
2979
  target.addVolatile('gastroacid');
2980
2980
  },
2981
2981
  onAfterSubDamage(damage, target) {
2982
- if (target.getAbility().isPermanent)
2982
+ if (target.getAbility().flags['cantsuppress'])
2983
2983
  return;
2984
2984
  if (target.newlySwitched || this.queue.willMove(target))
2985
2985
  return;
@@ -3975,16 +3975,18 @@ export const Moves = {
3975
3975
  flags: {},
3976
3976
  onHit(target, source, move) {
3977
3977
  let success = false;
3978
- for (const pokemon of source.alliesAndSelf()) {
3979
- if (pokemon.ability === target.ability)
3980
- continue;
3981
- const oldAbility = pokemon.setAbility(target.ability);
3982
- if (oldAbility) {
3983
- this.add('-ability', pokemon, target.getAbility().name, '[from] move: Doodle');
3984
- success = true;
3985
- }
3986
- else if (!success && oldAbility === null) {
3987
- success = null;
3978
+ if (!target.getAbility().flags['failroleplay']) {
3979
+ for (const pokemon of source.alliesAndSelf()) {
3980
+ if (pokemon.ability === target.ability || pokemon.getAbility().flags['cantsuppress'])
3981
+ continue;
3982
+ const oldAbility = pokemon.setAbility(target.ability);
3983
+ if (oldAbility) {
3984
+ this.add('-ability', pokemon, target.getAbility().name, '[from] move: Doodle');
3985
+ success = true;
3986
+ }
3987
+ else if (!success && oldAbility === null) {
3988
+ success = null;
3989
+ }
3988
3990
  }
3989
3991
  }
3990
3992
  if (!success) {
@@ -5072,13 +5074,9 @@ export const Moves = {
5072
5074
  onTryHit(target, source) {
5073
5075
  if (target === source || target.volatiles['dynamax'])
5074
5076
  return false;
5075
- const additionalBannedSourceAbilities = [
5076
- // Zen Mode included here for compatability with Gen 5-6
5077
- 'commander', 'flowergift', 'forecast', 'hungerswitch', 'illusion', 'imposter', 'neutralizinggas', 'powerofalchemy', 'receiver', 'trace', 'zenmode',
5078
- ];
5079
5077
  if (target.ability === source.ability ||
5080
- target.getAbility().isPermanent || target.ability === 'truant' ||
5081
- source.getAbility().isPermanent || additionalBannedSourceAbilities.includes(source.ability)) {
5078
+ target.getAbility().flags['cantsuppress'] || target.ability === 'truant' ||
5079
+ source.getAbility().flags['noentrain']) {
5082
5080
  return false;
5083
5081
  }
5084
5082
  },
@@ -5457,6 +5455,7 @@ export const Moves = {
5457
5455
  flags: { protect: 1, mirror: 1 },
5458
5456
  onBasePower(basePower, pokemon) {
5459
5457
  if (this.randomChance(3, 10)) {
5458
+ this.attrLastMove('[anim] Fickle Beam All Out');
5460
5459
  this.add('-activate', pokemon, 'move: Fickle Beam');
5461
5460
  return this.chainModify(2);
5462
5461
  }
@@ -5620,7 +5619,7 @@ export const Moves = {
5620
5619
  this.add('-combine');
5621
5620
  return 150;
5622
5621
  }
5623
- return 80;
5622
+ return move.basePower;
5624
5623
  },
5625
5624
  category: "Special",
5626
5625
  name: "Fire Pledge",
@@ -6721,7 +6720,7 @@ export const Moves = {
6721
6720
  flags: { protect: 1, reflectable: 1, mirror: 1, allyanim: 1 },
6722
6721
  volatileStatus: 'gastroacid',
6723
6722
  onTryHit(target) {
6724
- if (target.getAbility().isPermanent) {
6723
+ if (target.getAbility().flags['cantsuppress']) {
6725
6724
  return false;
6726
6725
  }
6727
6726
  if (target.hasItem('Ability Shield')) {
@@ -6738,7 +6737,7 @@ export const Moves = {
6738
6737
  this.singleEvent('End', pokemon.getAbility(), pokemon.abilityState, pokemon, pokemon, 'gastroacid');
6739
6738
  },
6740
6739
  onCopy(pokemon) {
6741
- if (pokemon.getAbility().isPermanent)
6740
+ if (pokemon.getAbility().flags['cantsuppress'])
6742
6741
  pokemon.removeVolatile('gastroacid');
6743
6742
  },
6744
6743
  },
@@ -7945,7 +7944,7 @@ export const Moves = {
7945
7944
  this.add('-combine');
7946
7945
  return 150;
7947
7946
  }
7948
- return 80;
7947
+ return move.basePower;
7949
7948
  },
7950
7949
  category: "Special",
7951
7950
  name: "Grass Pledge",
@@ -16112,14 +16111,8 @@ export const Moves = {
16112
16111
  onTryHit(target, source) {
16113
16112
  if (target.ability === source.ability)
16114
16113
  return false;
16115
- const additionalBannedTargetAbilities = [
16116
- // Zen Mode included here for compatability with Gen 5-6
16117
- 'commander', 'flowergift', 'forecast', 'hungerswitch', 'illusion', 'imposter', 'neutralizinggas', 'powerofalchemy', 'receiver', 'trace', 'wonderguard', 'zenmode',
16118
- ];
16119
- if (target.getAbility().isPermanent || additionalBannedTargetAbilities.includes(target.ability) ||
16120
- source.getAbility().isPermanent) {
16114
+ if (target.getAbility().flags['failroleplay'] || source.getAbility().flags['cantsuppress'])
16121
16115
  return false;
16122
- }
16123
16116
  },
16124
16117
  onHit(target, source) {
16125
16118
  const oldAbility = source.setAbility(target.ability);
@@ -17362,7 +17355,7 @@ export const Moves = {
17362
17355
  priority: 0,
17363
17356
  flags: { protect: 1, reflectable: 1, mirror: 1, allyanim: 1 },
17364
17357
  onTryHit(target) {
17365
- if (target.getAbility().isPermanent || target.ability === 'simple' || target.ability === 'truant') {
17358
+ if (target.getAbility().flags['cantsuppress'] || target.ability === 'simple' || target.ability === 'truant') {
17366
17359
  return false;
17367
17360
  }
17368
17361
  },
@@ -17481,13 +17474,9 @@ export const Moves = {
17481
17474
  priority: 0,
17482
17475
  flags: { protect: 1, mirror: 1, bypasssub: 1, allyanim: 1 },
17483
17476
  onTryHit(target, source) {
17484
- const additionalBannedAbilities = ['hungerswitch', 'illusion', 'neutralizinggas', 'wonderguard', 'terashell'];
17485
17477
  const targetAbility = target.getAbility();
17486
17478
  const sourceAbility = source.getAbility();
17487
- // TODO: research in what order these should be checked
17488
- if (target.volatiles['dynamax'] ||
17489
- targetAbility.isPermanent || sourceAbility.isPermanent ||
17490
- additionalBannedAbilities.includes(target.ability) || additionalBannedAbilities.includes(source.ability)) {
17479
+ if (sourceAbility.flags['failskillswap'] || targetAbility.flags['failskillswap'] || target.volatiles['dynamax']) {
17491
17480
  return false;
17492
17481
  }
17493
17482
  const sourceCanBeSet = this.runEvent('SetAbility', source, source, this.effect, targetAbility);
@@ -20270,7 +20259,7 @@ export const Moves = {
20270
20259
  if (pokemon.terastallized === 'Stellar') {
20271
20260
  return 100;
20272
20261
  }
20273
- return 80;
20262
+ return move.basePower;
20274
20263
  },
20275
20264
  category: "Special",
20276
20265
  name: "Tera Blast",
@@ -21666,7 +21655,7 @@ export const Moves = {
21666
21655
  this.add('-combine');
21667
21656
  return 150;
21668
21657
  }
21669
- return 80;
21658
+ return move.basePower;
21670
21659
  },
21671
21660
  category: "Special",
21672
21661
  name: "Water Pledge",
@@ -22227,7 +22216,7 @@ export const Moves = {
22227
22216
  }
22228
22217
  },
22229
22218
  onTryHit(target) {
22230
- if (target.getAbility().isPermanent) {
22219
+ if (target.getAbility().flags['cantsuppress']) {
22231
22220
  return false;
22232
22221
  }
22233
22222
  },