Search in sources :

Example 1 with MyrToken

use of mage.game.permanent.token.MyrToken in project mage by magefree.

the class MyrIncubatorEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null && controller.searchLibrary(target, source, game)) {
        if (!target.getTargets().isEmpty()) {
            tokensToCreate = target.getTargets().size();
            controller.moveCards(new CardsImpl(target.getTargets()), Zone.EXILED, source, game);
        }
        CreateTokenEffect effect = new CreateTokenEffect(new MyrToken(), tokensToCreate);
        effect.apply(game, source);
        controller.shuffleLibrary(source, game);
        return true;
    }
    return false;
}
Also used : Player(mage.players.Player) CreateTokenEffect(mage.abilities.effects.common.CreateTokenEffect) MyrToken(mage.game.permanent.token.MyrToken) CardsImpl(mage.cards.CardsImpl)

Example 2 with MyrToken

use of mage.game.permanent.token.MyrToken in project mage by magefree.

the class GenesisChamberEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
    if (permanent != null) {
        MyrToken token = new MyrToken();
        token.putOntoBattlefield(1, game, source, permanent.getControllerId());
    }
    return true;
}
Also used : Permanent(mage.game.permanent.Permanent) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) MyrToken(mage.game.permanent.token.MyrToken)

Aggregations

MyrToken (mage.game.permanent.token.MyrToken)2 CreateTokenEffect (mage.abilities.effects.common.CreateTokenEffect)1 CardsImpl (mage.cards.CardsImpl)1 FilterCreaturePermanent (mage.filter.common.FilterCreaturePermanent)1 Permanent (mage.game.permanent.Permanent)1 Player (mage.players.Player)1