@pkmn/sim 0.5.1 → 0.5.5

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 (88) hide show
  1. package/build/config/formats.js +373 -289
  2. package/build/config/formats.js.map +1 -1
  3. package/build/data/abilities.js +5 -1
  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/formats-data.js +91 -92
  8. package/build/data/formats-data.js.map +1 -1
  9. package/build/data/items.js +5 -5
  10. package/build/data/items.js.map +1 -1
  11. package/build/data/learnsets.js +1 -1
  12. package/build/data/learnsets.js.map +1 -1
  13. package/build/data/mods/gen1/formats-data.js +190 -190
  14. package/build/data/mods/gen1/formats-data.js.map +1 -1
  15. package/build/data/mods/gen1/moves.js +1 -2
  16. package/build/data/mods/gen1/moves.js.map +1 -1
  17. package/build/data/mods/gen1/scripts.js +12 -0
  18. package/build/data/mods/gen1/scripts.js.map +1 -1
  19. package/build/data/mods/gen2/formats-data.js +2 -2
  20. package/build/data/mods/gen2/formats-data.js.map +1 -1
  21. package/build/data/mods/gen3/formats-data.js +12 -12
  22. package/build/data/mods/gen3/formats-data.js.map +1 -1
  23. package/build/data/mods/gen4/moves.js +22 -0
  24. package/build/data/mods/gen4/moves.js.map +1 -1
  25. package/build/data/mods/gen5/formats-data.js +172 -155
  26. package/build/data/mods/gen5/formats-data.js.map +1 -1
  27. package/build/data/mods/gen6/formats-data.js +1 -1
  28. package/build/data/mods/gen7/formats-data.js +1 -1
  29. package/build/data/mods/gen7/formats-data.js.map +1 -1
  30. package/build/data/mods/gen7/moves.js +154 -0
  31. package/build/data/mods/gen7/moves.js.map +1 -1
  32. package/build/data/moves.js +47 -20
  33. package/build/data/moves.js.map +1 -1
  34. package/build/data/pokedex.js +3 -3
  35. package/build/data/pokedex.js.map +1 -1
  36. package/build/data/rulesets.js +48 -5
  37. package/build/data/rulesets.js.map +1 -1
  38. package/build/data/tags.d.ts +1 -0
  39. package/build/data/tags.js +4 -3
  40. package/build/data/tags.js.map +1 -1
  41. package/build/data/text/abilities.js +4 -4
  42. package/build/data/text/abilities.js.map +1 -1
  43. package/build/data/text/moves.js +19 -19
  44. package/build/data/text/moves.js.map +1 -1
  45. package/build/sim/battle-actions.js +12 -4
  46. package/build/sim/battle-actions.js.map +1 -1
  47. package/build/sim/dex-formats.d.ts +1 -0
  48. package/build/sim/dex-formats.js +3 -2
  49. package/build/sim/dex-formats.js.map +1 -1
  50. package/build/sim/exported-global-types.d.ts +1 -0
  51. package/build/sim/global-types.d.ts +1 -0
  52. package/build/sim/index.d.ts +1 -0
  53. package/build/sim/index.js +3 -1
  54. package/build/sim/index.js.map +1 -1
  55. package/build/sim/pokemon.js +1 -1
  56. package/build/sim/pokemon.js.map +1 -1
  57. package/build/sim/team-validator.js +16 -0
  58. package/build/sim/team-validator.js.map +1 -1
  59. package/config/formats.ts +379 -292
  60. package/data/abilities.ts +3 -1
  61. package/data/aliases.ts +2 -2
  62. package/data/formats-data.ts +91 -92
  63. package/data/items.ts +5 -5
  64. package/data/learnsets.ts +1 -1
  65. package/data/mods/gen1/formats-data.ts +190 -190
  66. package/data/mods/gen1/moves.ts +1 -2
  67. package/data/mods/gen1/scripts.ts +11 -0
  68. package/data/mods/gen2/formats-data.ts +2 -2
  69. package/data/mods/gen3/formats-data.ts +12 -12
  70. package/data/mods/gen4/moves.ts +21 -0
  71. package/data/mods/gen5/formats-data.ts +172 -155
  72. package/data/mods/gen6/formats-data.ts +1 -1
  73. package/data/mods/gen7/formats-data.ts +1 -1
  74. package/data/mods/gen7/moves.ts +150 -0
  75. package/data/moves.ts +46 -20
  76. package/data/pokedex.ts +3 -3
  77. package/data/rulesets.ts +44 -6
  78. package/data/tags.ts +6 -3
  79. package/data/text/abilities.ts +4 -4
  80. package/data/text/moves.ts +19 -19
  81. package/package.json +2 -2
  82. package/sim/battle-actions.ts +12 -4
  83. package/sim/dex-formats.ts +4 -1
  84. package/sim/exported-global-types.ts +1 -0
  85. package/sim/global-types.ts +1 -0
  86. package/sim/index.ts +1 -0
  87. package/sim/pokemon.ts +1 -1
  88. package/sim/team-validator.ts +15 -0
@@ -664,7 +664,7 @@ export const FormatsData: {[k: string]: ModdedSpeciesFormatsData} = {
664
664
  doublesTier: "(DUU)",
665
665
  },
