use of mage.abilities.effects.common.DamageEverythingEffect in project mage by magefree.
the class AshlingThePilgrimEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (sourcePermanent != null) {
int counters = sourcePermanent.getCounters(game).getCount(CounterType.P1P1);
if (counters < 1) {
return false;
}
sourcePermanent.removeCounters(CounterType.P1P1.createInstance(counters), source, game);
return new DamageEverythingEffect(counters, StaticFilters.FILTER_PERMANENT_CREATURE).apply(game, source);
}
return true;
}
use of mage.abilities.effects.common.DamageEverythingEffect in project mage by magefree.
the class CycloneEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
int total = permanent.getCounters(game).getCount(CounterType.WIND);
StringBuilder greens = new StringBuilder(total);
for (int i = 0; i < total; i++) {
greens.append("{G}");
}
if (this.choice(game, source, player, new ManaCostsImpl(greens.toString()))) {
DamageEverythingEffect dmg = new DamageEverythingEffect(total);
dmg.apply(game, source);
} else {
permanent.sacrifice(source, game);
}
return true;
}
Aggregations