Add test for Voja, Jaws of the Conclave

This commit is contained in:
Susucre 2024-04-05 12:13:01 +02:00
parent d2356abe31
commit d317dd1307
2 changed files with 60 additions and 5 deletions

View file

@ -56,18 +56,21 @@ public class AddCountersAllEffect extends OneShotEffect {
}
if (newCounter.getCount() <= 0) {
return false; // no need to iterate on targets, no counters will be put on them
return false; // no need to iterate on the permanents, no counters will be put on them
}
boolean result = false;
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) {
Counter newCounterForPermanent = newCounter.copy();
permanent.addCounters(newCounterForPermanent, source.getControllerId(), source, game);
if (!game.isSimulation() && newCounterForPermanent.getCount() > 0) {
game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " puts " + newCounterForPermanent.getCount() + ' ' + newCounterForPermanent.getName()
+ (newCounterForPermanent.getCount() == 1 ? " counter" : " counters") + " on " + permanent.getLogName());
}
game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " puts "
+ newCounterForPermanent.getCount() + ' ' + newCounterForPermanent.getName()
+ (newCounterForPermanent.getCount() == 1 ? " counter" : " counters") + " on " + permanent.getLogName());
result |= true;
}
return result;
}
return false;
}