@pkmn/sim 0.5.15 → 0.5.16
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.
- package/build/config/formats.js +15 -14
- package/build/config/formats.js.map +1 -1
- package/build/data/formats-data.js +1 -1
- package/build/data/formats-data.js.map +1 -1
- package/build/data/mods/gen2/moves.js +0 -3
- package/build/data/mods/gen2/moves.js.map +1 -1
- package/build/data/mods/gen3/moves.js +0 -3
- package/build/data/mods/gen3/moves.js.map +1 -1
- package/build/data/mods/gen4/moves.js +3 -4
- package/build/data/mods/gen4/moves.js.map +1 -1
- package/build/data/moves.js +4 -5
- package/build/data/moves.js.map +1 -1
- package/build/sim/battle-actions.js +3 -3
- package/build/sim/battle-actions.js.map +1 -1
- package/build/sim/battle.js +4 -4
- package/build/sim/battle.js.map +1 -1
- package/build/sim/dex-moves.d.ts +1 -1
- package/config/formats.ts +15 -14
- package/data/formats-data.ts +1 -1
- package/data/mods/gen2/moves.ts +0 -3
- package/data/mods/gen3/moves.ts +0 -3
- package/data/mods/gen4/moves.ts +2 -4
- package/data/moves.ts +4 -5
- package/package.json +1 -1
- package/sim/battle-actions.ts +3 -4
- package/sim/battle.ts +4 -4
- package/sim/dex-moves.ts +1 -1
package/data/moves.ts
CHANGED
|
@@ -4799,7 +4799,6 @@ export const Moves: {[moveid: string]: MoveData} = {
|
|
|
4799
4799
|
pp: 5,
|
|
4800
4800
|
priority: 0,
|
|
4801
4801
|
flags: {protect: 1},
|
|
4802
|
-
selfdestruct: "ifHit",
|
|
4803
4802
|
secondary: null,
|
|
4804
4803
|
target: "normal",
|
|
4805
4804
|
type: "Fighting",
|
|
@@ -7820,10 +7819,10 @@ export const Moves: {[moveid: string]: MoveData} = {
|
|
|
7820
7819
|
priority: 0,
|
|
7821
7820
|
flags: {snatch: 1, heal: 1},
|
|
7822
7821
|
onHit(target, source, move) {
|
|
7823
|
-
if (!this.canSwitch(
|
|
7822
|
+
if (!this.canSwitch(source.side)) {
|
|
7824
7823
|
delete move.selfdestruct;
|
|
7825
7824
|
this.attrLastMove('[still]');
|
|
7826
|
-
this.add('-fail',
|
|
7825
|
+
this.add('-fail', source);
|
|
7827
7826
|
return this.NOT_FAIL;
|
|
7828
7827
|
}
|
|
7829
7828
|
},
|
|
@@ -9916,10 +9915,10 @@ export const Moves: {[moveid: string]: MoveData} = {
|
|
|
9916
9915
|
priority: 0,
|
|
9917
9916
|
flags: {snatch: 1, heal: 1, dance: 1},
|
|
9918
9917
|
onHit(target, source, move) {
|
|
9919
|
-
if (!this.canSwitch(
|
|
9918
|
+
if (!this.canSwitch(source.side)) {
|
|
9920
9919
|
delete move.selfdestruct;
|
|
9921
9920
|
this.attrLastMove('[still]');
|
|
9922
|
-
this.add('-fail',
|
|
9921
|
+
this.add('-fail', source);
|
|
9923
9922
|
return this.NOT_FAIL;
|
|
9924
9923
|
}
|
|
9925
9924
|
},
|
package/package.json
CHANGED
package/sim/battle-actions.ts
CHANGED
|
@@ -1124,9 +1124,6 @@ export class BattleActions {
|
|
|
1124
1124
|
continue;
|
|
1125
1125
|
}
|
|
1126
1126
|
damage[i] = curDamage;
|
|
1127
|
-
if (move.selfdestruct === 'ifHit') {
|
|
1128
|
-
this.battle.faint(source, source, move);
|
|
1129
|
-
}
|
|
1130
1127
|
}
|
|
1131
1128
|
return damage;
|
|
1132
1129
|
}
|
|
@@ -1230,6 +1227,9 @@ export class BattleActions {
|
|
|
1230
1227
|
}
|
|
1231
1228
|
}
|
|
1232
1229
|
}
|
|
1230
|
+
if (moveData.selfdestruct === 'ifHit' && damage[i] !== false) {
|
|
1231
|
+
this.battle.faint(source, source, move);
|
|
1232
|
+
}
|
|
1233
1233
|
if (moveData.selfSwitch) {
|
|
1234
1234
|
if (this.battle.canSwitch(source.side)) {
|
|
1235
1235
|
didSomething = true;
|
|
@@ -1243,7 +1243,6 @@ export class BattleActions {
|
|
|
1243
1243
|
didAnything = this.combineResults(didAnything, didSomething);
|
|
1244
1244
|
}
|
|
1245
1245
|
|
|
1246
|
-
|
|
1247
1246
|
if (!didAnything && didAnything !== 0 && !moveData.self && !moveData.selfdestruct) {
|
|
1248
1247
|
if (!isSelf && !isSecondary) {
|
|
1249
1248
|
if (didAnything === false) {
|
package/sim/battle.ts
CHANGED
|
@@ -2263,11 +2263,11 @@ export class Battle {
|
|
|
2263
2263
|
if (this.activePerHalf > 2) {
|
|
2264
2264
|
if (move.target === 'adjacentFoe' || move.target === 'normal' || move.target === 'randomNormal') {
|
|
2265
2265
|
// even if a move can target an ally, auto-resolution will never make it target an ally
|
|
2266
|
-
// i.e. if both your opponents faint before you use Flamethrower, it will fail instead of targeting your
|
|
2266
|
+
// i.e. if both your opponents faint before you use Flamethrower, it will fail instead of targeting your ally
|
|
2267
2267
|
const adjacentFoes = pokemon.adjacentFoes();
|
|
2268
2268
|
if (adjacentFoes.length) return this.sample(adjacentFoes);
|
|
2269
|
-
// no valid target at all, return
|
|
2270
|
-
return pokemon.side.foe.active[
|
|
2269
|
+
// no valid target at all, return slot directly across for any possible redirection
|
|
2270
|
+
return pokemon.side.foe.active[pokemon.side.foe.active.length - 1 - pokemon.position];
|
|
2271
2271
|
}
|
|
2272
2272
|
}
|
|
2273
2273
|
return pokemon.side.randomFoe() || pokemon.side.foe.active[0];
|
|
@@ -2624,7 +2624,7 @@ export class Battle {
|
|
|
2624
2624
|
|
|
2625
2625
|
if (this.gen < 5) this.eachEvent('Update');
|
|
2626
2626
|
|
|
2627
|
-
if (this.gen >= 8 && this.queue.peek()?.choice === 'move') {
|
|
2627
|
+
if (this.gen >= 8 && (this.queue.peek()?.choice === 'move' || this.queue.peek()?.choice === 'runDynamax')) {
|
|
2628
2628
|
// In gen 8, speed is updated dynamically so update the queue's speed properties and sort it.
|
|
2629
2629
|
this.updateSpeed();
|
|
2630
2630
|
for (const queueAction of this.queue.list) {
|
package/sim/dex-moves.ts
CHANGED
|
@@ -196,7 +196,7 @@ export interface MoveData extends EffectData, MoveEventMethods, HitEffect {
|
|
|
196
196
|
forceSwitch?: boolean;
|
|
197
197
|
selfSwitch?: string | boolean;
|
|
198
198
|
selfBoost?: {boosts?: SparseBoostsTable};
|
|
199
|
-
selfdestruct?:
|
|
199
|
+
selfdestruct?: 'always' | 'ifHit' | boolean;
|
|
200
200
|
breaksProtect?: boolean;
|
|
201
201
|
/**
|
|
202
202
|
* Note that this is only "true" recoil. Other self-damage, like Struggle,
|