Search in sources :

Example 1 with ManaSpentToCastWatcher

use of mage.watchers.common.ManaSpentToCastWatcher in project mage by magefree.

the class RadiantEpicureEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    ManaSpentToCastWatcher watcher = game.getState().getWatcher(ManaSpentToCastWatcher.class);
    if (player == null || watcher == null) {
        return false;
    }
    Mana payment = watcher.getLastManaPayment(source.getSourceId());
    if (payment == null) {
        return false;
    }
    int xValue = payment.getDifferentColors();
    new DamagePlayersEffect(xValue, TargetController.OPPONENT).apply(game, source);
    player.gainLife(xValue, game, source);
    return true;
}
Also used : Player(mage.players.Player) Mana(mage.Mana) ManaSpentToCastWatcher(mage.watchers.common.ManaSpentToCastWatcher) DamagePlayersEffect(mage.abilities.effects.common.DamagePlayersEffect)

Aggregations

Mana (mage.Mana)1 DamagePlayersEffect (mage.abilities.effects.common.DamagePlayersEffect)1 Player (mage.players.Player)1 ManaSpentToCastWatcher (mage.watchers.common.ManaSpentToCastWatcher)1