mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-23 15:03:24 +02:00
[Bug] [Move] Fix pollen puff (#6363)
* Ensure pollen puff does not heal enemy after damage * Add test to ensure pollen puff does not heal enemy
This commit is contained in:
parent
873e12f9ad
commit
99bf639ea7
@ -2325,6 +2325,13 @@ export class HealOnAllyAttr extends HealAttr {
|
|||||||
// Don't trigger if not targeting an ally
|
// Don't trigger if not targeting an ally
|
||||||
return target === user.getAlly() && super.canApply(user, target, _move, _args);
|
return target === user.getAlly() && super.canApply(user, target, _move, _args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override apply(user: Pokemon, target: Pokemon, _move: Move, _args: any[]): boolean {
|
||||||
|
if (user.isOpponent(target)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return super.apply(user, target, _move, _args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -61,4 +61,16 @@ describe("Moves - Pollen Puff", () => {
|
|||||||
|
|
||||||
expect(target.battleData.hitCount).toBe(2);
|
expect(target.battleData.hitCount).toBe(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Regression test for pollen puff healing an enemy after dealing damage
|
||||||
|
it("should not heal an enemy after dealing damage", async () => {
|
||||||
|
await game.classicMode.startBattle([SpeciesId.FEEBAS]);
|
||||||
|
const target = game.field.getEnemyPokemon();
|
||||||
|
game.move.use(MoveId.POLLEN_PUFF);
|
||||||
|
|
||||||
|
await game.phaseInterceptor.to("BerryPhase", false);
|
||||||
|
|
||||||
|
expect(target.hp).not.toBe(target.getMaxHp());
|
||||||
|
expect(game.phaseInterceptor.log).not.toContain("PokemonHealPhase");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -37,6 +37,7 @@ import { NewBiomeEncounterPhase } from "#phases/new-biome-encounter-phase";
|
|||||||
import { NextEncounterPhase } from "#phases/next-encounter-phase";
|
import { NextEncounterPhase } from "#phases/next-encounter-phase";
|
||||||
import { PartyExpPhase } from "#phases/party-exp-phase";
|
import { PartyExpPhase } from "#phases/party-exp-phase";
|
||||||
import { PartyHealPhase } from "#phases/party-heal-phase";
|
import { PartyHealPhase } from "#phases/party-heal-phase";
|
||||||
|
import { PokemonHealPhase } from "#phases/pokemon-heal-phase";
|
||||||
import { PokemonTransformPhase } from "#phases/pokemon-transform-phase";
|
import { PokemonTransformPhase } from "#phases/pokemon-transform-phase";
|
||||||
import { PositionalTagPhase } from "#phases/positional-tag-phase";
|
import { PositionalTagPhase } from "#phases/positional-tag-phase";
|
||||||
import { PostGameOverPhase } from "#phases/post-game-over-phase";
|
import { PostGameOverPhase } from "#phases/post-game-over-phase";
|
||||||
@ -181,6 +182,7 @@ export class PhaseInterceptor {
|
|||||||
UnlockPhase,
|
UnlockPhase,
|
||||||
PostGameOverPhase,
|
PostGameOverPhase,
|
||||||
RevivalBlessingPhase,
|
RevivalBlessingPhase,
|
||||||
|
PokemonHealPhase,
|
||||||
];
|
];
|
||||||
|
|
||||||
private endBySetMode = [
|
private endBySetMode = [
|
||||||
|
Loading…
Reference in New Issue
Block a user