use of mage.abilities.common.AttacksTriggeredAbility in project mage by magefree.
the class SpareDaggerEffect method makeAbility.
@Override
protected Ability makeAbility(Game game, Ability source) {
if (source == null || game == null) {
return null;
}
String sourceName = source.getSourcePermanentIfItStillExists(game).getName();
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new DamageTargetEffect(1), false, "This creature deals 1 damage to any target");
ability.addTarget(new TargetAnyTarget());
return new AttacksTriggeredAbility(new DoWhenCostPaid(ability, useAttachedCost.copy().setMageObjectReference(source, game), "Sacrifice " + sourceName + "?"), false, "Whenever this creature attacks, you may sacrifice " + sourceName + ". When you do, this creature deals 1 damage to any target.");
}
Aggregations