This commit is contained in:
Bertie690 2025-06-14 15:06:17 -04:00
parent 501fb0b594
commit 07eb03f981
2 changed files with 10 additions and 8 deletions

View File

@ -1948,16 +1948,18 @@ export class HealAttr extends MoveEffectAttr {
} }
override canApply(user: Pokemon, target: Pokemon, _move: Move, _args?: any[]): boolean { override canApply(user: Pokemon, target: Pokemon, _move: Move, _args?: any[]): boolean {
return !(this.selfTarget ? user : target).isFullHp(); if (!super.canApply(user, target, _move, _args)) {
return false;
} }
override getFailedText(user: Pokemon, target: Pokemon, _move: Move): string | undefined {
const healedPokemon = this.selfTarget ? user : target; const healedPokemon = this.selfTarget ? user : target;
return healedPokemon.isFullHp() if (healedPokemon.isFullHp()) {
? i18next.t("battle:hpIsFull", { globalScene.phaseManager.queueMessage(i18next.t("battle:hpIsFull", {
pokemonName: getPokemonNameWithAffix(healedPokemon), pokemonName: getPokemonNameWithAffix(healedPokemon),
}) }))
: undefined; return false;
}
return true;
} }
} }

View File

@ -104,7 +104,7 @@ describe("Moves - Recovery Moves", () => {
game.move.use(MoveId.MOONLIGHT); game.move.use(MoveId.MOONLIGHT);
await game.toEndOfTurn(); await game.toEndOfTurn();
expect(blissey.getHpRatio()).toBeCloseTo(0.67, 1); expect(blissey.getHpRatio()).toBeCloseTo(0.66, 1);
}); });
const nonSunWTs = getEnumValues(WeatherType) const nonSunWTs = getEnumValues(WeatherType)