mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-05-10 18:33:22 +01:00
[Bug][Hotfix] Suppress Illusion if NG is already active (#5797)
* Suppress preSummon attrs off field * Add test case
This commit is contained in:
parent
530b2b8a00
commit
5a58abfddf
@ -186,6 +186,7 @@ import {
|
||||
applyAllyStatMultiplierAbAttrs,
|
||||
AllyStatMultiplierAbAttr,
|
||||
MoveAbilityBypassAbAttr,
|
||||
PreSummonAbAttr,
|
||||
} from "#app/data/abilities/ability";
|
||||
import { allAbilities } from "#app/data/data-lists";
|
||||
import type PokemonData from "#app/system/pokemon-data";
|
||||
@ -2414,8 +2415,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
const suppressAbilitiesTag = arena.getTag(
|
||||
ArenaTagType.NEUTRALIZING_GAS,
|
||||
) as SuppressAbilitiesTag;
|
||||
const suppressOffField = ability.hasAttr(PreSummonAbAttr);
|
||||
if (
|
||||
this.isOnField() &&
|
||||
(this.isOnField() || suppressOffField) &&
|
||||
suppressAbilitiesTag &&
|
||||
!suppressAbilitiesTag.isBeingRemoved()
|
||||
) {
|
||||
|
@ -65,7 +65,7 @@ describe("Abilities - Illusion", () => {
|
||||
expect(!!zorua.summonData.illusion).equals(false);
|
||||
});
|
||||
|
||||
it("break with neutralizing gas", async () => {
|
||||
it("breaks with neutralizing gas", async () => {
|
||||
game.override.enemyAbility(Abilities.NEUTRALIZING_GAS);
|
||||
await game.classicMode.startBattle([Species.KOFFING]);
|
||||
|
||||
@ -74,6 +74,20 @@ describe("Abilities - Illusion", () => {
|
||||
expect(!!zorua.summonData.illusion).equals(false);
|
||||
});
|
||||
|
||||
it("does not activate if neutralizing gas is active", async () => {
|
||||
game.override
|
||||
.enemyAbility(Abilities.NEUTRALIZING_GAS)
|
||||
.ability(Abilities.ILLUSION)
|
||||
.moveset(Moves.SPLASH)
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS, Species.MAGIKARP]);
|
||||
|
||||
game.doSwitchPokemon(1);
|
||||
await game.toNextTurn();
|
||||
|
||||
expect(game.scene.getPlayerPokemon()!.summonData.illusion).toBeFalsy();
|
||||
});
|
||||
|
||||
it("causes enemy AI to consider the illusion's type instead of the actual type when considering move effectiveness", async () => {
|
||||
game.override.enemyMoveset([Moves.FLAMETHROWER, Moves.PSYCHIC, Moves.TACKLE]);
|
||||
await game.classicMode.startBattle([Species.ZOROARK, Species.FEEBAS]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user