From 87b7122b601fcfe40b82401e6ee33bda05bffb1e Mon Sep 17 00:00:00 2001 From: Tempoanon <163687446+Tempo-anon@users.noreply.github.com> Date: Sun, 3 Nov 2024 21:47:07 -0500 Subject: [PATCH] [P2] Illuminate ignores evasion (#4781) --- src/data/ability.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 87f9e89e534..5be87fc2397 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -1956,6 +1956,10 @@ export class CopyFaintedAllyAbilityAbAttr extends PostKnockOutAbAttr { } } +/** + * Ability attribute for ignoring the opponent's stat changes + * @param stats the stats that should be ignored + */ export class IgnoreOpponentStatStagesAbAttr extends AbAttr { private stats: readonly BattleStat[]; @@ -1965,6 +1969,15 @@ export class IgnoreOpponentStatStagesAbAttr extends AbAttr { this.stats = stats ?? BATTLE_STATS; } + /** + * Modifies a BooleanHolder and returns the result to see if a stat is ignored or not + * @param _pokemon n/a + * @param _passive n/a + * @param simulated n/a + * @param _cancelled n/a + * @param args A BooleanHolder that represents whether or not to ignore a stat's stat changes + * @returns true if the stat is ignored, false otherwise + */ apply(_pokemon: Pokemon, _passive: boolean, simulated: boolean, _cancelled: Utils.BooleanHolder, args: any[]) { if (this.stats.includes(args[0])) { (args[1] as Utils.BooleanHolder).value = true; @@ -5361,6 +5374,7 @@ export function initAbilities() { new Ability(Abilities.ILLUMINATE, 3) .attr(ProtectStatAbAttr, Stat.ACC) .attr(DoubleBattleChanceAbAttr) + .attr(IgnoreOpponentStatStagesAbAttr, [ Stat.EVA ]) .ignorable(), new Ability(Abilities.TRACE, 3) .attr(PostSummonCopyAbilityAbAttr) @@ -5580,7 +5594,7 @@ export function initAbilities() { new Ability(Abilities.FOREWARN, 4) .attr(ForewarnAbAttr), new Ability(Abilities.UNAWARE, 4) - .attr(IgnoreOpponentStatStagesAbAttr) + .attr(IgnoreOpponentStatStagesAbAttr, [ Stat.ATK, Stat.DEF, Stat.SPATK, Stat.SPDEF, Stat.ACC, Stat.EVA ]) .ignorable(), new Ability(Abilities.TINTED_LENS, 4) .attr(DamageBoostAbAttr, 2, (user, target, move) => (target?.getMoveEffectiveness(user!, move) ?? 1) <= 0.5),