diff --git a/Mage.Sets/src/mage/cards/t/TomeboundLich.java b/Mage.Sets/src/mage/cards/t/TomeboundLich.java new file mode 100644 index 00000000000..1a379a035d4 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TomeboundLich.java @@ -0,0 +1,90 @@ +package mage.cards.t; + +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.DrawDiscardControllerEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.abilities.keyword.LifelinkAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.DamagedPlayerEvent; +import mage.game.events.GameEvent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class TomeboundLich extends CardImpl { + + public TomeboundLich(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{B}"); + + this.subtype.add(SubType.ZOMBIE); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Deathtouch + this.addAbility(DeathtouchAbility.getInstance()); + + // Lifelink + this.addAbility(LifelinkAbility.getInstance()); + + // Whenever Tomebound Lich enters the battlefield or deals combat damage to a player, draw a card, then discard a card. + this.addAbility(new TomeboundLichTriggeredAbility()); + } + + private TomeboundLich(final TomeboundLich card) { + super(card); + } + + @Override + public TomeboundLich copy() { + return new TomeboundLich(this); + } +} + +class TomeboundLichTriggeredAbility extends TriggeredAbilityImpl { + + TomeboundLichTriggeredAbility() { + super(Zone.BATTLEFIELD, new DrawDiscardControllerEffect(1, 1), false); + } + + private TomeboundLichTriggeredAbility(final TomeboundLichTriggeredAbility ability) { + super(ability); + } + + @Override + public TomeboundLichTriggeredAbility copy() { + return new TomeboundLichTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DAMAGED_PLAYER + || event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER + && event.getSourceId().equals(this.getSourceId()) + && ((DamagedPlayerEvent) event).isCombatDamage()) { + return true; + } + return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD + && event.getTargetId().equals(this.getSourceId()); + } + + @Override + public String getRule() { + return "Whenever {this} enters the battlefield or deals combat damage " + + "to a player, draw a card, then discard a card"; + } + +} diff --git a/Mage.Sets/src/mage/sets/CoreSet2020.java b/Mage.Sets/src/mage/sets/CoreSet2020.java index c202a956791..21f62095a08 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2020.java +++ b/Mage.Sets/src/mage/sets/CoreSet2020.java @@ -168,6 +168,7 @@ public final class CoreSet2020 extends ExpansionSet { cards.add(new SetCardInfo("Thornwood Falls", 258, Rarity.COMMON, mage.cards.t.ThornwoodFalls.class)); cards.add(new SetCardInfo("Thought Distortion", 117, Rarity.UNCOMMON, mage.cards.t.ThoughtDistortion.class)); cards.add(new SetCardInfo("Thrashing Brontodon", 197, Rarity.UNCOMMON, mage.cards.t.ThrashingBrontodon.class)); + cards.add(new SetCardInfo("Tomebound Lich", 219, Rarity.UNCOMMON, mage.cards.t.TomeboundLich.class)); cards.add(new SetCardInfo("Tranquil Cove", 259, Rarity.COMMON, mage.cards.t.TranquilCove.class)); cards.add(new SetCardInfo("Uncaged Fury", 163, Rarity.UNCOMMON, mage.cards.u.UncagedFury.class)); cards.add(new SetCardInfo("Unchained Berserker", 164, Rarity.UNCOMMON, mage.cards.u.UnchainedBerserker.class));