use of mage.game.permanent.token.OonaQueenFaerieRogueToken in project mage by magefree.
the class OonaQueenOfTheFaeEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Player opponent = game.getPlayer(getTargetPointer().getFirst(game, source));
ChoiceColor choice = new ChoiceColor();
if (controller == null || opponent == null || !controller.choose(outcome, choice, game)) {
return false;
}
int cardsWithColor = 0;
Cards cardsToExile = new CardsImpl();
cardsToExile.addAll(opponent.getLibrary().getTopCards(game, source.getManaCostsToPay().getX()));
for (Card card : cardsToExile.getCards(game)) {
if (card != null && card.getColor(game).contains(choice.getColor())) {
cardsWithColor++;
}
}
controller.moveCards(cardsToExile, Zone.EXILED, source, game);
if (cardsWithColor > 0) {
new CreateTokenEffect(new OonaQueenFaerieRogueToken(), cardsWithColor).apply(game, source);
}
game.informPlayers("Oona: " + cardsWithColor + " Token" + (cardsWithColor != 1 ? "s" : "") + " created");
return true;
}
Aggregations