Revert "[Bug] Fix canApplyAbility check #5413" (#5417)

This reverts commit 2cc0ac90f8.
This commit is contained in:
Sirz Benjie 2025-02-25 21:05:18 -06:00 committed by GitHub
parent 2cc0ac90f8
commit aa3f924633
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 7 deletions

View File

@ -5152,10 +5152,6 @@ function applySingleAbAttrs<TAttr extends AbAttr>(
showAbilityInstant: boolean = false,
messages: string[] = []
) {
if (!pokemon?.canApplyAbility(passive) || (passive && (pokemon.getPassiveAbility().id === pokemon.getAbility().id))) {
return;
}
const ability = passive ? pokemon.getPassiveAbility() : pokemon.getAbility();
if (gainedMidTurn && ability.getAttrs(attrType).some(attr => attr instanceof PostSummonAbAttr && !attr.shouldActivateOnGain())) {
return;
@ -5449,10 +5445,12 @@ function applyAbAttrsInternal<TAttr extends AbAttr>(
gainedMidTurn: boolean = false
) {
for (const passive of [ false, true ]) {
if (pokemon) {
applySingleAbAttrs(pokemon, passive, attrType, applyFunc, args, gainedMidTurn, simulated, showAbilityInstant, messages);
globalScene.clearPhaseQueueSplice();
if (!pokemon?.canApplyAbility(passive) || (passive && (pokemon.getPassiveAbility().id === pokemon.getAbility().id))) {
continue;
}
applySingleAbAttrs(pokemon, passive, attrType, applyFunc, args, gainedMidTurn, simulated, showAbilityInstant, messages);
globalScene.clearPhaseQueueSplice();
}
}