@pkmn/sim 0.4.19 → 0.4.23

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 +752 -743
  2. package/build/config/formats.js.map +1 -1
  3. package/build/data/aliases.js +4 -4
  4. package/build/data/aliases.js.map +1 -1
  5. package/build/data/conditions.js +4 -1
  6. package/build/data/conditions.js.map +1 -1
  7. package/build/data/formats-data.js +27 -27
  8. package/build/data/formats-data.js.map +1 -1
  9. package/build/data/learnsets.js +10 -10
  10. package/build/data/learnsets.js.map +1 -1
  11. package/build/data/mods/gen1/moves.js +1 -1
  12. package/build/data/mods/gen1/moves.js.map +1 -1
  13. package/build/data/mods/gen1/scripts.js +18 -22
  14. package/build/data/mods/gen1/scripts.js.map +1 -1
  15. package/build/data/mods/gen2/scripts.js +16 -23
  16. package/build/data/mods/gen2/scripts.js.map +1 -1
  17. package/build/data/mods/gen3/moves.js +2 -1
  18. package/build/data/mods/gen3/moves.js.map +1 -1
  19. package/build/data/mods/gen4/conditions.js +6 -0
  20. package/build/data/mods/gen4/conditions.js.map +1 -1
  21. package/build/data/mods/gen4/moves.js +2 -1
  22. package/build/data/mods/gen4/moves.js.map +1 -1
  23. package/build/data/mods/gen4/scripts.js +2 -1
  24. package/build/data/mods/gen4/scripts.js.map +1 -1
  25. package/build/data/mods/gen6/conditions.js +4 -1
  26. package/build/data/mods/gen6/conditions.js.map +1 -1
  27. package/build/data/mods/gen7/formats-data.js +2 -2
  28. package/build/data/mods/gen7/formats-data.js.map +1 -1
  29. package/build/data/mods/gen7/moves.js +8 -0
  30. package/build/data/mods/gen7/moves.js.map +1 -1
  31. package/build/data/moves.js +26 -14
  32. package/build/data/moves.js.map +1 -1
  33. package/build/data/rulesets.js +258 -16
  34. package/build/data/rulesets.js.map +1 -1
  35. package/build/data/tags.js +3 -3
  36. package/build/data/tags.js.map +1 -1
  37. package/build/lib/streams.d.ts +1 -199
  38. package/build/lib/streams.js +11 -772
  39. package/build/lib/streams.js.map +1 -1
  40. package/build/sim/battle-actions.d.ts +1 -1
  41. package/build/sim/battle-actions.js +18 -42
  42. package/build/sim/battle-actions.js.map +1 -1
  43. package/build/sim/battle.d.ts +1 -0
  44. package/build/sim/battle.js +5 -0
  45. package/build/sim/battle.js.map +1 -1
  46. package/build/sim/dex-moves.d.ts +31 -11
  47. package/build/sim/dex-moves.js +4 -3
  48. package/build/sim/dex-moves.js.map +1 -1
  49. package/build/sim/dex-species.js +11 -1
  50. package/build/sim/dex-species.js.map +1 -1
  51. package/build/sim/exported-global-types.d.ts +4 -0
  52. package/build/sim/global-types.d.ts +4 -0
  53. package/build/sim/pokemon.js +1 -1
  54. package/build/sim/pokemon.js.map +1 -1
  55. package/build/sim/side.js +2 -2
  56. package/build/sim/side.js.map +1 -1
  57. package/build/sim/team-validator.d.ts +4 -0
  58. package/build/sim/team-validator.js +37 -11
  59. package/build/sim/team-validator.js.map +1 -1
  60. package/config/formats.ts +649 -630
  61. package/data/aliases.ts +4 -4
  62. package/data/conditions.ts +4 -1
  63. package/data/formats-data.ts +27 -27
  64. package/data/learnsets.ts +10 -10
  65. package/data/mods/gen1/moves.ts +1 -1
  66. package/data/mods/gen1/scripts.ts +23 -19
  67. package/data/mods/gen2/scripts.ts +20 -19
  68. package/data/mods/gen3/moves.ts +2 -1
  69. package/data/mods/gen4/conditions.ts +6 -0
  70. package/data/mods/gen4/moves.ts +2 -1
  71. package/data/mods/gen4/scripts.ts +1 -1
  72. package/data/mods/gen6/conditions.ts +4 -1
  73. package/data/mods/gen7/formats-data.ts +2 -2
  74. package/data/mods/gen7/moves.ts +8 -0
  75. package/data/moves.ts +23 -14
  76. package/data/rulesets.ts +235 -16
  77. package/data/tags.ts +3 -3
  78. package/lib/streams.ts +1 -874
  79. package/package.json +4 -3
  80. package/sim/battle-actions.ts +19 -40
  81. package/sim/battle.ts +6 -0
  82. package/sim/dex-moves.ts +35 -13
  83. package/sim/dex-species.ts +10 -1
  84. package/sim/exported-global-types.ts +4 -0
  85. package/sim/global-types.ts +4 -0
  86. package/sim/pokemon.ts +1 -1
  87. package/sim/side.ts +2 -2
  88. package/sim/team-validator.ts +41 -10
