Modify gastro acid to call onLose attributes when suppressing

This commit is contained in:
Dean 2025-02-19 14:31:30 -08:00
parent e1b2dfd827
commit 6134016655
3 changed files with 13 additions and 4 deletions

View File

@ -7635,11 +7635,12 @@ export class SuppressAbilitiesAttr extends MoveEffectAttr {
return false; return false;
} }
target.summonData.abilitySuppressed = true;
globalScene.arena.triggerWeatherBasedFormChangesToNormal();
globalScene.queueMessage(i18next.t("moveTriggers:suppressAbilities", { pokemonName: getPokemonNameWithAffix(target) })); globalScene.queueMessage(i18next.t("moveTriggers:suppressAbilities", { pokemonName: getPokemonNameWithAffix(target) }));
target.suppressAbility();
globalScene.arena.triggerWeatherBasedFormChangesToNormal();
return true; return true;
} }

View File

@ -1498,6 +1498,14 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
applyOnGainAbAttrs(this, passive); applyOnGainAbAttrs(this, passive);
} }
/**
* Suppresses an ability and calls its onlose attributes
*/
public suppressAbility() {
this.summonData.abilitySuppressed = true;
[ true, false ].forEach((v) => applyOnLoseAbAttrs(this, v));
}
/** /**
* Checks if a pokemon has a passive either from: * Checks if a pokemon has a passive either from:
* - bought with starter candy * - bought with starter candy

View File

@ -125,7 +125,7 @@ describe("Abilities - Neutralizing Gas", () => {
expect(game.scene.arena.getTag(ArenaTagType.NEUTRALIZING_GAS)).toBeUndefined(); // No neut gas users are left expect(game.scene.arena.getTag(ArenaTagType.NEUTRALIZING_GAS)).toBeUndefined(); // No neut gas users are left
}); });
it.todo("should deactivate when suppressed by gastro acid", async () => { it("should deactivate when suppressed by gastro acid", async () => {
game.override.enemyMoveset(Moves.GASTRO_ACID); game.override.enemyMoveset(Moves.GASTRO_ACID);
await game.classicMode.startBattle([ Species.FEEBAS ]); await game.classicMode.startBattle([ Species.FEEBAS ]);