@pkmn/sim 0.5.26 → 0.5.28

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 (56) hide show
  1. package/build/config/formats.js +205 -169
  2. package/build/config/formats.js.map +1 -1
  3. package/build/data/abilities.js +2 -4
  4. package/build/data/abilities.js.map +1 -1
  5. package/build/data/aliases.js +2 -2
  6. package/build/data/aliases.js.map +1 -1
  7. package/build/data/conditions.js +1 -1
  8. package/build/data/conditions.js.map +1 -1
  9. package/build/data/formats-data.js +24 -25
  10. package/build/data/formats-data.js.map +1 -1
  11. package/build/data/items.js +5 -5
  12. package/build/data/items.js.map +1 -1
  13. package/build/data/learnsets.js +30 -28
  14. package/build/data/learnsets.js.map +1 -1
  15. package/build/data/mods/gen2/moves.js +10 -5
  16. package/build/data/mods/gen2/moves.js.map +1 -1
  17. package/build/data/mods/gen3/formats-data.js +2 -2
  18. package/build/data/mods/gen3/formats-data.js.map +1 -1
  19. package/build/data/mods/gen3/moves.js +9 -0
  20. package/build/data/mods/gen3/moves.js.map +1 -1
  21. package/build/data/mods/gen5/formats-data.js +69 -69
  22. package/build/data/mods/gen5/formats-data.js.map +1 -1
  23. package/build/data/pokedex.js +13 -13
  24. package/build/data/pokedex.js.map +1 -1
  25. package/build/data/text/abilities.js +321 -139
  26. package/build/data/text/abilities.js.map +1 -1
  27. package/build/data/text/items.js +5 -5
  28. package/build/data/text/moves.js +8 -2
  29. package/build/data/text/moves.js.map +1 -1
  30. package/build/sim/battle-actions.js.map +1 -1
  31. package/build/sim/battle.js +2 -2
  32. package/build/sim/battle.js.map +1 -1
  33. package/build/sim/pokemon.js +1 -1
  34. package/build/sim/pokemon.js.map +1 -1
  35. package/build/sim/team-validator.js +21 -16
  36. package/build/sim/team-validator.js.map +1 -1
  37. package/config/formats.ts +206 -167
  38. package/data/abilities.ts +2 -4
  39. package/data/aliases.ts +2 -2
  40. package/data/conditions.ts +1 -1
  41. package/data/formats-data.ts +24 -25
  42. package/data/items.ts +5 -5
  43. package/data/learnsets.ts +30 -28
  44. package/data/mods/gen2/moves.ts +10 -5
  45. package/data/mods/gen3/formats-data.ts +2 -2
  46. package/data/mods/gen3/moves.ts +9 -0
  47. package/data/mods/gen5/formats-data.ts +69 -69
  48. package/data/pokedex.ts +13 -13
  49. package/data/text/abilities.ts +321 -139
  50. package/data/text/items.ts +5 -5
  51. package/data/text/moves.ts +8 -2
  52. package/package.json +1 -1
  53. package/sim/battle-actions.ts +1 -0
  54. package/sim/battle.ts +2 -2
  55. package/sim/pokemon.ts +1 -1
  56. package/sim/team-validator.ts +22 -18
@@ -29,7 +29,7 @@ export const ItemsText: {[k: string]: ItemText} = {
29
29
  },