666
666
  kangaskhanmega: {
667
- randomBattleMoves: ["crunch", "earthquake", "fakeout", "poweruppunch", "return", "suckerpunch", "seismictoss"],
667
+ randomBattleMoves: ["crunch", "earthquake", "fakeout", "poweruppunch", "return", "seismictoss", "suckerpunch"],
668
668
  randomDoubleBattleMoves: ["crunch", "doubleedge", "drainpunch", "earthquake", "fakeout", "poweruppunch", "protect", "return", "suckerpunch"],
669
669
  tier: "Uber",
670
670
  doublesTier: "DOU",
@@ -2300,7 +2300,7 @@ export const FormatsData: {[k: string]: ModdedSpeciesFormatsData} = {
2300
2300
  doublesTier: "DUber",
2301
2301
  },
2302
2302
  deoxys: {
2303
- randomBattleMoves: ["extremespeed", "icebeam", "firepunch", "knockoff", "psychoboost", "stealthrock", "superpower"],
2303
+ randomBattleMoves: ["extremespeed", "firepunch", "icebeam", "knockoff", "psychoboost", "stealthrock", "superpower"],
2304
2304
  randomDoubleBattleMoves: ["extremespeed", "firepunch", "icebeam", "knockoff", "protect", "psychoboost", "superpower"],
2305
2305
  tier: "Uber",
2306
2306
  doublesTier: "(DUU)",
@@ -240,6 +240,25 @@ export const Moves: {[k: string]: ModdedMoveData} = {
240
240
  inherit: true,
241
241
  isNonstandard: null,
242
242
  },
243
+ floralhealing: {
244
+ inherit: true,
245
+ onHit(target, source) {
246
+ let success = false;
247
+ if (this.field.isTerrain('grassyterrain')) {
248
+ success = !!this.heal(this.modify(target.baseMaxhp, 0.667));
249
+ } else {
250
+ success = !!this.heal(Math.ceil(target.baseMaxhp * 0.5));
251
+ }
252
+ if (success && !target.isAlly(source)) {
253
+ target.staleness = 'external';
254
+ }
255
+ if (!success) {
256
+ this.add('-fail', target, 'heal');
257
+ return null;
258
+ }
259
+ return success;
260
+ },
261
+ },
243
262
  foresight: {
244
263
  inherit: true,
245
264
  isNonstandard: null,
@@ -359,6 +378,25 @@ export const Moves: {[k: string]: ModdedMoveData} = {
359
378
  inherit: true,
360
379
  isNonstandard: null,
361
380
  },
381
+ healpulse: {
382
+ inherit: true,
383
+ onHit(target, source) {
384
+ let success = false;
385
+ if (source.hasAbility('megalauncher')) {
386
+ success = !!this.heal(this.modify(target.baseMaxhp, 0.75));
387
+ } else {
388
+ success = !!this.heal(Math.ceil(target.baseMaxhp * 0.5));
389
+ }
390
+ if (success && !target.isAlly(source)) {
391
+ target.staleness = 'external';
392
+ }
393
+ if (!success) {
394
+ this.add('-fail', target, 'heal');
395
+ return null;
396
+ }
397
+ return success;
398
+ },
399
+ },
362
400
  heartstamp: {
363
401
  inherit: true,
364
402
  isNonstandard: null,
@@ -608,6 +646,54 @@ export const Moves: {[k: string]: ModdedMoveData} = {
608
646
  inherit: true,
609
647
  isNonstandard: null,
610
648
  },
649
+ moonlight: {
650
+ inherit: true,
651
+ onHit(pokemon) {
652
+ let factor = 0.5;
653
+ switch (pokemon.effectiveWeather()) {
654
+ case 'sunnyday':
655
+ case 'desolateland':
656
+ factor = 0.667;
657
+ break;
658
+ case 'raindance':
659
+ case 'primordialsea':
660
+ case 'sandstorm':
661
+ case 'hail':
662
+ factor = 0.25;
663
+ break;
664
+ }
665
+ const success = !!this.heal(this.modify(pokemon.maxhp, factor));
666
+ if (!success) {
667
+ this.add('-fail', pokemon, 'heal');
668
+ return null;
669
+ }
670
+ return success;
671
+ },
672
+ },
673
+ morningsun: {
674
+ inherit: true,
675
+ onHit(pokemon) {
676
+ let factor = 0.5;
677
+ switch (pokemon.effectiveWeather()) {
678
+ case 'sunnyday':
679
+ case 'desolateland':
680
+ factor = 0.667;
681
+ break;
682
+ case 'raindance':
683
+ case 'primordialsea':
684
+ case 'sandstorm':
685
+ case 'hail':
686
+ factor = 0.25;
687
+ break;
688
+ }
689
+ const success = !!this.heal(this.modify(pokemon.maxhp, factor));
690
+ if (!success) {
691
+ this.add('-fail', pokemon, 'heal');
692
+ return null;
693
+ }
694
+ return success;
695
+ },
696
+ },
611
697
  mudbomb: {
612
698
  inherit: true,
613
699
  isNonstandard: null,
@@ -651,6 +737,14 @@ export const Moves: {[k: string]: ModdedMoveData} = {
651
737
  pollenpuff: {
652
738
  inherit: true,
653
739
  flags: {bullet: 1, protect: 1, mirror: 1},
740
+ onHit(target, source) {
741
+ if (source.isAlly(target)) {
742
+ if (!this.heal(Math.floor(target.baseMaxhp * 0.5))) {
743
+ this.add('-immune', target);
744
+ return null;
745
+ }
746
+ }
747
+ },
654
748
  },
655
749
  powder: {
656
750
  inherit: true,
@@ -722,6 +816,13 @@ export const Moves: {[k: string]: ModdedMoveData} = {
722
816
  inherit: true,
723
817
  isNonstandard: null,
724
818
  },
819
+ purify: {
820
+ inherit: true,
821
+ onHit(target, source) {
822
+ if (!target.cureStatus()) return false;
823
+ this.heal(Math.ceil(source.maxhp * 0.5), source);
824
+ },
825
+ },
725
826
  pursuit: {
726
827
  inherit: true,
727
828
  isNonstandard: null,
@@ -815,6 +916,21 @@ export const Moves: {[k: string]: ModdedMoveData} = {
815
916
  inherit: true,
816
917
  isNonstandard: null,
817
918
  },
919
+ shoreup: {
920
+ inherit: true,
921
+ onHit(pokemon) {
922
+ let factor = 0.5;
923
+ if (this.field.isWeather('sandstorm')) {
924
+ factor = 0.667;
925
+ }
926
+ const success = !!this.heal(this.modify(pokemon.maxhp, factor));
927
+ if (!success) {
928
+ this.add('-fail', pokemon, 'heal');
929
+ return null;
930
+ }
931
+ return success;
932
+ },
933
+ },
818
934
  signalbeam: {
819
935
  inherit: true,
820
936
  isNonstandard: null,
@@ -898,6 +1014,16 @@ export const Moves: {[k: string]: ModdedMoveData} = {
898
1014
  inherit: true,
899
1015
  isNonstandard: null,
900
1016
  },
1017
+ swallow: {
1018
+ inherit: true,
1019
+ onHit(pokemon) {
1020
+ const healAmount = [0.25, 0.5, 1];
1021
+ const success = !!this.heal(this.modify(pokemon.maxhp, healAmount[(pokemon.volatiles['stockpile'].layers - 1)]));
1022
+ if (!success) this.add('-fail', pokemon, 'heal');
1023
+ pokemon.removeVolatile('stockpile');
1024
+ return success || null;
1025
+ },
1026
+ },
901
1027
  switcheroo: {
902
1028
  inherit: true,
903
1029
  onHit(target, source, move) {
@@ -935,6 +1061,30 @@ export const Moves: {[k: string]: ModdedMoveData} = {
935
1061
  inherit: true,
936
1062
  isNonstandard: null,
937
1063
  },
1064
+ synthesis: {
1065
+ inherit: true,
1066
+ onHit(pokemon) {
1067
+ let factor = 0.5;
1068
+ switch (pokemon.effectiveWeather()) {
1069
+ case 'sunnyday':
1070
+ case 'desolateland':
1071
+ factor = 0.667;
1072
+ break;
1073
+ case 'raindance':
1074
+ case 'primordialsea':
1075
+ case 'sandstorm':
1076
+ case 'hail':
1077
+ factor = 0.25;
1078
+ break;
1079
+ }
1080
+ const success = !!this.heal(this.modify(pokemon.maxhp, factor));
1081
+ if (!success) {
1082
+ this.add('-fail', pokemon, 'heal');
1083
+ return null;
1084
+ }
1085
+ return success;
1086
+ },
1087
+ },
938
1088
  tailglow: {
939
1089
  inherit: true,
940
1090
  isNonstandard: null,
package/data/moves.ts CHANGED
@@ -4574,7 +4574,7 @@ export const Moves: {[moveid: string]: MoveData} = {
4574
4574
  pseudoWeather: 'fairylock',
4575
4575
  condition: {
4576
4576
  duration: 2,
4577
- onStart(target) {
4577
+ onFieldStart(target) {
4578
4578
  this.add('-fieldactivate', 'move: Fairy Lock');
4579
4579
  },
4580
4580
  onTrapPokemon(pokemon) {
@@ -5320,6 +5320,10 @@ export const Moves: {[moveid: string]: MoveData} = {
5320
5320
  if (success && !target.isAlly(source)) {
5321
5321
  target.staleness = 'external';
5322
5322
  }
5323
+ if (!success) {
5324
+ this.add('-fail', target, 'heal');
5325
+ return this.NOT_FAIL;
5326
+ }
5323
5327
  return success;
5324
5328
  },
5325
5329
  secondary: null,
@@ -7854,6 +7858,10 @@ export const Moves: {[moveid: string]: MoveData} = {
7854
7858
  if (success && !target.isAlly(source)) {
7855
7859
  target.staleness = 'external';
7856
7860
  }
7861
+ if (!success) {
7862
+ this.add('-fail', target, 'heal');
7863
+ return this.NOT_FAIL;
7864
+ }
7857
7865
  return success;
7858
7866
  },
7859
7867
  secondary: null,
@@ -9077,7 +9085,7 @@ export const Moves: {[moveid: string]: MoveData} = {
9077
9085
  pseudoWeather: 'iondeluge',
9078
9086
  condition: {
9079
9087
  duration: 1,
9080
- onStart(target, source, sourceEffect) {
9088
+ onFieldStart(target, source, sourceEffect) {
9081
9089
  this.add('-fieldactivate', 'move: Ion Deluge');
9082
9090
  this.hint(`Normal-type moves become Electric-type after using ${sourceEffect}.`);
9083
9091
  },
@@ -10420,16 +10428,10 @@ export const Moves: {[moveid: string]: MoveData} = {
10420
10428
  },
10421
10429
  onTryHitPriority: 3,
10422
10430
  onTryHit(target, source, move) {
10423
- if (['gmaxoneblow', 'gmaxrapidflow'].includes(move.id)) return;
10424
- /** moves blocked by Max Guard but not Protect */
10425
- const overrideBypassProtect = [
10426
- 'block', 'flowershield', 'gearup', 'magneticflux', 'phantomforce', 'psychup', 'shadowforce', 'teatime', 'transform', 'whirlwind',
10431
+ const bypassesMaxGuard = [
10432
+ 'acupressure', 'afteryou', 'allyswitch', 'aromatherapy', 'aromaticmist', 'coaching', 'confide', 'copycat', 'curse', 'decorate', 'doomdesire', 'feint', 'futuresight', 'gmaxoneblow', 'gmaxrapidflow', 'healbell', 'holdhands', 'howl', 'junglehealing', 'lifedew', 'meanlook', 'perishsong', 'playnice', 'powertrick', 'roar', 'roleplay', 'tearfullook',
10427
10433
  ];
10428
- const blockedByMaxGuard = (this.dex.moves.get(move.id).flags['protect'] ||
10429
- move.isZ || move.isMax || overrideBypassProtect.includes(move.id));
10430
- if (!blockedByMaxGuard) {
10431
- return;
10432
- }
10434
+ if (bypassesMaxGuard.includes(move.id)) return;
10433
10435
  if (move.smartTarget) {
10434
10436
  move.smartTarget = false;
10435
10437
  } else {
@@ -11090,7 +11092,9 @@ export const Moves: {[moveid: string]: MoveData} = {
11090
11092
  priority: 0,
11091
11093
  flags: {protect: 1, bypasssub: 1, allyanim: 1},
11092
11094
  onHit(target, source) {
11093
- const disallowedMoves = ['chatter', 'dynamaxcannon', 'mimic', 'sketch', 'struggle', 'transform'];
11095
+ const disallowedMoves = [
11096
+ 'behemothbash', 'behemothblade', 'chatter', 'dynamaxcannon', 'mimic', 'sketch', 'struggle', 'transform',
11097
+ ];
11094
11098
  const move = target.lastMove;
11095
11099
  if (source.transformed || !move || disallowedMoves.includes(move.id) || source.moves.includes(move.id)) {
11096
11100
  return false;
@@ -11518,7 +11522,12 @@ export const Moves: {[moveid: string]: MoveData} = {
11518
11522
  factor = 0.25;
11519
11523
  break;
11520
11524
  }
11521
- return !!this.heal(this.modify(pokemon.maxhp, factor));
11525
+ const success = !!this.heal(this.modify(pokemon.maxhp, factor));
11526
+ if (!success) {
11527
+ this.add('-fail', pokemon, 'heal');
11528
+ return this.NOT_FAIL;
11529
+ }
11530
+ return success;
11522
11531
  },
11523
11532
  secondary: null,
11524
11533
  target: "self",
@@ -11549,7 +11558,12 @@ export const Moves: {[moveid: string]: MoveData} = {
11549
11558
  factor = 0.25;
11550
11559
  break;
11551
11560
  }
11552
- return !!this.heal(this.modify(pokemon.maxhp, factor));
11561
+ const success = !!this.heal(this.modify(pokemon.maxhp, factor));
11562
+ if (!success) {
11563
+ this.add('-fail', pokemon, 'heal');
11564
+ return this.NOT_FAIL;
11565
+ }
11566
+ return success;
11553
11567
  },
11554
11568
  secondary: null,
11555
11569
  target: "self",
@@ -12738,6 +12752,7 @@ export const Moves: {[moveid: string]: MoveData} = {
12738
12752
  if (source.isAlly(target)) {
12739
12753
  if (!this.heal(Math.floor(target.baseMaxhp * 0.5))) {
12740
12754
  this.add('-immune', target);
12755
+ return this.NOT_FAIL;
12741
12756
  }
12742
12757
  }
12743
12758
  },
@@ -13400,7 +13415,7 @@ export const Moves: {[moveid: string]: MoveData} = {
13400
13415
  priority: 0,
13401
13416
  flags: {protect: 1, reflectable: 1, heal: 1},
13402
13417
  onHit(target, source) {
13403
- if (!target.cureStatus()) return false;
13418
+ if (!target.cureStatus()) return this.NOT_FAIL;
13404
13419
  this.heal(Math.ceil(source.maxhp * 0.5), source);
13405
13420
  },
13406
13421
  secondary: null,
@@ -15259,7 +15274,12 @@ export const Moves: {[moveid: string]: MoveData} = {
15259
15274
  if (this.field.isWeather('sandstorm')) {
15260
15275
  factor = 0.667;
15261
15276
  }
15262
- return !!this.heal(this.modify(pokemon.maxhp, factor));
15277
+ const success = !!this.heal(this.modify(pokemon.maxhp, factor));
15278
+ if (!success) {
15279
+ this.add('-fail', pokemon, 'heal');
15280
+ return this.NOT_FAIL;
15281
+ }
15282
+ return success;
15263
15283
  },
15264
15284
  secondary: null,
15265
15285
  target: "self",
@@ -15752,7 +15772,7 @@ export const Moves: {[moveid: string]: MoveData} = {
15752
15772
  const moveid = moveSlot.id;
15753
15773
  if (!moveid) continue;
15754
15774
  const move = this.dex.moves.get(moveid);
15755
- if (noSleepTalk.includes(moveid) || move.flags['charge'] || (move.isZ && move.basePower !== 1)) {
15775
+ if (noSleepTalk.includes(moveid) || move.flags['charge'] || (move.isZ && move.basePower !== 1) || move.isMax) {
15756
15776
  continue;
15757
15777
  }
15758
15778
  moves.push(moveid);
@@ -17389,9 +17409,10 @@ export const Moves: {[moveid: string]: MoveData} = {
17389
17409
  },
17390
17410
  onHit(pokemon) {
17391
17411
  const healAmount = [0.25, 0.5, 1];
17392
- const healedBy = this.heal(this.modify(pokemon.maxhp, healAmount[(pokemon.volatiles['stockpile'].layers - 1)]));
17412
+ const success = !!this.heal(this.modify(pokemon.maxhp, healAmount[(pokemon.volatiles['stockpile'].layers - 1)]));
17413
+ if (!success) this.add('-fail', pokemon, 'heal');
17393
17414
  pokemon.removeVolatile('stockpile');
17394
- return !!healedBy;
17415
+ return success || this.NOT_FAIL;
17395
17416
  },
17396
17417
  secondary: null,
17397
17418
  target: "self",
@@ -17554,7 +17575,12 @@ export const Moves: {[moveid: string]: MoveData} = {
17554
17575
  factor = 0.25;
17555
17576
  break;
17556
17577
  }
17557
- return !!this.heal(this.modify(pokemon.maxhp, factor));
17578
+ const success = !!this.heal(this.modify(pokemon.maxhp, factor));
17579
+ if (!success) {
17580
+ this.add('-fail', pokemon, 'heal');
17581
+ return this.NOT_FAIL;
17582
+ }
17583
+ return success;
17558
17584
  },
17559
17585
  secondary: null,
17560
17586
  target: "self",
package/data/pokedex.ts CHANGED
@@ -16911,13 +16911,13 @@ export const Pokedex: {[speciesid: string]: SpeciesData} = {
16911
16911
  gen: 4,
16912
16912
  },
16913
16913
  venomicon: {
16914
- num: -67,
16914
+ num: -66,
16915
16915
  name: "Venomicon",
16916
16916
  baseForme: "Prologue",
16917
16917
  types: ["Poison", "Flying"],
16918
16918
  gender: "N",
16919
16919
  baseStats: {hp: 85, atk: 70, def: 113, spa: 118, spd: 90, spe: 64},
16920
- abilities: {0: "Stamina"},
16920
+ abilities: {0: "Stamina", H: "Power of Alchemy"},
16921
16921
  heightm: 0.8,
16922
16922
  weightkg: 11.5,
16923
16923
  color: "Purple",
@@ -16927,7 +16927,7 @@ export const Pokedex: {[speciesid: string]: SpeciesData} = {
16927
16927
  gen: 8,
16928
16928
  },
16929
16929
  venomiconepilogue: {
16930
- num: -67,
16930
+ num: -66,
16931
16931
  name: "Venomicon-Epilogue",
16932
16932
  baseSpecies: "Venomicon",
16933
16933
  forme: "Epilogue",
package/data/rulesets.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Note: These are the rules that formats use
1
+ // Note: These are the rules that formats use
2
2
 
3
3
  import {Utils} from "../lib";
4
4
 
@@ -791,13 +791,51 @@ export const Rulesets: {[k: string]: FormatData} = {
791
791
  ];
792
792
  },
793
793
  },
794
- "3batonpassclause": {
794
+ onebatonpassclause: {
795
795
  effectType: 'ValidatorRule',
796
- name: '3 Baton Pass Clause',
797
- desc: "Stops teams from having more than three Pokémon with Baton Pass",
798
- banlist: ["Baton Pass > 3"],
796
+ name: 'One Baton Pass Clause',
797
+ desc: "Stops teams from having more than one Pokémon with Baton Pass",
798
+ banlist: ["Baton Pass > 1"],
799
+ onBegin() {
800
+ this.add('rule', 'One Baton Pass Clause: Limit one Baton Passer');
801
+ },
802
+ },
803
+ oneboostpasserclause: {
804
+ effectType: 'ValidatorRule',
805
+ name: 'One Boost Passer Clause',
806
+ desc: "Stops teams from having a Pokémon with Baton Pass that has multiple ways to boost its stats, and no more than one Baton Passer may be able to boost its stats",
799
807
  onBegin() {
800
- this.add('rule', '3 Baton Pass Clause: Limit three Baton Passers');
808
+ this.add('rule', 'One Boost Passer Clause: Limit one Baton Passer that has a way to boost its stats');
809
+ },
810
+ onValidateTeam(team) {
811
+ const boostingEffects = [
812
+ 'acidarmor', 'agility', 'amnesia', 'apicotberry', 'barrier', 'bellydrum', 'bulkup', 'calmmind', 'cosmicpower', 'curse',
813
+ 'defensecurl', 'dragondance', 'ganlonberry', 'growth', 'harden', 'howl', 'irondefense', 'liechiberry', 'meditate',
814
+ 'petayaberry', 'salacberry', 'sharpen', 'speedboost', 'starfberry', 'swordsdance', 'tailglow', 'withdraw',
815
+ ];
816
+ let passers = 0;
817
+ for (const set of team) {
818
+ if (!set.moves.includes('Baton Pass')) continue;
819
+ let passableBoosts = 0;
820
+ const item = this.toID(set.item);
821
+ const ability = this.toID(set.ability);
822
+ for (const move of set.moves) {
823
+ if (boostingEffects.includes(this.toID(move))) passableBoosts++;
824
+ }
825
+ if (boostingEffects.includes(item)) passableBoosts++;
826
+ if (boostingEffects.includes(ability)) passableBoosts++;
827
+ if (passableBoosts === 1) passers++;
828
+ if (passableBoosts > 1) {
829
+ return [
830
+ `${set.name || set.species} has Baton Pass and multiple ways to boost its stats, which is banned by One Boost Passer Clause.`,
831
+ ];
832
+ }
833
+ if (passers > 1) {
834
+ return [
835
+ `Multiple Pokemon have Baton Pass and a way to boost their stats, which is banned by One Boost Passer Clause.`,
836
+ ];
837
+ }
838
+ }
801
839
  },
802
840
  },
803
841
  cfzclause: {
package/data/tags.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import {Ability, Item, Move, Species} from '../sim/exported-global-types';
2
+
1
3
  interface TagData {
2
4
  name: string;
3
5
  desc?: string;
@@ -195,9 +197,10 @@ export const Tags: {[id: string]: TagData} = {
195
197
  nduubl: {
196
198
  name: "ND UUBL",
197
199
  speciesFilter: species => [
198
- 'Aerodactyl-Mega', 'Azumarill', 'Blacephalon', 'Diancie-Mega', 'Gallade-Mega', 'Gardevoir-Mega', 'Gengar', 'Gyarados', 'Gyarados-Mega',
199
- 'Hawlucha', 'Heracross-Mega', 'Hoopa-Unbound', 'Hydreigon', 'Jirachi', 'Latias', 'Latias-Mega', 'Latios', 'Latios-Mega', 'Manaphy', 'Mew',
200
- 'Pinsir-Mega', 'Sableye-Mega', 'Slowbro-Mega', 'Slowking-Galar', 'Thundurus', 'Thundurus-Therian', 'Venusaur-Mega', 'Xurkitree', 'Zapdos-Galar',
200
+ 'Aerodactyl-Mega', 'Blacephalon', 'Diancie-Mega', 'Gallade-Mega', 'Gardevoir-Mega', 'Gengar', 'Gyarados', 'Gyarados-Mega',
201
+ 'Hawlucha', 'Heracross-Mega', 'Hoopa-Unbound', 'Hydreigon', 'Jirachi', 'Latias', 'Latias-Mega', 'Latios', 'Latios-Mega', 'Manaphy',
202
+ 'Medicham-Mega', 'Mew', 'Pinsir-Mega', 'Sableye-Mega', 'Slowbro-Mega', 'Slowking-Galar', 'Thundurus', 'Thundurus-Therian', 'Venusaur-Mega',
203
+ 'Xurkitree', 'Zapdos-Galar',
201
204
  ].includes(species.name),
202
205
  },
203
206
 
@@ -270,8 +270,8 @@ export const AbilitiesText: {[k: string]: AbilityText} = {
270
270
  },
271
271
  dazzling: {
272
272
  name: "Dazzling",
273
- desc: "While this Pokemon is active, priority moves from opposing Pokemon targeted at allies are prevented from having an effect.",
274
- shortDesc: "While this Pokemon is active, allies are protected from opposing priority moves.",
273
+ desc: "Priority moves used by opposing Pokemon targeting this Pokemon or its allies are prevented from having an effect.",
274
+ shortDesc: "This Pokemon and its allies are protected from opposing priority moves.",
275
275
 
276
276
  block: "#damp",
277
277
  },
@@ -1088,8 +1088,8 @@ export const AbilitiesText: {[k: string]: AbilityText} = {
1088
1088
  },
1089
1089
  queenlymajesty: {
1090
1090
  name: "Queenly Majesty",
1091
- desc: "While this Pokemon is active, priority moves from opposing Pokemon targeted at allies are prevented from having an effect.",
1092
- shortDesc: "While this Pokemon is active, allies are protected from opposing priority moves.",
1091
+ desc: "Priority moves used by opposing Pokemon targeting this Pokemon or its allies are prevented from having an effect.",
1092
+ shortDesc: "This Pokemon and its allies are protected from opposing priority moves.",
1093
1093
 
1094
1094
  block: "#damp",
1095
1095
  },
@@ -3484,27 +3484,27 @@ export const MovesText: {[k: string]: MoveText} = {
3484
3484
  },
3485
3485
  maxairstream: {
3486
3486
  name: "Max Airstream",
3487
- desc: "Power is equal to the base move's Max Move power. If this move is successful, the Speed of each Pokemon on the user's side is raised by 1 stage, even if they have a substitute.",
3487
+ desc: "Power is equal to the base move's Max Move power. If this move is successful, the Speed of each Pokemon on the user's side is raised by 1 stage, even if they have a substitute. This effect does not happen if the user is not Dynamaxed. If this move is used as a base move, it deals damage with a power of 0.",
3488
3488
  shortDesc: "Base move affects power. Allies: +1 Speed.",
3489
3489
  },
3490
3490
  maxdarkness: {
3491
3491
  name: "Max Darkness",
3492
- desc: "Power is equal to the base move's Max Move power. If this move is successful, the Special Defense of each Pokemon on the opposing side is lowered by 1 stage, even if they have a substitute.",
3492
+ desc: "Power is equal to the base move's Max Move power. If this move is successful, the Special Defense of each Pokemon on the opposing side is lowered by 1 stage, even if they have a substitute. This effect does not happen if the user is not Dynamaxed. If this move is used as a base move, it deals damage with a power of 0.",
3493
3493
  shortDesc: "Base move affects power. Foes: -1 Sp. Def.",
3494
3494
  },
3495
3495
  maxflare: {
3496
3496
  name: "Max Flare",
3497
- desc: "Power is equal to the base move's Max Move power. If this move is successful, the effect of Sunny Day begins.",
3497
+ desc: "Power is equal to the base move's Max Move power. If this move is successful, the effect of Sunny Day begins. This effect does not happen if the user is not Dynamaxed. If this move is used as a base move, it deals damage with a power of 0.",
3498
3498
  shortDesc: "Base move affects power. Starts Sunny Day.",
3499
3499
  },
3500
3500
  maxflutterby: {
3501
3501
  name: "Max Flutterby",
3502
- desc: "Power is equal to the base move's Max Move power. If this move is successful, the Special Attack of each Pokemon on the opposing side is lowered by 1 stage, even if they have a substitute.",
3502
+ desc: "Power is equal to the base move's Max Move power. If this move is successful, the Special Attack of each Pokemon on the opposing side is lowered by 1 stage, even if they have a substitute. This effect does not happen if the user is not Dynamaxed. If this move is used as a base move, it deals damage with a power of 0.",
3503
3503
  shortDesc: "Base move affects power. Foes: -1 Sp. Atk.",
3504
3504
  },
3505
3505
  maxgeyser: {
3506
3506
  name: "Max Geyser",
3507
- desc: "Power is equal to the base move's Max Move power. If this move is successful, the effect of Rain Dance begins.",
3507
+ desc: "Power is equal to the base move's Max Move power. If this move is successful, the effect of Rain Dance begins. This effect does not happen if the user is not Dynamaxed. If this move is used as a base move, it deals damage with a power of 0.",
3508
3508
  shortDesc: "Base move affects power. Starts Rain Dance.",
3509
3509
  },
3510
3510
  maxguard: {
@@ -3516,67 +3516,67 @@ export const MovesText: {[k: string]: MoveText} = {
3516
3516
  },
3517
3517
  maxhailstorm: {
3518
3518
  name: "Max Hailstorm",
3519
- desc: "Power is equal to the base move's Max Move power. If this move is successful, the effect of Hail begins.",
3519
+ desc: "Power is equal to the base move's Max Move power. If this move is successful, the effect of Hail begins. This effect does not happen if the user is not Dynamaxed. If this move is used as a base move, it deals damage with a power of 0.",
3520
3520
  shortDesc: "Base move affects power. Starts Hail.",
3521
3521
  },
3522
3522
  maxknuckle: {
3523
3523
  name: "Max Knuckle",
3524
- desc: "Boosts the user and its allies' Attack by 1 stage. BP scales with the base move's BP.",
3524
+ desc: "Boosts the user and its allies' Attack by 1 stage. BP scales with the base move's BP. This effect does not happen if the user is not Dynamaxed. If this move is used as a base move, it deals damage with a power of 0.",
3525
3525
  shortDesc: "Base move affects power. Allies: +1 Attack.",
3526
3526
  },
3527
3527
  maxlightning: {
3528
3528
  name: "Max Lightning",
3529
- desc: "Power is equal to the base move's Max Move power. If this move is successful, the effect of Electric Terrain begins.",
3529
+ desc: "Power is equal to the base move's Max Move power. If this move is successful, the effect of Electric Terrain begins. This effect does not happen if the user is not Dynamaxed. If this move is used as a base move, it deals damage with a power of 0.",
3530
3530
  shortDesc: "Base move affects power. Starts Electric Terrain.",
3531
3531
  },
3532
3532
  maxmindstorm: {
3533
3533
  name: "Max Mindstorm",
3534
- desc: "Power is equal to the base move's Max Move power. If this move is successful, the effect of Psychic Terrain begins.",
3534
+ desc: "Power is equal to the base move's Max Move power. If this move is successful, the effect of Psychic Terrain begins. This effect does not happen if the user is not Dynamaxed. If this move is used as a base move, it deals damage with a power of 0.",
3535
3535
  shortDesc: "Base move affects power. Starts Psychic Terrain.",
3536
3536
  },
3537
3537
  maxooze: {
3538
3538
  name: "Max Ooze",
3539
- desc: "Power is equal to the base move's Max Move power. If this move is successful, the Special Attack of each Pokemon on the user's side is raised by 1 stage, even if they have a substitute.",
3539
+ desc: "Power is equal to the base move's Max Move power. If this move is successful, the Special Attack of each Pokemon on the user's side is raised by 1 stage, even if they have a substitute. This effect does not happen if the user is not Dynamaxed. If this move is used as a base move, it deals damage with a power of 0.",
3540
3540
  shortDesc: "Base move affects power. Allies: +1 Sp. Atk.",
3541
3541
  },
3542
3542
  maxovergrowth: {
3543
3543
  name: "Max Overgrowth",
3544
- desc: "Power is equal to the base move's Max Move power. If this move is successful, the effect of Grassy Terrain begins.",
3544
+ desc: "Power is equal to the base move's Max Move power. If this move is successful, the effect of Grassy Terrain begins. This effect does not happen if the user is not Dynamaxed. If this move is used as a base move, it deals damage with a power of 0.",
3545
3545
  shortDesc: "Base move affects power. Starts Grassy Terrain.",
3546
3546
  },
3547
3547
  maxphantasm: {
3548
3548
  name: "Max Phantasm",
3549
- desc: "Power is equal to the base move's Max Move power. If this move is successful, the Defense of each Pokemon on the opposing side is lowered by 1 stage, even if they have a substitute.",
3549
+ desc: "Power is equal to the base move's Max Move power. If this move is successful, the Defense of each Pokemon on the opposing side is lowered by 1 stage, even if they have a substitute. This effect does not happen if the user is not Dynamaxed. If this move is used as a base move, it deals damage with a power of 0.",
3550
3550
  shortDesc: "Base move affects power. Foes: -1 Defense.",
3551
3551
  },
3552
3552
  maxquake: {
3553
3553
  name: "Max Quake",
3554
- desc: "Power is equal to the base move's Max Move power. If this move is successful, the Special Defense of each Pokemon on the user's side is raised by 1 stage, even if they have a substitute.",
3554
+ desc: "Power is equal to the base move's Max Move power. If this move is successful, the Special Defense of each Pokemon on the user's side is raised by 1 stage, even if they have a substitute. This effect does not happen if the user is not Dynamaxed. If this move is used as a base move, it deals damage with a power of 0.",
3555
3555
  shortDesc: "Base move affects power. Allies: +1 Sp. Def.",
3556
3556
  },
3557
3557
  maxrockfall: {
3558
3558
  name: "Max Rockfall",
3559
- desc: "Power is equal to the base move's Max Move power. If this move is successful, the effect of Sandstorm begins.",
3559
+ desc: "Power is equal to the base move's Max Move power. If this move is successful, the effect of Sandstorm begins. This effect does not happen if the user is not Dynamaxed. If this move is used as a base move, it deals damage with a power of 0.",
3560
3560
  shortDesc: "Base move affects power. Starts Sandstorm.",
3561
3561
  },
3562
3562
  maxstarfall: {
3563
3563
  name: "Max Starfall",
3564
- desc: "Power is equal to the base move's Max Move power. If this move is successful, the effect of Misty Terrain begins.",
3564
+ desc: "Power is equal to the base move's Max Move power. If this move is successful, the effect of Misty Terrain begins. This effect does not happen if the user is not Dynamaxed. If this move is used as a base move, it deals damage with a power of 0.",
3565
3565
  shortDesc: "Base move affects power. Starts Misty Terrain.",
3566
3566
  },
3567
3567
  maxsteelspike: {
3568
3568
  name: "Max Steelspike",
3569
- desc: "Power is equal to the base move's Max Move power. If this move is successful, the Defense of each Pokemon on the user's side is raised by 1 stage, even if they have a substitute.",
3569
+ desc: "Power is equal to the base move's Max Move power. If this move is successful, the Defense of each Pokemon on the user's side is raised by 1 stage, even if they have a substitute. This effect does not happen if the user is not Dynamaxed. If this move is used as a base move, it deals damage with a power of 0.",
3570
3570
  shortDesc: "Base move affects power. Allies: +1 Defense.",
3571
3571
  },
3572
3572
  maxstrike: {
3573
3573
  name: "Max Strike",
3574
- desc: "Power is equal to the base move's Max Move power. If this move is successful, the Speed of each Pokemon on the opposing side is lowered by 1 stage, even if they have a substitute.",
3574
+ desc: "Power is equal to the base move's Max Move power. If this move is successful, the Speed of each Pokemon on the opposing side is lowered by 1 stage, even if they have a substitute. This effect does not happen if the user is not Dynamaxed. If this move is used as a base move, it deals damage with a power of 0.",
3575
3575
  shortDesc: "Base move affects power. Foes: -1 Speed.",
3576
3576
  },
3577
3577
  maxwyrmwind: {
3578
3578
  name: "Max Wyrmwind",
3579
- desc: "Power is equal to the base move's Max Move power. If this move is successful, the Attack of each Pokemon on the opposing side is lowered by 1 stage, even if they have a substitute.",
3579
+ desc: "Power is equal to the base move's Max Move power. If this move is successful, the Attack of each Pokemon on the opposing side is lowered by 1 stage, even if they have a substitute. This effect does not happen if the user is not Dynamaxed. If this move is used as a base move, it deals damage with a power of 0.",
3580
3580
  shortDesc: "Base move affects power. Foes: -1 Attack.",
3581
3581
  },
3582
3582
  meanlook: {
@@ -3729,7 +3729,7 @@ export const MovesText: {[k: string]: MoveText} = {
3729
3729
  },
3730
3730
  mimic: {
3731
3731
  name: "Mimic",
3732
- desc: "While the user remains active, this move is replaced by the last move used by the target. The copied move has the maximum PP for that move. Fails if the target has not made a move, if the user has Transformed, if the user already knows the move, or if the move is Chatter, Dynamax Cannon, Mimic, Sketch, Struggle, Transform, or any Z-Move.",
3732
+ desc: "While the user remains active, this move is replaced by the last move used by the target. The copied move has the maximum PP for that move. Fails if the target has not made a move, if the user has Transformed, if the user already knows the move, or if the move is Behemoth Bash, Behemoth Blade, Chatter, Dynamax Cannon, Mimic, Sketch, Struggle, Transform, or any Z-Move.",
3733
3733
  shortDesc: "The last move the target used replaces this one.",
3734
3734
  gen6: {
3735
3735
  desc: "While the user remains active, this move is replaced by the last move used by the target. The copied move has the maximum PP for that move. Fails if the target has not made a move, if the user has Transformed, if the user already knows the move, or if the move is Chatter, Mimic, Sketch, Struggle, or Transform.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pkmn/sim",
3
- "version": "0.5.1",
3
+ "version": "0.5.5",
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",
@@ -31,7 +31,7 @@
31
31
  "@pkmn/streams": "^1.0.0"
32
32
  },
33
33
  "devDependencies": {
34
- "mocha": "^9.1.3"
34
+ "mocha": "^9.1.4"
35
35
  },
36
36
  "scripts": {
37
37
  "compile": "tsc -p .",