@pkmn/sim 0.5.25 → 0.5.27

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 (57) hide show
  1. package/build/config/formats.js +195 -162
  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/conditions.js +1 -1
  6. package/build/data/conditions.js.map +1 -1
  7. package/build/data/formats-data.js +24 -25
  8. package/build/data/formats-data.js.map +1 -1
  9. package/build/data/learnsets.js +27 -20
  10. package/build/data/learnsets.js.map +1 -1
  11. package/build/data/mods/gen1/formats-data.js +0 -5
  12. package/build/data/mods/gen1/formats-data.js.map +1 -1
  13. package/build/data/mods/gen1/moves.js +54 -22
  14. package/build/data/mods/gen1/moves.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/gen6/formats-data.js +14 -14
  22. package/build/data/mods/gen6/formats-data.js.map +1 -1
  23. package/build/data/mods/gen7/pokedex.js +4 -5
  24. package/build/data/mods/gen7/pokedex.js.map +1 -1
  25. package/build/data/pokedex.js +14 -14
  26. package/build/data/pokedex.js.map +1 -1
  27. package/build/data/rulesets.js +1 -1
  28. package/build/data/rulesets.js.map +1 -1
  29. package/build/data/text/abilities.js +321 -139
  30. package/build/data/text/abilities.js.map +1 -1
  31. package/build/data/text/moves.js +8 -2
  32. package/build/data/text/moves.js.map +1 -1
  33. package/build/sim/battle-actions.js.map +1 -1
  34. package/build/sim/pokemon.js +1 -1
  35. package/build/sim/pokemon.js.map +1 -1
  36. package/build/sim/team-validator.js +30 -18
  37. package/build/sim/team-validator.js.map +1 -1
  38. package/config/formats.ts +194 -159
  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/learnsets.ts +27 -20
  43. package/data/mods/gen1/formats-data.ts +0 -5
  44. package/data/mods/gen1/moves.ts +54 -23
  45. package/data/mods/gen2/moves.ts +10 -5
  46. package/data/mods/gen3/formats-data.ts +2 -2
  47. package/data/mods/gen3/moves.ts +9 -0
  48. package/data/mods/gen6/formats-data.ts +14 -14
  49. package/data/mods/gen7/pokedex.ts +4 -5
  50. package/data/pokedex.ts +14 -14
  51. package/data/rulesets.ts +1 -1
  52. package/data/text/abilities.ts +321 -139
  53. package/data/text/moves.ts +8 -2
  54. package/package.json +1 -1
  55. package/sim/battle-actions.ts +1 -0
  56. package/sim/pokemon.ts +1 -1
  57. package/sim/team-validator.ts +31 -20
@@ -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.25",
3
+ "version": "0.5.27",
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/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;
@@ -733,29 +733,37 @@ export class TeamValidator {
733
733
  isFromRBYEncounter = true;
734
734
  }
735
735
  }
736
- if (!isFromRBYEncounter && ruleTable.has('obtainablemisc') && set.level < (species.evoLevel || 0)) {
736
+ if (!isFromRBYEncounter && ruleTable.has('obtainablemisc')) {
737
737
  // FIXME: Event pokemon given at a level under what it normally can be attained at gives a false positive
738
- problems.push(`${name} must be at least level ${species.evoLevel} to be evolved.`);
738
+ let evoSpecies = species;
739
+ while (evoSpecies.prevo) {
740
+ if (set.level < (evoSpecies.evoLevel || 0)) {
741
+ problems.push(`${name} must be at least level ${evoSpecies.evoLevel} to be evolved.`);
742
+ break;
743
+ }
744
+ evoSpecies = dex.species.get(evoSpecies.prevo);
745
+ }
739
746
  }
740
747
 
741
- if (ruleTable.has('obtainablemoves') && species.id === 'keldeo' && set.moves.includes('secretsword') &&
742
- this.minSourceGen > 5 && dex.gen <= 7) {
743
- problems.push(`${name} has Secret Sword, which is only compatible with Keldeo-Ordinary obtained from Gen 5.`);
744
- }
745
- const requiresGen3Source = setSources.maxSourceGen() <= 3;
746
- if (requiresGen3Source && dex.abilities.get(set.ability).gen === 4 && !species.prevo && dex.gen <= 5) {
747
- // Ability Capsule allows this in Gen 6+
748
- problems.push(`${name} has a Gen 4 ability and isn't evolved - it can't use moves from Gen 3.`);
749
- }
750
- const canUseAbilityPatch = dex.gen >= 8 && format.mod !== 'gen8dlc1';
751
- if (setSources.isHidden && !canUseAbilityPatch && setSources.maxSourceGen() < 5) {
752
- problems.push(`${name} has a Hidden Ability - it can't use moves from before Gen 5.`);
753
- }
754
- if (
755
- species.maleOnlyHidden && setSources.isHidden && setSources.sourcesBefore < 5 &&
756
- setSources.sources.every(source => source.charAt(1) === 'E')
757
- ) {
758
- 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
+ }
759
767
  }
760
768
 
761
769
  if (teamHas) {
@@ -1123,6 +1131,9 @@ export class TeamValidator {
1123
1131
  let eggGroups = species.eggGroups;
1124
1132
  if (species.id === 'nidoqueen' || species.id === 'nidorina') {
1125
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;
1126
1137
  } else if (dex !== this.dex) {
1127
1138
  // Gen 1 tradeback; grab the egg groups from Gen 2
1128
1139
  eggGroups = dex.species.get(species.id).eggGroups;