foul-magics/Mage.Sets/src/mage/cards/i/InterventionPact.java
Susucre a6ca052106 refactor one-use prevention effect for a chosen source
fixes a few bugs along the way:

[[Pilgrim and Justice]] & [[Pilgrim of Virue]] were incorrectly adding a "to you" to their damage clause.
[[Ajani's Aid]] was improperly a one-use prevention effect.

[[Story Circle]] and [[Prismatic Circle]] have not been refactor as it is not currently possible to have a proper filter for them. Would require a FilterSource with a 4-argument match most likely.
2025-06-10 19:45:02 -07:00

43 lines
No EOL
1.5 KiB
Java

package mage.cards.i;
import mage.abilities.common.delayed.PactDelayedTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.PreventNextDamageFromChosenSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import java.util.UUID;
/**
* @author Plopman
*/
public final class InterventionPact extends CardImpl {
public InterventionPact(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{0}");
this.color.setWhite(true);
// The next time a source of your choice would deal damage to you this turn, prevent that damage. You gain life equal to the damage prevented this way.
this.getSpellAbility().addEffect(
new PreventNextDamageFromChosenSourceEffect(
Duration.EndOfTurn, true,
PreventNextDamageFromChosenSourceEffect.ON_PREVENT_YOU_GAIN_THAT_MUCH_LIFE
)
);
// At the beginning of your next upkeep, pay {1}{W}{W}. If you don't, you lose the game.
this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new PactDelayedTriggeredAbility(new ManaCostsImpl<>("{1}{W}{W}")), false));
}
private InterventionPact(final InterventionPact card) {
super(card);
}
@Override
public InterventionPact copy() {
return new InterventionPact(this);
}
}