We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d43e960 commit a77ed2aCopy full SHA for a77ed2a
play.pokemonshowdown.com/src/battle.ts
@@ -2231,6 +2231,20 @@ export class Battle {
2231
let item = Dex.items.get(args[2]);
2232
let effect = Dex.getEffect(kwArgs.from);
2233
let ofpoke = this.getPokemon(kwArgs.of);
2234
+ if (!poke) {
2235
+ if (effect.id === 'frisk') {
2236
+ const possibleTargets = ofpoke!.side.foe.active.filter(p => p !== null);
2237
+ if (possibleTargets.length === 1) {
2238
+ poke = possibleTargets[0]!;
2239
+ } else {
2240
+ this.activateAbility(ofpoke!, "Frisk");
2241
+ this.log(args, kwArgs);
2242
+ break;
2243
+ }
2244
2245
+ throw new Error('No Pokemon in -item message');
2246
2247
2248
poke.item = item.name;
2249
poke.itemEffect = '';
2250
poke.removeVolatile('airballoon' as ID);
0 commit comments