mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
- Fixed #5457
This commit is contained in:
parent
8452d50409
commit
09827e1e11
1 changed files with 8 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue