From dd82423702390949df68d5f438d7f4c19473d1cf Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 21 Jun 2019 18:25:20 -0400 Subject: [PATCH] Implemented Icon of Ancestry --- .../src/mage/cards/i/IconOfAncestry.java | 67 +++++++++++++++++++ Mage.Sets/src/mage/sets/CoreSet2020.java | 1 + 2 files changed, 68 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/i/IconOfAncestry.java diff --git a/Mage.Sets/src/mage/cards/i/IconOfAncestry.java b/Mage.Sets/src/mage/cards/i/IconOfAncestry.java new file mode 100644 index 0000000000..11259f39db --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/IconOfAncestry.java @@ -0,0 +1,67 @@ +package mage.cards.i; + +import mage.abilities.Ability; +import mage.abilities.common.AsEntersBattlefieldAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.ChooseCreatureTypeEffect; +import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureCard; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ChosenSubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class IconOfAncestry extends CardImpl { + + private static final FilterCreaturePermanent filter + = new FilterCreaturePermanent("creatures you control of the chosen type"); + private static final FilterCard filter2 + = new FilterCreatureCard("creature card of the chosen type"); + + static { + filter.add(ChosenSubtypePredicate.instance); + filter.add(new ControllerPredicate(TargetController.YOU)); + filter2.add(ChosenSubtypePredicate.instance); + } + + public IconOfAncestry(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); + + // As Icon of Ancestry enters the battlefield, choose a creature type. + this.addAbility(new AsEntersBattlefieldAbility(new ChooseCreatureTypeEffect(Outcome.BoostCreature))); + + // Creatures you control of the chosen type get +1/+1. + this.addAbility(new SimpleStaticAbility( + new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false) + )); + + // {3}, {T}: Look at the top three cards of your library. You may reveal a creature card of the chosen type from among them and put it into your hand. Put the rest on the bottom of your library in a random order. + Ability ability = new SimpleActivatedAbility(new LookLibraryAndPickControllerEffect( + 3, 1, filter2, + true, false, Zone.HAND, true + ).setBackInRandomOrder(true), new GenericManaCost(3)); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + private IconOfAncestry(final IconOfAncestry card) { + super(card); + } + + @Override + public IconOfAncestry copy() { + return new IconOfAncestry(this); + } +} diff --git a/Mage.Sets/src/mage/sets/CoreSet2020.java b/Mage.Sets/src/mage/sets/CoreSet2020.java index 140b0bb7db..3a65430df6 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2020.java +++ b/Mage.Sets/src/mage/sets/CoreSet2020.java @@ -80,6 +80,7 @@ public final class CoreSet2020 extends ExpansionSet { cards.add(new SetCardInfo("Hard Cover", 63, Rarity.UNCOMMON, mage.cards.h.HardCover.class)); cards.add(new SetCardInfo("Heart-Piercer Bow", 228, Rarity.COMMON, mage.cards.h.HeartPiercerBow.class)); cards.add(new SetCardInfo("Herald of the Sun", 23, Rarity.UNCOMMON, mage.cards.h.HeraldOfTheSun.class)); + cards.add(new SetCardInfo("Icon of Ancestry", 229, Rarity.RARE, mage.cards.i.IconOfAncestry.class)); cards.add(new SetCardInfo("Infuriate", 145, Rarity.COMMON, mage.cards.i.Infuriate.class)); cards.add(new SetCardInfo("Ironroot Warlord", 209, Rarity.UNCOMMON, mage.cards.i.IronrootWarlord.class)); cards.add(new SetCardInfo("Jungle Hollow", 248, Rarity.COMMON, mage.cards.j.JungleHollow.class));