mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-07 17:02:16 +02:00
Applies ClearWeatherAbAttr and PostFaintAbAttr separately for edge case of fused pokemon
This commit is contained in:
parent
0e6194992d
commit
b2ec961294
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user