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;
}
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;
}
Aggregations