use of mage.abilities.effects.common.LookLibraryAndPickControllerEffect in project mage by magefree.
the class GarruksHarbingerEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Integer damage = (Integer) getValue("damage");
if (damage != null) {
LookLibraryAndPickControllerEffect effect = new LookLibraryAndPickControllerEffect(StaticValue.get(damage), false, StaticValue.get(1), filter, false);
effect.setBackInRandomOrder(true);
return effect.apply(game, source);
}
return false;
}
use of mage.abilities.effects.common.LookLibraryAndPickControllerEffect in project mage by magefree.
the class PreferredSelectionEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 2));
player.lookAtCards(source, "Top two cards", cards, game);
Cost cost = new CompositeCost(new SacrificeSourceCost(), new ManaCostsImpl<>("{2}{G}{G}"), "sacrifice this permanent and pay {2}{G}{G}");
return new DoIfCostPaid(new LookLibraryAndPickControllerEffect(StaticValue.get(2), false, StaticValue.get(1), StaticFilters.FILTER_CARD, Zone.HAND, true, false), new LookLibraryAndPickControllerEffect(StaticValue.get(2), false, StaticValue.get(1), StaticFilters.FILTER_CARD, Zone.HAND, true, false, false, Zone.LIBRARY, false, true, false), cost).apply(game, source);
}
Aggregations