Search in sources :

Example 6 with ExileSourceEffect

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;
}
Also used : ExileSourceEffect(mage.abilities.effects.common.ExileSourceEffect) Player(mage.players.Player) Cards(mage.cards.Cards) CardsImpl(mage.cards.CardsImpl)

Example 7 with ExileSourceEffect

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;
}
Also used : ExileSourceEffect(mage.abilities.effects.common.ExileSourceEffect) Player(mage.players.Player) CreateTokenCopyTargetEffect(mage.abilities.effects.common.CreateTokenCopyTargetEffect) EndOfCombatTriggeredAbility(mage.abilities.common.EndOfCombatTriggeredAbility)

Aggregations

ExileSourceEffect (mage.abilities.effects.common.ExileSourceEffect)7 Player (mage.players.Player)7 MageObject (mage.MageObject)2 Effect (mage.abilities.effects.Effect)2 OneShotEffect (mage.abilities.effects.OneShotEffect)2 Card (mage.cards.Card)2 EndOfCombatTriggeredAbility (mage.abilities.common.EndOfCombatTriggeredAbility)1 CreateTokenCopyTargetEffect (mage.abilities.effects.common.CreateTokenCopyTargetEffect)1 ExileAllEffect (mage.abilities.effects.common.ExileAllEffect)1 ReturnFromGraveyardToBattlefieldTargetEffect (mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect)1 ReturnToHandSourceEffect (mage.abilities.effects.common.ReturnToHandSourceEffect)1 ReturnToHandTargetEffect (mage.abilities.effects.common.ReturnToHandTargetEffect)1 SearchLibraryPutInPlayEffect (mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect)1 Cards (mage.cards.Cards)1 CardsImpl (mage.cards.CardsImpl)1 FilterPermanentCard (mage.filter.common.FilterPermanentCard)1 Permanent (mage.game.permanent.Permanent)1 FixedTarget (mage.target.targetpointer.FixedTarget)1