Search in sources :

Example 1 with HighestManaValueCount

use of mage.abilities.dynamicvalue.common.HighestManaValueCount in project mage by magefree.

the class DispersalShieldEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    DynamicValue amount = new HighestManaValueCount();
    Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source));
    if (spell != null && spell.getManaValue() <= amount.calculate(game, source, this)) {
        return game.getStack().counter(source.getFirstTarget(), source, game);
    }
    return false;
}
Also used : DynamicValue(mage.abilities.dynamicvalue.DynamicValue) Spell(mage.game.stack.Spell) TargetSpell(mage.target.TargetSpell) HighestManaValueCount(mage.abilities.dynamicvalue.common.HighestManaValueCount)

Example 2 with HighestManaValueCount

use of mage.abilities.dynamicvalue.common.HighestManaValueCount in project mage by magefree.

the class UginsInsightEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
        int highCMC = new HighestManaValueCount().calculate(game, source, this);
        if (highCMC > 0) {
            controller.scry(highCMC, source, game);
        }
        controller.drawCards(3, source, game);
        return true;
    }
    return false;
}
Also used : Player(mage.players.Player) HighestManaValueCount(mage.abilities.dynamicvalue.common.HighestManaValueCount)

Aggregations

HighestManaValueCount (mage.abilities.dynamicvalue.common.HighestManaValueCount)2 DynamicValue (mage.abilities.dynamicvalue.DynamicValue)1 Spell (mage.game.stack.Spell)1 Player (mage.players.Player)1 TargetSpell (mage.target.TargetSpell)1