foul-magics/Mage.Sets/src/mage/cards/r/RuneOfProtectionLands.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

47 lines
1.5 KiB
Java

package mage.cards.r;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.PreventNextDamageFromChosenSourceEffect;
import mage.abilities.keyword.CyclingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.filter.FilterObject;
import java.util.UUID;
/**
* @author fireshoes
*/
public final class RuneOfProtectionLands extends CardImpl {
private static final FilterObject filter = new FilterObject("land source");
static {
filter.add(CardType.LAND.getPredicate());
}
public RuneOfProtectionLands(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}");
// {W}: The next time a land source of your choice would deal damage to you this turn, prevent that damage.
Effect effect = new PreventNextDamageFromChosenSourceEffect(Duration.EndOfTurn, true, filter);
this.addAbility(new SimpleActivatedAbility(effect, new ManaCostsImpl<>("{W}")));
// Cycling {2} ({2}, Discard this card: Draw a card.)
this.addAbility(new CyclingAbility(new ManaCostsImpl<>("{2}")));
}
private RuneOfProtectionLands(final RuneOfProtectionLands card) {
super(card);
}
@Override
public RuneOfProtectionLands copy() {
return new RuneOfProtectionLands(this);
}
}