From 3d96e947fcba47e3e8b90bc004e95a6559f1425d Mon Sep 17 00:00:00 2001 From: Madi Simpson Date: Sun, 5 May 2024 21:52:55 -0700 Subject: [PATCH] ability: add fixes for filter, solid rock, tinted lens --- src/data/ability.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 484aaa875b4..cbbbe6aa711 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -2977,9 +2977,17 @@ export function initAbilities() { .attr(IgnoreOpponentStatChangesAbAttr) .ignorable(), new Ability(Abilities.TINTED_LENS, 4) - .attr(MovePowerBoostAbAttr, (user, target, move) => target.getAttackTypeEffectiveness(move.type) <= 0.5, 2), + .attr(MovePowerBoostAbAttr, (user, target, move) => { + const variableType = new Utils.IntegerHolder(move.type); + applyMoveAttrs(VariableMoveTypeAttr, user, target, move, variableType); + return target.getAttackTypeEffectiveness(variableType.value) <= 0.5; + }, 2), new Ability(Abilities.FILTER, 4) - .attr(ReceivedMoveDamageMultiplierAbAttr,(target, user, move) => target.getAttackTypeEffectiveness(move.type) >= 2, 0.75) + .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => { + const variableType = new Utils.IntegerHolder(move.type); + applyMoveAttrs(VariableMoveTypeAttr, user, target, move, variableType); + return target.getAttackTypeEffectiveness(move.type) >= 2; + }, 0.75) .ignorable(), new Ability(Abilities.SLOW_START, 4) .attr(PostSummonAddBattlerTagAbAttr, BattlerTagType.SLOW_START, 5), @@ -2994,7 +3002,11 @@ export function initAbilities() { .attr(BlockWeatherDamageAttr, WeatherType.HAIL) .attr(PostWeatherLapseHealAbAttr, 1, WeatherType.HAIL, WeatherType.SNOW), new Ability(Abilities.SOLID_ROCK, 4) - .attr(ReceivedMoveDamageMultiplierAbAttr,(target, user, move) => target.getAttackTypeEffectiveness(move.type) >= 2, 0.75) + .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => { + const variableType = new Utils.IntegerHolder(move.type); + applyMoveAttrs(VariableMoveTypeAttr, user, target, move, variableType); + return target.getAttackTypeEffectiveness(move.type) >= 2; + }, 0.75) .ignorable(), new Ability(Abilities.SNOW_WARNING, 4) .attr(PostSummonWeatherChangeAbAttr, WeatherType.SNOW)