use of mage.target.common.TargetAttackingOrBlockingCreature in project mage by magefree.
the class ArcheryTrainingValue method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent aura = game.getPermanent(source.getSourceId());
if (aura == null) {
return false;
}
Permanent permanent = game.getPermanent(aura.getAttachedTo());
if (permanent == null) {
return false;
}
String rule = "this creature deals X damage to target attacking or blocking creature, " + "where X is the number of arrow counters on " + aura.getName();
Ability ability = new SimpleActivatedAbility(new DamageTargetEffect(new ArcheryTrainingValue(aura)).setText(rule), new TapSourceCost());
ability.addTarget(new TargetAttackingOrBlockingCreature());
permanent.addAbility(ability, source.getSourceId(), game);
return true;
}
Aggregations