30
30
  aguavberry: {
31
31
  name: "Aguav Berry",
32
- desc: "Restores 33% max HP at 1/4 max HP or less; confuses if -SpD Nature. Single use.",
32
+ desc: "Restores 1/3 max HP at 1/4 max HP or less; confuses if -SpD Nature. Single use.",
33
33
  gen7: {
34
34
  desc: "Restores 1/2 max HP at 1/4 max HP or less; confuses if -SpD Nature. Single use.",
35
35
  },
@@ -510,7 +510,7 @@ export const ItemsText: {[k: string]: ItemText} = {
510
510
  },
511
511
  figyberry: {
512
512
  name: "Figy Berry",
513
- desc: "Restores 33% max HP at 1/4 max HP or less; confuses if -Atk Nature. Single use.",
513
+ desc: "Restores 1/3 max HP at 1/4 max HP or less; confuses if -Atk Nature. Single use.",
514
514
  gen7: {
515
515
  desc: "Restores 1/2 max HP at 1/4 max HP or less; confuses if -Atk Nature. Single use.",
516
516
  },
@@ -768,7 +768,7 @@ export const ItemsText: {[k: string]: ItemText} = {
768
768
  },
769
769
  iapapaberry: {
770
770
  name: "Iapapa Berry",
771
- desc: "Restores 33% max HP at 1/4 max HP or less; confuses if -Def Nature. Single use.",
771
+ desc: "Restores 1/3 max HP at 1/4 max HP or less; confuses if -Def Nature. Single use.",
772
772
  gen7: {
773
773
  desc: "Restores 1/2 max HP at 1/4 max HP or less; confuses if -Def Nature. Single use.",
774
774
  },
@@ -1009,7 +1009,7 @@ export const ItemsText: {[k: string]: ItemText} = {
1009
1009
  },
1010
1010
  magoberry: {
1011
1011
  name: "Mago Berry",
1012
- desc: "Restores 33% max HP at 1/4 max HP or less; confuses if -Spe Nature. Single use.",
1012
+ desc: "Restores 1/3 max HP at 1/4 max HP or less; confuses if -Spe Nature. Single use.",
1013
1013
  gen7: {
1014
1014
  desc: "Restores 1/2 max HP at 1/4 max HP or less; confuses if -Spe Nature. Single use.",
1015
1015
  },
@@ -2250,7 +2250,7 @@ export const ItemsText: {[k: string]: ItemText} = {
2250
2250
  },
2251
2251
  wikiberry: {
2252
2252
  name: "Wiki Berry",
2253
- desc: "Restores 33% max HP at 1/4 max HP or less; confuses if -SpA Nature. Single use.",
2253
+ desc: "Restores 1/3 max HP at 1/4 max HP or less; confuses if -SpA Nature. Single use.",
2254
2254
  gen7: {
2255
2255
  desc: "Restores 1/2 max HP at 1/4 max HP or less; confuses if -SpA Nature. Single use.",
2256
2256
  },
@@ -2934,8 +2934,11 @@ export const MovesText: {[k: string]: MoveText} = {
2934
2934
  },
2935
2935
  iceball: {
2936
2936
  name: "Ice Ball",
2937
- desc: "If this move is successful, the user is locked into this move and cannot make another move until it misses, 5 turns have passed, or the attack cannot be used. Power doubles with each successful hit of this move and doubles again if Defense Curl was used previously by the user. If this move is called by Sleep Talk, the move is used for one turn. If this move hits an active Disguise during the effect, the power multiplier is paused but the turn counter is not, potentially allowing the multiplier to be used on the user's next move after this effect ends.",
2937
+ desc: "If this move is successful, the user is locked into this move and cannot make another move until it misses, 5 turns have passed, or the attack cannot be used. Power doubles with each successful hit of this move and doubles again if Defense Curl was used previously by the user. If this move is called by Sleep Talk, the move is used for one turn.",
2938
2938
  shortDesc: "Power doubles with each hit. Repeats for 5 turns.",
2939
+ gen7: {
2940
+ desc: "If this move is successful, the user is locked into this move and cannot make another move until it misses, 5 turns have passed, or the attack cannot be used. Power doubles with each successful hit of this move and doubles again if Defense Curl was used previously by the user. If this move is called by Sleep Talk, the move is used for one turn. If this move hits an active Disguise during the effect, the power multiplier is paused but the turn counter is not, potentially allowing the multiplier to be used on the user's next move after this effect ends.",
2941
+ },
2939
2942
  gen6: {
2940
2943
  desc: "If this move is successful, the user is locked into this move and cannot make another move until it misses, 5 turns have passed, or the attack cannot be used. Power doubles with each successful hit of this move and doubles again if Defense Curl was used previously by the user. If this move is called by Sleep Talk, the move is used for one turn.",
2941
2944
  },
@@ -4909,8 +4912,11 @@ export const MovesText: {[k: string]: MoveText} = {
4909
4912
  },
4910
4913
  rollout: {
4911
4914
  name: "Rollout",
4912
- desc: "If this move is successful, the user is locked into this move and cannot make another move until it misses, 5 turns have passed, or the attack cannot be used. Power doubles with each successful hit of this move and doubles again if Defense Curl was used previously by the user. If this move is called by Sleep Talk, the move is used for one turn. If this move hits an active Disguise during the effect, the power multiplier is paused but the turn counter is not, potentially allowing the multiplier to be used on the user's next move after this effect ends.",
4915
+ desc: "If this move is successful, the user is locked into this move and cannot make another move until it misses, 5 turns have passed, or the attack cannot be used. Power doubles with each successful hit of this move and doubles again if Defense Curl was used previously by the user. If this move is called by Sleep Talk, the move is used for one turn.",
4913
4916
  shortDesc: "Power doubles with each hit. Repeats for 5 turns.",
4917
+ gen7: {
4918
+ desc: "If this move is successful, the user is locked into this move and cannot make another move until it misses, 5 turns have passed, or the attack cannot be used. Power doubles with each successful hit of this move and doubles again if Defense Curl was used previously by the user. If this move is called by Sleep Talk, the move is used for one turn. If this move hits an active Disguise during the effect, the power multiplier is paused but the turn counter is not, potentially allowing the multiplier to be used on the user's next move after this effect ends.",
4919
+ },
4914
4920
  gen6: {
4915
4921
  desc: "If this move is successful, the user is locked into this move and cannot make another move until it misses, 5 turns have passed, or the attack cannot be used. Power doubles with each successful hit of this move and doubles again if Defense Curl was used previously by the user. If this move is called by Sleep Talk, the move is used for one turn.",
4916
4922
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pkmn/sim",
3
- "version": "0.5.26",
3
+ "version": "0.5.28",
4
4
  "description": "An automatically generated extraction of just the simulator portion of Pokémon Showdown",
5
5
  "homepage": "https://psim.us",
6
6
  "main": "build/sim/index.js",
@@ -306,6 +306,7 @@ export class BattleActions {
306
306
  this.battle.add('-zpower', pokemon);
307
307
  pokemon.side.zMoveUsed = true;
308
308
  }
309
+
309
310
  const moveDidSomething = this.useMove(baseMove, pokemon, target, sourceEffect, zMove, maxMove);
310
311
  this.battle.lastSuccessfulMoveThisTurn = moveDidSomething ? this.battle.activeMove && this.battle.activeMove.id : null;
311
312
  if (this.battle.activeMove) move = this.battle.activeMove;
package/sim/battle.ts CHANGED
@@ -1829,8 +1829,8 @@ export class Battle {
1829
1829
  break;
1830
1830
  }
1831
1831
  this.runEvent('AfterEachBoost', target, source, effect, currentBoost);
1832
- } else if (effect && effect.effectType === 'Ability') {
1833
- if (isSecondary) this.add(msg, target, boostName, boostBy);
1832
+ } else if (effect?.effectType === 'Ability') {
1833
+ if (isSecondary || isSelf) this.add(msg, target, boostName, boostBy);
1834
1834
  } else if (!isSecondary && !isSelf) {
1835
1835
  this.add(msg, target, boostName, boostBy);
1836
1836
  }
package/sim/pokemon.ts CHANGED
@@ -1153,7 +1153,7 @@ export class Pokemon {
1153
1153
 
1154
1154
  transformInto(pokemon: Pokemon, effect?: Effect) {
1155
1155
  const species = pokemon.species;
1156
- if (pokemon.fainted || pokemon.illusion || (pokemon.volatiles['substitute'] && this.battle.gen >= 5) ||
1156
+ if (pokemon.fainted || this.illusion || pokemon.illusion || (pokemon.volatiles['substitute'] && this.battle.gen >= 5) ||
1157
1157
  (pokemon.transformed && this.battle.gen >= 2) || (this.transformed && this.battle.gen >= 5) ||
1158
1158
  species.name === 'Eternatus-Eternamax') {
1159
1159
  return false;
@@ -745,24 +745,25 @@ export class TeamValidator {
745
745
  }
746
746
  }
747
747
 
748
- if (ruleTable.has('obtainablemoves') && species.id === 'keldeo' && set.moves.includes('secretsword') &&
749
- this.minSourceGen > 5 && dex.gen <= 7) {
750
- problems.push(`${name} has Secret Sword, which is only compatible with Keldeo-Ordinary obtained from Gen 5.`);
751
- }
752
- const requiresGen3Source = setSources.maxSourceGen() <= 3;
753
- if (requiresGen3Source && dex.abilities.get(set.ability).gen === 4 && !species.prevo && dex.gen <= 5) {
754
- // Ability Capsule allows this in Gen 6+
755
- problems.push(`${name} has a Gen 4 ability and isn't evolved - it can't use moves from Gen 3.`);
756
- }
757
- const canUseAbilityPatch = dex.gen >= 8 && format.mod !== 'gen8dlc1';
758
- if (setSources.isHidden && !canUseAbilityPatch && setSources.maxSourceGen() < 5) {
759
- problems.push(`${name} has a Hidden Ability - it can't use moves from before Gen 5.`);
760
- }
761
- if (
762
- species.maleOnlyHidden && setSources.isHidden && setSources.sourcesBefore < 5 &&
763
- setSources.sources.every(source => source.charAt(1) === 'E')
764
- ) {
765
- problems.push(`${name} has an unbreedable Hidden Ability - it can't use egg moves.`);
748
+ if (ruleTable.has('obtainablemoves')) {
749
+ if (species.id === 'keldeo' && set.moves.includes('secretsword') && this.minSourceGen > 5 && dex.gen <= 7) {
750
+ problems.push(`${name} has Secret Sword, which is only compatible with Keldeo-Ordinary obtained from Gen 5.`);
751
+ }
752
+ const requiresGen3Source = setSources.maxSourceGen() <= 3;
753
+ if (requiresGen3Source && dex.abilities.get(set.ability).gen === 4 && !species.prevo && dex.gen <= 5) {
754
+ // Ability Capsule allows this in Gen 6+
755
+ problems.push(`${name} has a Gen 4 ability and isn't evolved - it can't use moves from Gen 3.`);
756
+ }
757
+ const canUseAbilityPatch = dex.gen >= 8 && format.mod !== 'gen8dlc1';
758
+ if (setSources.isHidden && !canUseAbilityPatch && setSources.maxSourceGen() < 5) {
759
+ problems.push(`${name} has a Hidden Ability - it can't use moves from before Gen 5.`);
760
+ }
761
+ if (
762
+ species.maleOnlyHidden && setSources.isHidden && setSources.sourcesBefore < 5 &&
763
+ setSources.sources.every(source => source.charAt(1) === 'E')
764
+ ) {
765
+ problems.push(`${name} has an unbreedable Hidden Ability - it can't use egg moves.`);
766
+ }
766
767
  }
767
768
 
768
769
  if (teamHas) {
@@ -1130,6 +1131,9 @@ export class TeamValidator {
1130
1131
  let eggGroups = species.eggGroups;
1131
1132
  if (species.id === 'nidoqueen' || species.id === 'nidorina') {
1132
1133
  eggGroups = dex.species.get('nidoranf').eggGroups;
1134
+ } else if (species.id === 'shedinja') {
1135
+ // Shedinja and Nincada are different Egg groups; Shedinja itself is genderless
1136
+ eggGroups = dex.species.get('nincada').eggGroups;
1133
1137
  } else if (dex !== this.dex) {
1134
1138
  // Gen 1 tradeback; grab the egg groups from Gen 2
1135
1139
  eggGroups = dex.species.get(species.id).eggGroups;