Search in sources :

Example 1 with CastWithoutPayingManaCostEffect

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;
}
Also used : Player(mage.players.Player) CastWithoutPayingManaCostEffect(mage.abilities.effects.common.cost.CastWithoutPayingManaCostEffect)

Example 2 with CastWithoutPayingManaCostEffect

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;
}
Also used : CastWithoutPayingManaCostEffect(mage.abilities.effects.common.cost.CastWithoutPayingManaCostEffect) Spell(mage.game.stack.Spell) TargetSpell(mage.target.TargetSpell)

Aggregations

CastWithoutPayingManaCostEffect (mage.abilities.effects.common.cost.CastWithoutPayingManaCostEffect)2 Spell (mage.game.stack.Spell)1 Player (mage.players.Player)1 TargetSpell (mage.target.TargetSpell)1