mirror of
https://github.com/magefree/mage.git
synced 2025-12-30 07:22:03 -08:00
Merge branch 'master' into Network_Upgrade
Conflicts: Mage.Client/src/main/java/mage/client/draft/DraftPanel.java
This commit is contained in:
commit
b9c8a2598d
338 changed files with 15225 additions and 1521 deletions
|
|
@ -612,4 +612,34 @@ public class MorphTest extends CardTestPlayerBase {
|
|||
assertPermanentCount(playerA, "", 1);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Linvala, Keep of Silence is preventing morph creatures from turning face
|
||||
* up Turning face up is a special ability not an active ability. This
|
||||
* should not be prevented by the loss of active abilities.
|
||||
*/
|
||||
@Test
|
||||
public void testTurnFaceUpWithLinvala() {
|
||||
addCard(Zone.HAND, playerA, "Pine Walker");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 5);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Linvala, Keeper of Silence", 1);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Pine Walker");
|
||||
setChoice(playerA, "Yes"); // cast it face down as 2/2 creature
|
||||
|
||||
attack(3, playerA, "");
|
||||
|
||||
activateAbility(3, PhaseStep.POSTCOMBAT_MAIN, playerA, "{4}{G}: Turn this face-down permanent face up.");
|
||||
setStopAt(3, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertLife(playerB, 18);
|
||||
|
||||
assertPermanentCount(playerA, "", 0);
|
||||
assertPermanentCount(playerA, "Pine Walker", 1);
|
||||
assertPowerToughness(playerA, "Pine Walker", 5, 5);
|
||||
assertTapped("Pine Walker", false);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package org.mage.test.cards.abilities.keywords;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
|
|
@ -15,33 +14,32 @@ import org.junit.Test;
|
|||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
* 702.78. Persist
|
||||
* 702.78a Persist is a triggered ability. "Persist" means "When this permanent is put into a graveyard
|
||||
* from the battlefield, if it had no -1/-1 counters on it, return it to the battlefield under its
|
||||
* owner's control with a -1/-1 counter on it."
|
||||
* 702.78. Persist 702.78a Persist is a triggered ability. "Persist" means "When
|
||||
* this permanent is put into a graveyard from the battlefield, if it had no
|
||||
* -1/-1 counters on it, return it to the battlefield under its owner's control
|
||||
* with a -1/-1 counter on it."
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class PersistTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* Tests Safehold Elite don't returns from Persist if already a -1/-1 counter
|
||||
* was put on it from another source
|
||||
* Tests Safehold Elite don't returns from Persist if already a -1/-1
|
||||
* counter was put on it from another source
|
||||
*
|
||||
*/
|
||||
@Test
|
||||
public void testUndyingdoesntTriggerWithMinusCounter() {
|
||||
|
||||
|
||||
// Safehold Elite 2/2 {1}{G/W}
|
||||
// Creature - Elf Scout
|
||||
//
|
||||
//
|
||||
// Persist
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Safehold Elite");
|
||||
|
||||
// Put a -1/-1 counter on target creature. When that creature dies this turn, its controller gets a poison counter.
|
||||
addCard(Zone.HAND, playerB, "Virulent Wound",1);
|
||||
addCard(Zone.HAND, playerB, "Lightning Bolt",1);
|
||||
addCard(Zone.HAND, playerB, "Virulent Wound", 1);
|
||||
addCard(Zone.HAND, playerB, "Lightning Bolt", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Swamp", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1);
|
||||
|
||||
|
|
@ -58,9 +56,9 @@ public class PersistTest extends CardTestPlayerBase {
|
|||
Assert.assertEquals(1, playerA.getCounters().getCount(CounterType.POISON));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If a card with persist is removed from a graveyard before the persist ability resolves, persist will do nothing.
|
||||
* If a card with persist is removed from a graveyard before the persist
|
||||
* ability resolves, persist will do nothing.
|
||||
*/
|
||||
@Test
|
||||
public void testWontTriggerIfPersistCardIsRemovedFromGraveyard() {
|
||||
|
|
@ -72,14 +70,14 @@ public class PersistTest extends CardTestPlayerBase {
|
|||
addCard(Zone.BATTLEFIELD, playerA, "Safehold Elite");
|
||||
|
||||
// Exile target card from a graveyard. You gain 3 life.
|
||||
addCard(Zone.HAND, playerB, "Lightning Bolt",1);
|
||||
addCard(Zone.HAND, playerB, "Shadowfeed",1);
|
||||
addCard(Zone.HAND, playerB, "Lightning Bolt", 1);
|
||||
addCard(Zone.HAND, playerB, "Shadowfeed", 1);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Swamp", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Safehold Elite");
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Shadowfeed", "Safehold Elite","Persist <i>(When this creature dies, if it had no -1/-1 counters on it, return it to the battlefield under its owner's control with a -1/-1 counter on it.)</i>");
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Shadowfeed", "Safehold Elite", "Persist <i>(When this creature dies, if it had no -1/-1 counters on it, return it to the battlefield under its owner's control with a -1/-1 counter on it.)</i>");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
|
@ -103,11 +101,11 @@ public class PersistTest extends CardTestPlayerBase {
|
|||
addCard(Zone.BATTLEFIELD, playerA, "Kitchen Finks", 1);
|
||||
|
||||
/**
|
||||
* Deathtouch, lifelink
|
||||
* When Wurmcoil Engine dies, put a 3/3 colorless Wurm artifact creature token with
|
||||
* deathtouch and a 3/3 colorless Wurm artifact creature token with lifelink onto the battlefield.
|
||||
* Deathtouch, lifelink When Wurmcoil Engine dies, put a 3/3 colorless
|
||||
* Wurm artifact creature token with deathtouch and a 3/3 colorless Wurm
|
||||
* artifact creature token with lifelink onto the battlefield.
|
||||
*/
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Wurmcoil Engine",1);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Wurmcoil Engine", 1);
|
||||
|
||||
attack(2, playerB, "Wurmcoil Engine");
|
||||
block(2, playerA, "Kitchen Finks", "Wurmcoil Engine");
|
||||
|
|
@ -117,14 +115,13 @@ public class PersistTest extends CardTestPlayerBase {
|
|||
|
||||
assertPermanentCount(playerB, "Wurmcoil Engine", 1);
|
||||
assertPermanentCount(playerA, "Kitchen Finks", 1);
|
||||
assertPowerToughness(playerA, "Kitchen Finks", 2,1);
|
||||
assertPowerToughness(playerA, "Kitchen Finks", 2, 1);
|
||||
|
||||
assertLife(playerA, 22); // Kitchen Finks +2 life
|
||||
assertLife(playerB, 26); // Wurmcoil Engine +6 ife
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testInteractionWithToporOrb() {
|
||||
|
||||
|
|
@ -137,12 +134,12 @@ public class PersistTest extends CardTestPlayerBase {
|
|||
addCard(Zone.BATTLEFIELD, playerA, "Kitchen Finks", 2);
|
||||
|
||||
/**
|
||||
* Deathtouch, lifelink
|
||||
* When Wurmcoil Engine dies, put a 3/3 colorless Wurm artifact creature token with
|
||||
* deathtouch and a 3/3 colorless Wurm artifact creature token with lifelink onto the battlefield.
|
||||
* Deathtouch, lifelink When Wurmcoil Engine dies, put a 3/3 colorless
|
||||
* Wurm artifact creature token with deathtouch and a 3/3 colorless Wurm
|
||||
* artifact creature token with lifelink onto the battlefield.
|
||||
*/
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Wurmcoil Engine",1);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Torpor Orb",1);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Wurmcoil Engine", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Torpor Orb", 1);
|
||||
|
||||
attack(2, playerB, "Wurmcoil Engine");
|
||||
block(2, playerA, "Kitchen Finks", "Wurmcoil Engine");
|
||||
|
|
@ -161,9 +158,44 @@ public class PersistTest extends CardTestPlayerBase {
|
|||
assertPermanentCount(playerB, "Wurm", 2);
|
||||
assertPermanentCount(playerA, "Kitchen Finks", 2);
|
||||
assertPowerToughness(playerA, "Kitchen Finks", 2, 1, Filter.ComparisonScope.All);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Situation: Clever Impersonator is copying ". Opponent casts Supreme
|
||||
* Verdict. Persist on the clone of Glen Elendra Archmage triggers and goes
|
||||
* on the stack, and I am asked to put triggers on the stack. Problem: No
|
||||
* options pop up. I tried pressing many buttons, but the game was
|
||||
* deadlocked.
|
||||
*/
|
||||
@Test
|
||||
public void testCopiedCreatureWithPersists() {
|
||||
|
||||
// some tests were moved to LastKnownInformationTest
|
||||
// Flying
|
||||
// {U}, Sacrifice Glen Elendra Archmage: Counter target noncreature spell.
|
||||
// Persist
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Glen Elendra Archmage", 1); // 2/2
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Plains", 2);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Island", 2);
|
||||
// Supreme Verdict can't be countered.
|
||||
// Destroy all creatures.
|
||||
addCard(Zone.HAND, playerB, "Supreme Verdict", 1); // {1}{W}{W}{U}
|
||||
|
||||
// You may have Clever Impersonator enter the battlefield as a copy of any nonland permanent on the battlefield.
|
||||
addCard(Zone.HAND, playerA, "Clever Impersonator", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 4);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Clever Impersonator");
|
||||
setChoice(playerA, "Glen Elendra Archmage");
|
||||
|
||||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Supreme Verdict");
|
||||
|
||||
setStopAt(2, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerB, "Glen Elendra Archmage", 1);
|
||||
assertPowerToughness(playerB, "Glen Elendra Archmage", 1, 1);
|
||||
assertPermanentCount(playerA, "Glen Elendra Archmage", 1);
|
||||
assertPowerToughness(playerA, "Glen Elendra Archmage", 1, 1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package org.mage.test.cards.abilities.keywords;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
|
|
@ -35,30 +34,34 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
|
|||
|
||||
/**
|
||||
*
|
||||
* 702.52. Transmute
|
||||
* 702.52. Transmute
|
||||
*
|
||||
* 702.52a Transmute is an activated ability that functions only while the card with transmute is
|
||||
* in a player’s hand. “Transmute [cost]” means “[Cost], Discard this card: Search your library for
|
||||
* a card with the same converted mana cost as the discarded card, reveal that card, and put it into
|
||||
* your hand. Then shuffle your library. Play this ability only any time you could play a sorcery.”
|
||||
* 702.52a Transmute is an activated ability that functions only while the card
|
||||
* with transmute is in a player’s hand. “Transmute [cost]” means “[Cost],
|
||||
* Discard this card: Search your library for a card with the same converted
|
||||
* mana cost as the discarded card, reveal that card, and put it into your hand.
|
||||
* Then shuffle your library. Play this ability only any time you could play a
|
||||
* sorcery.”
|
||||
*
|
||||
* 702.52b Although the transmute ability is playable only if the card is in a player’s hand, it
|
||||
* continues to exist while the object is in play and in all other zones. Therefore objects with
|
||||
* transmute will be affected by effects that depend on objects having one or more activated abilities.
|
||||
* 702.52b Although the transmute ability is playable only if the card is in a
|
||||
* player’s hand, it continues to exist while the object is in play and in all
|
||||
* other zones. Therefore objects with transmute will be affected by effects
|
||||
* that depend on objects having one or more activated abilities.
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class TransmuteTest extends CardTestPlayerBase{
|
||||
public class TransmuteTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void searchSimpleOneManaCmcSpell() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
|
||||
// Target creature gets -3/-0 until end of turn.
|
||||
// Transmute {1}{U}{U}
|
||||
addCard(Zone.HAND, playerA, "Dizzy Spell");
|
||||
|
||||
addCard(Zone.LIBRARY, playerA, "Lightning Bolt");
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Transmute {1}{U}{U} ({1}{U}{U}, Discard this card: Search your library for a card with the same converted mana cost as this card, reveal it, and put it into your hand. Then shuffle your library. Transmute only as a sorcery.)");
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Transmute {1}{U}{U}");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
|
@ -74,7 +77,7 @@ public class TransmuteTest extends CardTestPlayerBase{
|
|||
|
||||
addCard(Zone.LIBRARY, playerA, "Wear // Tear");
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Transmute {1}{U}{U} ({1}{U}{U}, Discard this card: Search your library for a card with the same converted mana cost as this card, reveal it, and put it into your hand. Then shuffle your library. Transmute only as a sorcery.)");
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Transmute {1}{U}{U}");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
|
@ -84,4 +87,4 @@ public class TransmuteTest extends CardTestPlayerBase{
|
|||
assertHandCount(playerA, "Tear", 1); // Filter search can only search for one side of a split card
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,104 @@
|
|||
/*
|
||||
* 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.continuous;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class PlatinumEmperionTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testLifeGain() {
|
||||
// Your life total can't change.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Platinum Emperion", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
|
||||
// You gain 3 life.
|
||||
// Draw a card.
|
||||
addCard(Zone.HAND, playerA, "Reviving Dose");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reviving Dose");
|
||||
|
||||
setStopAt(2, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerA, "Reviving Dose", 1);
|
||||
assertHandCount(playerA, 1);
|
||||
|
||||
assertLife(playerA, 20);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLifeLoose() {
|
||||
// Your life total can't change.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Platinum Emperion", 1);
|
||||
// You draw two cards and you lose 2 life.
|
||||
addCard(Zone.HAND, playerA, "Night's Whisper");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Night's Whisper");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerA, "Night's Whisper", 1);
|
||||
assertHandCount(playerA, 2);
|
||||
|
||||
assertLife(playerA, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* Swords to Plowshares and Platinum Emperion doesn't work
|
||||
*/
|
||||
@Test
|
||||
public void testSwordsToPlowshares() {
|
||||
// Your life total can't change.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Platinum Emperion", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1);
|
||||
// Exile target creature.
|
||||
// Its controller gains life equal to its power.
|
||||
addCard(Zone.HAND, playerB, "Swords to Plowshares");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Plains", 1);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Swords to Plowshares", "Silvercoat Lion");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerB, "Swords to Plowshares", 1);
|
||||
assertExileCount("Silvercoat Lion", 1);
|
||||
|
||||
assertLife(playerA, 20);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -82,4 +82,32 @@ public class DrawEffectsTest extends CardTestPlayerBase {
|
|||
assertHandCount(playerB, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notion thief and Reforge the Soul - opponent got 0 cards - ok but I got
|
||||
* only 7 cards (should be 14)
|
||||
*/
|
||||
@Test
|
||||
public void testNotionThief2() {
|
||||
addCard(Zone.LIBRARY, playerA, "Silvercoat Lion", 3);
|
||||
skipInitShuffling();
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5);
|
||||
// Flash
|
||||
// If an opponent would draw a card except the first one he or she draws in each of his or her draw steps, instead that player skips that draw and you draw a card.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Notion Thief", 1);
|
||||
// Each player discards his or her hand, then draws seven cards.
|
||||
// Miracle {1}{R}
|
||||
addCard(Zone.HAND, playerA, "Reforge the Soul", 1);
|
||||
|
||||
addCard(Zone.HAND, playerB, "Mountain", 1);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reforge the Soul");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerA, "Reforge the Soul", 1);
|
||||
assertGraveyardCount(playerB, "Mountain", 1);
|
||||
assertHandCount(playerA, 14);
|
||||
assertHandCount(playerB, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* 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.triggers;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class ColorCausedTriggerTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testGhostfire() {
|
||||
// Whenever a player casts a red spell, you may gain 1 life.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Dragon's Claw", 1);
|
||||
|
||||
// Ghostfire deals 3 damage to target creature or player.
|
||||
addCard(Zone.HAND, playerA, "Ghostfire", 1); // {2}{R}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ghostfire", playerB);
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerA, "Ghostfire", 1);
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 17);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* 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.triggers;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class EntersTheBattlefieldTriggerTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testDrawCardsAddedCounters() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1);
|
||||
addCard(Zone.HAND, playerA, "Soul Warden");
|
||||
|
||||
// You may have Clever Impersonator enter the battlefield as a copy of any nonland permanent on the battlefield.
|
||||
addCard(Zone.HAND, playerB, "Clever Impersonator", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Island", 4);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Soul Warden");
|
||||
|
||||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Clever Impersonator");
|
||||
setChoice(playerB, "Silvercoat Lion");
|
||||
|
||||
setStopAt(2, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Soul Warden", 1);
|
||||
assertPermanentCount(playerA, "Silvercoat Lion", 1);
|
||||
assertPermanentCount(playerB, "Silvercoat Lion", 1);
|
||||
|
||||
assertLife(playerA, 21);
|
||||
assertLife(playerB, 20);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -8,13 +8,15 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
|
|||
/**
|
||||
* @author noxx
|
||||
*
|
||||
* Card: When Oblivion Ring enters the battlefield, exile another target nonland permanent.
|
||||
* When Oblivion Ring leaves the battlefield, return the exiled card to the battlefield under its owner's control.
|
||||
* Card: When Oblivion Ring enters the battlefield, exile another target nonland
|
||||
* permanent. When Oblivion Ring leaves the battlefield, return the exiled card
|
||||
* to the battlefield under its owner's control.
|
||||
*/
|
||||
public class OblivionRingTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* When Oblivion Ring enters the battlefield, exile another target nonland permanent.
|
||||
* When Oblivion Ring enters the battlefield, exile another target nonland
|
||||
* permanent.
|
||||
*/
|
||||
@Test
|
||||
public void testFirstTriggeredAbility() {
|
||||
|
|
@ -24,7 +26,7 @@ public class OblivionRingTest extends CardTestPlayerBase {
|
|||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Oblivion Ring");
|
||||
|
||||
setStopAt(2, PhaseStep.END_TURN);
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
|
|
@ -34,7 +36,8 @@ public class OblivionRingTest extends CardTestPlayerBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* When Oblivion Ring leaves the battlefield, return the exiled card to the battlefield under its owner's control.
|
||||
* When Oblivion Ring leaves the battlefield, return the exiled card to the
|
||||
* battlefield under its owner's control.
|
||||
*/
|
||||
@Test
|
||||
public void testSecondTriggeredAbility() {
|
||||
|
|
@ -79,7 +82,8 @@ public class OblivionRingTest extends CardTestPlayerBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests that when Oblivion Ring gets destroyed planeswalker returns with new counters and can be used second time at the same turn
|
||||
* Tests that when Oblivion Ring gets destroyed planeswalker returns with
|
||||
* new counters and can be used second time at the same turn
|
||||
*/
|
||||
@Test
|
||||
public void testExilePlaneswalker() {
|
||||
|
|
@ -100,4 +104,36 @@ public class OblivionRingTest extends CardTestPlayerBase {
|
|||
assertPermanentCount(playerA, "Jace Beleren", 1); // returns back
|
||||
assertHandCount(playerA, 2); // can use ability twice
|
||||
}
|
||||
|
||||
/**
|
||||
* Oblivion Ring leaves from battlefield Effect brings Hangarback Walker
|
||||
* back with counters. But with rules it should come back with no counters
|
||||
*/
|
||||
@Test
|
||||
public void testReturningHangarbackWalker() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 4);
|
||||
// Hangarback Walker enters the battlefield with X +1/+1 counters on it.
|
||||
// When Hangarback Walker dies, put a 1/1 colorless Thopter artifact creature token with flying onto the battlefield for each +1/+1 counter on Hangarback Walker.
|
||||
// {1}, {t}: Put a +1/+1 counter on Hangarback Walker.
|
||||
addCard(Zone.HAND, playerA, "Hangarback Walker"); // {X}{X}
|
||||
addCard(Zone.HAND, playerA, "Naturalize");
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Plains", 3);
|
||||
addCard(Zone.HAND, playerB, "Oblivion Ring");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Hangarback Walker");
|
||||
setChoice(playerA, "X=2");
|
||||
|
||||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Oblivion Ring");
|
||||
|
||||
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Naturalize", "Oblivion Ring");
|
||||
setStopAt(3, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerB, "Oblivion Ring", 0);
|
||||
assertGraveyardCount(playerB, "Oblivion Ring", 1);
|
||||
assertPermanentCount(playerA, "Hangarback Walker", 0);
|
||||
assertGraveyardCount(playerA, "Hangarback Walker", 1);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,4 +112,48 @@ public class SidisiBroodTyrantTest extends CardTestPlayerBase {
|
|||
assertPermanentCount(playerA, "Zombie", 2);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
Sidisi's zombie trigger still resolves even with Anafenza on the battle field.
|
||||
|
||||
Steps:
|
||||
Cast Anafenza
|
||||
Pass
|
||||
Cast Sidisi, mill creature.
|
||||
Zombie is still created.
|
||||
|
||||
Due to replacement effect of exiling creatures, the second phase of sidisi is null with Anafenza out.
|
||||
|
||||
*/
|
||||
@Test
|
||||
public void testWithAnafenza() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 4);
|
||||
// {1}{B}{G}{U}
|
||||
// Whenever Sidisi, Brood Tyrant enters the battlefield or attacks, put the top three cards of your library into your graveyard
|
||||
// Whenever one or more creature cards are put into your graveyard from your library, put a 2/2 black Zombie creature token onto the battlefield.
|
||||
addCard(Zone.HAND, playerA, "Sidisi, Brood Tyrant"); // 2/2 {1}{B}{G}{U}
|
||||
addCard(Zone.LIBRARY, playerA, "Silvercoat Lion", 1);
|
||||
addCard(Zone.LIBRARY, playerA, "Swamp", 1);
|
||||
addCard(Zone.LIBRARY, playerA, "Silvercoat Lion", 1);
|
||||
skipInitShuffling();
|
||||
|
||||
// Whenever Anafenza, the Foremost attacks, put a +1/+1 counter on another target tapped creature you control.
|
||||
// If a creature card would be put into an opponent's graveyard from anywhere, exile it instead.
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Anafenza, the Foremost");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sidisi, Brood Tyrant");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Sidisi, Brood Tyrant", 1);
|
||||
assertGraveyardCount(playerA, "Swamp", 1);
|
||||
assertGraveyardCount(playerA, "Silvercoat Lion", 0);
|
||||
assertExileCount("Silvercoat Lion", 2);
|
||||
assertPermanentCount(playerA, "Zombie", 0);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1358,6 +1358,11 @@ public class TestPlayer implements Player {
|
|||
computerPlayer.resetPassed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetPlayerPassedActions() {
|
||||
computerPlayer.resetPlayerPassedActions();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void quit(Game game) {
|
||||
computerPlayer.quit(game);
|
||||
|
|
@ -1608,8 +1613,8 @@ public class TestPlayer implements Player {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void revealFaceDownCard(Card card, Game game) {
|
||||
computerPlayer.revealFaceDownCard(card, game);
|
||||
public boolean lookAtFaceDownCard(Card card, Game game) {
|
||||
return computerPlayer.lookAtFaceDownCard(card, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -1701,13 +1706,18 @@ public class TestPlayer implements Player {
|
|||
return computerPlayer.moveCardToHandWithInfo(card, sourceId, game, withName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean moveCardsToExile(Card card, Ability source, Game game, boolean withName, UUID exileId, String exileZoneName) {
|
||||
return computerPlayer.moveCardsToExile(card, source, game, withName, exileId, exileZoneName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean moveCardsToExile(Set<Card> cards, Ability source, Game game, boolean withName, UUID exileId, String exileZoneName) {
|
||||
return computerPlayer.moveCardsToExile(cards, source, game, withName, exileId, exileZoneName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean moveCardsToGraveyardWithInfo(Set<Card> allCards, Ability source, Game game, Zone fromZone) {
|
||||
public Set<Card> moveCardsToGraveyardWithInfo(Set<Card> allCards, Ability source, Game game, Zone fromZone) {
|
||||
return computerPlayer.moveCardsToGraveyardWithInfo(allCards, source, game, fromZone);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue