From de092a7ea743f367f343e3bffec50d67af2728a7 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 11 Sep 2020 12:51:48 -0400 Subject: [PATCH] [ZNR] Implemented Zagras, Thief of Heartbeats --- .../mage/cards/z/ZagrasThiefOfHeartbeats.java | 114 ++++++++++++++++++ Mage.Sets/src/mage/sets/ZendikarRising.java | 1 + 2 files changed, 115 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/z/ZagrasThiefOfHeartbeats.java diff --git a/Mage.Sets/src/mage/cards/z/ZagrasThiefOfHeartbeats.java b/Mage.Sets/src/mage/cards/z/ZagrasThiefOfHeartbeats.java new file mode 100644 index 0000000000..6f30cfb5e7 --- /dev/null +++ b/Mage.Sets/src/mage/cards/z/ZagrasThiefOfHeartbeats.java @@ -0,0 +1,114 @@ +package mage.cards.z; + +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.PartyCount; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.effects.common.cost.SpellCostReductionForEachSourceEffect; +import mage.abilities.hint.common.PartyCountHint; +import mage.abilities.keyword.DeathtouchAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.events.DamagedCreatureEvent; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ZagrasThiefOfHeartbeats extends CardImpl { + + public ZagrasThiefOfHeartbeats(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{R}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.VAMPIRE); + this.subtype.add(SubType.ROGUE); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // This spell costs {1} less to cast for each creature in your party. + this.addAbility(new SimpleStaticAbility( + Zone.ALL, new SpellCostReductionForEachSourceEffect(1, PartyCount.instance) + ).addHint(PartyCountHint.instance)); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Deathtouch + this.addAbility(DeathtouchAbility.getInstance()); + + // Haste + this.addAbility(HasteAbility.getInstance()); + + // Other creatures you control have deathtouch. + this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect( + DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield, + StaticFilters.FILTER_PERMANENT_CREATURES, true + ))); + + // Whenever a creature you control deals combat damage to a planeswalker, destroy that planeswalker. + this.addAbility(new ZagrasThiefOfHeartbeatsTriggeredAbility()); + } + + private ZagrasThiefOfHeartbeats(final ZagrasThiefOfHeartbeats card) { + super(card); + } + + @Override + public ZagrasThiefOfHeartbeats copy() { + return new ZagrasThiefOfHeartbeats(this); + } +} + +class ZagrasThiefOfHeartbeatsTriggeredAbility extends TriggeredAbilityImpl { + + ZagrasThiefOfHeartbeatsTriggeredAbility() { + super(Zone.BATTLEFIELD, null, false); + } + + private ZagrasThiefOfHeartbeatsTriggeredAbility(final ZagrasThiefOfHeartbeatsTriggeredAbility ability) { + super(ability); + } + + @Override + public ZagrasThiefOfHeartbeatsTriggeredAbility copy() { + return new ZagrasThiefOfHeartbeatsTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (!((DamagedCreatureEvent) event).isCombatDamage()) { + return false; + } + Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); + if (permanent == null + || !permanent.isCreature() + || !permanent.isControlledBy(getControllerId())) { + return false; + } + this.getEffects().clear(); + this.addEffect(new DestroyTargetEffect().setTargetPointer(new FixedTarget(event.getTargetId(), game))); + return true; + } + + @Override + public String getRule() { + return "Whenever a creature you control deals combat damage to a planeswalker, destroy that planeswalker."; + } +} diff --git a/Mage.Sets/src/mage/sets/ZendikarRising.java b/Mage.Sets/src/mage/sets/ZendikarRising.java index fe20932331..821e464dfc 100644 --- a/Mage.Sets/src/mage/sets/ZendikarRising.java +++ b/Mage.Sets/src/mage/sets/ZendikarRising.java @@ -388,6 +388,7 @@ public final class ZendikarRising extends ExpansionSet { cards.add(new SetCardInfo("Wayward Guide-Beast", 176, Rarity.RARE, mage.cards.w.WaywardGuideBeast.class)); cards.add(new SetCardInfo("Windrider Wizard", 87, Rarity.UNCOMMON, mage.cards.w.WindriderWizard.class)); cards.add(new SetCardInfo("Yasharn, Implacable Earth", 240, Rarity.RARE, mage.cards.y.YasharnImplacableEarth.class)); + cards.add(new SetCardInfo("Zagras, Thief of Heartbeats", 241, Rarity.RARE, mage.cards.z.ZagrasThiefOfHeartbeats.class)); cards.add(new SetCardInfo("Zareth San, the Trickster", 242, Rarity.RARE, mage.cards.z.ZarethSanTheTrickster.class)); cards.add(new SetCardInfo("Zof Bloodbog", 132, Rarity.UNCOMMON, mage.cards.z.ZofBloodbog.class)); cards.add(new SetCardInfo("Zof Consumption", 132, Rarity.UNCOMMON, mage.cards.z.ZofConsumption.class));