From b2ec9612945f9ea117bd5e8846acec7e13b47718 Mon Sep 17 00:00:00 2001 From: Christopher Schmidt Date: Tue, 27 Aug 2024 11:23:11 -0400 Subject: [PATCH] Applies ClearWeatherAbAttr and PostFaintAbAttr separately for edge case of fused pokemon --- src/phases/faint-phase.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/phases/faint-phase.ts b/src/phases/faint-phase.ts index 4f492ef2cae..ec79f6aba1c 100644 --- a/src/phases/faint-phase.ts +++ b/src/phases/faint-phase.ts @@ -62,7 +62,10 @@ export class FaintPhase extends PokemonPhase { if (pokemon.turnData?.attacksReceived?.length) { const lastAttack = pokemon.turnData.attacksReceived[0]; - if (pokemon.hasAbilityWithAttr(PostFaintClearWeatherAbAttr) || lastAttack.sourceId !== pokemon.id) { // prevent applying faint abilities to self unless its clear weather + if (pokemon.hasAbilityWithAttr(PostFaintClearWeatherAbAttr)) { + applyPostFaintAbAttrs(PostFaintClearWeatherAbAttr, pokemon, this.scene.getPokemonById(lastAttack.sourceId)!, new PokemonMove(lastAttack.move).getMove(), lastAttack.result); + } + if (lastAttack.sourceId !== pokemon.id) { // prevent applying faint abilities to self unless its clear weather applyPostFaintAbAttrs(PostFaintAbAttr, pokemon, this.scene.getPokemonById(lastAttack.sourceId)!, new PokemonMove(lastAttack.move).getMove(), lastAttack.result); } }