package/data/aliases.ts CHANGED
@@ -14,8 +14,8 @@ export const Aliases: {[alias: string]: string} = {
14
14
  mono: "[Gen 8] Monotype",
15
15
  ag: "[Gen 8] Anything Goes",
16
16
  bss: "[Gen 8] Battle Stadium Singles",
17
- vgc: "[Gen 8] VGC 2021 Series 10",
18
- bsd: "[Gen 8] VGC 2021 Series 10",
17
+ vgc: "[Gen 8] VGC 2021 Series 11",
18
+ bsd: "[Gen 8] VGC 2021 Series 11",
19
19
  randdubs: "[Gen 8] Random Doubles Battle",
20
20
  doubles: "[Gen 8] Doubles OU",
21
21
  dou: "[Gen 8] Doubles OU",
@@ -65,8 +65,8 @@ export const Aliases: {[alias: string]: string} = {
65
65
  gen6mono: "[Gen 6] Monotype",
66
66
  gen6ag: "[Gen 6] Anything Goes",
67
67
  crossevo: "[Gen 8] Cross Evolution",
68
- omotm: "[Gen 8] Inheritance",
69
- lcotm: "[Gen 8] Godly Gift",
68
+ omotm: "[Gen 8] Sketchmons",
69
+ lcotm: "[Gen 8] AAA Doubles",
70
70
 
71
71
  // mega evos
72
72
  fabio: "Ampharos-Mega",
@@ -28,9 +28,12 @@ export const Conditions: {[k: string]: ConditionData} = {
28
28
  }
29
29
  },
30
30
  onModifySpe(spe, pokemon) {
31
+ // Paralysis occurs after all other Speed modifiers, so evaluate all modifiers up to this point first
32
+ spe = this.finalModify(spe);
31
33
  if (!pokemon.hasAbility('quickfeet')) {
32
- return this.chainModify(0.5);
34
+ spe = Math.floor(spe * 50 / 100);
33
35
  }
36
+ return spe;
34
37
  },
35
38
  onBeforeMovePriority: 1,
36
39
  onBeforeMove(pokemon) {
@@ -276,7 +276,7 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
276
276
  randomBattleMoves: ["earthquake", "knockoff", "rapidspin", "stealthrock", "swordsdance", "toxic", "spikes", "stoneedge"],
277
277
  randomBattleLevel: 86,
278
278
  randomDoubleBattleMoves: ["drillrun", "knockoff", "protect", "stealthrock", "stoneedge", "swordsdance"],
279
- randomDoubleBattleLevel: 88,
279
+ randomDoubleBattleLevel: 89,
280
280
  tier: "PU",
281
281
  doublesTier: "(DUU)",
282
282
  },
@@ -467,7 +467,7 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
467
467
  },
468
468
  persianalola: {
469
469
  randomBattleMoves: ["darkpulse", "hypnosis", "nastyplot", "thunderbolt"],
470
- randomBattleLevel: 83,
470
+ randomBattleLevel: 82,
471
471
  randomDoubleBattleMoves: ["fakeout", "foulplay", "icywind", "partingshot", "protect", "snarl", "taunt"],
472
472
  randomDoubleBattleLevel: 88,
473
473
  tier: "(PU)",
@@ -847,7 +847,7 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
847
847
  },
848
848
  exeggutoralola: {
849
849
  randomBattleMoves: ["dracometeor", "flamethrower", "gigadrain", "leafstorm", "trickroom"],
850
- randomBattleLevel: 86,
850
+ randomBattleLevel: 87,
851
851
  randomDoubleBattleMoves: ["dragonpulse", "energyball", "flamethrower", "protect", "trickroom"],
852
852
  randomDoubleBattleLevel: 88,
853
853
  tier: "PUBL",
@@ -1139,7 +1139,7 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
1139
1139
  randomBattleMoves: ["bounce", "dragondance", "earthquake", "powerwhip", "waterfall"],
1140
1140
  randomBattleLevel: 76,
1141
1141
  randomDoubleBattleMoves: ["bounce", "dragondance", "icefang", "powerwhip", "protect", "waterfall"],
1142
- randomDoubleBattleLevel: 82,
1142
+ randomDoubleBattleLevel: 81,
1143
1143
  tier: "UU",
1144
1144
  doublesTier: "(DUU)",
1145
1145
  },
@@ -1353,7 +1353,7 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
1353
1353
  randomBattleMoves: ["airslash", "defog", "fireblast", "roost", "uturn"],
1354
1354
  randomBattleLevel: 80,
1355
1355
  randomDoubleBattleMoves: ["bravebird", "fireblast", "heatwave", "protect", "roost", "tailwind"],
1356
- randomDoubleBattleLevel: 83,
1356
+ randomDoubleBattleLevel: 81,
1357
1357
  randomBattleNoDynamaxMoves: ["defog", "fireblast", "hurricane", "roost", "uturn"],
1358
1358
  tier: "UU",
1359
1359
  doublesTier: "(DUU)",
@@ -1703,7 +1703,7 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
1703
1703
  tier: "NFE",
1704
1704
  },
1705
1705
  weavile: {
1706
- randomBattleMoves: ["iceshard", "iciclecrash", "knockoff", "lowkick", "swordsdance"],
1706
+ randomBattleMoves: ["iceshard", "knockoff", "lowkick", "swordsdance", "tripleaxel"],
1707
1707
  randomBattleLevel: 79,
1708
1708
  randomDoubleBattleMoves: ["fakeout", "iceshard", "knockoff", "swordsdance", "tripleaxel"],
1709
1709
  randomDoubleBattleLevel: 84,
@@ -1736,13 +1736,13 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
1736
1736
  randomBattleMoves: ["earthquake", "iceshard", "iciclecrash", "knockoff", "stealthrock", "superpower"],
1737
1737
  randomBattleLevel: 80,
1738
1738
  randomDoubleBattleMoves: ["highhorsepower", "iceshard", "iciclecrash", "protect", "rockslide"],
1739
- randomDoubleBattleLevel: 84,
1739
+ randomDoubleBattleLevel: 83,
1740
1740
  tier: "UU",
1741
1741
  doublesTier: "(DUU)",
1742
1742
  },
