[Bug] Fix NoTransformAbilityAttr not doing anything (#6693)

[Bug] Fix `NoTransformAbilityAttr` not doing anythin
This commit is contained in:
Bertie690 2025-11-01 19:18:04 -04:00 committed by GitHub
parent 6cf28bf13b
commit 4b9ccf5408
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 5 deletions

View File

@ -2200,6 +2200,9 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
if (this.isFusion() && ability.hasAttr("NoFusionAbilityAbAttr")) {
return false;
}
if (this.isTransformed() && ability.hasAttr("NoTransformAbilityAbAttr")) {
return false;
}
const arena = globalScene?.arena;
if (arena.ignoreAbilities && arena.ignoringEffectSource !== this.getBattlerIndex() && ability.ignorable) {
return false;

View File

@ -74,7 +74,7 @@ describe("Abilities - Shields Down", () => {
minior.hp = 0;
minior.status = new Status(StatusEffect.FAINT);
expect(minior.isFainted()).toBe(true);
expect(minior).toHaveFainted();
game.move.use(MoveId.SPLASH);
await game.doKillOpponents();
@ -176,15 +176,15 @@ describe("Abilities - Shields Down", () => {
expect(game.field.getPlayerPokemon()).toHaveBattlerTag(BattlerTagType.CONFUSED);
});
// TODO: The `NoTransformAbilityAbAttr` attribute is not checked anywhere, so this test cannot pass.
// TODO: Move this to a transform test
it.todo("should not activate when transformed", async () => {
it("should not activate when transformed", async () => {
game.override.enemyAbility(AbilityId.IMPOSTER);
await game.classicMode.startBattle([SpeciesId.MINIOR]);
game.move.use(MoveId.SPORE);
await game.toEndOfTurn();
expect(game.field.getEnemyPokemon()).toHaveStatusEffect(StatusEffect.SLEEP);
const karp = game.field.getEnemyPokemon();
expect(karp).not.toHaveAbilityApplied(AbilityId.SHIELDS_DOWN);
expect(karp).toHaveStatusEffect(StatusEffect.SLEEP);
});
});