Fix intimidate display

This commit is contained in:
Dean 2025-02-02 12:21:51 -08:00
parent aea1ee717b
commit 9c9d550605

View File

@ -2148,7 +2148,7 @@ export class PostSummonStatStageChangeAbAttr extends PostSummonAbAttr {
private intimidate: boolean; private intimidate: boolean;
constructor(stats: BattleStat[], stages: number, selfTarget?: boolean, intimidate?: boolean) { constructor(stats: BattleStat[], stages: number, selfTarget?: boolean, intimidate?: boolean) {
super(false); super(true);
this.stats = stats; this.stats = stats;
this.stages = stages; this.stages = stages;
@ -5002,6 +5002,7 @@ async function applyAbAttrsInternal<TAttr extends AbAttr>(
messages: string[] = [], messages: string[] = [],
) { ) {
for (const passive of [ false, true ]) { for (const passive of [ false, true ]) {
let abShown = false;
if (!pokemon?.canApplyAbility(passive) || (passive && pokemon.getPassiveAbility().id === pokemon.getAbility().id)) { if (!pokemon?.canApplyAbility(passive) || (passive && pokemon.getPassiveAbility().id === pokemon.getAbility().id)) {
continue; continue;
} }
@ -5017,6 +5018,7 @@ async function applyAbAttrsInternal<TAttr extends AbAttr>(
if (attr.showAbility && !simulated) { if (attr.showAbility && !simulated) {
queueShowAbility(pokemon, passive); queueShowAbility(pokemon, passive);
abShown = true;
} }
const message = attr.getTriggerMessage(pokemon, ability.name, args); const message = attr.getTriggerMessage(pokemon, ability.name, args);
if (message) { if (message) {
@ -5032,7 +5034,9 @@ async function applyAbAttrsInternal<TAttr extends AbAttr>(
result = await result; result = await result;
} }
if (result) { if (result) {
if (abShown) {
queueHideAbility(pokemon, passive); queueHideAbility(pokemon, passive);
}
if (pokemon.summonData && !pokemon.summonData.abilitiesApplied.includes(ability.id)) { if (pokemon.summonData && !pokemon.summonData.abilitiesApplied.includes(ability.id)) {
pokemon.summonData.abilitiesApplied.push(ability.id); pokemon.summonData.abilitiesApplied.push(ability.id);