diff --git a/Mage.Sets/src/mage/cards/t/TomeOfLegends.java b/Mage.Sets/src/mage/cards/t/TomeOfLegends.java new file mode 100644 index 00000000000..b21286429ba --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TomeOfLegends.java @@ -0,0 +1,62 @@ +package mage.cards.t; + +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.EntersBattlefieldOrAttacksAllTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.counters.CounterType; +import mage.filter.FilterPermanent; +import mage.filter.predicate.permanent.CommanderPredicate; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class TomeOfLegends extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("your commander"); + + static { + filter.add(CommanderPredicate.instance); + } + + public TomeOfLegends(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); + + // Tome of Legends enters the battlefield with a page counter on it. + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect( + CounterType.PAGE.createInstance() + ), "with a page counter on it")); + + // Whenever your commander enters the battlefield or attacks, put a page counter on Tome of Legends. + this.addAbility(new EntersBattlefieldOrAttacksAllTriggeredAbility( + new AddCountersSourceEffect(CounterType.PAGE.createInstance()), filter + )); + + // {1}, {T}, Remove a page counter from Tome of Legends: Draw a card. + Ability ability = new SimpleActivatedAbility( + new DrawCardSourceControllerEffect(1), new GenericManaCost(1) + ); + ability.addCost(new TapSourceCost()); + ability.addCost(new RemoveCountersSourceCost(CounterType.PAGE.createInstance())); + this.addAbility(ability); + } + + private TomeOfLegends(final TomeOfLegends card) { + super(card); + } + + @Override + public TomeOfLegends copy() { + return new TomeOfLegends(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java index b3bc6a96f17..b6a9c4c9c22 100644 --- a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java +++ b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java @@ -58,6 +58,7 @@ public final class ThroneOfEldraine extends ExpansionSet { cards.add(new SetCardInfo("Steelbane Hydra", 322, Rarity.RARE, mage.cards.s.SteelbaneHydra.class)); cards.add(new SetCardInfo("Taste of Death", 320, Rarity.RARE, mage.cards.t.TasteOfDeath.class)); cards.add(new SetCardInfo("Tome Raider", 68, Rarity.COMMON, mage.cards.t.TomeRaider.class)); + cards.add(new SetCardInfo("Tome of Legends", 332, Rarity.RARE, mage.cards.t.TomeOfLegends.class)); cards.add(new SetCardInfo("Wishful Merfolk", 73, Rarity.COMMON, mage.cards.w.WishfulMerfolk.class)); cards.add(new SetCardInfo("Witching Well", 74, Rarity.COMMON, mage.cards.w.WitchingWell.class)); } diff --git a/Mage/src/main/java/mage/filter/predicate/permanent/CommanderPredicate.java b/Mage/src/main/java/mage/filter/predicate/permanent/CommanderPredicate.java index ada3bcbaeaa..a833490e3b0 100644 --- a/Mage/src/main/java/mage/filter/predicate/permanent/CommanderPredicate.java +++ b/Mage/src/main/java/mage/filter/predicate/permanent/CommanderPredicate.java @@ -1,8 +1,3 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ package mage.filter.predicate.permanent; import mage.filter.predicate.Predicate;