From 1a62e116401f7e0e744b128f810a72c5a0e140a4 Mon Sep 17 00:00:00 2001 From: Lylian Date: Tue, 1 Apr 2025 23:01:24 +0200 Subject: [PATCH] add comments --- src/data/ability.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index fb68512a019..363096815e3 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -5234,8 +5234,13 @@ export class IllusionPreSummonAbAttr extends PreSummonAbAttr { const party: Pokemon[] = (pokemon.isPlayer() ? globalScene.getPlayerParty() : globalScene.getEnemyParty()).filter(p => p.isAllowedInBattle()); const lastPokemon: Pokemon = party.filter(p => p !==pokemon).at(-1) || pokemon; const speciesId = lastPokemon.species.speciesId; - if ( lastPokemon === pokemon || !!pokemon.summonData?.illusion || - ((speciesId === Species.OGERPON || speciesId === Species.TERAPAGOS) && (lastPokemon.isTerastallized || pokemon.isTerastallized))) { + + // If the last conscious Pokémon in the party is a Terastallized Ogerpon or Terapagos, Illusion will not activate. + // Illusion will also not activate if the Pokémon with Illusion is Terastallized and the last Pokémon in the party is Ogerpon or Terapagos. + if ( + lastPokemon === pokemon || + ((speciesId === Species.OGERPON || speciesId === Species.TERAPAGOS) && (lastPokemon.isTerastallized || pokemon.isTerastallized)) + ) { return false; } }