From a54cd953a6d12d04522a0b1ae901d15d1c3e5478 Mon Sep 17 00:00:00 2001 From: Bertie690 <136088738+Bertie690@users.noreply.github.com> Date: Mon, 30 Jun 2025 05:19:59 +0100 Subject: [PATCH] [Bug] Fix Shields Down blocking status in Core Form, unnecessarily resetting before battle (#6044) * Fix Minior Form Change issues * Fix bug * Update Power Construct conditionals to be less janky * Fix syntax error * Fix ability.ts --- src/data/abilities/ability.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/data/abilities/ability.ts b/src/data/abilities/ability.ts index 5e7e1c2992a..0aaf5b4b124 100644 --- a/src/data/abilities/ability.ts +++ b/src/data/abilities/ability.ts @@ -7263,11 +7263,14 @@ export function initAbilities() { new Ability(AbilityId.MERCILESS, 7) .attr(ConditionalCritAbAttr, (_user, target, _move) => target?.status?.effect === StatusEffect.TOXIC || target?.status?.effect === StatusEffect.POISON), new Ability(AbilityId.SHIELDS_DOWN, 7, -1) - .attr(PostBattleInitFormChangeAbAttr, () => 0) + // Change into Meteor Form on switch-in or turn end if HP >= 50%, + // or Core Form if HP <= 50%. + .attr(PostBattleInitFormChangeAbAttr, p => p.formIndex % 7) .attr(PostSummonFormChangeAbAttr, p => p.formIndex % 7 + (p.getHpRatio() <= 0.5 ? 7 : 0)) .attr(PostTurnFormChangeAbAttr, p => p.formIndex % 7 + (p.getHpRatio() <= 0.5 ? 7 : 0)) - .conditionalAttr(p => p.formIndex !== 7, StatusEffectImmunityAbAttr) - .conditionalAttr(p => p.formIndex !== 7, BattlerTagImmunityAbAttr, BattlerTagType.DROWSY) + // All variants of Meteor Form are immune to status effects & Yawn + .conditionalAttr(p => p.formIndex < 7, StatusEffectImmunityAbAttr) + .conditionalAttr(p => p.formIndex < 7, BattlerTagImmunityAbAttr, BattlerTagType.DROWSY) .attr(NoFusionAbilityAbAttr) .attr(NoTransformAbilityAbAttr) .uncopiable() @@ -7333,12 +7336,11 @@ export function initAbilities() { .unsuppressable() .bypassFaint(), new Ability(AbilityId.POWER_CONSTRUCT, 7) - .conditionalAttr(pokemon => pokemon.formIndex === 2 || pokemon.formIndex === 4, PostBattleInitFormChangeAbAttr, () => 2) - .conditionalAttr(pokemon => pokemon.formIndex === 3 || pokemon.formIndex === 5, PostBattleInitFormChangeAbAttr, () => 3) - .conditionalAttr(pokemon => pokemon.formIndex === 2 || pokemon.formIndex === 4, PostSummonFormChangeAbAttr, p => p.getHpRatio() <= 0.5 || p.getFormKey() === "complete" ? 4 : 2) - .conditionalAttr(pokemon => pokemon.formIndex === 2 || pokemon.formIndex === 4, PostTurnFormChangeAbAttr, p => p.getHpRatio() <= 0.5 || p.getFormKey() === "complete" ? 4 : 2) - .conditionalAttr(pokemon => pokemon.formIndex === 3 || pokemon.formIndex === 5, PostSummonFormChangeAbAttr, p => p.getHpRatio() <= 0.5 || p.getFormKey() === "10-complete" ? 5 : 3) - .conditionalAttr(pokemon => pokemon.formIndex === 3 || pokemon.formIndex === 5, PostTurnFormChangeAbAttr, p => p.getHpRatio() <= 0.5 || p.getFormKey() === "10-complete" ? 5 : 3) + // Change to 10% complete or 50% complete on switchout/turn end if at <50% HP; + // revert to 10% PC or 50% PC before a new battle starts + .conditionalAttr(p => p.formIndex === 4 || p.formIndex === 5, PostBattleInitFormChangeAbAttr, p => p.formIndex - 2) + .conditionalAttr(p => p.getHpRatio() <= 0.5 && (p.formIndex === 2 || p.formIndex === 3), PostSummonFormChangeAbAttr, p => p.formIndex + 2) + .conditionalAttr(p => p.getHpRatio() <= 0.5 && (p.formIndex === 2 || p.formIndex === 3), PostTurnFormChangeAbAttr, p => p.formIndex + 2) .attr(NoFusionAbilityAbAttr) .uncopiable() .unreplaceable()