diff --git a/src/@types/ab-attr-types.ts b/src/@types/ab-attr-types.ts index 45f8a6d44d4..62999f46db6 100644 --- a/src/@types/ab-attr-types.ts +++ b/src/@types/ab-attr-types.ts @@ -1 +1,7 @@ export type * from "#app/data/abilities/ability"; +import type { AbAttrMap } from "./ability-types"; + + +export type AbAttrParamMap = { + [K in keyof AbAttrMap]: Parameters[0]; +} \ No newline at end of file diff --git a/src/@types/type-helpers.ts b/src/@types/type-helpers.ts index 0249f88919a..e67d38518f0 100644 --- a/src/@types/type-helpers.ts +++ b/src/@types/type-helpers.ts @@ -18,17 +18,7 @@ export type Exact = { /** * Type hint that indicates that the type is intended to be closed to a specific shape. + * Does not actually do anything special, is really just an alias for X. * - * @remarks - * Can be used to ensure that a particular parameter does not change when subclassed, **But will only do so for one level of inheritance** - * ```ts - * type foo = { } // whatever - * class Foo { - * method(param: Closed) - * } - * ``` - * - * @typeParam T - The type to check - * @typeParam Shape - The shape to match against */ -export type Closed = X extends Shape ? (Shape extends X ? X : never) : never; +export type Closed = X; diff --git a/src/data/abilities/ability.ts b/src/data/abilities/ability.ts index 8e49855b477..c983b5c7c47 100644 --- a/src/data/abilities/ability.ts +++ b/src/data/abilities/ability.ts @@ -231,11 +231,6 @@ export interface AbAttrBaseParams { */ readonly pokemon: Pokemon; - /** - * Whether the ability application results in the interaction being cancelled - */ - readonly cancelled: BooleanHolder; - /** Whether the ability's effects are being simulated. * Used to prevent, for instance, messages flyouts from being displayed. * Defaults to false. @@ -246,6 +241,13 @@ export interface AbAttrBaseParams { readonly passive?: boolean; } +export interface AbAttrParamsWithCancel extends AbAttrBaseParams { + /** + * Whether the ability application results in the interaction being cancelled + */ + readonly cancelled: BooleanHolder; +} + export abstract class AbAttr { public showAbility: boolean; private extraCondition: AbAttrCondition; @@ -308,11 +310,11 @@ export class BlockRecoilDamageAttr extends AbAttr { super(false); } - override apply({ cancelled }: AbAttrBaseParams): void { + override apply({ cancelled }: AbAttrParamsWithCancel): void { cancelled.value = true; } - getTriggerMessage({ pokemon }: AbAttrBaseParams, abilityName: string) { + getTriggerMessage({ pokemon }: AbAttrParamsWithCancel, abilityName: string) { return i18next.t("abilityTriggers:blockRecoilDamage", { pokemonName: getPokemonNameWithAffix(pokemon), abilityName: abilityName, @@ -345,7 +347,9 @@ export class DoubleBattleChanceAbAttr extends AbAttr { } } -export class PostBattleInitAbAttr extends AbAttr {} +export class PostBattleInitAbAttr extends AbAttr { + private declare readonly _: never; +} export class PostBattleInitFormChangeAbAttr extends PostBattleInitAbAttr { private formFunc: (p: Pokemon) => number; @@ -397,6 +401,7 @@ export class PostTeraFormChangeStatChangeAbAttr extends AbAttr { * Clears a specified weather whenever this attribute is called. */ export class ClearWeatherAbAttr extends AbAttr { + // TODO: evaluate why this is a field and constructor parameter even though it is never checked private weather: WeatherType[]; /** @@ -426,6 +431,7 @@ export class ClearWeatherAbAttr extends AbAttr { * Clears a specified terrain whenever this attribute is called. */ export class ClearTerrainAbAttr extends AbAttr { + // TODO: evaluate why this is a field and constructor parameter even though it is never checked private terrain: TerrainType[]; /** @@ -456,7 +462,7 @@ type PreDefendAbAttrCondition = (pokemon: Pokemon, attacker: Pokemon, move: Move * Often extended by other interfaces to add more parameters. * Used, e.g. by {@linkcode PreDefendAbAttr} and {@linkcode PostAttackAbAttr} */ -export interface AugmentMoveInteractionAbAttrParams extends AbAttrBaseParams { +export interface AugmentMoveInteractionAbAttrParams extends AbAttrParamsWithCancel { /** The move used by (or against, for defend attributes) */ move: Move; /** The pokemon on the other side of the interaction*/ @@ -476,7 +482,9 @@ export interface PreDefendModifyDamageAbAttrParams extends AugmentMoveInteractio * * ⚠️ This attribute must not be called via `applyAbAttrs` as its subclasses violate the Liskov Substitution Principle. */ -export abstract class PreDefendAbAttr extends AbAttr {} +export abstract class PreDefendAbAttr extends AbAttr { + private declare readonly _: never; +} export class PreDefendFullHpEndureAbAttr extends PreDefendAbAttr { override canApply({ pokemon, damage }: PreDefendModifyDamageAbAttrParams): boolean { @@ -499,7 +507,7 @@ export class PreDefendFullHpEndureAbAttr extends PreDefendAbAttr { } export class BlockItemTheftAbAttr extends AbAttr { - override apply({ cancelled }: AbAttrBaseParams): void { + override apply({ cancelled }: AbAttrParamsWithCancel): void { cancelled.value = true; } @@ -863,7 +871,9 @@ export interface PostMoveInteractionAbAttrParams extends AugmentMoveInteractionA readonly hitResult: HitResult; } -export class PostDefendAbAttr extends AbAttr {} +export class PostDefendAbAttr extends AbAttr { + private declare readonly _: never; +} /** * Class for abilities that make drain moves deal damage to user instead of healing them. @@ -990,26 +1000,27 @@ export class PostDefendHpGatedStatStageChangeAbAttr extends PostDefendAbAttr { export class PostDefendApplyArenaTrapTagAbAttr extends PostDefendAbAttr { private condition: PokemonDefendCondition; - private tagType: ArenaTagType; + private arenaTagType: ArenaTagType; constructor(condition: PokemonDefendCondition, tagType: ArenaTagType) { super(true); this.condition = condition; - this.tagType = tagType; + this.arenaTagType = tagType; } override canApply({ pokemon, opponent: attacker, move }: PostMoveInteractionAbAttrParams): boolean { - const tag = globalScene.arena.getTag(this.tagType) as ArenaTrapTag; + const tag = globalScene.arena.getTag(this.arenaTagType) as ArenaTrapTag; return ( - this.condition(pokemon, attacker, move) && (!globalScene.arena.getTag(this.tagType) || tag.layers < tag.maxLayers) + this.condition(pokemon, attacker, move) && + (!globalScene.arena.getTag(this.arenaTagType) || tag.layers < tag.maxLayers) ); } override apply({ simulated, pokemon }: PostMoveInteractionAbAttrParams): void { if (!simulated) { globalScene.arena.addTag( - this.tagType, + this.arenaTagType, 0, undefined, pokemon.id, @@ -1096,7 +1107,7 @@ export class PostDefendTerrainChangeAbAttr extends PostDefendAbAttr { } export class PostDefendContactApplyStatusEffectAbAttr extends PostDefendAbAttr { - public chance: number; + private chance: number; private effects: StatusEffect[]; constructor(chance: number, ...effects: StatusEffect[]) { @@ -1710,10 +1721,10 @@ may not modify the type of apply's parameter to an interface that introduces new or changes the type of existing fields. */ export abstract class VariableMovePowerAbAttr extends PreAttackAbAttr { - override canApply(_params: Closed): boolean { + override canApply(_params: Closed): boolean { return true; } - override apply(_params: Closed): void {} + override apply(_params: Closed): void {} } export class MovePowerBoostAbAttr extends VariableMovePowerAbAttr { @@ -1945,11 +1956,11 @@ export class AllyStatMultiplierAbAttr extends AbAttr { * (More specifically, whenever a move is pushed to the move history) */ export class ExecutedMoveAbAttr extends AbAttr { - canApply(_params: Closed): boolean { + canApply(_params: Closed): boolean { return true; } - apply(_params: Closed): void {} + apply(_params: Closed): void {} } /** @@ -1998,11 +2009,11 @@ export abstract class PostAttackAbAttr extends AbAttr { * This can be changed by providing a different {@link attackCondition} to the constructor. See {@link ConfusionOnStatusEffectAbAttr} * for an example of an effect that does not require a damaging move. */ - override canApply({ pokemon, opponent, move }: Closed): boolean { + override canApply({ pokemon, opponent, move }: Closed): boolean { return this.attackCondition(pokemon, opponent, move); } - override apply(_params: Closed): void {} + override apply(_params: Closed): void {} } export class PostAttackStealHeldItemAbAttr extends PostAttackAbAttr { @@ -2216,11 +2227,11 @@ type of their parameters. This is enforced via the Closed type. * Base class for defining all {@linkcode Ability} Attributes after a status effect has been set. */ export class PostSetStatusAbAttr extends AbAttr { - canApply(_params: Closed): boolean { + canApply(_params: Closed): boolean { return true; } - apply(_params: Closed): void {} + apply(_params: Closed): void {} } /** @@ -2265,11 +2276,11 @@ export class SynchronizeStatusAbAttr extends PostSetStatusAbAttr { * Not to be confused with {@link PostKnockOutAbAttr}, which applies after any pokemon is knocked out in battle. */ export class PostVictoryAbAttr extends AbAttr { - canApply(_params: Closed): boolean { + canApply(_params: Closed): boolean { return true; } - apply(_params: Closed): void {} + apply(_params: Closed): void {} } class PostVictoryStatStageChangeAbAttr extends PostVictoryAbAttr { @@ -2325,11 +2336,11 @@ export interface PostKnockOutAbAttrParams extends AbAttrBaseParams { * Not to be confused with {@linkcode PostVictoryAbAttr}, which applies after the user directly knocks out an opponent. */ export abstract class PostKnockOutAbAttr extends AbAttr { - canApply(_params: Closed): boolean { + canApply(_params: Closed): boolean { return true; } - apply(_params: Closed): void {} + apply(_params: Closed): void {} } export class PostKnockOutStatStageChangeAbAttr extends PostKnockOutAbAttr { @@ -2412,11 +2423,11 @@ export class IntimidateImmunityAbAttr extends AbAttr { super(false); } - override apply({ cancelled }: AbAttrBaseParams): void { + override apply({ cancelled }: AbAttrParamsWithCancel): void { cancelled.value = true; } - getTriggerMessage({ pokemon }: AbAttrBaseParams, abilityName: string, ..._args: any[]): string { + getTriggerMessage({ pokemon }: AbAttrParamsWithCancel, abilityName: string, ..._args: any[]): string { return i18next.t("abilityTriggers:intimidateImmunity", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), abilityName, @@ -2436,7 +2447,7 @@ export class PostIntimidateStatStageChangeAbAttr extends AbAttr { this.overwrites = !!overwrites; } - override apply({ pokemon, simulated, cancelled }: AbAttrBaseParams): void { + override apply({ pokemon, simulated, cancelled }: AbAttrParamsWithCancel): void { if (!simulated) { globalScene.phaseManager.pushNew( "StatStageChangePhase", @@ -2470,14 +2481,14 @@ export abstract class PostSummonAbAttr extends AbAttr { return this.activateOnGain; } - canApply(_params: Closed): boolean { + canApply(_params: Closed): boolean { return true; } /** * Applies ability post summon (after switching in) */ - apply(_params: Closed): void {} + apply(_params: Closed): void {} } /** @@ -2655,7 +2666,7 @@ export class PostSummonStatStageChangeAbAttr extends PostSummonAbAttr { for (const opponent of pokemon.getOpponents()) { const cancelled = new BooleanHolder(false); if (this.intimidate) { - const params: AbAttrBaseParams = { pokemon: opponent, cancelled, simulated }; + const params: AbAttrParamsWithCancel = { pokemon: opponent, cancelled, simulated }; applyAbAttrs("IntimidateImmunityAbAttr", params); applyAbAttrs("PostIntimidateStatStageChangeAbAttr", params); @@ -3172,11 +3183,11 @@ export abstract class PreSwitchOutAbAttr extends AbAttr { super(showAbility); } - canApply(_params: Closed): boolean { + canApply(_params: Closed): boolean { return true; } - apply(_params: Closed): void {} + apply(_params: Closed): void {} } /** @@ -3303,11 +3314,11 @@ export class PreSwitchOutFormChangeAbAttr extends PreSwitchOutAbAttr { * Base class for ability attributes that apply their effect just before the user leaves the field */ export class PreLeaveFieldAbAttr extends AbAttr { - canApplyPreLeaveField(_params: Closed): boolean { + canApplyPreLeaveField(_params: Closed): boolean { return true; } - applyPreLeaveField(_params: Closed): void {} + applyPreLeaveField(_params: Closed): void {} } /** @@ -3397,11 +3408,11 @@ export interface PreStatStageChangeAbAttrParams extends AbAttrBaseParams { * Base class for ability attributes that apply their effect before a stat stage change. */ export abstract class PreStatStageChangeAbAttr extends AbAttr { - canApplyPreStatStageChange(_params: Closed): boolean { + canApplyPreStatStageChange(_params: Closed): boolean { return true; } - applyPreStatStageChange(_params: Closed): void {} + applyPreStatStageChange(_params: Closed): void {} } /** @@ -3525,11 +3536,11 @@ export interface PreSetStatusAbAttrParams extends AbAttrBaseParams { export class PreSetStatusAbAttr extends AbAttr { /** Return whether the ability attribute can be applied */ - canApply(_params: Closed): boolean { + canApply(_params: Closed): boolean { return true; } - apply(_params: Closed): void {} + apply(_params: Closed): void {} } /** @@ -3715,11 +3726,11 @@ export interface PreApplyBattlerTagAbAttrParams extends AbAttrBaseParams { * Base class for ability attributes that apply their effect before a BattlerTag {@linkcode BattlerTag} is applied. */ export abstract class PreApplyBattlerTagAbAttr extends AbAttr { - canApplyPreApplyBattlerTag(_params: Closed): boolean { + canApplyPreApplyBattlerTag(_params: Closed): boolean { return true; } - applyPreApplyBattlerTag(_params: Closed): void {} + applyPreApplyBattlerTag(_params: Closed): void {} } /** @@ -3881,7 +3892,7 @@ export class BlockNonDirectDamageAbAttr extends AbAttr { super(false); } - override apply({ cancelled }: AbAttrBaseParams): void { + override apply({ cancelled }: AbAttrParamsWithCancel): void { cancelled.value = true; } } @@ -3901,19 +3912,19 @@ export class BlockStatusDamageAbAttr extends AbAttr { this.effects = effects; } - override canApply({ pokemon }: AbAttrBaseParams): boolean { + override canApply({ pokemon }: AbAttrParamsWithCancel): boolean { return !!pokemon.status?.effect && this.effects.includes(pokemon.status.effect); } /** */ - override apply({ cancelled }: AbAttrBaseParams): void { + override apply({ cancelled }: AbAttrParamsWithCancel): void { cancelled.value = true; } } export class BlockOneHitKOAbAttr extends AbAttr { - override apply({ cancelled }: AbAttrBaseParams): void { + override apply({ cancelled }: AbAttrParamsWithCancel): void { cancelled.value = true; } } @@ -3961,17 +3972,17 @@ export class IgnoreContactAbAttr extends AbAttr {} /** * Shared interface for attributes that respond to a weather. */ -export interface PreWeatherEffectAbAttrParams extends AbAttrBaseParams { +export interface PreWeatherEffectAbAttrParams extends AbAttrParamsWithCancel { /** The weather effect for the interaction. `null` is treated as no weather */ weather: Weather | null; } export abstract class PreWeatherEffectAbAttr extends AbAttr { - override canApply(_params: Closed): boolean { + override canApply(_params: Closed): boolean { return true; } - override apply(_params: Closed): void {} + override apply(_params: Closed): void {} } /** @@ -4218,11 +4229,11 @@ export interface PostWeatherChangeAbAttrParams extends AbAttrBaseParams { * Base class for ability attributes that apply their effect after a weather change. */ export abstract class PostWeatherChangeAbAttr extends AbAttr { - canApply(_params: Closed): boolean { + canApply(_params: Closed): boolean { return true; } - apply(_params: Closed): void {} + apply(_params: Closed): void {} } /** @@ -4424,11 +4435,11 @@ export interface PostTerrainChangeAbAttrParams extends AbAttrBaseParams { } export class PostTerrainChangeAbAttr extends AbAttr { - canApply(_params: Closed): boolean { + canApply(_params: Closed): boolean { return true; } - apply(_params: Closed): void {} + apply(_params: Closed): void {} } export class PostTerrainChangeAddBattlerTagAttr extends PostTerrainChangeAbAttr { @@ -4463,11 +4474,11 @@ function getTerrainCondition(...terrainTypes: TerrainType[]): AbAttrCondition { } export class PostTurnAbAttr extends AbAttr { - canApply(_params: Closed): boolean { + canApply(_params: Closed): boolean { return true; } - apply(_params: Closed): void {} + apply(_params: Closed): void {} } /** @@ -4903,11 +4914,11 @@ export interface PostMoveUsedAbAttrParams extends AbAttrBaseParams { * Triggers just after a move is used either by the opponent or the player */ export class PostMoveUsedAbAttr extends AbAttr { - canApplyPostMoveUsed(_params: Closed): boolean { + canApplyPostMoveUsed(_params: Closed): boolean { return true; } - applyPostMoveUsed(_params: Closed): void {} + applyPostMoveUsed(_params: Closed): void {} } /** @@ -5048,11 +5059,12 @@ export class StatStageChangeCopyAbAttr extends AbAttr { } export class BypassBurnDamageReductionAbAttr extends AbAttr { + private declare readonly _: never; constructor() { super(false); } - override apply({ cancelled }: AbAttrBaseParams): void { + override apply({ cancelled }: AbAttrParamsWithCancel): void { cancelled.value = true; } } @@ -5098,7 +5110,7 @@ export class PreventBerryUseAbAttr extends AbAttr { /** * Prevent use of opposing berries. */ - override apply({ cancelled }: AbAttrBaseParams): void { + override apply({ cancelled }: AbAttrParamsWithCancel): void { cancelled.value = true; } } @@ -5250,15 +5262,16 @@ export interface PostBattleAbAttrParams extends AbAttrBaseParams { // TODO PICKUP FROM HERE 6/12/2025 export abstract class PostBattleAbAttr extends AbAttr { + private declare readonly _: never; constructor(showAbility = true) { super(showAbility); } - canApply(_params: Closed): boolean { + canApply(_params: Closed): boolean { return true; } - apply(_params: Closed): void {} + apply(_params: Closed): void {} } export class PostBattleLootAbAttr extends PostBattleAbAttr { @@ -5305,11 +5318,11 @@ export interface PostFaintAbAttrParams extends AbAttrBaseParams { } export abstract class PostFaintAbAttr extends AbAttr { - canApply(_params: Closed): boolean { + canApply(_params: Closed): boolean { return true; } - apply(_params: Closed): void {} + apply(_params: Closed): void {} } /** @@ -5450,7 +5463,9 @@ export class RedirectTypeMoveAbAttr extends RedirectMoveAbAttr { } } -export class BlockRedirectAbAttr extends AbAttr {} +export class BlockRedirectAbAttr extends AbAttr { + private declare readonly _: never; +} export interface ReduceStatusEffectDurationAbAttrParams extends AbAttrBaseParams { /** The status effect in question */ @@ -5497,11 +5512,11 @@ export abstract class FlinchEffectAbAttr extends AbAttr { super(true); } - canApply(_params: Closed): boolean { + canApply(_params: Closed): boolean { return true; } - apply(_params: Closed): void {} + apply(_params: Closed): void {} } export class FlinchStatStageChangeAbAttr extends FlinchEffectAbAttr { @@ -5532,7 +5547,7 @@ export class IncreasePpAbAttr extends AbAttr {} /** @sealed */ export class ForceSwitchOutImmunityAbAttr extends AbAttr { - override apply({ cancelled }: AbAttrBaseParams): void { + override apply({ cancelled }: AbAttrParamsWithCancel): void { cancelled.value = true; } } @@ -5623,10 +5638,14 @@ export class MoveAbilityBypassAbAttr extends AbAttr { } } -export class AlwaysHitAbAttr extends AbAttr {} +export class AlwaysHitAbAttr extends AbAttr { + private declare readonly _: never; +} /** Attribute for abilities that allow moves that make contact to ignore protection (i.e. Unseen Fist) */ -export class IgnoreProtectOnContactAbAttr extends AbAttr {} +export class IgnoreProtectOnContactAbAttr extends AbAttr { + private declare readonly _: never; +} export interface InfiltratorAbAttrParams extends AbAttrBaseParams { /** Holds a flag indicating that infiltrator's bypass is active */ @@ -5639,6 +5658,7 @@ export interface InfiltratorAbAttrParams extends AbAttrBaseParams { * @sealed */ export class InfiltratorAbAttr extends AbAttr { + private declare readonly _: never; constructor() { super(false); } @@ -5707,7 +5727,7 @@ export class IgnoreTypeImmunityAbAttr extends AbAttr { } } -export interface IgnoreTypeStatusEffectImmunityAbAttrParams extends AbAttrBaseParams { +export interface IgnoreTypeStatusEffectImmunityAbAttrParams extends AbAttrParamsWithCancel { /** The status effect being applied */ readonly statusEffect: StatusEffect; /** Holds whether the type immunity should be bypassed */ @@ -5763,7 +5783,7 @@ export class MoneyAbAttr extends PostBattleAbAttr { */ export class PostSummonStatStageChangeOnArenaAbAttr extends PostSummonStatStageChangeAbAttr { /** The type of arena tag that conditions the stat change. */ - private tagType: ArenaTagType; + private arenaTagType: ArenaTagType; /** * Creates an instance of PostSummonStatStageChangeOnArenaAbAttr. @@ -5773,12 +5793,12 @@ export class PostSummonStatStageChangeOnArenaAbAttr extends PostSummonStatStageC */ constructor(tagType: ArenaTagType) { super([Stat.ATK], 1, true, false); - this.tagType = tagType; + this.arenaTagType = tagType; } override canApply(params: AbAttrBaseParams): boolean { const side = params.pokemon.isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY; - return (globalScene.arena.getTagOnSide(this.tagType, side) ?? false) && super.canApply(params); + return (globalScene.arena.getTagOnSide(this.arenaTagType, side) ?? false) && super.canApply(params); } } @@ -5849,9 +5869,10 @@ export class FormBlockDamageAbAttr extends ReceivedMoveDamageMultiplierAbAttr { * @see {@linkcode applyPreSummon()} */ export class PreSummonAbAttr extends AbAttr { - apply(_params: Closed): void {} + private declare readonly _: never; + apply(_params: Closed): void {} - canApply(_params: Closed): boolean { + canApply(_params: Closed): boolean { return true; } } diff --git a/src/data/abilities/apply-ab-attrs.ts b/src/data/abilities/apply-ab-attrs.ts index 355356ac431..56a22f2c2b0 100644 --- a/src/data/abilities/apply-ab-attrs.ts +++ b/src/data/abilities/apply-ab-attrs.ts @@ -1,9 +1,10 @@ -import type { AbAttrBaseParams, AbAttrMap, CallableAbAttrString } from "#app/@types/ability-types"; +import type { AbAttrParamMap } from "#app/@types/ab-attr-types"; +import type { AbAttr, AbAttrBaseParams, AbAttrMap, CallableAbAttrString } from "#app/@types/ability-types"; import { globalScene } from "#app/global-scene"; function applySingleAbAttrs( attrType: T, - params: Parameters[0], + params: AbAttrParamMap[T], gainedMidTurn = false, messages: string[] = [], ) { @@ -12,6 +13,13 @@ function applySingleAbAttrs( return; } + const attr = 1 as unknown as AbAttr; + + if (attr.is("BlockRedirectAbAttr")) { + attr + } + + const ability = passive ? pokemon.getPassiveAbility() : pokemon.getAbility(); if ( gainedMidTurn && @@ -22,8 +30,9 @@ function applySingleAbAttrs( return; } + + // typescript assert for (const attr of ability.getAttrs(attrType)) { - declare const attr: AbAttrMap[T]; const condition = attr.getCondition(); let abShown = false; if ((condition && !condition(pokemon)) || !attr.canApply(params)) { @@ -36,7 +45,7 @@ function applySingleAbAttrs( globalScene.phaseManager.queueAbilityDisplay(pokemon, passive, true); abShown = true; } - const message = attr.getTriggerMessage(pokemon, ability.name, params); + const message = attr.getTriggerMessage(params, ability.name); if (message) { if (!simulated) { globalScene.phaseManager.queueMessage(message); @@ -44,7 +53,7 @@ function applySingleAbAttrs( messages.push(message); } - attr.apply(params); + if (abShown) { globalScene.phaseManager.queueAbilityDisplay(pokemon, passive, false); diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index f61e8debc9f..c03022eff22 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -33,11 +33,7 @@ import type { ArenaTrapTag } from "../arena-tag"; import { WeakenMoveTypeTag } from "../arena-tag"; import { ArenaTagSide } from "#enums/arena-tag-side"; import { - applyAbAttrs, - applyPostAttackAbAttrs, - applyPostItemLostAbAttrs, - applyPreAttackAbAttrs, - applyPreDefendAbAttrs + applyAbAttrs } from "../abilities/apply-ab-attrs"; import { allAbilities, allMoves } from "../data-lists"; import {