From 8f63e647c62d0a6e0ecca6ca1bf9caca5a304f46 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 10 Apr 2019 17:08:30 -0400 Subject: [PATCH] Implemented Living Twister --- Mage.Sets/src/mage/cards/l/LivingTwister.java | 64 +++++++++++++++++++ Mage.Sets/src/mage/cards/m/MoltenVortex.java | 17 ++--- Mage.Sets/src/mage/sets/WarOfTheSpark.java | 1 + 3 files changed, 74 insertions(+), 8 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/l/LivingTwister.java diff --git a/Mage.Sets/src/mage/cards/l/LivingTwister.java b/Mage.Sets/src/mage/cards/l/LivingTwister.java new file mode 100644 index 0000000000..11518351d8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/l/LivingTwister.java @@ -0,0 +1,64 @@ +package mage.cards.l; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.ReturnToHandChosenControlledPermanentEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.filter.StaticFilters; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.permanent.TappedPredicate; +import mage.target.common.TargetAnyTarget; +import mage.target.common.TargetCardInHand; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class LivingTwister extends CardImpl { + + private static final FilterControlledPermanent filter + = new FilterControlledLandPermanent("a tapped land you control"); + + static { + filter.add(TappedPredicate.instance); + } + + public LivingTwister(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}{R}{G}"); + + this.subtype.add(SubType.ELEMENTAL); + this.power = new MageInt(2); + this.toughness = new MageInt(5); + + // {1}{R}, Discard a land card: Living Twister deals 2 damage to any target. + Ability ability = new SimpleActivatedAbility( + new DamageTargetEffect(2), new ManaCostsImpl("{1}{R}") + ); + ability.addCost(new DiscardTargetCost(new TargetCardInHand(StaticFilters.FILTER_CARD_LAND_A))); + ability.addTarget(new TargetAnyTarget()); + this.addAbility(ability); + + // {G}: Return a tapped land you control to its owner's hand. + this.addAbility(new SimpleActivatedAbility( + new ReturnToHandChosenControlledPermanentEffect(filter), new ManaCostsImpl("{G}") + )); + } + + private LivingTwister(final LivingTwister card) { + super(card); + } + + @Override + public LivingTwister copy() { + return new LivingTwister(this); + } +} diff --git a/Mage.Sets/src/mage/cards/m/MoltenVortex.java b/Mage.Sets/src/mage/cards/m/MoltenVortex.java index e436857f45..19474d57f0 100644 --- a/Mage.Sets/src/mage/cards/m/MoltenVortex.java +++ b/Mage.Sets/src/mage/cards/m/MoltenVortex.java @@ -1,7 +1,6 @@ package mage.cards.m; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.DiscardTargetCost; @@ -10,23 +9,25 @@ import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.Zone; -import mage.filter.common.FilterLandCard; -import mage.target.common.TargetCardInHand; +import mage.filter.StaticFilters; import mage.target.common.TargetAnyTarget; +import mage.target.common.TargetCardInHand; + +import java.util.UUID; /** - * * @author fireshoes */ public final class MoltenVortex extends CardImpl { public MoltenVortex(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{R}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{R}"); // {R}, Discard a land card: Molten Vortex deals 2 damage to any target. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new DiscardTargetCost(new TargetCardInHand(new FilterLandCard()))); - ability.addCost(new ManaCostsImpl("{R}")); + Ability ability = new SimpleActivatedAbility( + new DamageTargetEffect(2), new ManaCostsImpl("{R}") + ); + ability.addCost(new DiscardTargetCost(new TargetCardInHand(StaticFilters.FILTER_CARD_LAND_A))); ability.addTarget(new TargetAnyTarget()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/WarOfTheSpark.java b/Mage.Sets/src/mage/sets/WarOfTheSpark.java index dbc3c0e983..d6359ad336 100644 --- a/Mage.Sets/src/mage/sets/WarOfTheSpark.java +++ b/Mage.Sets/src/mage/sets/WarOfTheSpark.java @@ -112,6 +112,7 @@ public final class WarOfTheSpark extends ExpansionSet { cards.add(new SetCardInfo("Leyline Prowler", 202, Rarity.UNCOMMON, mage.cards.l.LeylineProwler.class)); cards.add(new SetCardInfo("Liliana's Triumph", 98, Rarity.UNCOMMON, mage.cards.l.LilianasTriumph.class)); cards.add(new SetCardInfo("Liliana, Dreadhorde General", 97, Rarity.MYTHIC, mage.cards.l.LilianaDreadhordeGeneral.class)); + cards.add(new SetCardInfo("Living Twister", 203, Rarity.RARE, mage.cards.l.LivingTwister.class)); cards.add(new SetCardInfo("Loxodon Sergeant", 21, Rarity.COMMON, mage.cards.l.LoxodonSergeant.class)); cards.add(new SetCardInfo("Makeshift Battalion", 22, Rarity.COMMON, mage.cards.m.MakeshiftBattalion.class)); cards.add(new SetCardInfo("Martyr for the Cause", 23, Rarity.COMMON, mage.cards.m.MartyrForTheCause.class));