Fix CopyFaintedAllyAbilityAbAttr

This commit is contained in:
Dean 2025-01-17 22:55:59 -08:00
parent 7634fe562c
commit 936568f264

View File

@ -1920,8 +1920,8 @@ export class CopyFaintedAllyAbilityAbAttr extends PostKnockOutAbAttr {
applyPostKnockOut(pokemon: Pokemon, passive: boolean, simulated: boolean, knockedOut: Pokemon, args: any[]): boolean | Promise<boolean> { applyPostKnockOut(pokemon: Pokemon, passive: boolean, simulated: boolean, knockedOut: Pokemon, args: any[]): boolean | Promise<boolean> {
if (pokemon.isPlayer() === knockedOut.isPlayer() && !knockedOut.getAbility().hasAttr(UncopiableAbilityAbAttr)) { if (pokemon.isPlayer() === knockedOut.isPlayer() && !knockedOut.getAbility().hasAttr(UncopiableAbilityAbAttr)) {
if (!simulated) { if (!simulated) {
pokemon.summonData.ability = knockedOut.getAbility().id;
globalScene.queueMessage(i18next.t("abilityTriggers:copyFaintedAllyAbility", { pokemonNameWithAffix: getPokemonNameWithAffix(knockedOut), abilityName: allAbilities[knockedOut.getAbility().id].name })); globalScene.queueMessage(i18next.t("abilityTriggers:copyFaintedAllyAbility", { pokemonNameWithAffix: getPokemonNameWithAffix(knockedOut), abilityName: allAbilities[knockedOut.getAbility().id].name }));
pokemon.setTempAbility(knockedOut.getAbility());
} }
return true; return true;
} }