use of mage.abilities.effects.common.ExileSourceEffect in project mage by magefree.
the class BarishiEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
new ExileSourceEffect().apply(game, source);
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
}
Cards cards = new CardsImpl(controller.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game));
controller.putCardsOnTopOfLibrary(cards, game, source, false);
controller.shuffleLibrary(source, game);
return true;
}
use of mage.abilities.effects.common.ExileSourceEffect in project mage by magefree.
the class DelinaWildMageEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(source.getControllerId(), null, false, 1, true, true);
effect.setIsntLegendary(true);
effect.addAdditionalAbilities(new EndOfCombatTriggeredAbility(new ExileSourceEffect(), false, "Exile this creature at end of combat."));
effect.setTargetPointer(getTargetPointer());
while (true) {
int result = player.rollDice(outcome, source, game, 20);
effect.apply(game, source);
if (result < 15 || 20 < result || !player.chooseUse(outcome, "Roll again?", source, game)) {
break;
}
}
return true;
}
Aggregations