Search in sources :

Example 1 with FilterHistoricCard

use of mage.filter.common.FilterHistoricCard in project mage by magefree.

the class UrzasTomeEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    new DrawCardSourceControllerEffect(1).apply(game, source);
    if (controller != null && controller.chooseUse(Outcome.Exile, "Exile a historic card from your graveyard?", source, game)) {
        Cost cost = new ExileFromGraveCost(new TargetCardInYourGraveyard(new FilterHistoricCard()));
        if (cost.canPay(source, source, controller.getId(), game)) {
            if (cost.pay(source, game, source, controller.getId(), false, null)) {
                return true;
            }
        }
    }
    if (controller != null) {
        controller.discard(1, false, false, source, game);
        return true;
    }
    return false;
}
Also used : Player(mage.players.Player) ExileFromGraveCost(mage.abilities.costs.common.ExileFromGraveCost) DrawCardSourceControllerEffect(mage.abilities.effects.common.DrawCardSourceControllerEffect) TargetCardInYourGraveyard(mage.target.common.TargetCardInYourGraveyard) FilterHistoricCard(mage.filter.common.FilterHistoricCard) Cost(mage.abilities.costs.Cost) TapSourceCost(mage.abilities.costs.common.TapSourceCost) GenericManaCost(mage.abilities.costs.mana.GenericManaCost) ExileFromGraveCost(mage.abilities.costs.common.ExileFromGraveCost)

Aggregations

Cost (mage.abilities.costs.Cost)1 ExileFromGraveCost (mage.abilities.costs.common.ExileFromGraveCost)1 TapSourceCost (mage.abilities.costs.common.TapSourceCost)1 GenericManaCost (mage.abilities.costs.mana.GenericManaCost)1 DrawCardSourceControllerEffect (mage.abilities.effects.common.DrawCardSourceControllerEffect)1 FilterHistoricCard (mage.filter.common.FilterHistoricCard)1 Player (mage.players.Player)1 TargetCardInYourGraveyard (mage.target.common.TargetCardInYourGraveyard)1