Search in sources :

Example 1 with UnearthAbility

use of mage.abilities.keyword.UnearthAbility in project mage by magefree.

the class DregscapeSliverEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller == null) {
        return false;
    }
    for (UUID cardId : controller.getGraveyard()) {
        Card card = game.getCard(cardId);
        if (card == null || !card.isCreature(game) || !card.hasSubtype(SubType.SLIVER, game)) {
            continue;
        }
        UnearthAbility ability = new UnearthAbility(new ManaCostsImpl("{2}"));
        ability.setSourceId(cardId);
        ability.setControllerId(card.getOwnerId());
        game.getState().addOtherAbility(card, ability);
    }
    return true;
}
Also used : UnearthAbility(mage.abilities.keyword.UnearthAbility) Player(mage.players.Player) UUID(java.util.UUID) ManaCostsImpl(mage.abilities.costs.mana.ManaCostsImpl) Card(mage.cards.Card)

Example 2 with UnearthAbility

use of mage.abilities.keyword.UnearthAbility in project mage by magefree.

the class SedrisTheTraitorKingEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
        for (UUID cardId : controller.getGraveyard()) {
            Card card = game.getCard(cardId);
            if (card != null && card.isCreature(game)) {
                UnearthAbility ability = new UnearthAbility(new ManaCostsImpl("{2}{B}"));
                ability.setSourceId(cardId);
                ability.setControllerId(card.getOwnerId());
                game.getState().addOtherAbility(card, ability);
            }
        }
        return true;
    }
    return false;
}
Also used : UnearthAbility(mage.abilities.keyword.UnearthAbility) Player(mage.players.Player) UUID(java.util.UUID) ManaCostsImpl(mage.abilities.costs.mana.ManaCostsImpl) Card(mage.cards.Card)

Aggregations

UUID (java.util.UUID)2 ManaCostsImpl (mage.abilities.costs.mana.ManaCostsImpl)2 UnearthAbility (mage.abilities.keyword.UnearthAbility)2 Card (mage.cards.Card)2 Player (mage.players.Player)2