From 1d936bcddc2b4a033020d6ad8418b240d59fbbee Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 9 Jun 2020 08:32:08 -0400 Subject: [PATCH] Implemented Mazemind Tome --- Mage.Sets/src/mage/cards/m/MazemindTome.java | 86 ++++++++++++++++++++ Mage.Sets/src/mage/sets/CoreSet2021.java | 1 + 2 files changed, 87 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/m/MazemindTome.java diff --git a/Mage.Sets/src/mage/cards/m/MazemindTome.java b/Mage.Sets/src/mage/cards/m/MazemindTome.java new file mode 100644 index 0000000000..282b220a4e --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MazemindTome.java @@ -0,0 +1,86 @@ +package mage.cards.m; + +import mage.abilities.Ability; +import mage.abilities.StateTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.ExileSourceCost; +import mage.abilities.costs.common.PutCountersSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.keyword.ScryEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class MazemindTome extends CardImpl { + + public MazemindTome(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); + + // {T}, Put a page counter on Mazemind Tome: Scry 1. + Ability ability = new SimpleActivatedAbility(new ScryEffect(1), new TapSourceCost()); + ability.addCost(new PutCountersSourceCost(CounterType.PAGE.createInstance())); + this.addAbility(ability); + + // {2}, {T}, Put a page counter on Mazemind Tome: Draw a card. + ability = new SimpleActivatedAbility(new DrawCardSourceControllerEffect(1), new GenericManaCost(2)); + ability.addCost(new TapSourceCost()); + ability.addCost(new PutCountersSourceCost(CounterType.PAGE.createInstance())); + this.addAbility(ability); + + // When there are four or more page counters on Mazemind Tome, exile it. If you do, you gain 4 life. + this.addAbility(new MazemindTomeTriggeredAbility()); + } + + private MazemindTome(final MazemindTome card) { + super(card); + } + + @Override + public MazemindTome copy() { + return new MazemindTome(this); + } +} + +class MazemindTomeTriggeredAbility extends StateTriggeredAbility { + + MazemindTomeTriggeredAbility() { + super(Zone.BATTLEFIELD, new DoIfCostPaid( + new GainLifeEffect(4), new ExileSourceCost(), null, false + )); + } + + private MazemindTomeTriggeredAbility(final MazemindTomeTriggeredAbility ability) { + super(ability); + } + + @Override + public MazemindTomeTriggeredAbility copy() { + return new MazemindTomeTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent permanent = game.getPermanent(getSourceId()); + return permanent != null && permanent.getCounters(game).getCount(CounterType.PAGE) >= 4; + } + + @Override + public String getRule() { + return "When there are four or more page counters on {this}, exile it. If you do, you gain 4 life."; + } + +} diff --git a/Mage.Sets/src/mage/sets/CoreSet2021.java b/Mage.Sets/src/mage/sets/CoreSet2021.java index d4980a4644..caea954e4a 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2021.java +++ b/Mage.Sets/src/mage/sets/CoreSet2021.java @@ -76,6 +76,7 @@ public final class CoreSet2021 extends ExpansionSet { cards.add(new SetCardInfo("Malefic Scythe", 112, Rarity.UNCOMMON, mage.cards.m.MaleficScythe.class)); cards.add(new SetCardInfo("Mangara, the Diplomat", 27, Rarity.MYTHIC, mage.cards.m.MangaraTheDiplomat.class)); cards.add(new SetCardInfo("Massacre Wurm", 114, Rarity.MYTHIC, mage.cards.m.MassacreWurm.class)); + cards.add(new SetCardInfo("Mazemind Tome", 232, Rarity.RARE, mage.cards.m.MazemindTome.class)); cards.add(new SetCardInfo("Mystic Skyfish", 326, Rarity.COMMON, mage.cards.m.MysticSkyfish.class)); cards.add(new SetCardInfo("Necromentia", 116, Rarity.RARE, mage.cards.n.Necromentia.class)); cards.add(new SetCardInfo("Pack Leader", 29, Rarity.RARE, mage.cards.p.PackLeader.class));