diff --git a/src/data/abilities/ability.ts b/src/data/abilities/ability.ts index 2dd8c2964db..d7c116ad8f8 100644 --- a/src/data/abilities/ability.ts +++ b/src/data/abilities/ability.ts @@ -893,6 +893,10 @@ export interface PostMoveInteractionAbAttrParams extends AugmentMoveInteractionA export class PostDefendAbAttr extends AbAttr { private declare readonly _: never; + override canApply(_params: PostMoveInteractionAbAttrParams): boolean { + return true; + } + override apply(_params: PostMoveInteractionAbAttrParams): void {} } /** @@ -1662,7 +1666,7 @@ export class PokemonTypeChangeAbAttr extends PreAttackAbAttr { /** * Parameters for abilities that modify the hit count and damage of a move */ -export interface AddSecondStrikeAbAttrParams extends AugmentMoveInteractionAbAttrParams { +export interface AddSecondStrikeAbAttrParams extends Omit { /** Holder for the number of hits. May be modified by ability application */ hitCount?: NumberHolder; /** Holder for the damage multiplier _of the current hit_ */ diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index b6c8eca47f2..cc424e0ea08 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -3742,7 +3742,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { if (!ignoreSourceAbility) { applyAbAttrs("AddSecondStrikeAbAttr", { pokemon: source, - opponent: this, move, simulated, multiplier: multiStrikeEnhancementMultiplier, diff --git a/src/phases/move-effect-phase.ts b/src/phases/move-effect-phase.ts index d7da1ab996c..7fdb4169dda 100644 --- a/src/phases/move-effect-phase.ts +++ b/src/phases/move-effect-phase.ts @@ -1,12 +1,6 @@ import { BattlerIndex } from "#enums/battler-index"; import { globalScene } from "#app/global-scene"; -import { - applyExecutedMoveAbAttrs, - applyPostAttackAbAttrs, - applyPostDamageAbAttrs, - applyPostDefendAbAttrs, - applyPreAttackAbAttrs, -} from "#app/data/abilities/apply-ab-attrs"; +import { applyAbAttrs } from "#app/data/abilities/apply-ab-attrs"; import { ConditionalProtectTag } from "#app/data/arena-tag"; import { ArenaTagSide } from "#enums/arena-tag-side"; import { MoveAnim } from "#app/data/battle-anims"; @@ -322,7 +316,7 @@ export class MoveEffectPhase extends PokemonPhase { // Assume single target for multi hit applyMoveAttrs("MultiHitAttr", user, this.getFirstTarget() ?? null, move, hitCount); // If Parental Bond is applicable, add another hit - applyPreAttackAbAttrs("AddSecondStrikeAbAttr", user, null, move, false, hitCount, null); + applyAbAttrs("AddSecondStrikeAbAttr", { pokemon: user, move, hitCount }); // If Multi-Lens is applicable, add hits equal to the number of held Multi-Lenses globalScene.applyModifiers(PokemonMultiHitModifier, user.isPlayer(), user, move.id, hitCount); // Set the user's relevant turnData fields to reflect the final hit count @@ -370,7 +364,7 @@ export class MoveEffectPhase extends PokemonPhase { // Add to the move history entry if (this.firstHit) { user.pushMoveHistory(this.moveHistoryEntry); - applyExecutedMoveAbAttrs("ExecutedMoveAbAttr", user); + applyAbAttrs("ExecutedMoveAbAttr", { pokemon: user }); } try { @@ -439,7 +433,7 @@ export class MoveEffectPhase extends PokemonPhase { * @param hitResult - The {@linkcode HitResult} of the attempted move */ protected applyOnGetHitAbEffects(user: Pokemon, target: Pokemon, hitResult: HitResult): void { - applyPostDefendAbAttrs("PostDefendAbAttr", target, user, this.move, hitResult); + applyAbAttrs("PostDefendAbAttr", { pokemon: target, opponent: user, move: this.move, hitResult }); target.lapseTags(BattlerTagLapseType.AFTER_HIT); } @@ -808,7 +802,9 @@ export class MoveEffectPhase extends PokemonPhase { // Multi-hit check for Wimp Out/Emergency Exit if (user.turnData.hitCount > 1) { - applyPostDamageAbAttrs("PostDamageAbAttr", target, 0, target.hasPassive(), false, [], user); + // TODO: Investigate why 0 is being passed for damage amount here + // and then determing if refactoring `applyMove` to return the damage dealt is appropriate. + applyAbAttrs("PostDamageAbAttr", { pokemon: target, damage: 0, source: user }); } } } @@ -1002,7 +998,7 @@ export class MoveEffectPhase extends PokemonPhase { this.triggerMoveEffects(MoveEffectTrigger.POST_APPLY, user, target, firstTarget, false); this.applyHeldItemFlinchCheck(user, target, dealsDamage); this.applyOnGetHitAbEffects(user, target, hitResult); - applyPostAttackAbAttrs("PostAttackAbAttr", user, target, this.move, hitResult); + applyAbAttrs("PostAttackAbAttr", { pokemon: user, opponent: target, move: this.move, hitResult }); // We assume only enemy Pokemon are able to have the EnemyAttackStatusEffectChanceModifier from tokens if (!user.isPlayer() && this.move.is("AttackMove")) {