use of mage.abilities.costs.common.SacrificeTargetCost in project mage by magefree.
the class DiscipleOfGriselbrandEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
int amount = 0;
for (Cost cost : source.getCosts()) {
if (cost instanceof SacrificeTargetCost) {
amount = ((SacrificeTargetCost) cost).getPermanents().get(0).getToughness().getValue();
Player player = game.getPlayer(source.getControllerId());
if (amount > 0 && player != null) {
player.gainLife(amount, game, source);
return true;
}
}
}
return false;
}
Aggregations