mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
* Icon of Ancestry - some fixes to PR#6509 (fixes #6333).
This commit is contained in:
parent
cd27ee4ac3
commit
b5127fdce2
1 changed files with 19 additions and 7 deletions
|
@ -1,10 +1,13 @@
|
||||||
package mage.cards.i;
|
package mage.cards.i;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.AsEntersBattlefieldAbility;
|
import mage.abilities.common.AsEntersBattlefieldAbility;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
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.ChooseCreatureTypeEffect;
|
||||||
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
|
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
|
||||||
import mage.abilities.effects.common.continuous.BoostAllEffect;
|
import mage.abilities.effects.common.continuous.BoostAllEffect;
|
||||||
|
@ -14,10 +17,6 @@ import mage.constants.*;
|
||||||
import mage.filter.common.FilterCreatureCard;
|
import mage.filter.common.FilterCreatureCard;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.mageobject.ChosenSubtypePredicate;
|
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;
|
import mage.game.Game;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -47,7 +46,7 @@ public final class IconOfAncestry extends CardImpl {
|
||||||
// {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.
|
// 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");
|
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());
|
ability.addCost(new TapSourceCost());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
@ -63,6 +62,7 @@ public final class IconOfAncestry extends CardImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
class IconOfAncestryEffect extends LookLibraryAndPickControllerEffect {
|
class IconOfAncestryEffect extends LookLibraryAndPickControllerEffect {
|
||||||
|
|
||||||
public IconOfAncestryEffect(FilterCreatureCard filter) {
|
public IconOfAncestryEffect(FilterCreatureCard filter) {
|
||||||
super(StaticValue.get(3), false, StaticValue.get(1), filter, Zone.LIBRARY, false,
|
super(StaticValue.get(3), false, StaticValue.get(1), filter, Zone.LIBRARY, false,
|
||||||
true, false, Zone.HAND, true, false, 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");
|
SubType subtype = (SubType) game.getState().getValue(source.getSourceId() + "_type");
|
||||||
if (subtype != null) {
|
if (subtype != null) {
|
||||||
filter.add(subtype.getPredicate());
|
filter.add(subtype.getPredicate());
|
||||||
|
filter.setMessage("creature card of subtype " + subtype.toString());
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return super.apply(game, source);
|
return super.apply(game, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IconOfAncestryEffect(final IconOfAncestryEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IconOfAncestryEffect copy() {
|
||||||
|
return new IconOfAncestryEffect(this);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue