[OTC] Implement Leyline Dowser

This commit is contained in:
theelk801 2024-04-05 09:13:24 -04:00
parent e4cd084b1b
commit ba853ba51a
2 changed files with 59 additions and 0 deletions

View file

@ -0,0 +1,58 @@
package mage.cards.l;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.common.TapTargetCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.MillThenPutInHandEffect;
import mage.abilities.effects.common.UntapSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SuperType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.permanent.TappedPredicate;
import mage.target.common.TargetControlledPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class LeylineDowser extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledCreaturePermanent("an untapped legendary creature you control");
static {
filter.add(TappedPredicate.UNTAPPED);
filter.add(SuperType.LEGENDARY.getPredicate());
}
public LeylineDowser(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
// {1}, {T}: Mill a card. You may put an instant or sorcery card milled this way into your hand.
Ability ability = new SimpleActivatedAbility(
new MillThenPutInHandEffect(1, StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY), new GenericManaCost(1)
);
ability.addCost(new TapSourceCost());
this.addAbility(ability);
// Tap an untapped legendary creature you control: Untap Leyline Dowser.
this.addAbility(new SimpleActivatedAbility(
new UntapSourceEffect(), new TapTargetCost(new TargetControlledPermanent(filter))
));
}
private LeylineDowser(final LeylineDowser card) {
super(card);
}
@Override
public LeylineDowser copy() {
return new LeylineDowser(this);
}
}

View file

@ -23,6 +23,7 @@ public final class OutlawsOfThunderJunctionCommander extends ExpansionSet {
cards.add(new SetCardInfo("Angelic Sell-Sword", 10, Rarity.RARE, mage.cards.a.AngelicSellSword.class));
cards.add(new SetCardInfo("Charred Graverobber", 19, Rarity.RARE, mage.cards.c.CharredGraverobber.class));
cards.add(new SetCardInfo("Elemental Eruption", 27, Rarity.RARE, mage.cards.e.ElementalEruption.class));
cards.add(new SetCardInfo("Leyline Dowser", 39, Rarity.RARE, mage.cards.l.LeylineDowser.class));
cards.add(new SetCardInfo("Stella Lee, Wild Card", 3, Rarity.MYTHIC, mage.cards.s.StellaLeeWildCard.class));
}
}