This commit is contained in:
Jeff 2018-12-11 17:54:35 -06:00
parent 8452d50409
commit 09827e1e11

View file

@ -13,10 +13,11 @@ import mage.abilities.effects.common.cost.SpellsCostReductionAllOfChosenSubtypeE
import mage.cards.*;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.ChosenSubtypePredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.players.Player;
@ -79,15 +80,18 @@ class HeraldsHornEffect extends OneShotEffect {
// If it's a creature card of the chosen type, you may reveal it and put it into your hand.
FilterCreatureCard filter = new FilterCreatureCard("creature card of the chosen type");
filter.add(new ChosenSubtypePredicate());
SubType subtype = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game);
filter.add(new SubtypePredicate(subtype));
String message = "Reveal the top card of your library and put that card into your hand?";
if (card != null) {
if (filter.match(card, game) && controller.chooseUse(Outcome.Benefit, message, source, game)) {
if (filter.match(card, game)
&& controller.chooseUse(Outcome.Benefit, message, source, game)) {
controller.moveCards(card, Zone.HAND, source, game);
controller.revealCards(sourceObject.getIdName() + " put into hand", cards, game);
return true;
}
}
}
return true;
return false;
}
}