Update Power Construct conditionals to be less janky

This commit is contained in:
Bertie690 2025-06-29 19:47:56 +01:00 committed by GitHub
parent 121ffdba38
commit 5489ad1bb8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7334,16 +7334,13 @@ export function initAbilities() {
.unreplaceable() .unreplaceable()
.unsuppressable() .unsuppressable()
.bypassFaint(), .bypassFaint(),
new Ability(AbilityId.POWER_CONSTRUCT, 7) new Ability(AbilityId.POWER_CONSTRUCT,
// Change to 10% PC or 50% PC after battle ends, // Change to 10% complete or 50% complete on switchout/turn end if at <50% HP;
// 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
// TODO: change condition functions to remove duplicate changes // TODO: Should this revert the form change even if it would re-activate on summon?
.conditionalAttr(pokemon => pokemon.formIndex === 2 || pokemon.formIndex === 4, PostBattleInitFormChangeAbAttr, () => 2) .conditionalAttr(p => p.formIndex === 4 || p.formIndex === 5, PostBattleInitFormChangeAbAttr, p => p.formIndex - 2)
.conditionalAttr(pokemon => pokemon.formIndex === 3 || pokemon.formIndex === 5, PostBattleInitFormChangeAbAttr, () => 3) .conditionalAttr(p => p.getHpRatio() <= 0.5 && (p.formIndex === 2 || p.formIndex === 3), PostSummonFormChangeAbAttr, p => p.formIndex + 2)
.conditionalAttr(pokemon => pokemon.formIndex === 2 || pokemon.formIndex === 4, PostSummonFormChangeAbAttr, p => p.getHpRatio() <= 0.5 || p.getFormKey() === "complete" ? 4 : 2) .conditionalAttr(p => p.getHpRatio() <= 0.5 && (p.formIndex === 2 || p.formIndex === 3), PostTurnFormChangeAbAttr, p => p.formIndex + 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)
.attr(NoFusionAbilityAbAttr) .attr(NoFusionAbilityAbAttr)
.uncopiable() .uncopiable()
.unreplaceable() .unreplaceable()