From b5127fdce2946e0fd5006b9f9d75c226d6b24378 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 14 Jun 2020 19:22:17 +0200 Subject: [PATCH] * Icon of Ancestry - some fixes to PR#6509 (fixes #6333). --- .../src/mage/cards/i/IconOfAncestry.java | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/Mage.Sets/src/mage/cards/i/IconOfAncestry.java b/Mage.Sets/src/mage/cards/i/IconOfAncestry.java index 19196fd230..a65420d527 100644 --- a/Mage.Sets/src/mage/cards/i/IconOfAncestry.java +++ b/Mage.Sets/src/mage/cards/i/IconOfAncestry.java @@ -1,10 +1,13 @@ package mage.cards.i; +import java.util.UUID; 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.dynamicvalue.common.StaticValue; import mage.abilities.effects.common.ChooseCreatureTypeEffect; import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; import mage.abilities.effects.common.continuous.BoostAllEffect; @@ -14,10 +17,6 @@ import mage.constants.*; import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.ChosenSubtypePredicate; - -import java.util.UUID; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.dynamicvalue.common.StaticValue; import mage.game.Game; /** @@ -44,10 +43,10 @@ public final class IconOfAncestry extends CardImpl { 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 + // {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. FilterCreatureCard filter2 = new FilterCreatureCard("creature card that matches the chosen subtype"); - Ability ability = new SimpleActivatedAbility(new IconOfAncestryEffect(filter2), new ManaCostsImpl("{3}")); + Ability ability = new SimpleActivatedAbility(new IconOfAncestryEffect(filter2), new GenericManaCost(3)); ability.addCost(new TapSourceCost()); this.addAbility(ability); } @@ -63,6 +62,7 @@ public final class IconOfAncestry extends CardImpl { } class IconOfAncestryEffect extends LookLibraryAndPickControllerEffect { + public IconOfAncestryEffect(FilterCreatureCard filter) { super(StaticValue.get(3), false, StaticValue.get(1), filter, Zone.LIBRARY, false, true, false, Zone.HAND, true, false, false); @@ -75,7 +75,19 @@ class IconOfAncestryEffect extends LookLibraryAndPickControllerEffect { SubType subtype = (SubType) game.getState().getValue(source.getSourceId() + "_type"); if (subtype != null) { filter.add(subtype.getPredicate()); + filter.setMessage("creature card of subtype " + subtype.toString()); + } else { + return false; } return super.apply(game, source); } -} \ No newline at end of file + + public IconOfAncestryEffect(final IconOfAncestryEffect effect) { + super(effect); + } + + @Override + public IconOfAncestryEffect copy() { + return new IconOfAncestryEffect(this); + } +}