diff --git a/src/battle.ts b/src/battle.ts index a43ec41503..35c2c02d00 100644 --- a/src/battle.ts +++ b/src/battle.ts @@ -1733,7 +1733,7 @@ export class Battle { break; } case '-heal': { - let poke = this.getPokemon(args[1])!; + let poke = this.getPokemon(args[1], Dex.getEffect(kwArgs.from).id === 'revivalblessing')!; let damage = poke.healthParse(args[2], true, true); if (damage === null) break; let range = poke.getDamageRange(damage); @@ -3279,7 +3279,7 @@ export class Battle { } return null; } - getPokemon(pokemonid: string | undefined) { + getPokemon(pokemonid: string | undefined, faintedOnly = false) { if (!pokemonid || pokemonid === '??' || pokemonid === 'null' || pokemonid === 'false') { return null; } @@ -3295,6 +3295,7 @@ export class Battle { for (const pokemon of side.pokemon) { if (isInactive && side.active.includes(pokemon)) continue; + if (faintedOnly && pokemon.hp) continue; if (pokemon.ident === pokemonid) { // name matched, good enough if (slot >= 0) pokemon.slot = slot; return pokemon;