diff --git a/Mage.Sets/src/mage/cards/v/ViridianJoiner.java b/Mage.Sets/src/mage/cards/v/ViridianJoiner.java index 563743319f..7b1e6837d7 100644 --- a/Mage.Sets/src/mage/cards/v/ViridianJoiner.java +++ b/Mage.Sets/src/mage/cards/v/ViridianJoiner.java @@ -25,7 +25,7 @@ public final class ViridianJoiner extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(2); - // {tap}: Add an amount of {G} equal to Viridian Joiner's power. + // {T}: Add an amount of {G} equal to Viridian Joiner's power. this.addAbility(new DynamicManaAbility(Mana.GreenMana(1), new SourcePermanentPowerCount())); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/mana/TappedForManaRelatedTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/mana/TappedForManaRelatedTest.java index ecbe7ca846..c91d0756b2 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/mana/TappedForManaRelatedTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/mana/TappedForManaRelatedTest.java @@ -314,4 +314,33 @@ public class TappedForManaRelatedTest extends CardTestPlayerBase { Assert.assertEquals("mana variations don't fit", 1, manaOptions.size()); assertManaOptions("{C}{C}{C}{C}{C}", manaOptions); } + + @Test + public void TestViridianJoiner() { + setStrictChooseMode(true); + + // {T}: Add an amount of {G} equal to Viridian Joiner's power. + addCard(Zone.HAND, playerA, "Viridian Joiner", 1); // Creature {2}{G} 1/2 + addCard(Zone.BATTLEFIELD, playerA, "Forest", 3); + + addCard(Zone.BATTLEFIELD, playerB, "Forest", 1); + addCard(Zone.HAND, playerB, "Giant Growth", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Viridian Joiner"); + + castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerB, "Giant Growth", "Viridian Joiner"); + + setStopAt(3, PhaseStep.BEGIN_COMBAT); + execute(); + + assertAllCommandsUsed(); + + assertGraveyardCount(playerB, "Giant Growth", 1); + assertPowerToughness(playerA, "Viridian Joiner", 4, 5); + + ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame); + Assert.assertEquals("mana variations don't fit", 1, manaOptions.size()); + assertManaOptions("{G}{G}{G}{G}{G}{G}{G}", manaOptions); + } + } diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/SourcePermanentPowerCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/SourcePermanentPowerCount.java index af4effc0f0..e48bfa0451 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/SourcePermanentPowerCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/SourcePermanentPowerCount.java @@ -31,7 +31,9 @@ public class SourcePermanentPowerCount implements DynamicValue { @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { Permanent sourcePermanent = game.getPermanent(sourceAbility.getSourceId()); - if (sourcePermanent == null || sourcePermanent.getZoneChangeCounter(game) > sourceAbility.getSourceObjectZoneChangeCounter()) { + if (sourcePermanent == null + || (sourceAbility.getSourceObjectZoneChangeCounter() > 0 + && sourcePermanent.getZoneChangeCounter(game) > sourceAbility.getSourceObjectZoneChangeCounter())) { sourcePermanent = (Permanent) game.getLastKnownInformation(sourceAbility.getSourceId(), Zone.BATTLEFIELD); } if (sourcePermanent != null diff --git a/Mage/src/main/java/mage/abilities/mana/DynamicManaAbility.java b/Mage/src/main/java/mage/abilities/mana/DynamicManaAbility.java index 7400c17f3b..e880c07101 100644 --- a/Mage/src/main/java/mage/abilities/mana/DynamicManaAbility.java +++ b/Mage/src/main/java/mage/abilities/mana/DynamicManaAbility.java @@ -79,17 +79,6 @@ public class DynamicManaAbility extends ActivatedManaAbilityImpl { return new DynamicManaAbility(this); } - @Override - public List getNetMana(Game game) { - List netMana = new ArrayList<>(); - if (game != null) { - // TODO: effects from replacement effects like Mana Reflection are not considered yet - // TODO: effects that need a X payment (e.g. Mage-Ring Network) return always 0 - netMana.addAll(manaEffect.getNetMana(game, this)); - } - return netMana; - } - @Override public boolean definesMana(Game game) { return true;