1743
1743
  corsola: {
1744
1744
  randomBattleMoves: ["powergem", "recover", "scald", "stealthrock", "toxic"],
1745
- randomBattleLevel: 92,
1745
+ randomBattleLevel: 93,
1746
1746
  randomDoubleBattleMoves: ["icywind", "lifedew", "recover", "scald", "toxic"],
1747
1747
  randomDoubleBattleLevel: 95,
1748
1748
  tier: "(PU)",
@@ -2662,7 +2662,7 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
2662
2662
  randomBattleLevel: 80,
2663
2663
  randomDoubleBattleMoves: ["calmmind", "dracometeor", "healpulse", "mysticalfire", "psyshock", "roost", "tailwind"],
2664
2664
  randomDoubleBattleLevel: 82,
2665
- tier: "UU",
2665
+ tier: "UUBL",
2666
2666
  doublesTier: "(DUU)",
2667
2667
  },
2668
2668
  latiasmega: {
@@ -2707,7 +2707,7 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
2707
2707
  tier: "Illegal",
2708
2708
  },
2709
2709
  rayquaza: {
2710
- randomBattleMoves: ["dracometeor", "dragonascent", "extremespeed", "swordsdance", "vcreate", "earthquake"],
2710
+ randomBattleMoves: ["dracometeor", "dragonascent", "dragondance", "extremespeed", "swordsdance", "vcreate", "earthquake"],
2711
2711
  randomBattleLevel: 74,
2712
2712
  randomDoubleBattleMoves: ["dracometeor", "dragonascent", "dragonclaw", "dragondance", "earthpower", "extremespeed", "vcreate"],
2713
2713
  randomDoubleBattleLevel: 74,
@@ -2885,7 +2885,7 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
2885
2885
  },
2886
2886
  cherrim: {
2887
2887
  randomBattleMoves: ["dazzlinggleam", "energyball", "healingwish", "petaldance", "pollenpuff"],
2888
- randomBattleLevel: 92,
2888
+ randomBattleLevel: 93,
2889
2889
  randomDoubleBattleMoves: ["aromatherapy", "energyball", "helpinghand", "pollenpuff", "protect"],
2890
2890
  randomDoubleBattleLevel: 92,
2891
2891
  tier: "(PU)",
@@ -3192,7 +3192,7 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
3192
3192
  randomBattleMoves: ["calmmind", "moonblast", "moonlight", "psyshock", "thunderwave", "toxic"],
3193
3193
  randomBattleLevel: 80,
3194
3194
  randomDoubleBattleMoves: ["allyswitch", "helpinghand", "icywind", "moonlight", "psychic"],
3195
- randomDoubleBattleLevel: 84,
3195
+ randomDoubleBattleLevel: 83,
3196
3196
  tier: "NUBL",
3197
3197
  doublesTier: "DUU",
3198
3198
  },
@@ -3445,7 +3445,7 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
3445
3445
  randomBattleMoves: ["healbell", "knockoff", "protect", "toxic", "wish"],
3446
3446
  randomBattleLevel: 88,
3447
3447
  randomDoubleBattleMoves: ["bodyslam", "healpulse", "helpinghand", "knockoff", "protect", "thunderwave"],
3448
- randomDoubleBattleLevel: 88,
3448
+ randomDoubleBattleLevel: 89,
3449
3449
  tier: "PU",
3450
3450
  doublesTier: "(DUU)",
3451
3451
  },
@@ -3608,7 +3608,7 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
3608
3608
  randomBattleMoves: ["energyball", "knockoff", "leechseed", "spikes", "spikyshield", "toxic"],
3609
3609
  randomBattleLevel: 94,
3610
3610
  randomDoubleBattleMoves: ["acupressure", "drainpunch", "helpinghand", "leafstorm", "spikyshield", "suckerpunch"],
3611
- randomDoubleBattleLevel: 95,
3611
+ randomDoubleBattleLevel: 96, // buffed twice in the last 6 months as of Nov 2021
3612
3612
  tier: "(PU)",
3613
3613
  doublesTier: "(DUU)",
3614
3614
  },
@@ -4089,7 +4089,7 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
4089
4089
  doublesTier: "(DUU)",
4090
4090
  },
4091
4091
  virizion: {
4092
- randomBattleMoves: ["airslash", "closecombat", "leafblade", "leafstorm", "stoneedge", "swordsdance"],
4092
+ randomBattleMoves: ["closecombat", "leafblade", "stoneedge", "swordsdance"],
4093
4093
  randomBattleLevel: 82,
4094
4094
  randomDoubleBattleMoves: ["closecombat", "coaching", "leafblade", "protect", "stoneedge", "swordsdance"],
4095
4095
  randomDoubleBattleLevel: 86,
@@ -4172,7 +4172,7 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
4172
4172
  },
4173
4173
  kyuremblack: {
4174
4174
  randomBattleMoves: ["dragondance", "fusionbolt", "iciclespear", "outrage"],
4175
- randomBattleLevel: 74,
4175
+ randomBattleLevel: 73,
4176
4176
  randomDoubleBattleMoves: ["dragonclaw", "dragondance", "fusionbolt", "iciclespear", "protect", "roost"],
4177
4177
  randomDoubleBattleLevel: 75,
4178
4178
  tier: "Uber",
@@ -4510,7 +4510,7 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
4510
4510
  },
