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);
}
Aggregations