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;
}
Aggregations