diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/mkm/VojaJawsOfTheConclaveTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/mkm/VojaJawsOfTheConclaveTest.java new file mode 100644 index 00000000000..245bda8ec4d --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/mkm/VojaJawsOfTheConclaveTest.java @@ -0,0 +1,52 @@ +package org.mage.test.cards.single.mkm; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * @author Susucr + */ +public class VojaJawsOfTheConclaveTest extends CardTestPlayerBase { + + /** + * {@link mage.cards.v.VojaJawsOfTheConclave Voja, Jaws of the Conclave} {2}{R}{G}{W} + * Legendary Creature — Wolf + * Vigilance, trample, ward {3} + * Whenever Voja, Jaws of the Conclave attacks, put X +1/+1 counters on each creature you control, where X is the number of Elves you control. Draw a card for each Wolf you control. + * 5/5 + */ + private static final String voja = "Voja, Jaws of the Conclave"; + + @Test + public void test_NoElves() { + setStrictChooseMode(true); + + addCard(Zone.BATTLEFIELD, playerA, voja); + + attack(1, playerA, voja, playerB); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertPowerToughness(playerA, voja, 5, 5); + assertHandCount(playerA, 1); + } + + @Test + public void test_2_Elves() { + setStrictChooseMode(true); + + addCard(Zone.BATTLEFIELD, playerA, voja); + addCard(Zone.BATTLEFIELD, playerA, "Llanowar Elves", 2); + + attack(1, playerA, voja, playerB); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertPowerToughness(playerA, voja, 5 + 2, 5 + 2); + assertHandCount(playerA, 1); + } +} diff --git a/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersAllEffect.java index 42d09048ae6..8f17cb2017e 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersAllEffect.java @@ -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; }