Search in sources :

Example 1 with AttacksTriggeredAbility

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.");
}
Also used : DoWhenCostPaid(mage.abilities.effects.common.DoWhenCostPaid) ReflexiveTriggeredAbility(mage.abilities.common.delayed.ReflexiveTriggeredAbility) AttacksTriggeredAbility(mage.abilities.common.AttacksTriggeredAbility) DamageTargetEffect(mage.abilities.effects.common.DamageTargetEffect) TargetAnyTarget(mage.target.common.TargetAnyTarget)

Aggregations

AttacksTriggeredAbility (mage.abilities.common.AttacksTriggeredAbility)1 ReflexiveTriggeredAbility (mage.abilities.common.delayed.ReflexiveTriggeredAbility)1 DamageTargetEffect (mage.abilities.effects.common.DamageTargetEffect)1 DoWhenCostPaid (mage.abilities.effects.common.DoWhenCostPaid)1 TargetAnyTarget (mage.target.common.TargetAnyTarget)1