@pkmn/sim 0.5.14 → 0.5.17

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 (127) hide show
  1. package/build/config/formats.js +167 -174
  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 +4 -1
  6. package/build/data/conditions.js.map +1 -1
  7. package/build/data/formats-data.js +3 -3
  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 +7 -6
  12. package/build/data/learnsets.js.map +1 -1
  13. package/build/data/mods/gen1/formats-data.js +1 -1
  14. package/build/data/mods/gen1/formats-data.js.map +1 -1
  15. package/build/data/mods/gen1/moves.js +1 -4
  16. package/build/data/mods/gen1/moves.js.map +1 -1
  17. package/build/data/mods/gen1/scripts.js +1 -1
  18. package/build/data/mods/gen1/scripts.js.map +1 -1
  19. package/build/data/mods/gen2/items.js +28 -0
  20. package/build/data/mods/gen2/items.js.map +1 -1
  21. package/build/data/mods/gen2/moves.js +2 -5
  22. package/build/data/mods/gen2/moves.js.map +1 -1
  23. package/build/data/mods/gen3/items.js +28 -0
  24. package/build/data/mods/gen3/items.js.map +1 -1
  25. package/build/data/mods/gen3/moves.js +0 -10
  26. package/build/data/mods/gen3/moves.js.map +1 -1
  27. package/build/data/mods/gen3/scripts.js +2 -2
  28. package/build/data/mods/gen3/scripts.js.map +1 -1
  29. package/build/data/mods/gen4/abilities.js +20 -0
  30. package/build/data/mods/gen4/abilities.js.map +1 -1
  31. package/build/data/mods/gen4/items.js +28 -0
  32. package/build/data/mods/gen4/items.js.map +1 -1
  33. package/build/data/mods/gen4/moves.js +17 -10
  34. package/build/data/mods/gen4/moves.js.map +1 -1
  35. package/build/data/mods/gen4/rulesets.js +2 -1
  36. package/build/data/mods/gen4/rulesets.js.map +1 -1
  37. package/build/data/mods/gen5/items.js +0 -4
  38. package/build/data/mods/gen5/items.js.map +1 -1
  39. package/build/data/mods/gen5/rulesets.js +2 -1
  40. package/build/data/mods/gen5/rulesets.js.map +1 -1
  41. package/build/data/mods/gen6/items.js +24 -0
  42. package/build/data/mods/gen6/items.js.map +1 -1
  43. package/build/data/mods/gen7/abilities.js +31 -0
  44. package/build/data/mods/gen7/abilities.js.map +1 -1
  45. package/build/data/mods/gen7/formats-data.js +4 -4
  46. package/build/data/mods/gen7/formats-data.js.map +1 -1
  47. package/build/data/mods/gen7/items.js +12 -0
  48. package/build/data/mods/gen7/items.js.map +1 -1
  49. package/build/data/mods/gen7/moves.js +14 -0
  50. package/build/data/mods/gen7/moves.js.map +1 -1
  51. package/build/data/mods/gen7/rulesets.js +2 -1
  52. package/build/data/mods/gen7/rulesets.js.map +1 -1
  53. package/build/data/moves.js +84 -91
  54. package/build/data/moves.js.map +1 -1
  55. package/build/data/pokedex.js +2 -2
  56. package/build/data/pokedex.js.map +1 -1
  57. package/build/data/rulesets.js +74 -4
  58. package/build/data/rulesets.js.map +1 -1
  59. package/build/data/tags.js +3 -3
  60. package/build/data/tags.js.map +1 -1
  61. package/build/data/text/items.js +1 -0
  62. package/build/data/text/items.js.map +1 -1
  63. package/build/data/text/moves.js +13 -11
  64. package/build/data/text/moves.js.map +1 -1
  65. package/build/sim/battle-actions.js +12 -4
  66. package/build/sim/battle-actions.js.map +1 -1
  67. package/build/sim/battle-queue.d.ts +2 -2
  68. package/build/sim/battle-queue.js +8 -0
  69. package/build/sim/battle-queue.js.map +1 -1
  70. package/build/sim/battle.js +85 -7
  71. package/build/sim/battle.js.map +1 -1
  72. package/build/sim/dex-conditions.d.ts +3 -2
  73. package/build/sim/dex-conditions.js.map +1 -1
  74. package/build/sim/dex-moves.d.ts +2 -1
  75. package/build/sim/dex-moves.js.map +1 -1
  76. package/build/sim/exported-global-types.d.ts +1 -0
  77. package/build/sim/global-types.d.ts +1 -0
  78. package/build/sim/pokemon.js +18 -5
  79. package/build/sim/pokemon.js.map +1 -1
  80. package/build/sim/team-validator.js +16 -5
  81. package/build/sim/team-validator.js.map +1 -1
  82. package/build/sim/tools/exhaustive-runner.d.ts +8 -0
  83. package/build/sim/tools/exhaustive-runner.js +18 -7
  84. package/build/sim/tools/exhaustive-runner.js.map +1 -1
  85. package/config/formats.ts +172 -179
  86. package/data/aliases.ts +2 -2
  87. package/data/conditions.ts +4 -1
  88. package/data/formats-data.ts +3 -3
  89. package/data/items.ts +5 -5
  90. package/data/learnsets.ts +7 -6
  91. package/data/mods/gen1/formats-data.ts +1 -1
  92. package/data/mods/gen1/moves.ts +1 -4
  93. package/data/mods/gen1/scripts.ts +1 -1
  94. package/data/mods/gen2/items.ts +28 -0
  95. package/data/mods/gen2/moves.ts +2 -5
  96. package/data/mods/gen3/items.ts +28 -0
  97. package/data/mods/gen3/moves.ts +0 -10
  98. package/data/mods/gen3/scripts.ts +3 -3
  99. package/data/mods/gen4/abilities.ts +20 -0
  100. package/data/mods/gen4/items.ts +28 -0
  101. package/data/mods/gen4/moves.ts +16 -11
  102. package/data/mods/gen4/rulesets.ts +2 -1
  103. package/data/mods/gen5/items.ts +0 -4
  104. package/data/mods/gen5/rulesets.ts +2 -1
  105. package/data/mods/gen6/items.ts +24 -0
  106. package/data/mods/gen7/abilities.ts +31 -0
  107. package/data/mods/gen7/formats-data.ts +4 -4
  108. package/data/mods/gen7/items.ts +12 -0
  109. package/data/mods/gen7/moves.ts +14 -0
  110. package/data/mods/gen7/rulesets.ts +2 -1
  111. package/data/moves.ts +84 -81
  112. package/data/pokedex.ts +2 -2
  113. package/data/rulesets.ts +73 -6
  114. package/data/tags.ts +3 -3
  115. package/data/text/items.ts +2 -0
  116. package/data/text/moves.ts +14 -11
  117. package/package.json +2 -2
  118. package/sim/battle-actions.ts +16 -5
  119. package/sim/battle-queue.ts +10 -2
  120. package/sim/battle.ts +81 -7
  121. package/sim/dex-conditions.ts +7 -2
  122. package/sim/dex-moves.ts +2 -1
  123. package/sim/exported-global-types.ts +3 -0
  124. package/sim/global-types.ts +3 -0
  125. package/sim/pokemon.ts +19 -7
  126. package/sim/team-validator.ts +17 -5
  127. package/sim/tools/exhaustive-runner.ts +29 -11