4511
4511
  dedenne: {
4512
4512
  randomBattleMoves: ["protect", "recycle", "thunderbolt", "toxic"],
4513
- randomBattleLevel: 86,
4513
+ randomBattleLevel: 87,
4514
4514
  randomDoubleBattleMoves: ["eerieimpulse", "helpinghand", "nuzzle", "recycle", "superfang", "thunderbolt"],
4515
4515
  randomDoubleBattleLevel: 88,
4516
4516
  tier: "(PU)",
@@ -5110,7 +5110,7 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
5110
5110
  randomBattleMoves: ["defog", "flamethrower", "icebeam", "multiattack", "partingshot", "toxic"],
5111
5111
  randomBattleLevel: 84,
5112
5112
  randomDoubleBattleMoves: ["multiattack", "rockslide", "swordsdance", "tailwind"],
5113
- randomDoubleBattleLevel: 90,
5113
+ randomDoubleBattleLevel: 89,
5114
5114
  tier: "(PU)",
5115
5115
  doublesTier: "(DUU)",
5116
5116
  },
@@ -5150,7 +5150,7 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
5150
5150
  randomBattleMoves: ["defog", "flamethrower", "multiattack", "partingshot", "thunderbolt", "toxic"],
5151
5151
  randomBattleLevel: 84,
5152
5152
  randomDoubleBattleMoves: ["flamethrower", "multiattack", "partingshot", "tailwind", "thunderbolt"],
5153
- randomDoubleBattleLevel: 88,
5153
+ randomDoubleBattleLevel: 87,
5154
5154
  tier: "NU",
5155
5155
  doublesTier: "(DUU)",
5156
5156
  },
@@ -5218,7 +5218,7 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
5218
5218
  randomBattleLevel: 86,
5219
5219
  randomDoubleBattleMoves: ["dracometeor", "dragonpulse", "glare", "heatwave", "hurricane", "hypervoice", "protect", "roost"],
5220
5220
  randomDoubleBattleLevel: 88,
5221
- tier: "PU",
5221
+ tier: "PUBL",
5222
5222
  doublesTier: "(DUU)",
5223
5223
  },
5224
5224
  dhelmise: {
@@ -5240,7 +5240,7 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
5240
5240
  randomBattleLevel: 80,
5241
5241
  randomDoubleBattleMoves: ["bodypress", "dracometeor", "irondefense", "protect"],
5242
5242
  randomDoubleBattleLevel: 80,
5243
- tier: "UU",
5243
+ tier: "UUBL",
5244
5244
  doublesTier: "(DUU)",
5245
5245
  },
5246
5246
  kommoototem: {
@@ -5336,8 +5336,8 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
5336
5336
  },
5337
5337
  celesteela: {
5338
5338
  randomBattleMoves: ["airslash", "earthquake", "fireblast", "flashcannon", "leechseed", "protect"],
5339
- randomBattleLevel: 78,
5340
- randomDoubleBattleMoves: ["airslash", "autotomize", "earthquake", "fireblast", "flashcannon"],
5339
+ randomBattleLevel: 77,
5340
+ randomDoubleBattleMoves: ["airslash", "fireblast", "flashcannon", "leechseed", "protect", "wideguard"],
5341
5341
  randomDoubleBattleLevel: 78,
5342
5342
  randomBattleNoDynamaxMoves: ["airslash", "earthquake", "fireblast", "heavyslam", "leechseed", "protect"],
5343
5343
  tier: "UU",
@@ -5955,7 +5955,7 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
5955
5955
  randomBattleMoves: ["crunch", "fishiousrend", "icefang", "lowkick", "psychicfangs"],
5956
5956
  randomBattleLevel: 80,
5957
5957
  randomDoubleBattleMoves: ["crunch", "dragonrush", "fishiousrend", "icefang", "psychicfangs"],
5958
- randomDoubleBattleLevel: 80,
5958
+ randomDoubleBattleLevel: 78,
5959
5959
  tier: "Uber",
5960
5960
  doublesTier: "DOU",
5961
5961
  },
@@ -6099,16 +6099,16 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
6099
6099
  randomBattleLevel: 78,
6100
6100
  randomDoubleBattleMoves: ["crunch", "dragonclaw", "dragonenergy", "firefang"],
6101
6101
  randomDoubleBattleLevel: 78,
6102
- tier: "NU",
6102
+ tier: "NUBL",
6103
6103
  doublesTier: "DUU",
6104
6104
  },
6105
6105
  glastrier: {
6106
6106
  randomBattleMoves: ["closecombat", "highhorsepower", "iciclecrash", "swordsdance"],
6107
6107
  randomBattleLevel: 82,
6108
6108
  randomDoubleBattleMoves: ["closecombat", "highhorsepower", "iciclecrash", "protect"],
6109
- randomDoubleBattleLevel: 83,
6109
+ randomDoubleBattleLevel: 82,
6110
6110
  tier: "NU",
6111
- doublesTier: "DUU",
6111
+ doublesTier: "(DUU)",
6112
6112
  },
