Implemented Tome of Legends

This commit is contained in:
Evan Kranzler 2019-09-05 19:56:48 -04:00
parent 4c1d9a2bc1
commit 1e272361c0
3 changed files with 63 additions and 5 deletions

View file

@ -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);
}
}

View file

@ -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));
}

View file

@ -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;