@pkmn/sim 0.7.42 → 0.7.43

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.
@@ -2207,12 +2207,19 @@ export const Moves = {
2207
2207
  pp: 15,
2208
2208
  priority: 0,
2209
2209
  flags: { contact: 1, protect: 1, mirror: 1, slicing: 1 },
2210
- self: {
2211
- onHit(source) {
2210
+ onAfterHit(target, source, move) {
2211
+ if (!move.hasSheerForce && source.hp) {
2212
2212
  for (const side of source.side.foeSidesWithConditions()) {
2213
2213
  side.addSideCondition('spikes');
2214
2214
  }
2215
- },
2215
+ }
2216
+ },
2217
+ onAfterSubDamage(damage, target, source, move) {
2218
+ if (!move.hasSheerForce && source.hp) {
2219
+ for (const side of source.side.foeSidesWithConditions()) {
2220
+ side.addSideCondition('spikes');
2221
+ }
2222
+ }
2216
2223
  },
2217
2224
  secondary: {},
2218
2225
  target: "normal",
@@ -12657,32 +12664,36 @@ export const Moves = {
12657
12664
  pp: 15,
12658
12665
  priority: 0,
12659
12666
  flags: { contact: 1, protect: 1, mirror: 1 },
12660
- onAfterHit(target, pokemon) {
12661
- if (pokemon.hp && pokemon.removeVolatile('leechseed')) {
12662
- this.add('-end', pokemon, 'Leech Seed', '[from] move: Mortal Spin', '[of] ' + pokemon);
12663
- }
12664
- const sideConditions = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge'];
12665
- for (const condition of sideConditions) {
12666
- if (pokemon.hp && pokemon.side.removeSideCondition(condition)) {
12667
- this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Mortal Spin', '[of] ' + pokemon);
12667
+ onAfterHit(target, pokemon, move) {
12668
+ if (!move.hasSheerForce) {
12669
+ if (pokemon.hp && pokemon.removeVolatile('leechseed')) {
12670
+ this.add('-end', pokemon, 'Leech Seed', '[from] move: Mortal Spin', '[of] ' + pokemon);
12671
+ }
12672
+ const sideConditions = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge'];
12673
+ for (const condition of sideConditions) {
12674
+ if (pokemon.hp && pokemon.side.removeSideCondition(condition)) {
12675
+ this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Mortal Spin', '[of] ' + pokemon);
12676
+ }
12677
+ }
12678
+ if (pokemon.hp && pokemon.volatiles['partiallytrapped']) {
12679
+ pokemon.removeVolatile('partiallytrapped');
12668
12680
  }
12669
- }
12670
- if (pokemon.hp && pokemon.volatiles['partiallytrapped']) {
12671
- pokemon.removeVolatile('partiallytrapped');
12672
12681
  }
12673
12682
  },
12674
- onAfterSubDamage(damage, target, pokemon) {
12675
- if (pokemon.hp && pokemon.removeVolatile('leechseed')) {
12676
- this.add('-end', pokemon, 'Leech Seed', '[from] move: Mortal Spin', '[of] ' + pokemon);
12677
- }
12678
- const sideConditions = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge'];
12679
- for (const condition of sideConditions) {
12680
- if (pokemon.hp && pokemon.side.removeSideCondition(condition)) {
12681
- this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Mortal Spin', '[of] ' + pokemon);
12683
+ onAfterSubDamage(damage, target, pokemon, move) {
12684
+ if (!move.hasSheerForce) {
12685
+ if (pokemon.hp && pokemon.removeVolatile('leechseed')) {
12686
+ this.add('-end', pokemon, 'Leech Seed', '[from] move: Mortal Spin', '[of] ' + pokemon);
12687
+ }
12688
+ const sideConditions = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge'];
12689
+ for (const condition of sideConditions) {
12690
+ if (pokemon.hp && pokemon.side.removeSideCondition(condition)) {
12691
+ this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Mortal Spin', '[of] ' + pokemon);
12692
+ }
12693
+ }
12694
+ if (pokemon.hp && pokemon.volatiles['partiallytrapped']) {
12695
+ pokemon.removeVolatile('partiallytrapped');
12682
12696
  }
12683
- }
12684
- if (pokemon.hp && pokemon.volatiles['partiallytrapped']) {
12685
- pokemon.removeVolatile('partiallytrapped');
12686
12697
  }
12687
12698
  },
12688
12699
  secondary: {
@@ -14143,23 +14154,23 @@ export const Moves = {
14143
14154
  condition: {
14144
14155
  onStart(pokemon) {
14145
14156
  this.add('-start', pokemon, 'Power Shift');
14146
- [pokemon.storedStats.atk, pokemon.storedStats.spa,
14147
- pokemon.storedStats.def, pokemon.storedStats.spd] =
14148
- [pokemon.storedStats.def, pokemon.storedStats.spd,
14149
- pokemon.storedStats.atk, pokemon.storedStats.spa];
14157
+ const newatk = pokemon.storedStats.def;
14158
+ const newdef = pokemon.storedStats.atk;
14159
+ pokemon.storedStats.atk = newatk;
14160
+ pokemon.storedStats.def = newdef;
14150
14161
  },
14151
14162
  onCopy(pokemon) {
14152
- [pokemon.storedStats.atk, pokemon.storedStats.spa,
14153
- pokemon.storedStats.def, pokemon.storedStats.spd] =
14154
- [pokemon.storedStats.def, pokemon.storedStats.spd,
14155
- pokemon.storedStats.atk, pokemon.storedStats.spa];
14163
+ const newatk = pokemon.storedStats.def;
14164
+ const newdef = pokemon.storedStats.atk;
14165
+ pokemon.storedStats.atk = newatk;
14166
+ pokemon.storedStats.def = newdef;
14156
14167
  },
14157
14168
  onEnd(pokemon) {
14158
14169
  this.add('-end', pokemon, 'Power Shift');
14159
- [pokemon.storedStats.atk, pokemon.storedStats.spa,
14160
- pokemon.storedStats.def, pokemon.storedStats.spd] =
14161
- [pokemon.storedStats.def, pokemon.storedStats.spd,
14162
- pokemon.storedStats.atk, pokemon.storedStats.spa];
14170
+ const newatk = pokemon.storedStats.def;
14171
+ const newdef = pokemon.storedStats.atk;
14172
+ pokemon.storedStats.atk = newatk;
14173
+ pokemon.storedStats.def = newdef;
14163
14174
  },
14164
14175
  onRestart(pokemon) {
14165
14176
  pokemon.removeVolatile('Power Shift');
@@ -15154,32 +15165,36 @@ export const Moves = {
15154
15165
  pp: 40,
15155
15166
  priority: 0,
15156
15167
  flags: { contact: 1, protect: 1, mirror: 1 },
15157
- onAfterHit(target, pokemon) {
15158
- if (pokemon.hp && pokemon.removeVolatile('leechseed')) {
15159
- this.add('-end', pokemon, 'Leech Seed', '[from] move: Rapid Spin', '[of] ' + pokemon);
15160
- }
15161
- const sideConditions = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge'];
15162
- for (const condition of sideConditions) {
15163
- if (pokemon.hp && pokemon.side.removeSideCondition(condition)) {
15164
- this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Rapid Spin', '[of] ' + pokemon);
15168
+ onAfterHit(target, pokemon, move) {
15169
+ if (!move.hasSheerForce) {
15170
+ if (pokemon.hp && pokemon.removeVolatile('leechseed')) {
15171
+ this.add('-end', pokemon, 'Leech Seed', '[from] move: Rapid Spin', '[of] ' + pokemon);
15172
+ }
15173
+ const sideConditions = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge'];
15174
+ for (const condition of sideConditions) {
15175
+ if (pokemon.hp && pokemon.side.removeSideCondition(condition)) {
15176
+ this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Rapid Spin', '[of] ' + pokemon);
15177
+ }
15178
+ }
15179
+ if (pokemon.hp && pokemon.volatiles['partiallytrapped']) {
15180
+ pokemon.removeVolatile('partiallytrapped');
15165
15181
  }
15166
- }
15167
- if (pokemon.hp && pokemon.volatiles['partiallytrapped']) {
15168
- pokemon.removeVolatile('partiallytrapped');
15169
15182
  }
15170
15183
  },
15171
- onAfterSubDamage(damage, target, pokemon) {
15172
- if (pokemon.hp && pokemon.removeVolatile('leechseed')) {
15173
- this.add('-end', pokemon, 'Leech Seed', '[from] move: Rapid Spin', '[of] ' + pokemon);
15174
- }
15175
- const sideConditions = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge'];
15176
- for (const condition of sideConditions) {
15177
- if (pokemon.hp && pokemon.side.removeSideCondition(condition)) {
15178
- this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Rapid Spin', '[of] ' + pokemon);
15184
+ onAfterSubDamage(damage, target, pokemon, move) {
15185
+ if (!move.hasSheerForce) {
15186
+ if (pokemon.hp && pokemon.removeVolatile('leechseed')) {
15187
+ this.add('-end', pokemon, 'Leech Seed', '[from] move: Rapid Spin', '[of] ' + pokemon);
15188
+ }
15189
+ const sideConditions = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge'];
15190
+ for (const condition of sideConditions) {
15191
+ if (pokemon.hp && pokemon.side.removeSideCondition(condition)) {
15192
+ this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Rapid Spin', '[of] ' + pokemon);
15193
+ }
15194
+ }
15195
+ if (pokemon.hp && pokemon.volatiles['partiallytrapped']) {
15196
+ pokemon.removeVolatile('partiallytrapped');
15179
15197
  }
15180
- }
15181
- if (pokemon.hp && pokemon.volatiles['partiallytrapped']) {
15182
- pokemon.removeVolatile('partiallytrapped');
15183
15198
  }
15184
15199
  },
15185
15200
  secondary: {
@@ -18776,12 +18791,19 @@ export const Moves = {
18776
18791
  pp: 15,
18777
18792
  priority: 0,
18778
18793
  flags: { contact: 1, protect: 1, mirror: 1, slicing: 1 },
18779
- self: {
18780
- onHit(source) {
18794
+ onAfterHit(target, source, move) {
18795
+ if (!move.hasSheerForce && source.hp) {
18781
18796
  for (const side of source.side.foeSidesWithConditions()) {
18782
18797
  side.addSideCondition('stealthrock');
18783
18798
  }
18784
- },
18799
+ }
18800
+ },
18801
+ onAfterSubDamage(damage, target, source, move) {
18802
+ if (!move.hasSheerForce && source.hp) {
18803
+ for (const side of source.side.foeSidesWithConditions()) {
18804
+ side.addSideCondition('stealthrock');
18805
+ }
18806
+ }
18785
18807
  },
18786
18808
  secondary: {},
18787
18809
  target: "normal",