diff --git a/Mage.Sets/src/mage/cards/c/CrypticTrilobite.java b/Mage.Sets/src/mage/cards/c/CrypticTrilobite.java index 2209f4e39b..40bbb7587c 100644 --- a/Mage.Sets/src/mage/cards/c/CrypticTrilobite.java +++ b/Mage.Sets/src/mage/cards/c/CrypticTrilobite.java @@ -1,5 +1,6 @@ package mage.cards.c; +import java.util.UUID; import mage.ConditionalMana; import mage.MageInt; import mage.Mana; @@ -24,8 +25,6 @@ import mage.constants.SubType; import mage.counters.CounterType; import mage.game.Game; -import java.util.UUID; - /** * @author TheElk801 */ @@ -45,9 +44,8 @@ public final class CrypticTrilobite extends CardImpl { // Remove a +1/+1 counter from Cryptic Trilobite: Add {C}{C}. Spend this mana only to activate abilities. this.addAbility(new ConditionalColorlessManaAbility( - new RemoveCountersSourceCost( - CounterType.P1P1.createInstance() - ), 2, new CrypticTrilobiteManaBuilder() + new RemoveCountersSourceCost(CounterType.P1P1.createInstance()), + 2, new CrypticTrilobiteManaBuilder() )); // {1}, {T}: Put a +1/+1 counter on Cryptic Trilobite. diff --git a/Mage.Sets/src/mage/cards/e/EssenceOfTheWild.java b/Mage.Sets/src/mage/cards/e/EssenceOfTheWild.java index eb64cf137c..c2dab424d6 100644 --- a/Mage.Sets/src/mage/cards/e/EssenceOfTheWild.java +++ b/Mage.Sets/src/mage/cards/e/EssenceOfTheWild.java @@ -1,10 +1,10 @@ package mage.cards.e; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ReplacementEffectImpl; -import mage.abilities.effects.common.CopyEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -14,8 +14,6 @@ import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; -import java.util.UUID; - /** * @author BetaSteward */ @@ -68,7 +66,7 @@ class EssenceOfTheWildEffect extends ReplacementEffectImpl { public boolean replaceEvent(GameEvent event, Ability source, Game game) { Permanent sourceObject = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (sourceObject != null) { - game.addEffect(new CopyEffect(Duration.Custom, sourceObject, event.getTargetId()), source); + game.copyPermanent(sourceObject, event.getTargetId(), source, null); } return false; } diff --git a/Mage.Sets/src/mage/cards/g/GolosTirelessPilgrim.java b/Mage.Sets/src/mage/cards/g/GolosTirelessPilgrim.java index 83d87fc44b..abd9d19893 100644 --- a/Mage.Sets/src/mage/cards/g/GolosTirelessPilgrim.java +++ b/Mage.Sets/src/mage/cards/g/GolosTirelessPilgrim.java @@ -7,7 +7,6 @@ import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.asthought.PlayFromNotOwnHandZoneTargetEffect; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; @@ -19,7 +18,6 @@ import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetCardInLibrary; -import mage.target.targetpointer.FixedTargets; /** * @author TheElk801 @@ -75,8 +73,8 @@ class GolosTirelessPilgrimEffect extends OneShotEffect { return false; } Set cards = player.getLibrary().getTopCards(game, 3); - return PlayFromNotOwnHandZoneTargetEffect.exileAndPlayFromExile(game, source, cards, - TargetController.YOU, Duration.EndOfTurn, true); + return PlayFromNotOwnHandZoneTargetEffect.exileAndPlayFromExile(game, source, cards, + TargetController.YOU, Duration.EndOfTurn, true); } @Override diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/EssenceOfTheWildCopyTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/EssenceOfTheWildCopyTest.java index 07fb2dcec3..b83b65c939 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/EssenceOfTheWildCopyTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/EssenceOfTheWildCopyTest.java @@ -1,19 +1,19 @@ package org.mage.test.cards.copy; -import mage.constants.PhaseStep; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.permanent.Permanent; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; -import org.mage.test.serverside.base.CardTestPlayerBase; - import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.UUID; import java.util.stream.Collectors; +import mage.constants.PhaseStep; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.game.Game; +import mage.game.permanent.Permanent; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; /** * @author JayDi85 @@ -22,7 +22,6 @@ public class EssenceOfTheWildCopyTest extends CardTestPlayerBase { // Essence of the Wild {3}{G}{G}{G} // Creatures you control enter the battlefield as a copy of Essence of the Wild. - private Permanent findCopyPermanent(Game game, int num) { int currentCopyNumber = 1; for (Permanent perm : game.getBattlefield().getAllActivePermanents()) { @@ -169,4 +168,36 @@ public class EssenceOfTheWildCopyTest extends CardTestPlayerBase { Assert.assertEquals("copy must have 6 p/t", 6, copy.getPower().getValue()); Assert.assertEquals("copy must have 6 p/t", 6, copy.getToughness().getValue()); } + + @Test + public void testCopyFromTheCopy() { + // Creatures you control enter the battlefield as a copy of Essence of the Wild. + addCard(Zone.BATTLEFIELD, playerA, "Essence of the Wild", 1); + + addCard(Zone.BATTLEFIELD, playerA, "Plains", 4); + addCard(Zone.HAND, playerA, "Silvercoat Lion", 2); + + // Destroy target nonartifact, nonblack creature. It can't be regenerated. + addCard(Zone.HAND, playerB, "Terror", 1); // Instant {1}{B} + addCard(Zone.BATTLEFIELD, playerB, "Swamp", 2); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion"); + + castSpell(1, PhaseStep.BEGIN_COMBAT, playerB, "Terror", "Essence of the Wild[no copy]"); + + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Silvercoat Lion"); + + setStrictChooseMode(true); + setStopAt(1, PhaseStep.END_TURN); + execute(); + assertAllCommandsUsed(); + + assertGraveyardCount(playerB, "Terror", 1); + assertGraveyardCount(playerA, "Essence of the Wild", 1); + assertPermanentCount(playerA, "Silvercoat Lion", 0); + assertPermanentCount(playerA, "Essence of the Wild", 2); + + assertPowerToughness(playerA, "Essence of the Wild", 6, 6, Filter.ComparisonScope.All); + } + }