@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); if (sourceObject != null && controller != null) { TargetCardInYourGraveyard target = new TargetCardInYourGraveyard( new FilterInstantOrSorceryCard("instant or sorcery card from your graveyard")); if (controller.chooseTarget(outcome, target, source, game)) { UUID exileId = CardUtil.getExileZoneId( game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()); Card card = controller.getGraveyard().get(target.getFirstTarget(), game); if (card != null) { controller.moveCardToExileWithInfo( card, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.GRAVEYARD, true); } } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player targetPlayer = game.getPlayer(source.getFirstTarget()); Player controller = game.getPlayer(source.getControllerId()); if (targetPlayer != null && controller != null) { TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(); target.setRequired(true); if (targetPlayer.chooseTarget(Outcome.Exile, target, source, game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { targetPlayer.getGraveyard().remove(card); card.moveToExile(null, "", source.getId(), game); if (card.getCardType().contains(CardType.CREATURE)) { controller.gainLife(2, game); } } return true; } } return false; }