mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-05 16:02:20 +02:00
Allow gastro acid to suppress passives if main ability is unsuppressable
This commit is contained in:
parent
288e4e7e7e
commit
74eac246a4
@ -7499,6 +7499,7 @@ export class SuppressAbilitiesAttr extends MoveEffectAttr {
|
|||||||
|
|
||||||
target.suppressAbility();
|
target.suppressAbility();
|
||||||
|
|
||||||
|
|
||||||
globalScene.arena.triggerWeatherBasedFormChangesToNormal();
|
globalScene.arena.triggerWeatherBasedFormChangesToNormal();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -7506,7 +7507,7 @@ export class SuppressAbilitiesAttr extends MoveEffectAttr {
|
|||||||
|
|
||||||
/** Causes the effect to fail when the target's ability is unsupressable or already suppressed. */
|
/** Causes the effect to fail when the target's ability is unsupressable or already suppressed. */
|
||||||
getCondition(): MoveConditionFunc {
|
getCondition(): MoveConditionFunc {
|
||||||
return (user, target, move) => target.getAbility().isSuppressable && !target.summonData.abilitySuppressed;
|
return (_user, target, _move) => !target.summonData.abilitySuppressed && (target.getAbility().isSuppressable || (target.hasPassive() && target.getPassiveAbility().isSuppressable));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ describe("Moves - Gastro Acid", () => {
|
|||||||
game.override.battleStyle("double");
|
game.override.battleStyle("double");
|
||||||
game.override.startingLevel(1);
|
game.override.startingLevel(1);
|
||||||
game.override.enemyLevel(100);
|
game.override.enemyLevel(100);
|
||||||
game.override.ability(Abilities.NONE);
|
game.override.ability(Abilities.BALL_FETCH);
|
||||||
game.override.moveset([Moves.GASTRO_ACID, Moves.WATER_GUN, Moves.SPLASH, Moves.CORE_ENFORCER]);
|
game.override.moveset([Moves.GASTRO_ACID, Moves.WATER_GUN, Moves.SPLASH, Moves.CORE_ENFORCER]);
|
||||||
game.override.enemySpecies(Species.BIDOOF);
|
game.override.enemySpecies(Species.BIDOOF);
|
||||||
game.override.enemyMoveset(Moves.SPLASH);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
@ -40,7 +40,7 @@ describe("Moves - Gastro Acid", () => {
|
|||||||
* - player mon 1 should have dealt damage, player mon 2 should have not
|
* - player mon 1 should have dealt damage, player mon 2 should have not
|
||||||
*/
|
*/
|
||||||
|
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
game.move.select(Moves.GASTRO_ACID, 0, BattlerIndex.ENEMY);
|
game.move.select(Moves.GASTRO_ACID, 0, BattlerIndex.ENEMY);
|
||||||
game.move.select(Moves.SPLASH, 1);
|
game.move.select(Moves.SPLASH, 1);
|
||||||
@ -63,7 +63,7 @@ describe("Moves - Gastro Acid", () => {
|
|||||||
it("fails if used on an enemy with an already-suppressed ability", async () => {
|
it("fails if used on an enemy with an already-suppressed ability", async () => {
|
||||||
game.override.battleStyle("single");
|
game.override.battleStyle("single");
|
||||||
|
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
game.move.select(Moves.CORE_ENFORCER);
|
game.move.select(Moves.CORE_ENFORCER);
|
||||||
// Force player to be slower to enable Core Enforcer to proc its suppression effect
|
// Force player to be slower to enable Core Enforcer to proc its suppression effect
|
||||||
@ -77,4 +77,22 @@ describe("Moves - Gastro Acid", () => {
|
|||||||
|
|
||||||
expect(game.scene.getPlayerPokemon()!.getLastXMoves()[0].result).toBe(MoveResult.FAIL);
|
expect(game.scene.getPlayerPokemon()!.getLastXMoves()[0].result).toBe(MoveResult.FAIL);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should suppress the passive of a target even if its main ability is unsuppressable", async () => {
|
||||||
|
game.override.enemyAbility(Abilities.COMATOSE);
|
||||||
|
game.override.enemyPassiveAbility(Abilities.WATER_ABSORB);
|
||||||
|
game.override.enemyHasPassiveAbility(true);
|
||||||
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
|
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||||
|
|
||||||
|
game.move.select(Moves.GASTRO_ACID);
|
||||||
|
await game.toNextTurn();
|
||||||
|
expect(enemyPokemon?.summonData.abilitySuppressed).toBe(true);
|
||||||
|
|
||||||
|
game.move.select(Moves.WATER_GUN);
|
||||||
|
await game.phaseInterceptor.to("BerryPhase");
|
||||||
|
|
||||||
|
expect(enemyPokemon?.getHpRatio()).toBeLessThan(1);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user