Search in sources :

Example 1 with ExileCardEnteringGraveyardReplacementEffect

use of mage.abilities.effects.common.ExileCardEnteringGraveyardReplacementEffect in project mage by magefree.

the class SinsOfThePastEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Card card = game.getCard(this.getTargetPointer().getFirst(game, source));
    if (card != null) {
        ContinuousEffect effect = new PlayFromNotOwnHandZoneTargetEffect(Zone.GRAVEYARD, TargetController.YOU, Duration.EndOfTurn, true);
        effect.setTargetPointer(new FixedTarget(card, game));
        game.addEffect(effect, source);
        effect = new ExileCardEnteringGraveyardReplacementEffect(card.getId());
        game.addEffect(effect, source);
        return true;
    }
    return false;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) PlayFromNotOwnHandZoneTargetEffect(mage.abilities.effects.common.asthought.PlayFromNotOwnHandZoneTargetEffect) ExileCardEnteringGraveyardReplacementEffect(mage.abilities.effects.common.ExileCardEnteringGraveyardReplacementEffect) ContinuousEffect(mage.abilities.effects.ContinuousEffect) FilterInstantOrSorceryCard(mage.filter.common.FilterInstantOrSorceryCard) Card(mage.cards.Card)

Example 2 with ExileCardEnteringGraveyardReplacementEffect

use of mage.abilities.effects.common.ExileCardEnteringGraveyardReplacementEffect in project mage by magefree.

the class EfreetFlamepainterEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    UUID targetId = source.getFirstTarget();
    if (targetId != null) {
        Card card = game.getCard(targetId);
        if (card != null && controller.chooseUse(outcome, "Cast " + card.getName() + " without paying its mana cost?", source, game)) {
            game.addEffect(new ExileCardEnteringGraveyardReplacementEffect(card.getId()), source);
            game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), Boolean.TRUE);
            controller.cast(controller.chooseAbilityForCast(card, game, true), game, true, new ApprovingObject(source, game));
            game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), null);
        }
    }
    return true;
}
Also used : Player(mage.players.Player) ApprovingObject(mage.ApprovingObject) ExileCardEnteringGraveyardReplacementEffect(mage.abilities.effects.common.ExileCardEnteringGraveyardReplacementEffect) UUID(java.util.UUID) Card(mage.cards.Card)

Aggregations

ExileCardEnteringGraveyardReplacementEffect (mage.abilities.effects.common.ExileCardEnteringGraveyardReplacementEffect)2 Card (mage.cards.Card)2 UUID (java.util.UUID)1 ApprovingObject (mage.ApprovingObject)1 ContinuousEffect (mage.abilities.effects.ContinuousEffect)1 PlayFromNotOwnHandZoneTargetEffect (mage.abilities.effects.common.asthought.PlayFromNotOwnHandZoneTargetEffect)1 FilterInstantOrSorceryCard (mage.filter.common.FilterInstantOrSorceryCard)1 Player (mage.players.Player)1 FixedTarget (mage.target.targetpointer.FixedTarget)1