diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index d860ab3add2..6d232e7c8f4 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -1945,14 +1945,27 @@ export class AddSubstituteAttr extends MoveEffectAttr { * @see {@linkcode apply} */ export class HealAttr extends MoveEffectAttr { + /** The percentage of {@linkcode Stat.HP} to heal; default `1` */ + protected healRatio = 1 + /** Whether to display a healing animation upon healing the target; default `false` */ + private showAnim = false + + /** + * Whether the move should fail if the target is at full HP. + * @todo Remove post move failure rework + */ + private failOnFullHp = true; + constructor( - /** The percentage of {@linkcode Stat.HP} to heal; default `1` */ - protected healRatio = 1, - /** Whether to display a healing animation upon healing the target; default `false` */ - private showAnim = false, - selfTarget = true + healRatio = 1, + showAnim = false, + selfTarget = true, + failOnFullHp = true ) { super(selfTarget); + this.healRatio = healRatio; + this.showAnim = showAnim + this.failOnFullHp = failOnFullHp } apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { @@ -1979,7 +1992,7 @@ export class HealAttr extends MoveEffectAttr { } override getCondition(): MoveConditionFunc { - return (user, target) => !(this.selfTarget ? user : target).isFullHp(); + return (user, target) => !(this.failOnFullHp && (this.selfTarget ? user : target).isFullHp()); } override getFailedText(user: Pokemon, target: Pokemon): string | undefined { @@ -1999,7 +2012,7 @@ export class HealAttr extends MoveEffectAttr { * Used for: * - {@linkcode MoveId.MOONLIGHT} and variants * - {@linkcode MoveId.SHORE_UP} - * - {@linkcode MoveId.JUNGLE_HEALING} + * - {@linkcode MoveId.FLORAL_HEALING} * - {@linkcode MoveId.SWALLOW} */ export class VariableHealAttr extends HealAttr { @@ -11035,10 +11048,11 @@ export function initMoves() { .attr(HealStatusEffectAttr, false, StatusEffect.FREEZE) .attr(StatusEffectAttr, StatusEffect.BURN), new StatusMove(MoveId.JUNGLE_HEALING, PokemonType.GRASS, -1, 10, -1, 0, 8) - .attr(HealAttr, 0.25, true, false) + .attr(HealAttr, 0.25, true, false, false) .attr(HealStatusEffectAttr, false, getNonVolatileStatusEffects()) .target(MoveTarget.USER_AND_ALLIES) - .triageMove(), + .triageMove() + .edgeCase(), // TODO: Review if jungle healing fails if HP cannot be restored and status cannot be cured new AttackMove(MoveId.WICKED_BLOW, PokemonType.DARK, MoveCategory.PHYSICAL, 75, 100, 5, -1, 0, 8) .attr(CritOnlyAttr) .punchingMove(), @@ -11140,10 +11154,11 @@ export function initMoves() { .windMove() .target(MoveTarget.ALL_NEAR_ENEMIES), new StatusMove(MoveId.LUNAR_BLESSING, PokemonType.PSYCHIC, -1, 5, -1, 0, 8) - .attr(HealAttr, 0.25, true, false) + .attr(HealAttr, 0.25, true, false, false) .attr(HealStatusEffectAttr, false, getNonVolatileStatusEffects()) .target(MoveTarget.USER_AND_ALLIES) - .triageMove(), + .triageMove() + .edgeCase(), // TODO: Review if lunar blessing fails if HP cannot be restored and status cannot be cured new SelfStatusMove(MoveId.TAKE_HEART, PokemonType.PSYCHIC, -1, 10, -1, 0, 8) .attr(StatStageChangeAttr, [ Stat.SPATK, Stat.SPDEF ], 1, true) .attr(HealStatusEffectAttr, true, [ StatusEffect.PARALYSIS, StatusEffect.POISON, StatusEffect.TOXIC, StatusEffect.BURN, StatusEffect.SLEEP ]), diff --git a/src/phases/pokemon-heal-phase.ts b/src/phases/pokemon-heal-phase.ts index fa6a3222466..573df9c2da9 100644 --- a/src/phases/pokemon-heal-phase.ts +++ b/src/phases/pokemon-heal-phase.ts @@ -69,9 +69,9 @@ export class PokemonHealPhase extends CommonAnimPhase { if (healBlock && this.hpHealed > 0) { globalScene.phaseManager.queueMessage(healBlock.onActivation(pokemon)); - this.message = null; return super.end(); } + if (healOrDamage) { const hpRestoreMultiplier = new NumberHolder(1); if (!this.revive) {