use of mage.abilities.effects.common.counter.AddCountersAllEffect in project mage by magefree.
the class MisfortuneEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Player chosenOpponent = game.getPlayer(targetPointer.getFirst(game, source));
if (controller != null && chosenOpponent != null) {
if (chosenOpponent.chooseUse(Outcome.Neutral, "If you choose Yes, the controller puts a +1/+1 counter" + "on each creature they control and they gain 4 life. If no, the controller puts a -1/-1 counter" + "on each creature you control and {this} deals 4 damage to you.", source, game)) {
Effect putP1P1CounterOnEachControlledCreature = new AddCountersAllEffect(CounterType.P1P1.createInstance(), new FilterControlledCreaturePermanent());
putP1P1CounterOnEachControlledCreature.apply(game, source);
controller.gainLife(4, game, source);
} else {
FilterCreaturePermanent filterOpponentCreatures = new FilterCreaturePermanent();
filterOpponentCreatures.add(new ControllerIdPredicate(chosenOpponent.getId()));
Effect putM1M1CounterOnEachOpponentCreature = new AddCountersAllEffect(CounterType.M1M1.createInstance(), filterOpponentCreatures);
putM1M1CounterOnEachOpponentCreature.apply(game, source);
chosenOpponent.damage(4, source.getSourceId(), source, game);
}
return true;
}
return false;
}
use of mage.abilities.effects.common.counter.AddCountersAllEffect in project mage by magefree.
the class VraskaRegalGorgonEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
int count = player.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, game);
return new AddCountersAllEffect(CounterType.P1P1.createInstance(count), StaticFilters.FILTER_CONTROLLED_CREATURE).apply(game, source);
}
Aggregations