From 0d755b3c89345e25e3d078eef11c7510e0edde3e Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 29 Sep 2015 17:37:51 +0200 Subject: [PATCH] Some minor changes. --- .../magicorigins/JaceTelepathUnbound.java | 4 +- .../src/mage/sets/ravnica/ChordOfCalling.java | 10 ++- .../test/cards/planeswalker/JaceTest.java | 72 +++++++++++++++++++ 3 files changed, 78 insertions(+), 8 deletions(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/JaceTest.java diff --git a/Mage.Sets/src/mage/sets/magicorigins/JaceTelepathUnbound.java b/Mage.Sets/src/mage/sets/magicorigins/JaceTelepathUnbound.java index 32b4489ce85..7fabc195698 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/JaceTelepathUnbound.java +++ b/Mage.Sets/src/mage/sets/magicorigins/JaceTelepathUnbound.java @@ -57,7 +57,7 @@ import mage.game.command.Emblem; import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; import mage.players.Player; -import mage.target.common.TargetCardInGraveyard; +import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetOpponent; import mage.target.targetpointer.FixedTarget; @@ -88,7 +88,7 @@ public class JaceTelepathUnbound extends CardImpl { // -3: You may cast target instant or sorcery card from your graveyard this turn. If that card would be put into your graveyard this turn, exile it instead. ability = new LoyaltyAbility(new JaceTelepathUnboundEffect(), -3); - ability.addTarget(new TargetCardInGraveyard(new FilterInstantOrSorceryCard())); + ability.addTarget(new TargetCardInYourGraveyard(new FilterInstantOrSorceryCard())); this.addAbility(ability); // -9: You get an emblem with "Whenever you cast a spell, target opponent puts the top five cards of his or her library into his or her graveyard". diff --git a/Mage.Sets/src/mage/sets/ravnica/ChordOfCalling.java b/Mage.Sets/src/mage/sets/ravnica/ChordOfCalling.java index b605b87f8b5..4a499e1aa25 100644 --- a/Mage.Sets/src/mage/sets/ravnica/ChordOfCalling.java +++ b/Mage.Sets/src/mage/sets/ravnica/ChordOfCalling.java @@ -28,15 +28,14 @@ package mage.sets.ravnica; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.ConvokeAbility; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.Filter; import mage.filter.FilterCard; @@ -56,8 +55,7 @@ public class ChordOfCalling extends CardImpl { super(ownerId, 156, "Chord of Calling", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{X}{G}{G}{G}"); this.expansionSetCode = "RAV"; - - // Convoke + // Convoke (Your creatures can help cast this spell. Each creature you tap while casting this spell pays for {1} or one mana of that creature's color.) this.addAbility(new ConvokeAbility()); // Search your library for a creature card with converted mana cost X or less and put it onto the battlefield. Then shuffle your library. @@ -97,7 +95,7 @@ class ChordofCallingSearchEffect extends OneShotEffect { filter.add(new CardTypePredicate(CardType.CREATURE)); //Set the mana cost one higher to 'emulate' a less than or equal to comparison. filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, xCost + 1)); - TargetCardInLibrary target = new TargetCardInLibrary(0,1,filter); + TargetCardInLibrary target = new TargetCardInLibrary(0, 1, filter); if (player.searchLibrary(target, game)) { if (target.getTargets().size() > 0) { Card card = player.getLibrary().getCard(target.getFirstTarget(), game); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/JaceTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/JaceTest.java new file mode 100644 index 00000000000..c8e6cd1adf8 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/JaceTest.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.planeswalker; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import mage.counters.CounterType; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class JaceTest extends CardTestPlayerBase { + + @Test + public void TelepathUnboundSecondAbility() { + // +1: Up to one target creature gets -2/-0 until your next turn. + // -3: You may cast target instant or sorcery card from your graveyard this turn. If that card would be put into your graveyard this turn, exile it instead. + // -9: You get an emblem with "Whenever you cast a spell, target opponent puts the top five cards of his or her library into his or her graveyard". + addCard(Zone.BATTLEFIELD, playerA, "Jace, Telepath Unbound"); // starts with 7 Loyality counters + + // As an additional cost to cast Magmatic Insight, discard a land card. + // Draw two cards. + addCard(Zone.GRAVEYARD, playerA, "Magmatic Insight");// {R} + addCard(Zone.HAND, playerA, "Plains"); + + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "-3: You may cast target instant", "Magmatic Insight"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Magmatic Insight"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Jace, Telepath Unbound", 1); + assertCounterCount("Jace, Telepath Unbound", CounterType.LOYALTY, 2); // 5 - 3 = 2 + + assertExileCount("Magmatic Insight", 1); + + assertHandCount(playerA, 2); + + } + +}