6113
6113
  spectrier: {
6114
6114
  randomBattleMoves: ["darkpulse", "nastyplot", "shadowball", "substitute"],
package/data/learnsets.ts CHANGED
@@ -46376,7 +46376,6 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
46376
46376
  coaching: ["8T"],
46377
46377
  confide: ["7M", "6M"],
46378
46378
  corrosivegas: ["8T"],
46379
- covet: ["7T", "6T", "5T"],
46380
46379
  crosspoison: ["8M"],
46381
46380
  cut: ["6M", "5M", "4M"],
46382
46381
  darkpulse: ["8M", "7M", "6M", "5T", "4M"],
@@ -76668,12 +76667,12 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
76668
76667
  hypervoice: ["8M"],
76669
76668
  icefang: ["8M"],
76670
76669
  imprison: ["8M"],
76671
- ironhead: ["8M", "8L33", "8S0"],
76670
+ ironhead: ["8M", "8L33", "8S0", "8S1"],
76672
76671
  irontail: ["8M"],
76673
76672
  laserfocus: ["8L44"],
76674
76673
  metalclaw: ["8L1"],
76675
76674
  moonblast: ["8L66"],
76676
- playrough: ["8M"],
76675
+ playrough: ["8M", "8S1"],
76677
76676
  protect: ["8M"],
76678
76677
  psychicfangs: ["8M"],
76679
76678
  psychocut: ["8M"],
@@ -76684,7 +76683,7 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
76684
76683
  revenge: ["8M"],
76685
76684
  reversal: ["8M"],
76686
76685
  round: ["8M"],
76687
- sacredsword: ["8L1", "8S0"],
76686
+ sacredsword: ["8L1", "8S0", "8S1"],
76688
76687
  scaryface: ["8M"],
76689
76688
  slash: ["8L11"],
76690
76689
  sleeptalk: ["8M"],
@@ -76694,7 +76693,7 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
76694
76693
  steelbeam: ["8T"],
76695
76694
  substitute: ["8M"],
76696
76695
  swift: ["8M"],
76697
- swordsdance: ["8M", "8L22", "8S0"],
76696
+ swordsdance: ["8M", "8L22", "8S0", "8S1"],
76698
76697
  tailslap: ["8M"],
76699
76698
  thunderfang: ["8M"],
76700
76699
  wildcharge: ["8M"],
@@ -76702,6 +76701,7 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
76702
76701
  },
76703
76702
  eventData: [
76704
76703
  {generation: 8, level: 70, perfectIVs: 3, moves: ["sacredsword", "swordsdance", "ironhead", "crunch"]},
76704
+ {generation: 8, level: 100, shiny: true, nature: "Adamant", ivs: {hp: 31, atk: 31, def: 31, spa: 30, spd: 31, spe: 31}, moves: ["ironhead", "playrough", "swordsdance", "sacredsword"], pokeball: "cherishball"},
76705
76705
  ],
76706
76706
  eventOnly: true,
76707
76707
  },
@@ -76715,7 +76715,7 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
76715
76715
  learnset: {
76716
76716
  agility: ["8M"],
76717
76717
  bite: ["8L1"],
76718
- closecombat: ["8M", "8L77"],
76718
+ closecombat: ["8M", "8L77", "8S1"],
76719
76719
  coaching: ["8T"],
76720
76720
  crunch: ["8M", "8L55", "8S0"],
76721
76721
  dazzlinggleam: ["8M"],
@@ -76734,8 +76734,8 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
76734
76734
  hypervoice: ["8M"],
76735
76735
  icefang: ["8M"],
76736
76736
  imprison: ["8M"],
76737
- irondefense: ["8M", "8L22", "8S0"],
76738
- ironhead: ["8M", "8L33", "8S0"],
76737
+ irondefense: ["8M", "8L22", "8S0", "8S1"],
76738
+ ironhead: ["8M", "8L33", "8S0", "8S1"],
76739
76739
  irontail: ["8M"],
76740
76740
  laserfocus: ["8L44"],
76741
76741
  lightscreen: ["8M"],
@@ -76766,12 +76766,13 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
76766
76766
  swift: ["8M"],
76767
76767
  tailslap: ["8M"],
76768
76768
  thunderfang: ["8M"],
76769
- wideguard: ["8L1"],
76769
+ wideguard: ["8L1", "8S1"],
76770
76770
  wildcharge: ["8M"],
76771
76771
  workup: ["8M"],
76772
76772
  },
76773
76773
  eventData: [
76774
76774
  {generation: 8, level: 70, perfectIVs: 3, moves: ["slash", "crunch", "ironhead", "irondefense"]},
76775
+ {generation: 8, level: 100, shiny: true, nature: "Adamant", ivs: {hp: 31, atk: 31, def: 31, spa: 30, spd: 31, spe: 31}, moves: ["ironhead", "closecombat", "irondefense", "wideguard"], pokeball: "cherishball"},
76775
76776
  ],
76776
76777
  eventOnly: true,
76777
76778
  },
@@ -82519,7 +82520,6 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
82519
82520
  snatch: ["7M", "4M"],
82520
82521
  snore: ["8M", "7T", "4T"],
82521
82522
  spite: ["8L12", "7T", "4T"],
82522
- steelbeam: ["8T"],
82523
82523
  substitute: ["8M", "7M", "4M"],
82524
82524
  suckerpunch: ["8E", "7E", "4T"],
82525
82525
  sunnyday: ["8M", "7M", "4M"],
