From 957fa7d6474b089d401f32a80d5b2ab94638240d Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 25 Feb 2015 23:47:53 +0100 Subject: [PATCH] Some minor changes. --- .../sets/avacynrestored/CavernOfSouls.java | 3 +- .../mage/sets/magic2015/ReturnToTheRanks.java | 3 -- .../cards/single/avr/CavernOfSoulsTest.java | 39 ++++++++++++++++++- 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/Mage.Sets/src/mage/sets/avacynrestored/CavernOfSouls.java b/Mage.Sets/src/mage/sets/avacynrestored/CavernOfSouls.java index 6a58f6f827..b9b0f65f06 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/CavernOfSouls.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/CavernOfSouls.java @@ -36,6 +36,7 @@ import mage.Mana; import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.ContinuousRuleModifiyingEffectImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.mana.ColorlessManaAbility; @@ -79,7 +80,7 @@ public class CavernOfSouls extends CardImpl { this.addAbility(new ColorlessManaAbility()); // {T}: Add one mana of any color to your mana pool. Spend this mana only to cast a creature spell of the chosen type, and that spell can't be countered. - this.addAbility(new ConditionalAnyColorManaAbility(1, new CavernOfSoulsManaBuilder())); + this.addAbility(new ConditionalAnyColorManaAbility(new TapSourceCost(), 1, new CavernOfSoulsManaBuilder(), true)); this.addWatcher(new CavernOfSoulsWatcher()); this.addAbility(new SimpleStaticAbility(Zone.ALL, new CavernOfSoulsCantCounterEffect())); } diff --git a/Mage.Sets/src/mage/sets/magic2015/ReturnToTheRanks.java b/Mage.Sets/src/mage/sets/magic2015/ReturnToTheRanks.java index 1786632046..2bd7ada215 100644 --- a/Mage.Sets/src/mage/sets/magic2015/ReturnToTheRanks.java +++ b/Mage.Sets/src/mage/sets/magic2015/ReturnToTheRanks.java @@ -29,7 +29,6 @@ package mage.sets.magic2015; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.dynamicvalue.common.GetXValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; import mage.abilities.keyword.ConvokeAbility; @@ -58,8 +57,6 @@ public class ReturnToTheRanks extends CardImpl { super(ownerId, 29, "Return to the Ranks", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{W}{W}"); this.expansionSetCode = "M15"; - this.color.setWhite(true); - // Convoke this.addAbility(new ConvokeAbility()); // Return X target creature cards with converted mana cost 2 or less from your graveyard to the battlefield. diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/avr/CavernOfSoulsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/avr/CavernOfSoulsTest.java index 88dc296419..4b2fc04a51 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/avr/CavernOfSoulsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/avr/CavernOfSoulsTest.java @@ -185,5 +185,42 @@ public class CavernOfSoulsTest extends CardTestPlayerBase { // Check Horror on the Battlefield // assertPermanentCount(playerA, "Fume Spitter", 1); } - + + /** + * Return to the Ranks cannot be countered if mana produced by Cavern of Souls + * was used to pay X. Can be bug also for all other spells with X in their cost, not sure. + * + */ + @Test + public void testCastWithColorlessManaCanBeCountered() { + addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); + addCard(Zone.HAND, playerA, "Cavern of Souls"); + // Sorcery {X}{W}{W} + // Convoke (Your creatures can help cast this spell. Each creature you tap while casting this spell pays for or one mana of that creature's color.) + // Return X target creature cards with converted mana cost 2 or less from your graveyard to the battlefield. + addCard(Zone.HAND, playerA, "Return to the Ranks"); + addCard(Zone.GRAVEYARD, playerA, "Silvercoat Lion"); + + // {1}{U} Remove Soul - Counter target creature spell. + addCard(Zone.HAND, playerB, "Counterspell"); + addCard(Zone.BATTLEFIELD, playerB, "Island", 2); + + + playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cavern of Souls"); + setChoice(playerA, "Drake"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Return to the Ranks", "Silvercoat Lion"); + setChoice(playerA, "X=1"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Counterspell", "Return to the Ranks"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + // check it was countered + assertGraveyardCount(playerA, "Return to the Ranks", 1); + assertGraveyardCount(playerB, "Counterspell", 1); + assertGraveyardCount(playerA, "Silvercoat Lion", 1); + assertPermanentCount(playerA, "Silvercoat Lion", 0); + + } }