[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:
Sirz Benjie 2025-08-23 11:42:10 -05:00 committed by GitHub
parent 873e12f9ad
commit 99bf639ea7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 21 additions and 0 deletions

View File

@ -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);
}
} }
/** /**

View File

@ -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");
});
}); });

View File

@ -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 = [