@@ -82,7 +82,7 @@ export const Moves: {[k: string]: ModdedMoveData} = {
82
82
  if (this.effectState.duration === 1) {
83
83
  this.add('-end', pokemon, 'Bide');
84
84
  if (!this.effectState.totalDamage) {
85
- this.debug("Bide failed due to 0 damage taken");
85
+ this.debug("Bide failed because no damage was taken");
86
86
  this.add('-fail', pokemon);
87
87
  return false;
88
88
  }
@@ -236,7 +236,7 @@ export const Scripts: ModdedBattleScriptsData = {
236
236
  // First, check if the target is semi-invulnerable
237
237
  let hitResult = this.battle.runEvent('Invulnerability', target, pokemon, move);
238
238
  if (hitResult === false) {
239
- if (!move.spreadHit) this.battle.attrLastMove('[miss]');
239
+ this.battle.attrLastMove('[miss]');
240
240
  this.battle.add('-miss', pokemon);
241
241
  return false;
242
242
  }
@@ -579,7 +579,7 @@ export const Scripts: ModdedBattleScriptsData = {
579
579
  return damage;
580
580
  },
581
581
  // This calculates the damage pokemon does to target with move.
582
- getDamage(pokemon, target, move, suppressMessages) {
582
+ getDamage(source, target, move, suppressMessages) {
583
583
  // First of all, we get the move.
584
584
  if (typeof move === 'string') {
585
585
  move = this.battle.dex.getActiveMove(move);
@@ -607,12 +607,12 @@ export const Scripts: ModdedBattleScriptsData = {
607
607
 
608
608
  // We edit the damage through move's damage callback if necessary.
609
609
  if (move.damageCallback) {
610
- return move.damageCallback.call(this.battle, pokemon, target);
610
+ return move.damageCallback.call(this.battle, source, target);
611
611
  }
612
612
 
613
613
  // We take damage from damage=level moves (seismic toss).
614
614
  if (move.damage === 'level') {
615
- return pokemon.level;
615
+ return source.level;
616
616
  }
617
617
 
618
618
  // If there's a fix move damage, we return that.
@@ -626,13 +626,12 @@ export const Scripts: ModdedBattleScriptsData = {
626
626
  }
627
627
 
628
628
  // Let's check if we are in middle of a partial trap sequence to return the previous damage.
629
- if (pokemon.volatiles['partialtrappinglock'] && (target === pokemon.volatiles['partialtrappinglock'].locked)) {
630
- return pokemon.volatiles['partialtrappinglock'].damage;
629
+ if (source.volatiles['partialtrappinglock'] && (target === source.volatiles['partialtrappinglock'].locked)) {
630
+ return source.volatiles['partialtrappinglock'].damage;
631
631
  }
632
632
 
633
633
  // We check the category and typing to calculate later on the damage.
634
634
  if (!move.category) move.category = 'Physical';
635
- if (!move.defensiveCategory) move.defensiveCategory = move.category;
636
635
  // '???' is typeless damage: used for Struggle and Confusion etc
637
636
  if (!move.type) move.type = '???';
638
637
  const type = move.type;
@@ -640,7 +639,7 @@ export const Scripts: ModdedBattleScriptsData = {
640
639
  // We get the base power and apply basePowerCallback if necessary.
641
640
  let basePower: number | false | null = move.basePower;
642
641
  if (move.basePowerCallback) {
643
- basePower = move.basePowerCallback.call(this.battle, pokemon, target, move);
642
+ basePower = move.basePowerCallback.call(this.battle, source, target, move);
644
643
  }
645
644
  if (!basePower) {
646
645
  return basePower === 0 ? undefined : basePower;
@@ -652,10 +651,10 @@ export const Scripts: ModdedBattleScriptsData = {
652
651
  if (!isCrit) {
653
652
  // In gen 1, the critical chance is based on speed.
654
653
  // First, we get the base speed, divide it by 2 and floor it. This is our current crit chance.
655
- let critChance = Math.floor(pokemon.species.baseStats['spe'] / 2);
654
+ let critChance = Math.floor(source.species.baseStats['spe'] / 2);
656
655
 
657
656
  // Now we check for focus energy volatile.
658
- if (pokemon.volatiles['focusenergy']) {
657
+ if (source.volatiles['focusenergy']) {
659
658
  // If it exists, crit chance is divided by 2 again and floored.
660
659
  critChance = Math.floor(critChance / 2);
661
660
  } else {
@@ -683,7 +682,7 @@ export const Scripts: ModdedBattleScriptsData = {
683
682
 
684
683
  // Happens after crit calculation.
685
684
  if (basePower) {
686
- basePower = this.battle.runEvent('BasePower', pokemon, target, move, basePower);
685
+ basePower = this.battle.runEvent('BasePower', source, target, move, basePower);
687
686
  if (basePower && move.basePowerModifier) {
688
687
  basePower *= move.basePowerModifier;
689
688
  }
@@ -692,14 +691,17 @@ export const Scripts: ModdedBattleScriptsData = {
692
691
  basePower = this.battle.clampIntRange(basePower, 1);
693
692
 
694
693
  // We now check attacker's and defender's stats.
695
- let level = pokemon.level;
696
- let attacker = pokemon;
697
- const defender = target;
698
- if (move.useTargetOffensive) attacker = target;
699
- const atkType: StatIDExceptHP = (move.category === 'Physical') ? 'atk' : 'spa';
700
- const defType: StatIDExceptHP = (move.defensiveCategory === 'Physical') ? 'def' : 'spd';
701
- let attack = attacker.getStat(move.useSourceDefensiveAsOffensive ? defType : atkType);
694
+ let level = source.level;
695
+ const attacker = move.overrideOffensivePokemon === 'target' ? target : source;
696
+ const defender = move.overrideDefensivePokemon === 'source' ? source : target;
697
+
698
+ const isPhysical = move.category === 'Physical';
699
+ const atkType: StatIDExceptHP = move.overrideOffensiveStat || (isPhysical ? 'atk' : 'spa');
700
+ const defType: StatIDExceptHP = move.overrideDefensiveStat || (isPhysical ? 'def' : 'spd');
701
+
702
+ let attack = attacker.getStat(atkType);
702
703
  let defense = defender.getStat(defType);
704
+
703
705
  // In gen 1, screen effect is applied here.
704
706
  if ((defType === 'def' && defender.volatiles['reflect']) || (defType === 'spd' && defender.volatiles['lightscreen'])) {
705
707
  this.battle.debug('Screen doubling (Sp)Def');
@@ -716,10 +718,12 @@ export const Scripts: ModdedBattleScriptsData = {
716
718
  level *= 2;
717
719
  if (!suppressMessages) this.battle.add('-crit', target);
718
720
  }
721
+
719
722
  if (move.ignoreOffensive) {
720
723
  this.battle.debug('Negating (sp)atk boost/penalty.');
721
724
  attack = attacker.getStat(atkType, true);
722
725
  }
726
+
723
727
  if (move.ignoreDefensive) {
724
728
  this.battle.debug('Negating (sp)def boost/penalty.');
725
729
  // No screens
@@ -751,7 +755,7 @@ export const Scripts: ModdedBattleScriptsData = {
751
755
  damage += 2;
752
756
 
753
757
  // STAB damage bonus, the "???" type never gets STAB
754
- if (type !== '???' && pokemon.hasType(type)) {
758
+ if (type !== '???' && source.hasType(type)) {
755
759
  damage += Math.floor(damage / 2);
756
760
  }
757
761
 
@@ -162,7 +162,7 @@ export const Scripts: ModdedBattleScriptsData = {
162
162
 
163
163
  hitResult = this.battle.runEvent('Invulnerability', target, pokemon, move);
164
164
  if (hitResult === false) {
165
- if (!move.spreadHit) this.battle.attrLastMove('[miss]');
165
+ this.battle.attrLastMove('[miss]');
166
166
  this.battle.add('-miss', pokemon);
167
167
  return false;
168
168
  }
@@ -466,7 +466,7 @@ export const Scripts: ModdedBattleScriptsData = {
466
466
  }
467
467
  return damage;
468
468
  },
469
- getDamage(pokemon, target, move, suppressMessages) {
469
+ getDamage(source, target, move, suppressMessages) {
470
470
  // First of all, we get the move.
471
471
  if (typeof move === 'string') {
472
472
  move = this.dex.getActiveMove(move);
@@ -494,12 +494,12 @@ export const Scripts: ModdedBattleScriptsData = {
494
494
 
495
495
  // We edit the damage through move's damage callback
496
496
  if (move.damageCallback) {
497
- return move.damageCallback.call(this.battle, pokemon, target);
497
+ return move.damageCallback.call(this.battle, source, target);
498
498
  }
499
499
 
500
500
  // We take damage from damage=level moves
501
501
  if (move.damage === 'level') {
502
- return pokemon.level;
502
+ return source.level;
503
503
  }
504
504
 
505
505
  // If there's a fix move damage, we run it
@@ -509,7 +509,6 @@ export const Scripts: ModdedBattleScriptsData = {
509
509
 
510
510
  // We check the category and typing to calculate later on the damage
511
511
  move.category = this.battle.getCategory(move);
512
- if (!move.defensiveCategory) move.defensiveCategory = move.category;
513
512
  // '???' is typeless damage: used for Struggle and Confusion etc
514
513
  if (!move.type) move.type = '???';
515
514
  const type = move.type;
@@ -517,7 +516,7 @@ export const Scripts: ModdedBattleScriptsData = {
517
516
  // We get the base power and apply basePowerCallback if necessary
518
517
  let basePower: number | false | null | undefined = move.basePower;
519
518
  if (move.basePowerCallback) {
520
- basePower = move.basePowerCallback.call(this.battle, pokemon, target, move);
519
+ basePower = move.basePowerCallback.call(this.battle, source, target, move);
521
520
  }
522
521
 
523
522
  // We check for Base Power
@@ -528,7 +527,7 @@ export const Scripts: ModdedBattleScriptsData = {
528
527
  basePower = this.battle.clampIntRange(basePower, 1);
529
528
 
530
529
  // Checking for the move's Critical Hit ratio
531
- let critRatio = this.battle.runEvent('ModifyCritRatio', pokemon, target, move, move.critRatio || 0);
530
+ let critRatio = this.battle.runEvent('ModifyCritRatio', source, target, move, move.critRatio || 0);
532
531
  critRatio = this.battle.clampIntRange(critRatio, 0, 5);
533
532
  const critMult = [0, 16, 8, 4, 3, 2];
534
533
  let isCrit = move.willCrit || false;
@@ -547,10 +546,10 @@ export const Scripts: ModdedBattleScriptsData = {
547
546
  // confusion damage
548
547
  if (move.isConfusionSelfHit) {
549
548
  move.type = move.baseMoveType!;
550
- basePower = this.battle.runEvent('BasePower', pokemon, target, move, basePower, true);
549
+ basePower = this.battle.runEvent('BasePower', source, target, move, basePower, true);
551
550
  move.type = '???';
552
551
  } else {
553
- basePower = this.battle.runEvent('BasePower', pokemon, target, move, basePower, true);
552
+ basePower = this.battle.runEvent('BasePower', source, target, move, basePower, true);
554
553
  }
555
554
  if (basePower && move.basePowerModifier) {
556
555
  basePower *= move.basePowerModifier;
@@ -560,20 +559,21 @@ export const Scripts: ModdedBattleScriptsData = {
560
559
  basePower = this.battle.clampIntRange(basePower, 1);
561
560
 
562
561
  // We now check for attacker and defender
563
- let level = pokemon.level;
562
+ let level = source.level;
564
563
 
565
564
  // Using Beat Up
566
565
  if (move.allies) {
567
- this.battle.add('-activate', pokemon, 'move: Beat Up', '[of] ' + move.allies[0].name);
566
+ this.battle.add('-activate', source, 'move: Beat Up', '[of] ' + move.allies[0].name);
568
567
  level = move.allies[0].level;
569
568
  }
570
569
 
571
- let attacker = pokemon;
572
- const defender = target;
573
- if (move.useTargetOffensive) attacker = target;
574
- let atkType: StatIDExceptHP = (move.category === 'Physical') ? 'atk' : 'spa';
575
- const defType: StatIDExceptHP = (move.defensiveCategory === 'Physical') ? 'def' : 'spd';
576
- if (move.useSourceDefensiveAsOffensive) atkType = defType;
570
+ const attacker = move.overrideOffensivePokemon === 'target' ? target : source;
571
+ const defender = move.overrideDefensivePokemon === 'source' ? source : target;
572
+
573
+ const isPhysical = move.category === 'Physical';
574
+ const atkType: StatIDExceptHP = move.overrideOffensiveStat || (isPhysical ? 'atk' : 'spa');
575
+ const defType: StatIDExceptHP = move.overrideDefensiveStat || (isPhysical ? 'def' : 'spd');
576
+
577
577
  let unboosted = false;
578
578
  let noburndrop = false;
579
579
 
@@ -586,7 +586,7 @@ export const Scripts: ModdedBattleScriptsData = {
586
586
  noburndrop = true;
587
587
  }
588
588
  }
589
- // Get stats now.
589
+
590
590
  let attack = attacker.getStat(atkType, unboosted, noburndrop);
591
591
  let defense = defender.getStat(defType, unboosted);
592
592
 
@@ -603,6 +603,7 @@ export const Scripts: ModdedBattleScriptsData = {
603
603
  // The attack drop from the burn is only applied when attacker's attack level is higher than defender's defense level.
604
604
  attack = attacker.getStat(atkType, true, true);
605
605
  }
606
+
606
607
  if (move.ignoreDefensive) {
607
608
  this.battle.debug('Negating (sp)def boost/penalty.');
608
609
  defense = target.getStat(defType, true, true);
@@ -666,7 +667,7 @@ export const Scripts: ModdedBattleScriptsData = {
666
667
  }
667
668
 
668
669
  // STAB damage bonus, the "???" type never gets STAB
669
- if (type !== '???' && pokemon.hasType(type)) {
670
+ if (type !== '???' && source.hasType(type)) {
670
671
  damage += Math.floor(damage / 2);
671
672
  }
672
673
 
@@ -40,7 +40,8 @@ export const Moves: {[k: string]: ModdedMoveData} = {
40
40
  duration: 1,
41
41
  onModifySpAPriority: -101,
42
42
  onModifySpA(atk, pokemon, defender, move) {
43
- this.add('-activate', pokemon, 'move: Beat Up', '[of] ' + move.allies![0].name);
43
+ // https://www.smogon.com/forums/posts/8992145/
44
+ // this.add('-activate', pokemon, 'move: Beat Up', '[of] ' + move.allies![0].name);
44
45
  this.event.modifier = 1;
45
46
  return move.allies!.shift()!.species.baseStats.atk;
46
47
  },
@@ -6,6 +6,12 @@ export const Conditions: {[k: string]: ModdedConditionData} = {
6
6
  },
7
7
  par: {
8
8
  inherit: true,
9
+ onModifySpe(spe, pokemon) {
10
+ if (!pokemon.hasAbility('quickfeet')) {
11
+ return this.chainModify(0.25);
12
+ }
13
+ return spe;
14
+ },
9
15
  onBeforeMove(pokemon) {
10
16
  if (!pokemon.hasAbility('magicguard') && this.randomChance(1, 4)) {
11
17
  this.add('cant', pokemon, 'par');
@@ -87,7 +87,8 @@ export const Moves: {[k: string]: ModdedMoveData} = {
87
87
  duration: 1,
88
88
  onModifyAtkPriority: -101,
89
89
  onModifyAtk(atk, pokemon, defender, move) {
90
- this.add('-activate', pokemon, 'move: Beat Up', '[of] ' + move.allies![0].name);
90
+ // https://www.smogon.com/forums/posts/8992145/
91
+ // this.add('-activate', pokemon, 'move: Beat Up', '[of] ' + move.allies![0].name);
91
92
  this.event.modifier = 1;
92
93
  return move.allies!.shift()!.species.baseStats.atk;
93
94
  },
@@ -88,7 +88,7 @@ export const Scripts: ModdedBattleScriptsData = {
88
88
  const hitResults = this.battle.runEvent('Invulnerability', targets, pokemon, move);
89
89
  for (const [i, target] of targets.entries()) {
90
90
  if (hitResults[i] === false) {
91
- this.battle.attrLastMove('[miss]');
91
+ if (!move.spreadHit) this.battle.attrLastMove('[miss]');
92
92
  this.battle.add('-miss', pokemon, target);
93
93
  }
94
94
  }