@@ -1212,7 +1212,7 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
1212
1212
  randomDoubleBattleMoves: ["faketears", "protect", "shadowball", "thunderbolt", "thunderwave"],
1213
1213
  randomDoubleBattleLevel: 86,
1214
1214
  tier: "PU",
1215
- doublesTier: "DUU",
1215
+ doublesTier: "(DUU)",
1216
1216
  },
1217
1217
  flareon: {
1218
1218
  randomBattleMoves: ["facade", "flamecharge", "flareblitz", "quickattack", "superpower"],
@@ -1382,7 +1382,7 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
1382
1382
  randomDoubleBattleMoves: ["fierywrath", "hurricane", "nastyplot", "protect"],
1383
1383
  randomDoubleBattleLevel: 75,
1384
1384
  randomBattleNoDynamaxMoves: ["agility", "fierywrath", "hurricane", "nastyplot", "rest"],
1385
- tier: "UU",
1385
+ tier: "UUBL",
1386
1386
  doublesTier: "DUU",
1387
1387
  },
1388
1388
  dratini: {
@@ -2016,7 +2016,7 @@ export const FormatsData: {[k: string]: SpeciesFormatsData} = {
2016
2016
  randomBattleLevel: 80,
2017
2017
  randomDoubleBattleMoves: ["closecombat", "facade", "knockoff", "obstruct", "partingshot", "taunt"],
2018
2018
  randomDoubleBattleLevel: 86,
2019
- tier: "RU",
2019
+ tier: "RUBL",
2020
2020
  doublesTier: "(DUU)",
2021
2021
  },
2022
2022
  wurmple: {
package/data/items.ts CHANGED
@@ -752,6 +752,7 @@ export const Items: {[itemid: string]: ItemData} = {
752
752
  num: 16,
753
753
  gen: 4,
754
754
  isPokeball: true,
755
+ isNonstandard: "Unobtainable",
755
756
  },
756
757
  chestoberry: {
757
758
  name: "Chesto Berry",
@@ -2348,7 +2349,7 @@ export const Items: {[itemid: string]: ItemData} = {
2348
2349
  },
2349
2350
  num: 1120,
2350
2351
  gen: 8,
2351
- // Hazard Immunity implemented in moves.js
2352
+ // Hazard Immunity implemented in moves.ts
2352
2353
  },
2353
2354
  helixfossil: {
2354
2355
  name: "Helix Fossil",
@@ -2904,7 +2905,7 @@ export const Items: {[itemid: string]: ItemData} = {
2904
2905
  return this.chainModify([5324, 4096]);
2905
2906
  },
2906
2907
  onAfterMoveSecondarySelf(source, target, move) {
2907
- if (source && source !== target && move && move.category !== 'Status') {
2908
+ if (source && source !== target && move && move.category !== 'Status' && !source.forceSwitchFlag) {
2908
2909
  this.damage(source.baseMaxhp / 10, source, source, this.dex.items.get('lifeorb'));
2909
2910
  }
2910
2911
  },
@@ -3773,6 +3774,7 @@ export const Items: {[itemid: string]: ItemData} = {
3773
3774
  num: 500,
3774
3775
  gen: 4,
3775
3776
  isPokeball: true,
3777
+ isNonstandard: "Unobtainable",
3776
3778
  },
3777
3779
  passhoberry: {
3778
3780
  name: "Passho Berry",
@@ -4662,7 +4664,6 @@ export const Items: {[itemid: string]: ItemData} = {
4662
4664
  }
4663
4665
  return true;
4664
4666
  },
4665
- forcedForme: "Zamazenta-Crowned",
4666
4667
  itemUser: ["Zamazenta-Crowned"],
4667
4668
  num: 1104,
4668
4669
  gen: 8,
@@ -4676,7 +4677,6 @@ export const Items: {[itemid: string]: ItemData} = {
4676
4677
  }
4677
4678
  return true;
4678
4679
  },
4679
- forcedForme: "Zacian-Crowned",
4680
4680
  itemUser: ["Zacian-Crowned"],
4681
4681
  num: 1103,
4682
4682
  gen: 8,
@@ -4877,7 +4877,7 @@ export const Items: {[itemid: string]: ItemData} = {
4877
4877
  },
4878
4878
  onAfterMoveSecondarySelfPriority: -1,
4879
4879
  onAfterMoveSecondarySelf(pokemon, target, move) {
4880
- if (move.totalDamage) {
4880
+ if (move.totalDamage && !pokemon.forceSwitchFlag) {
4881
4881
  this.heal(move.totalDamage / 8, pokemon);
4882
4882
  }
4883
4883
  },
package/data/learnsets.ts CHANGED
@@ -20480,20 +20480,20 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
20480
20480
  dualwingbeat: ["8T"],
20481
20481
  endure: ["8M", "8L60"],
20482
20482
  facade: ["8M"],
20483
- fierywrath: ["8L45", "8S0"],
20483
+ fierywrath: ["8L45", "8S0", "8S1"],
20484
20484
  fly: ["8M"],
20485
20485
  foulplay: ["8M"],
20486
20486
  gigaimpact: ["8M"],
20487
20487
  gust: ["8L1"],
20488
20488
  hex: ["8M"],
20489
- hurricane: ["8M", "8L55", "8S0"],
20489
+ hurricane: ["8M", "8L55", "8S0", "8S1"],
20490
20490
  hyperbeam: ["8M"],
20491
20491
  hypervoice: ["8M"],
20492
20492
  imprison: ["8M"],
20493
20493
  lashout: ["8T"],
20494
20494
  leer: ["8L1"],
20495
20495
  memento: ["8L65"],
20496
- nastyplot: ["8M", "8L50", "8S0"],
20496
+ nastyplot: ["8M", "8L50", "8S0", "8S1"],
20497
20497
  payback: ["8M", "8L5"],
20498
20498
  protect: ["8M"],
20499
20499
  rest: ["8M"],
@@ -20507,7 +20507,7 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
20507
20507
  snore: ["8M"],
20508
20508
  steelwing: ["8M"],
20509
20509
  substitute: ["8M"],
20510
- suckerpunch: ["8L30", "8S0"],
20510
+ suckerpunch: ["8L30", "8S0", "8S1"],
20511
20511
  swift: ["8M"],
20512
20512
  taunt: ["8M"],
20513
20513
  uturn: ["8M"],
@@ -20515,6 +20515,7 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
20515
20515
  },
20516
20516
  eventData: [
20517
20517
  {generation: 8, level: 70, moves: ["fierywrath", "hurricane", "suckerpunch", "nastyplot"]},
20518
+ {generation: 8, level: 70, shiny: true, moves: ["fierywrath", "hurricane", "suckerpunch", "nastyplot"], pokeball: "cherishball"},
20518
20519
  ],
20519
20520
  eventOnly: true,
20520
20521
  },
@@ -76709,7 +76710,7 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
76709
76710
  },
76710
76711
  zaciancrowned: {
76711
76712
  learnset: {
76712
- behemothblade: ["8M", "8L33"],
76713
+ behemothblade: ["8R"],
76713
76714
  },
76714
76715
  eventOnly: true,
76715
76716
  },
@@ -76780,7 +76781,7 @@ export const Learnsets: {[speciesid: string]: LearnsetData} = {
76780
76781
  },
76781
76782
  zamazentacrowned: {
76782
76783
  learnset: {
76783
- behemothbash: ["8M", "8L33"],
76784
+ behemothbash: ["8R"],
76784
76785
  },
76785
76786
  eventOnly: true,
76786
76787
  },
@@ -179,7 +179,7 @@ export const FormatsData: {[k: string]: ModdedSpeciesFormatsData} = {
179
179
  randomBattleMoves: ["bodyslam", "thunderbolt", "thunderwave"],
180
180
  essentialMove: "blizzard",
181
181
  exclusiveMoves: ["counter", "psychic", "seismictoss", "sing", "sing"],
182
- tier: "NFE",
182
+ tier: "LC",
183
183
  },
184
184
  clefable: {
185
185
  randomBattleMoves: ["bodyslam", "thunderbolt", "thunderwave"],
@@ -38,7 +38,7 @@ export const Moves: {[k: string]: ModdedMoveData} = {
38
38
  condition: {
39
39
  duration: 2,
40
40
  durationCallback(target, source, effect) {
41
- return this.random(3, 4);
41
+ return this.random(3, 5);
42
42
  },
43
43
  onStart(pokemon) {
44
44
  this.effectState.totalDamage = 0;
@@ -500,9 +500,6 @@ export const Moves: {[k: string]: ModdedMoveData} = {
500
500
  metronome: {
501
501
  inherit: true,
502
502
  noMetronome: ["Metronome", "Struggle"],
503
- secondary: null,
504
- target: "self",
505
- type: "Normal",
506
503
  },
507
504
  mimic: {
508
505
  inherit: true,
@@ -662,7 +662,7 @@ export const Scripts: ModdedBattleScriptsData = {
662
662
  if (!isCrit) {
663
663
  // In gen 1, the critical chance is based on speed.
664
664
  // First, we get the base speed, divide it by 2 and floor it. This is our current crit chance.
665
- let critChance = Math.floor(source.species.baseStats['spe'] / 2);
665
+ let critChance = Math.floor(this.dex.species.get(source.set.species).baseStats['spe'] / 2);
666
666
 
667
667
  // Now we check for focus energy volatile.
668
668
  if (source.volatiles['focusenergy']) {
@@ -50,6 +50,10 @@ export const Items: {[k: string]: ModdedItemData} = {
50
50
  }
51
51
  },
52
52
  },
53
+ fastball: {
54
+ inherit: true,
55
+ isNonstandard: null,
56
+ },
53
57
  focusband: {
54
58
  inherit: true,
55
59
  onDamage(damage, target, source, effect) {
@@ -68,6 +72,10 @@ export const Items: {[k: string]: ModdedItemData} = {
68
72
  }
69
73
  },
70
74
  },
75
+ heavyball: {
76
+ inherit: true,
77
+ isNonstandard: null,
78
+ },
71
79
  kingsrock: {
72
80
  inherit: true,
73
81
  onModifyMove(move) {
@@ -91,11 +99,19 @@ export const Items: {[k: string]: ModdedItemData} = {
91
99
  onResidualOrder: 5,
92
100
  onResidualSubOrder: 1,
93
101
  },
102
+ levelball: {
103
+ inherit: true,
104
+ isNonstandard: null,
105
+ },
94
106
  lightball: {
95
107
  inherit: true,
96
108
  // In Gen 2 this happens in stat calculation directly.
97
109
  onModifySpA() {},
98
110
  },
111
+ loveball: {
112
+ inherit: true,
113
+ isNonstandard: null,
114
+ },
99
115
  luckypunch: {
100
116
  inherit: true,
101
117
  onModifyCritRatioPriority: -1,
@@ -105,6 +121,10 @@ export const Items: {[k: string]: ModdedItemData} = {
105
121
  }
106
122
  },
107
123
  },
124
+ lureball: {
125
+ inherit: true,
126
+ isNonstandard: null,
127
+ },
108
128
  magnet: {
109
129
  inherit: true,
110
130
  onModifySpA() {},
@@ -138,6 +158,10 @@ export const Items: {[k: string]: ModdedItemData} = {
138
158
  }
139
159
  },
140
160
  },
161
+ moonball: {
162
+ inherit: true,
163
+ isNonstandard: null,
164
+ },
141
165
  mysticwater: {
142
166
  inherit: true,
143
167
  onModifySpA() {},
@@ -201,6 +225,10 @@ export const Items: {[k: string]: ModdedItemData} = {
201
225
  }
202
226
  },
203
227
  },
228
+ sportball: {
229
+ inherit: true,
230
+ isNonstandard: null,
231
+ },
204
232
  stick: {
205
233
  inherit: true,
206
234
  onModifyCritRatioPriority: -1,
@@ -129,7 +129,7 @@ export const Moves: {[k: string]: ModdedMoveData} = {
129
129
  return false;
130
130
  },
131
131
  beforeTurnCallback() {},
132
- onTryHit() {},
132
+ onTry() {},
133
133
  condition: {},
134
134
  priority: -1,
135
135
  },
@@ -204,9 +204,6 @@ export const Moves: {[k: string]: ModdedMoveData} = {
204
204
  }
205
205
  this.effectState.move = lockedMove;
206
206
  this.add('-start', target, 'Encore');
207
- if (!this.queue.willMove(target)) {
208
- this.effectState.duration++;
209
- }
210
207
  },
211
208
  onOverrideAction(pokemon) {
212
209
  return this.effectState.move;
@@ -446,7 +443,7 @@ export const Moves: {[k: string]: ModdedMoveData} = {
446
443
  return false;
447
444
  },
448
445
  beforeTurnCallback() {},
449
- onTryHit() {},
446
+ onTry() {},
450
447
  condition: {},
451
448
  priority: -1,
452
449
  },
@@ -83,6 +83,10 @@ export const Items: {[k: string]: ModdedItemData} = {
83
83
  gen: 3,
84
84
  isNonstandard: "Unobtainable",
85
85
  },
86
+ fastball: {
87
+ inherit: true,
88
+ isNonstandard: "Unobtainable",
89
+ },
86
90
  figyberry: {
87
91
  inherit: true,
88
92
  onUpdate() {},
@@ -115,6 +119,10 @@ export const Items: {[k: string]: ModdedItemData} = {
115
119
  }
116
120
  },
117
121
  },
122
+ heavyball: {
123
+ inherit: true,
124
+ isNonstandard: "Unobtainable",
125
+ },
118
126
  iapapaberry: {
119
127
  inherit: true,
120
128
  onUpdate() {},
@@ -160,6 +168,10 @@ export const Items: {[k: string]: ModdedItemData} = {
160
168
  return accuracy * 0.95;
161
169
  },
162
170
  },
171
+ levelball: {
172
+ inherit: true,
173
+ isNonstandard: "Unobtainable",
174
+ },
163
175
  liechiberry: {
164
176
  inherit: true,
165
177
  onUpdate() {},
@@ -180,6 +192,14 @@ export const Items: {[k: string]: ModdedItemData} = {
180
192
  },
181
193
  onBasePower() {},
182
194
  },
195
+ loveball: {
196
+ inherit: true,
197
+ isNonstandard: "Unobtainable",
198
+ },
199
+ lureball: {
200
+ inherit: true,
201
+ isNonstandard: "Unobtainable",
202
+ },
183
203
  magnet: {
184
204
  inherit: true,
185
205
  onBasePower() {},
@@ -221,6 +241,10 @@ export const Items: {[k: string]: ModdedItemData} = {
221
241
  }
222
242
  },
223
243
  },
244
+ moonball: {
245
+ inherit: true,
246
+ isNonstandard: "Unobtainable",
247
+ },
224
248
  mysticwater: {
225
249
  inherit: true,
226
250
  onBasePower() {},
@@ -363,6 +387,10 @@ export const Items: {[k: string]: ModdedItemData} = {
363
387
  }
364
388
  },
365
389
  },
390
+ sportball: {
391
+ inherit: true,
392
+ isNonstandard: "Unobtainable",
393
+ },
366
394
  starfberry: {
367
395
  inherit: true,
368
396
  onUpdate() {},
@@ -304,9 +304,6 @@ export const Moves: {[k: string]: ModdedMoveData} = {
304
304
  }
305
305
  this.effectState.move = target.lastMove.id;
306
306
  this.add('-start', target, 'Encore');
307
- if (!this.queue.willMove(target)) {
308
- this.effectState.duration++;
309
- }
310
307
  },
311
308
  onOverrideAction(pokemon) {
312
309
  return this.effectState.move;
@@ -549,13 +546,6 @@ export const Moves: {[k: string]: ModdedMoveData} = {
549
546
  },
550
547
  sleeptalk: {
551
548
  inherit: true,
552
- beforeMoveCallback(pokemon) {
553
- if (pokemon.volatiles['choicelock'] || pokemon.volatiles['encore']) {
554
- this.addMove('move', pokemon, 'Sleep Talk');
555
- this.add('-fail', pokemon);
556
- return true;
557
- }
558
- },
559
549
  onHit(pokemon) {
560
550
  const moves = [];
561
551
  for (const moveSlot of pokemon.moveSlots) {
@@ -69,9 +69,6 @@ export const Scripts: ModdedBattleScriptsData = {
69
69
  // Mod 2 (Damage is floored after all multipliers are in)
70
70
  baseDamage = Math.floor(this.battle.runEvent('ModifyDamagePhase2', pokemon, target, move, baseDamage));
71
71
 
72
- // this is not a modifier
73
- baseDamage = this.battle.randomizer(baseDamage);
74
-
75
72
  // STAB
76
73
  if (move.forceSTAB || type !== '???' && pokemon.hasType(type)) {
77
74
  // The "???" type never gets STAB
@@ -104,6 +101,9 @@ export const Scripts: ModdedBattleScriptsData = {
104
101
  // Final modifier.
105
102
  baseDamage = this.battle.runEvent('ModifyDamage', pokemon, target, move, baseDamage);
106
103
 
104
+ // this is not a modifier
105
+ baseDamage = this.battle.randomizer(baseDamage);
106
+
107
107
  if (!Math.floor(baseDamage)) {
108
108
  return 1;
109
109
  }
@@ -160,6 +160,16 @@ export const Abilities: {[k: string]: ModdedAbilityData} = {
160
160
  this.add('-activate', pokemon, 'ability: Forewarn', warnMove);
161
161
  },
162
162
  },
163
+ frisk: {
164
+ inherit: true,
165
+ onStart(pokemon) {
166
+ for (const target of pokemon.foes()) {
167
+ if (target.item && !target.itemState.knockedOff) {
168
+ this.add('-item', target, target.getItem().name, '[from] ability: Frisk', '[of] ' + pokemon, '[identify]');
169
+ }
170
+ }
171
+ },
172
+ },
163
173
  hustle: {
164
174
  inherit: true,
165
175
  onSourceModifyAccuracyPriority: 7,
@@ -504,6 +514,16 @@ export const Abilities: {[k: string]: ModdedAbilityData} = {
504
514
  }
505
515
  },
506
516
  },
517
+ unburden: {
518
+ inherit: true,
519
+ condition: {
520
+ onModifySpe(spe, pokemon) {
521
+ if ((!pokemon.item || pokemon.itemState.knockedOff) && !pokemon.ignoringAbility()) {
522
+ return this.chainModify(2);
523
+ }
524
+ },
525
+ },
526
+ },
507
527
  vitalspirit: {
508
528
  inherit: true,
509
529
  rating: 2.5,
@@ -113,6 +113,10 @@ export const Items: {[k: string]: ModdedItemData} = {
113
113
  }
114
114
  },
115
115
  },
116
+ fastball: {
117
+ inherit: true,
118
+ isNonstandard: null,
119
+ },
116
120
  flameorb: {
117
121
  inherit: true,
118
122
  onResidualOrder: 10,
@@ -148,6 +152,10 @@ export const Items: {[k: string]: ModdedItemData} = {
148
152
  }
149
153
  },
150
154
  },
155
+ heavyball: {
156
+ inherit: true,
157
+ isNonstandard: null,
158
+ },
151
159
  ironball: {
152
160
  inherit: true,
153
161
  onEffectiveness() {},
@@ -181,6 +189,10 @@ export const Items: {[k: string]: ModdedItemData} = {
181
189
  onResidualOrder: 10,
182
190
  onResidualSubOrder: 4,
183
191
  },
192
+ levelball: {
193
+ inherit: true,
194
+ isNonstandard: null,
195
+ },
184
196
  lifeorb: {
185
197
  inherit: true,
186
198
  onModifyDamage() {},
@@ -214,6 +226,10 @@ export const Items: {[k: string]: ModdedItemData} = {
214
226
  }
215
227
  },
216
228
  },
229
+ loveball: {
230
+ inherit: true,
231
+ isNonstandard: null,
232
+ },
217
233
  luckypunch: {
218
234
  inherit: true,
219
235
  onModifyCritRatio(critRatio, user) {
@@ -222,6 +238,10 @@ export const Items: {[k: string]: ModdedItemData} = {
222
238
  }
223
239
  },
224
240
  },
241
+ lureball: {
242
+ inherit: true,
243
+ isNonstandard: null,
244
+ },
225
245
  lustrousorb: {
226
246
  inherit: true,
227
247
  onBasePower(basePower, user, target, move) {
@@ -286,6 +306,10 @@ export const Items: {[k: string]: ModdedItemData} = {
286
306
  },
287
307
  },
288
308
  },
309
+ moonball: {
310
+ inherit: true,
311
+ isNonstandard: null,
312
+ },
289
313
  razorfang: {
290
314
  inherit: true,
291
315
  onModifyMove(move) {
@@ -301,6 +325,10 @@ export const Items: {[k: string]: ModdedItemData} = {
301
325
  }
302
326
  },
303
327
  },
328
+ sportball: {
329
+ inherit: true,
330
+ isNonstandard: null,
331
+ },
304
332
  stick: {
305
333
  inherit: true,
306
334
  onModifyCritRatio(critRatio, user) {
@@ -448,9 +448,6 @@ export const Moves: {[k: string]: ModdedMoveData} = {
448
448
  }
449
449
  this.effectState.move = target.lastMove.id;
450
450
  this.add('-start', target, 'Encore');
451
- if (!this.queue.willMove(target)) {
452
- this.effectState.duration++;
453
- }
454
451
  },
455
452
  onOverrideAction(pokemon) {
456
453
  return this.effectState.move;
@@ -541,12 +538,16 @@ export const Moves: {[k: string]: ModdedMoveData} = {
541
538
  },
542
539
  focuspunch: {
543
540
  inherit: true,
544
- beforeMoveCallback() { },
541
+ priorityChargeCallback() {},
542
+ beforeTurnCallback(pokemon) {
543
+ pokemon.addVolatile('focuspunch');
544
+ },
545
+ beforeMoveCallback() {},
545
546
  onTry(pokemon) {
546
- if (pokemon.volatiles['focuspunch'] && pokemon.volatiles['focuspunch'].lostFocus) {
547
+ if (pokemon.volatiles['focuspunch']?.lostFocus) {
547
548
  this.attrLastMove('[still]');
548
549
  this.add('cant', pokemon, 'Focus Punch', 'Focus Punch');
549
- return false;
550
+ return null;
550
551
  }
551
552
  },
552
553
  },
@@ -829,10 +830,14 @@ export const Moves: {[k: string]: ModdedMoveData} = {
829
830
  },
830
831
  knockoff: {
831
832
  inherit: true,
832
- onAfterHit(target, source) {
833
- const item = target.takeItem();
834
- if (item) {
835
- this.add('-enditem', target, item.name, '[from] move: Knock Off', '[of] ' + source);
833
+ onAfterHit(target, source, move) {
834
+ if (!target.item || target.itemState.knockedOff) return;
835
+ if (target.ability === 'multitype') return;
836
+ const item = target.getItem();
837
+ if (this.runEvent('TakeItem', target, source, move, item)) {
838
+ target.itemState.knockedOff = true;
839
+ this.add('-enditem', target, item.name, '[from] move: Knock Off');
840
+ this.hint("In Gens 3-4, Knock Off only makes the target's item unusable; it cannot obtain a new item.", true);
836
841
  }
837
842
  },
838
843
  },
@@ -1645,7 +1650,7 @@ export const Moves: {[k: string]: ModdedMoveData} = {
1645
1650
  this.add('-sidestart', side, 'move: Toxic Spikes');
1646
1651
  this.effectState.layers++;
1647
1652
  },
1648
- onSwitchIn(pokemon) {
1653
+ onEntryHazard(pokemon) {
1649
1654
  if (!pokemon.isGrounded()) return;
1650
1655
  if (pokemon.hasType('Poison')) {
1651
1656
  this.add('-sideend', pokemon.side, 'move: Toxic Spikes', '[of] ' + pokemon);
@@ -13,7 +13,8 @@ export const Rulesets: {[k: string]: ModdedFormatData} = {
13
13
  this.add('clearpoke');
14
14
  for (const pokemon of this.getAllPokemon()) {
15
15
  const details = pokemon.details.replace(', shiny', '')
16
- .replace(/(Arceus|Gourgeist|Genesect|Pumpkaboo|Silvally|Zacian|Zamazenta|Urshifu)(-[a-zA-Z?-]+)?/g, '$1-*');
16
+ .replace(/(Arceus|Gourgeist|Pumpkaboo|Xerneas|Silvally|Urshifu)(-[a-zA-Z?-]+)?/g, '$1-*')
17
+ .replace(/(Zacian|Zamazenta)(?!-Crowned)/g, '$1-*'); // Hacked-in Crowned formes will be revealed
17
18
  this.add('poke', pokemon.side.id, details, pokemon.item ? 'item' : '');
18
19
  }
19
20
  this.makeRequest('teampreview');
@@ -299,10 +299,6 @@ export const Items: {[k: string]: ModdedItemData} = {
299
299
  type: "Dragon",
300
300
  },
301
301
  },
302
- normalgem: {
303
- inherit: true,
304
- isNonstandard: null,
305
- },
306
302
  occaberry: {
307
303
  inherit: true,
308
304
  naturalGift: {
@@ -19,7 +19,8 @@ export const Rulesets: {[k: string]: ModdedFormatData} = {
19
19
  this.add('clearpoke');
20
20
  for (const pokemon of this.getAllPokemon()) {
21
21
  const details = pokemon.details.replace(', shiny', '')
22
- .replace(/(Arceus|Gourgeist|Genesect|Pumpkaboo|Silvally|Zacian|Zamazenta|Urshifu)(-[a-zA-Z?-]+)?/g, '$1-*');
22
+ .replace(/(Arceus|Gourgeist|Pumpkaboo|Xerneas|Silvally|Urshifu)(-[a-zA-Z?-]+)?/g, '$1-*')
23
+ .replace(/(Zacian|Zamazenta)(?!-Crowned)/g, '$1-*'); // Hacked-in Crowned formes will be revealed
23
24
  const item = pokemon.item.includes('mail') ? 'mail' : pokemon.item ? 'item' : '';
24
25
  this.add('poke', pokemon.side.id, details, item);
25
26
  }
@@ -25,6 +25,10 @@ export const Items: {[k: string]: ModdedItemData} = {
25
25
  inherit: true,
26
26
  isNonstandard: null,
27
27
  },
28
+ fastball: {
29
+ inherit: true,
30
+ isNonstandard: "Unobtainable",
31
+ },
28
32
  figyberry: {
29
33
  inherit: true,
30
34
  onUpdate(pokemon) {
@@ -39,6 +43,10 @@ export const Items: {[k: string]: ModdedItemData} = {
39
43
  }
40
44
  },
41
45
  },
46
+ heavyball: {
47
+ inherit: true,
48
+ isNonstandard: "Unobtainable",
49
+ },
42
50
  iapapaberry: {
43
51
  inherit: true,
44
52
  onUpdate(pokemon) {
@@ -63,6 +71,10 @@ export const Items: {[k: string]: ModdedItemData} = {
63
71
  }
64
72
  },
65
73
  },
74
+ levelball: {
75
+ inherit: true,
76
+ isNonstandard: "Unobtainable",
77
+ },
66
78
  lifeorb: {
67
79
  inherit: true,
68
80
  onAfterMoveSecondarySelf(source, target, move) {
@@ -71,6 +83,14 @@ export const Items: {[k: string]: ModdedItemData} = {
71
83
  }
72
84
  },
73
85
  },
86
+ loveball: {
87
+ inherit: true,
88
+ isNonstandard: "Unobtainable",
89
+ },
90
+ lureball: {
91
+ inherit: true,
92
+ isNonstandard: "Unobtainable",
93
+ },
74
94
  machobrace: {
75
95
  inherit: true,
76
96
  isNonstandard: null,
@@ -93,6 +113,10 @@ export const Items: {[k: string]: ModdedItemData} = {
93
113
  inherit: true,
94
114
  isNonstandard: null,
95
115
  },
116
+ moonball: {
117
+ inherit: true,
118
+ isNonstandard: "Unobtainable",
119
+ },
96
120
  nanabberry: {
97
121
  inherit: true,
98
122
  isNonstandard: null,