diff --git a/src/data/ability.ts b/src/data/ability.ts index d947bcddd99..8b7a7772efe 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -4498,7 +4498,7 @@ async function applyAbAttrsInternal( applyFunc: AbAttrApplyFunc, args: any[], showAbilityInstant: boolean = false, - quiet: boolean = false, + simulated: boolean = false, messages: string[] = [], ) { for (const passive of [false, true]) { @@ -4520,33 +4520,29 @@ async function applyAbAttrsInternal( if (result instanceof Promise) { result = await result; } - if (result) { if (pokemon.summonData && !pokemon.summonData.abilitiesApplied.includes(ability.id)) { pokemon.summonData.abilitiesApplied.push(ability.id); } - if (pokemon.battleData && !quiet && !pokemon.battleData.abilitiesApplied.includes(ability.id)) { + if (pokemon.battleData && !simulated && !pokemon.battleData.abilitiesApplied.includes(ability.id)) { pokemon.battleData.abilitiesApplied.push(ability.id); } - - if (attr.showAbility && !quiet) { + if (attr.showAbility && !simulated) { if (showAbilityInstant) { pokemon.scene.abilityBar.showAbility(pokemon, passive); } else { queueShowAbility(pokemon, passive); } } - - if (!quiet) { - const message = attr.getTriggerMessage(pokemon, ability.name, args); - if (message) { + const message = attr.getTriggerMessage(pokemon, ability.name, args); + if (message) { + if (!simulated) { pokemon.scene.queueMessage(message); - messages.push(message); } } + messages.push(message!); } } - pokemon.scene.clearPhaseQueueSplice(); } } diff --git a/src/phases/enemy-command-phase.ts b/src/phases/enemy-command-phase.ts index 0b62fcbe813..5277b2666c7 100644 --- a/src/phases/enemy-command-phase.ts +++ b/src/phases/enemy-command-phase.ts @@ -47,7 +47,7 @@ export class EnemyCommandPhase extends FieldPhase { const trapTag = enemyPokemon.findTag(t => t instanceof TrappedTag) as TrappedTag; const trapped = new Utils.BooleanHolder(false); - opponents.forEach(playerPokemon => applyCheckTrappedAbAttrs(CheckTrappedAbAttr, playerPokemon, trapped, enemyPokemon, [], true)); + opponents.forEach(playerPokemon => applyCheckTrappedAbAttrs(CheckTrappedAbAttr, playerPokemon, trapped, enemyPokemon, [""], true)); if (!trapTag && !trapped.value) { const partyMemberScores = trainer.getPartyMemberMatchupScores(enemyPokemon.trainerSlot, true);