diff --git a/Mage.Sets/src/mage/cards/u/UpTheBeanstalk.java b/Mage.Sets/src/mage/cards/u/UpTheBeanstalk.java new file mode 100644 index 00000000000..512a8f2e6c4 --- /dev/null +++ b/Mage.Sets/src/mage/cards/u/UpTheBeanstalk.java @@ -0,0 +1,48 @@ +package mage.cards.u; + +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.meta.OrTriggeredAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ManaValuePredicate; + +import java.util.UUID; + +/** + * @author Susucr + */ +public final class UpTheBeanstalk extends CardImpl { + + private static FilterSpell filter = new FilterSpell("spell with mana value 5 or greater"); + + static { + filter.add(new ManaValuePredicate(ComparisonType.OR_GREATER, 5)); + } + + public UpTheBeanstalk(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); + + // When Up the Beanstalk enters the battlefield and whenever you cast a spell with mana value 5 or greater, draw a card. + this.addAbility(new OrTriggeredAbility( + Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), false, + "When {this} enters the battlefield and whenever you cast a spell with mana value 5 or greater, ", + new EntersBattlefieldTriggeredAbility(null), + new SpellCastControllerTriggeredAbility(null, filter, false) + )); + } + + private UpTheBeanstalk(final UpTheBeanstalk card) { + super(card); + } + + @Override + public UpTheBeanstalk copy() { + return new UpTheBeanstalk(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/WildsOfEldraine.java b/Mage.Sets/src/mage/sets/WildsOfEldraine.java index 3393357ce7b..6cfe1f934b5 100644 --- a/Mage.Sets/src/mage/sets/WildsOfEldraine.java +++ b/Mage.Sets/src/mage/sets/WildsOfEldraine.java @@ -160,6 +160,7 @@ public final class WildsOfEldraine extends ExpansionSet { cards.add(new SetCardInfo("Twisted Fealty", 154, Rarity.UNCOMMON, mage.cards.t.TwistedFealty.class)); cards.add(new SetCardInfo("Twisted Sewer-Witch", 114, Rarity.UNCOMMON, mage.cards.t.TwistedSewerWitch.class)); cards.add(new SetCardInfo("Two-Headed Hunter", 155, Rarity.UNCOMMON, mage.cards.t.TwoHeadedHunter.class)); + cards.add(new SetCardInfo("Up the Beanstalk", 195, Rarity.COMMON, mage.cards.u.UpTheBeanstalk.class)); cards.add(new SetCardInfo("Virtue of Knowledge", 76, Rarity.MYTHIC, mage.cards.v.VirtueOfKnowledge.class)); cards.add(new SetCardInfo("Virtue of Loyalty", 38, Rarity.MYTHIC, mage.cards.v.VirtueOfLoyalty.class)); cards.add(new SetCardInfo("Virtue of Persistence", 115, Rarity.MYTHIC, mage.cards.v.VirtueOfPersistence.class));