use of mage.abilities.effects.common.cost.CastWithoutPayingManaCostEffect in project mage by magefree.
the class ArcaneEndeavorEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
List<Integer> results = player.rollDice(outcome, source, game, 8, 2, 0);
int firstResult = results.get(0);
int secondResult = results.get(1);
int first, second;
if (firstResult != secondResult && player.chooseUse(outcome, "Choose a number of cards to draw", "The other number will be the maximum mana value of the spell you cast", "" + firstResult, "" + secondResult, source, game)) {
first = firstResult;
second = secondResult;
} else {
first = secondResult;
second = firstResult;
}
player.drawCards(first, source, game);
new CastWithoutPayingManaCostEffect(StaticValue.get(second), filter).apply(game, source);
return true;
}
use of mage.abilities.effects.common.cost.CastWithoutPayingManaCostEffect in project mage by magefree.
the class ReinterpretEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Spell spell = game.getSpell(source.getFirstTarget());
if (spell == null) {
return false;
}
int manaValue = spell.getManaValue();
game.getStack().counter(spell.getId(), source, game);
new CastWithoutPayingManaCostEffect(manaValue).apply(game, source);
return true;
}
Aggregations