diff --git a/Mage.Sets/src/mage/cards/i/IymrithDesertDoom.java b/Mage.Sets/src/mage/cards/i/IymrithDesertDoom.java new file mode 100644 index 00000000000..082c0b1a198 --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/IymrithDesertDoom.java @@ -0,0 +1,91 @@ +package mage.cards.i; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.SourceTappedCondition; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.WardAbility; +import mage.constants.*; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author weirddan455 + */ +public final class IymrithDesertDoom extends CardImpl { + + public IymrithDesertDoom(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.DRAGON); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Iymrith, Desert Doom has ward {4} as long as it's untapped. + this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect( + new GainAbilitySourceEffect(new WardAbility(new GenericManaCost(4)), Duration.WhileOnBattlefield), + new InvertCondition(SourceTappedCondition.instance), + "{this} has ward {4} as long as it's untapped" + ))); + + // Whenever Iymrith deals combat damage to a player, draw a card. Then if you have fewer than three cards in hand, draw cards equal to the difference. + Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(new DrawCardSourceControllerEffect(1), false); + ability.addEffect(new IymrithDesertDoomEffect()); + this.addAbility(ability); + } + + private IymrithDesertDoom(final IymrithDesertDoom card) { + super(card); + } + + @Override + public IymrithDesertDoom copy() { + return new IymrithDesertDoom(this); + } +} + +class IymrithDesertDoomEffect extends OneShotEffect { + + public IymrithDesertDoomEffect() { + super(Outcome.DrawCard); + this.staticText = "Then if you have fewer than three cards in hand, draw cards equal to the difference"; + } + + private IymrithDesertDoomEffect(final IymrithDesertDoomEffect effect) { + super(effect); + } + + @Override + public IymrithDesertDoomEffect copy() { + return new IymrithDesertDoomEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int handSize = controller.getHand().size(); + if (handSize < 3) { + controller.drawCards(3 - handSize, source, game); + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java b/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java index 6b7efad5084..081f4dc224d 100644 --- a/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java +++ b/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java @@ -99,6 +99,7 @@ public final class AdventuresInTheForgottenRealms extends ExpansionSet { cards.add(new SetCardInfo("Inspiring Bard", 189, Rarity.COMMON, mage.cards.i.InspiringBard.class)); cards.add(new SetCardInfo("Intrepid Outlander", 191, Rarity.UNCOMMON, mage.cards.i.IntrepidOutlander.class)); cards.add(new SetCardInfo("Island", 266, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Iymrith, Desert Doom", 62, Rarity.MYTHIC, mage.cards.i.IymrithDesertDoom.class)); cards.add(new SetCardInfo("Lightfoot Rogue", 111, Rarity.UNCOMMON, mage.cards.l.LightfootRogue.class)); cards.add(new SetCardInfo("Lolth, Spider Queen", 112, Rarity.MYTHIC, mage.cards.l.LolthSpiderQueen.class)); cards.add(new SetCardInfo("Manticore", 113, Rarity.COMMON, mage.cards.m.Manticore.class));