Search in sources :

Example 1 with WeirdToken2

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

the class ExperimentalOverloadEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    if (player == null) {
        return false;
    }
    int spellCount = player.getGraveyard().count(StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY, game);
    new WeirdToken2(spellCount).putOntoBattlefield(1, game, source, source.getControllerId());
    if (spellCount < 1) {
        return true;
    }
    TargetCard target = new TargetCardInYourGraveyard(0, 1, StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY, true);
    player.choose(outcome, player.getGraveyard(), target, game);
    return player.moveCards(game.getCard(target.getFirstTarget()), Zone.HAND, source, game);
}
Also used : Player(mage.players.Player) WeirdToken2(mage.game.permanent.token.WeirdToken2) TargetCard(mage.target.TargetCard) TargetCardInYourGraveyard(mage.target.common.TargetCardInYourGraveyard)

Aggregations

WeirdToken2 (mage.game.permanent.token.WeirdToken2)1 Player (mage.players.Player)1 TargetCard (mage.target.TargetCard)1 TargetCardInYourGraveyard (mage.target.common.TargetCardInYourGraveyard)1