use of mage.abilities.costs.CostsImpl in project mage by magefree.
the class DemonicEmbracePlayEffect method applies.
@Override
public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
if (sourceId.equals(source.getSourceId()) && source.isControlledBy(affectedControllerId)) {
if (game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) {
Player player = game.getPlayer(affectedControllerId);
if (player != null) {
Costs<Cost> costs = new CostsImpl<>();
costs.add(new PayLifeCost(3));
costs.add(new DiscardCardCost());
player.setCastSourceIdWithAlternateMana(sourceId, new ManaCostsImpl<>("{1}{B}{B}"), costs);
return true;
}
}
}
return false;
}
Aggregations