@pkmn/sim 0.6.2 → 0.6.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 (39) hide show
  1. package/build/config/formats.js +98 -76
  2. package/build/config/formats.js.map +1 -1
  3. package/build/data/abilities.js +1 -1
  4. package/build/data/abilities.js.map +1 -1
  5. package/build/data/formats-data.js +3 -3
  6. package/build/data/formats-data.js.map +1 -1
  7. package/build/data/mods/gen1/moves.js +3 -2
  8. package/build/data/mods/gen1/moves.js.map +1 -1
  9. package/build/data/mods/gen1/scripts.js +75 -40
  10. package/build/data/mods/gen1/scripts.js.map +1 -1
  11. package/build/data/mods/gen2/scripts.js +1 -1
  12. package/build/data/moves.js +8 -6
  13. package/build/data/moves.js.map +1 -1
  14. package/build/data/pokedex.js +5 -0
  15. package/build/data/pokedex.js.map +1 -1
  16. package/build/data/rulesets.js +58 -0
  17. package/build/data/rulesets.js.map +1 -1
  18. package/build/sim/battle-queue.js +4 -3
  19. package/build/sim/battle-queue.js.map +1 -1
  20. package/build/sim/battle.js +8 -4
  21. package/build/sim/battle.js.map +1 -1
  22. package/build/sim/dex-species.d.ts +2 -0
  23. package/build/sim/dex-species.js.map +1 -1
  24. package/build/sim/team-validator.js +4 -0
  25. package/build/sim/team-validator.js.map +1 -1
  26. package/config/formats.ts +101 -73
  27. package/data/abilities.ts +1 -1
  28. package/data/formats-data.ts +3 -3
  29. package/data/mods/gen1/moves.ts +3 -2
  30. package/data/mods/gen1/scripts.ts +73 -39
  31. package/data/mods/gen2/scripts.ts +1 -1
  32. package/data/moves.ts +8 -6
  33. package/data/pokedex.ts +5 -0
  34. package/data/rulesets.ts +59 -0
  35. package/package.json +1 -1
  36. package/sim/battle-queue.ts +4 -3
  37. package/sim/battle.ts +6 -4
  38. package/sim/dex-species.ts +2 -0
  39. package/sim/team-validator.ts +5 -0
package/sim/battle.ts CHANGED
@@ -2247,13 +2247,15 @@ export class Battle {
2247
2247
  // when used without an explicit target.
2248
2248
 
2249
2249
  move = this.dex.moves.get(move);
2250
- if (move.target === 'adjacentAlly') {
2251
- const adjacentAllies = pokemon.adjacentAllies();
2252
- return adjacentAllies.length ? this.sample(adjacentAllies) : null;
2253
- }
2254
2250
  if (['self', 'all', 'allySide', 'allyTeam', 'adjacentAllyOrSelf'].includes(move.target)) {
2255
2251
  return pokemon;
2252
+ } else if (move.target === 'adjacentAlly') {
2253
+ if (this.gameType === 'singles') return null;
2254
+ const adjacentAllies = pokemon.adjacentAllies();
2255
+ return adjacentAllies.length ? this.sample(adjacentAllies) : null;
2256
2256
  }
2257
+ if (this.gameType === 'singles') return pokemon.side.foe.active[0];
2258
+
2257
2259
  if (this.activePerHalf > 2) {
2258
2260
  if (move.target === 'adjacentFoe' || move.target === 'normal' || move.target === 'randomNormal') {
2259
2261
  // even if a move can target an ally, auto-resolution will never make it target an ally
@@ -148,6 +148,8 @@ export class Species extends BasicEffect implements Readonly<BasicEffect & Speci
148
148
  declare readonly evoItem?: string;
149
149
  /** Evolution move. falsy if doesn't evolve. */
150
150
  readonly evoMove?: string;
151
+ /** Region required to be in for evolution. falsy if doesn't evolve. */
152
+ readonly evoRegion?: 'Alola' | 'Galar';
151
153
  /** Evolution level. falsy if doesn't evolve. */
152
154
  readonly evoLevel?: number;
153
155
  /** Is NFE? True if this Pokemon can evolve (Mega evolution doesn't count). */
@@ -2060,6 +2060,11 @@ export class TeamValidator {
2060
2060
  // redundant
2061
2061
  if (learnedGen <= moveSources.sourcesBefore) continue;
2062
2062
 
2063
+ if (baseSpecies.evoRegion === 'Alola' && checkingPrevo && learnedGen >= 8) {
2064
+ cantLearnReason = `is from a ${species.name} that can't be transferred to USUM to evolve into ${baseSpecies.name}.`;
2065
+ continue;
2066
+ }
2067
+
2063
2068
  const canUseAbilityPatch = dex.gen >= 8 && format.mod !== 'gen8dlc1';
2064
2069
  if (
2065
2070
  learnedGen < 7 && setSources.isHidden && !canUseAbilityPatch &&