use of mage.abilities.effects.common.DamageAllControlledTargetEffect in project mage by magefree.
the class DwarvenCatapultEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
int howMany = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURES, source.getFirstTarget(), game).size();
int amount = source.getManaCostsToPay().getX() / howMany;
DamageAllControlledTargetEffect dmgEffect = new DamageAllControlledTargetEffect(amount, new FilterCreaturePermanent());
return dmgEffect.apply(game, source);
}
Aggregations