Search in sources :

Example 1 with DamageAllControlledTargetEffect

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);
}
Also used : FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) DamageAllControlledTargetEffect(mage.abilities.effects.common.DamageAllControlledTargetEffect)

Aggregations

DamageAllControlledTargetEffect (mage.abilities.effects.common.DamageAllControlledTargetEffect)1 FilterCreaturePermanent (mage.filter.common.FilterCreaturePermanent)1