Updated text of cards that add colorless mana to use {C}. Added ExileSourceUnlessPaysEffect. Added some random cards.

This commit is contained in:
fireshoes 2015-12-11 16:12:46 -06:00
parent 7a102b2c35
commit 636f2d960e
292 changed files with 18180 additions and 15719 deletions

View file

@ -1,70 +1,70 @@
/*
* 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.AI.basic;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBaseAI;
/**
*
* @author LevelX2
*/
public class CastDestroySpellsTest extends CardTestPlayerBaseAI {
/**
*
*
*/
@Test
public void testOrzhovCharm() {
// Choose one -
// - Return target creature you control and all Auras you control attached to it to their owner's hand;
// - Destroy target creature and you lose life equal to its toughness;
// - Return target creature card with converted mana cost 1 or less from your graveyard to the battlefield.
addCard(Zone.HAND, playerA, "Orzhov Charm"); // {W}{B}
// {T}: Add {1} to your mana pool.
// {T} {W/B}, {T}: Add {W}{W}, {W}{B}, or {B}{B} to your mana pool.
addCard(Zone.BATTLEFIELD, playerA, "Fetid Heath", 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
// Cycling abilities you activate cost you up to {2} less to activate.
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 18);
assertGraveyardCount(playerA, "Orzhov Charm", 1);
assertGraveyardCount(playerB, "Silvercoat Lion", 1);
}
}
/*
* 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.AI.basic;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBaseAI;
/**
*
* @author LevelX2
*/
public class CastDestroySpellsTest extends CardTestPlayerBaseAI {
/**
*
*
*/
@Test
public void testOrzhovCharm() {
// Choose one -
// - Return target creature you control and all Auras you control attached to it to their owner's hand;
// - Destroy target creature and you lose life equal to its toughness;
// - Return target creature card with converted mana cost 1 or less from your graveyard to the battlefield.
addCard(Zone.HAND, playerA, "Orzhov Charm"); // {W}{B}
// {T}: Add {C} to your mana pool.
// {T} {W/B}, {T}: Add {W}{W}, {W}{B}, or {B}{B} to your mana pool.
addCard(Zone.BATTLEFIELD, playerA, "Fetid Heath", 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
// Cycling abilities you activate cost you up to {2} less to activate.
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 18);
assertGraveyardCount(playerA, "Orzhov Charm", 1);
assertGraveyardCount(playerB, "Silvercoat Lion", 1);
}
}

View file

@ -1,113 +1,113 @@
/*
* 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.AI.basic;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.game.permanent.Permanent;
import org.junit.Assert;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBaseAI;
/**
*
* @author LevelX2
*/
public class PreventRepeatedActionsTest extends CardTestPlayerBaseAI {
/**
* Check that an equipment is not switched again an again between creatures
*
*/
@Test
public void testEquipOnlyOnce() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 6);
// Equipped creature gets +1/+1.
// Equip {1}({1}: Attach to target creature you control. Equip only as a sorcery.)
addCard(Zone.BATTLEFIELD, playerA, "Fireshrieker", 1);
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 2);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
int tappedLands = 0;
for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents(new FilterLandPermanent(), playerA.getId(), currentGame)) {
if (permanent.isTapped()) {
tappedLands++;
}
}
Assert.assertEquals("AI should only used Equipment once", 2, tappedLands);
}
/**
* If the AI on a local server gets control of a Basalt Monolith it will
* infinite loop taping for three mana and then using the mana to untap lol.
* Seeing the computer durdle troll is quite the hillarious thing
*/
@Test
public void testBasaltMonolith() {
addCard(Zone.HAND, playerA, "Phyrexian Vault", 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
// Basalt Monolith doesn't untap during your untap step.
// {T}: Add {3} to your mana pool.
// {3}: Untap Basalt Monolith.
addCard(Zone.BATTLEFIELD, playerA, "Basalt Monolith", 1, true);
setStopAt(5, PhaseStep.END_TURN);
execute();
// {2}, {T}, Sacrifice a creature: Draw a card.
assertPermanentCount(playerA, "Phyrexian Vault", 1);
assertTapped("Basalt Monolith", true);
assertTappedCount("Plains", false, 3);
}
/**
* AI gets stuck with two Kiora's Followers #1167
*/
@Test
public void testKiorasFollower() {
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2, true);
// {T}: Untap another target permanent.
addCard(Zone.BATTLEFIELD, playerA, "Kiora's Follower", 1, true);
addCard(Zone.BATTLEFIELD, playerA, "Kiora's Follower", 1);
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 2);
attack(2, playerB, "Silvercoat Lion");
attack(2, playerB, "Silvercoat Lion");
setStopAt(2, PhaseStep.END_TURN);
execute();
assertLife(playerA, 16);
assertTapped("Kiora's Follower", false);
}
}
/*
* 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.AI.basic;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.game.permanent.Permanent;
import org.junit.Assert;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBaseAI;
/**
*
* @author LevelX2
*/
public class PreventRepeatedActionsTest extends CardTestPlayerBaseAI {
/**
* Check that an equipment is not switched again an again between creatures
*
*/
@Test
public void testEquipOnlyOnce() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 6);
// Equipped creature gets +1/+1.
// Equip {1}({1}: Attach to target creature you control. Equip only as a sorcery.)
addCard(Zone.BATTLEFIELD, playerA, "Fireshrieker", 1);
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 2);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
int tappedLands = 0;
for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents(new FilterLandPermanent(), playerA.getId(), currentGame)) {
if (permanent.isTapped()) {
tappedLands++;
}
}
Assert.assertEquals("AI should only used Equipment once", 2, tappedLands);
}
/**
* If the AI on a local server gets control of a Basalt Monolith it will
* infinite loop taping for three mana and then using the mana to untap lol.
* Seeing the computer durdle troll is quite the hillarious thing
*/
@Test
public void testBasaltMonolith() {
addCard(Zone.HAND, playerA, "Phyrexian Vault", 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
// Basalt Monolith doesn't untap during your untap step.
// {T}: Add {C}{C}{C} to your mana pool.
// {3}: Untap Basalt Monolith.
addCard(Zone.BATTLEFIELD, playerA, "Basalt Monolith", 1, true);
setStopAt(5, PhaseStep.END_TURN);
execute();
// {2}, {T}, Sacrifice a creature: Draw a card.
assertPermanentCount(playerA, "Phyrexian Vault", 1);
assertTapped("Basalt Monolith", true);
assertTappedCount("Plains", false, 3);
}
/**
* AI gets stuck with two Kiora's Followers #1167
*/
@Test
public void testKiorasFollower() {
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2, true);
// {T}: Untap another target permanent.
addCard(Zone.BATTLEFIELD, playerA, "Kiora's Follower", 1, true);
addCard(Zone.BATTLEFIELD, playerA, "Kiora's Follower", 1);
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 2);
attack(2, playerB, "Silvercoat Lion");
attack(2, playerB, "Silvercoat Lion");
setStopAt(2, PhaseStep.END_TURN);
execute();
assertLife(playerA, 16);
assertTapped("Kiora's Follower", false);
}
}

View file

@ -1,75 +1,75 @@
/*
* 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.abilities.activated;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class PutToGraveyardTest extends CardTestPlayerBase {
/**
* Void Attendant The usable "Prozessor-Effect" doesnt put the card back
* into the graveyard from the exile.
*/
@Test
public void testExileToGraveyard() {
// Devoid
// {1}{G}, Put a card an opponent owns from exile into that player's graveyard: Put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool."
addCard(Zone.BATTLEFIELD, playerA, "Void Attendant");
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
// Flash (You may cast this spell any time you could cast an instant.)
// When Stasis Snare enters the battlefield, exile target creature an opponent controls until Stasis Snare leaves the battlefield. (That creature returns under its owner's control.)
addCard(Zone.HAND, playerA, "Stasis Snare", 1); // {1}{W}{W}
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Stasis Snare");
addTarget(playerA, "Silvercoat Lion");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}{G},", NO_TARGET, "");
addTarget(playerA, "Silvercoat Lion");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Stasis Snare", 1);
assertPermanentCount(playerB, "Silvercoat Lion", 0);
assertExileCount(playerB, 0);
assertGraveyardCount(playerB, "Silvercoat Lion", 1);
assertPermanentCount(playerA, "Eldrazi Scion", 1);
}
}
/*
* 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.abilities.activated;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class PutToGraveyardTest extends CardTestPlayerBase {
/**
* Void Attendant The usable "Prozessor-Effect" doesnt put the card back
* into the graveyard from the exile.
*/
@Test
public void testExileToGraveyard() {
// Devoid
// {1}{G}, Put a card an opponent owns from exile into that player's graveyard: Put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {C} to your mana pool."
addCard(Zone.BATTLEFIELD, playerA, "Void Attendant");
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
// Flash (You may cast this spell any time you could cast an instant.)
// When Stasis Snare enters the battlefield, exile target creature an opponent controls until Stasis Snare leaves the battlefield. (That creature returns under its owner's control.)
addCard(Zone.HAND, playerA, "Stasis Snare", 1); // {1}{W}{W}
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Stasis Snare");
addTarget(playerA, "Silvercoat Lion");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}{G},", NO_TARGET, "");
addTarget(playerA, "Silvercoat Lion");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Stasis Snare", 1);
assertPermanentCount(playerB, "Silvercoat Lion", 0);
assertExileCount(playerB, 0);
assertGraveyardCount(playerB, "Silvercoat Lion", 1);
assertPermanentCount(playerA, "Eldrazi Scion", 1);
}
}

View file

@ -1,69 +1,69 @@
/*
* 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.abilities.keywords;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class MetalcraftTest extends CardTestPlayerBase {
/**
* Rusted Relic or Blinkmoth nexus is bugged
* Either Relic does not see Blinkmoth as an artifact or it does not turn
* into one when it should.
*
*/
@Test
public void testMetalcraftFromBlinkmoth() {
addCard(Zone.BATTLEFIELD, playerA, "Darksteel Citadel",1);
// Metalcraft - {this} is a 5/5 Golem artifact creature as long as you control three or more artifacts
addCard(Zone.BATTLEFIELD, playerA, "Rusted Relic", 1);
// {T}: Add {1}to your mana pool.
// {1}: Blinkmoth Nexus becomes a 1/1 Blinkmoth artifact creature with flying until end of turn. It's still a land.
// {1}, {T}: Target Blinkmoth creature gets +1/+1 until end of turn.
addCard(Zone.BATTLEFIELD, playerA, "Blinkmoth Nexus", 1);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}: Until end of turn {this} becomes ");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPowerToughness(playerA, "Blinkmoth Nexus", 1, 1);
assertPowerToughness(playerA, "Rusted Relic", 5, 5);
}
}
/*
* 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.abilities.keywords;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class MetalcraftTest extends CardTestPlayerBase {
/**
* Rusted Relic or Blinkmoth nexus is bugged
* Either Relic does not see Blinkmoth as an artifact or it does not turn
* into one when it should.
*
*/
@Test
public void testMetalcraftFromBlinkmoth() {
addCard(Zone.BATTLEFIELD, playerA, "Darksteel Citadel",1);
// Metalcraft - {this} is a 5/5 Golem artifact creature as long as you control three or more artifacts
addCard(Zone.BATTLEFIELD, playerA, "Rusted Relic", 1);
// {T}: Add {C}to your mana pool.
// {1}: Blinkmoth Nexus becomes a 1/1 Blinkmoth artifact creature with flying until end of turn. It's still a land.
// {1}, {T}: Target Blinkmoth creature gets +1/+1 until end of turn.
addCard(Zone.BATTLEFIELD, playerA, "Blinkmoth Nexus", 1);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}: Until end of turn {this} becomes ");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPowerToughness(playerA, "Blinkmoth Nexus", 1, 1);
assertPowerToughness(playerA, "Rusted Relic", 5, 5);
}
}

View file

@ -1,66 +1,66 @@
/*
* 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.abilities.other;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class SpellFizzlesTest extends CardTestPlayerBase {
@Test
public void testSpellFizzlesWithNoLegalTargets() throws Exception {
addCard(Zone.BATTLEFIELD, playerA, "Island", 4);
// Devoid
// Tap up to two target creatures. Those creatures don't untap during their controller's next untap step.
// Put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool."
addCard(Zone.HAND, playerA, "Adverse Conditions"); // {3}{U}
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1);
addCard(Zone.HAND, playerB, "Lightning Bolt", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Adverse Conditions", "Silvercoat Lion");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Silvercoat Lion", "Adverse Conditions");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Adverse Conditions", 1);
assertGraveyardCount(playerB, "Lightning Bolt", 1);
assertGraveyardCount(playerB, "Silvercoat Lion", 1);
assertPermanentCount(playerA, "Eldrazi Scion", 0); // All targets were illegal - spell fizzles
}
}
/*
* 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.abilities.other;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class SpellFizzlesTest extends CardTestPlayerBase {
@Test
public void testSpellFizzlesWithNoLegalTargets() throws Exception {
addCard(Zone.BATTLEFIELD, playerA, "Island", 4);
// Devoid
// Tap up to two target creatures. Those creatures don't untap during their controller's next untap step.
// Put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {C} to your mana pool."
addCard(Zone.HAND, playerA, "Adverse Conditions"); // {3}{U}
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1);
addCard(Zone.HAND, playerB, "Lightning Bolt", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Adverse Conditions", "Silvercoat Lion");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Silvercoat Lion", "Adverse Conditions");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Adverse Conditions", 1);
assertGraveyardCount(playerB, "Lightning Bolt", 1);
assertGraveyardCount(playerB, "Silvercoat Lion", 1);
assertPermanentCount(playerA, "Eldrazi Scion", 0); // All targets were illegal - spell fizzles
}
}

View file

@ -1,125 +1,125 @@
package org.mage.test.cards.control;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* Tests that if a creature was controlled by opponent and died and was cast
* again by owner, that continuous effects of this creature work with controller
* for the owner
*
* @author LevelX2
*/
public class GainControlDiedCastAgainTest extends CardTestPlayerBase {
@Test
public void testBoostEffectsWorksForControllerOfElesh() {
addCard(Zone.BATTLEFIELD, playerB, "Plains", 4);
addCard(Zone.BATTLEFIELD, playerB, "Swamp", 3);
/**
* Volrath's Stronghold Legendary Land {t}: Add {1} to your mana pool.
* {1}{B}, {tap}: Put target creature card from your graveyard on top of
* your library.
*/
addCard(Zone.BATTLEFIELD, playerB, "Volrath's Stronghold");
/**
* Elesh Norn, Grand Cenobite {5}{W}{W} Legendary Creature Praetor 4/7
* Vigilance Other creatures you control get +2/+2. Creatures your
* opponents control get -2/-2.
*/
addCard(Zone.BATTLEFIELD, playerB, "Elesh Norn, Grand Cenobite");
addCard(Zone.BATTLEFIELD, playerB, "Kalonian Tusker"); // simple 3/3
/**
* Keiga, the Tide Star Legendary Dragon Spirit When Keiga, the Tide
* Star dies, gain control of target creature
*/
addCard(Zone.BATTLEFIELD, playerA, "Keiga, the Tide Star");
addCard(Zone.BATTLEFIELD, playerA, "Kalonian Tusker");
attack(2, playerB, "Elesh Norn, Grand Cenobite");
block(2, playerA, "Keiga, the Tide Star", "Elesh Norn, Grand Cenobite");
addTarget(playerB, "Elesh Norn, Grand Cenobite");
setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertLife(playerA, 20);
assertLife(playerB, 20);
assertPermanentCount(playerA, "Elesh Norn, Grand Cenobite", 1);
assertPowerToughness(playerA, "Kalonian Tusker", 5, 5);
assertPowerToughness(playerB, "Kalonian Tusker", 1, 1);
}
@Test
public void testBoostEffectsWorkForController() {
addCard(Zone.BATTLEFIELD, playerB, "Plains", 6);
addCard(Zone.BATTLEFIELD, playerB, "Swamp", 6);
/**
* Akroma's Vengeance {4}{W}{W} Sorcery Destroy all artifacts,
* creatures, and enchantments.
*/
addCard(Zone.HAND, playerB, "Akroma's Vengeance");
/**
* Volrath's Stronghold Legendary Land {t}: Add {1} to your mana pool.
* {1}{B}, {tap}: Put target creature card from your graveyard on top of
* your library.
*/
addCard(Zone.BATTLEFIELD, playerB, "Volrath's Stronghold");
/**
* Elesh Norn, Grand Cenobite {5}{W}{W} Legendary Creature Praetor
* Vigilance Other creatures you control get +2/+2. Creatures your
* opponents control get -2/-2.
*/
addCard(Zone.HAND, playerB, "Elesh Norn, Grand Cenobite");
addCard(Zone.BATTLEFIELD, playerB, "Darksteel Gargoyle"); // indestructible 3/3
addCard(Zone.BATTLEFIELD, playerA, "Island", 6);
/**
* Keiga, the Tide Star {5}{U} Legendary Dragon Spirit 5/5 When Keiga,
* the Tide Star dies, gain control of target creature
*/
addCard(Zone.HAND, playerA, "Keiga, the Tide Star");
addCard(Zone.BATTLEFIELD, playerA, "Darksteel Gargoyle");
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Elesh Norn, Grand Cenobite");
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Keiga, the Tide Star");
attack(4, playerB, "Elesh Norn, Grand Cenobite");
block(4, playerA, "Keiga, the Tide Star", "Elesh Norn, Grand Cenobite");
addTarget(playerA, "Elesh Norn, Grand Cenobite");
// Destroy all creatures, enchantments and artifacts
castSpell(4, PhaseStep.POSTCOMBAT_MAIN, playerB, "Akroma's Vengeance");
// Put Elesh Norn back on library
activateAbility(5, PhaseStep.END_TURN, playerB, "{1}{B},{T}: Put target creature card", "Elesh Norn, Grand Cenobite");
castSpell(6, PhaseStep.PRECOMBAT_MAIN, playerB, "Elesh Norn, Grand Cenobite");
setStopAt(6, PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 20);
assertLife(playerB, 20);
assertPermanentCount(playerA, "Keiga, the Tide Star", 0);
assertGraveyardCount(playerA, "Keiga, the Tide Star", 1);
assertPermanentCount(playerB, "Elesh Norn, Grand Cenobite", 1);
assertGraveyardCount(playerB, "Elesh Norn, Grand Cenobite", 0);
assertGraveyardCount(playerB, "Akroma's Vengeance", 1);
assertPermanentCount(playerA, "Darksteel Gargoyle", 1);
assertPermanentCount(playerB, "Darksteel Gargoyle", 1);
assertPowerToughness(playerA, "Darksteel Gargoyle", 1, 1);
assertPowerToughness(playerB, "Darksteel Gargoyle", 5, 5);
}
}
package org.mage.test.cards.control;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* Tests that if a creature was controlled by opponent and died and was cast
* again by owner, that continuous effects of this creature work with controller
* for the owner
*
* @author LevelX2
*/
public class GainControlDiedCastAgainTest extends CardTestPlayerBase {
@Test
public void testBoostEffectsWorksForControllerOfElesh() {
addCard(Zone.BATTLEFIELD, playerB, "Plains", 4);
addCard(Zone.BATTLEFIELD, playerB, "Swamp", 3);
/**
* Volrath's Stronghold Legendary Land {t}: Add {C} to your mana pool.
* {1}{B}, {tap}: Put target creature card from your graveyard on top of
* your library.
*/
addCard(Zone.BATTLEFIELD, playerB, "Volrath's Stronghold");
/**
* Elesh Norn, Grand Cenobite {5}{W}{W} Legendary Creature Praetor 4/7
* Vigilance Other creatures you control get +2/+2. Creatures your
* opponents control get -2/-2.
*/
addCard(Zone.BATTLEFIELD, playerB, "Elesh Norn, Grand Cenobite");
addCard(Zone.BATTLEFIELD, playerB, "Kalonian Tusker"); // simple 3/3
/**
* Keiga, the Tide Star Legendary Dragon Spirit When Keiga, the Tide
* Star dies, gain control of target creature
*/
addCard(Zone.BATTLEFIELD, playerA, "Keiga, the Tide Star");
addCard(Zone.BATTLEFIELD, playerA, "Kalonian Tusker");
attack(2, playerB, "Elesh Norn, Grand Cenobite");
block(2, playerA, "Keiga, the Tide Star", "Elesh Norn, Grand Cenobite");
addTarget(playerB, "Elesh Norn, Grand Cenobite");
setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertLife(playerA, 20);
assertLife(playerB, 20);
assertPermanentCount(playerA, "Elesh Norn, Grand Cenobite", 1);
assertPowerToughness(playerA, "Kalonian Tusker", 5, 5);
assertPowerToughness(playerB, "Kalonian Tusker", 1, 1);
}
@Test
public void testBoostEffectsWorkForController() {
addCard(Zone.BATTLEFIELD, playerB, "Plains", 6);
addCard(Zone.BATTLEFIELD, playerB, "Swamp", 6);
/**
* Akroma's Vengeance {4}{W}{W} Sorcery Destroy all artifacts,
* creatures, and enchantments.
*/
addCard(Zone.HAND, playerB, "Akroma's Vengeance");
/**
* Volrath's Stronghold Legendary Land {t}: Add {C} to your mana pool.
* {1}{B}, {tap}: Put target creature card from your graveyard on top of
* your library.
*/
addCard(Zone.BATTLEFIELD, playerB, "Volrath's Stronghold");
/**
* Elesh Norn, Grand Cenobite {5}{W}{W} Legendary Creature Praetor
* Vigilance Other creatures you control get +2/+2. Creatures your
* opponents control get -2/-2.
*/
addCard(Zone.HAND, playerB, "Elesh Norn, Grand Cenobite");
addCard(Zone.BATTLEFIELD, playerB, "Darksteel Gargoyle"); // indestructible 3/3
addCard(Zone.BATTLEFIELD, playerA, "Island", 6);
/**
* Keiga, the Tide Star {5}{U} Legendary Dragon Spirit 5/5 When Keiga,
* the Tide Star dies, gain control of target creature
*/
addCard(Zone.HAND, playerA, "Keiga, the Tide Star");
addCard(Zone.BATTLEFIELD, playerA, "Darksteel Gargoyle");
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Elesh Norn, Grand Cenobite");
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Keiga, the Tide Star");
attack(4, playerB, "Elesh Norn, Grand Cenobite");
block(4, playerA, "Keiga, the Tide Star", "Elesh Norn, Grand Cenobite");
addTarget(playerA, "Elesh Norn, Grand Cenobite");
// Destroy all creatures, enchantments and artifacts
castSpell(4, PhaseStep.POSTCOMBAT_MAIN, playerB, "Akroma's Vengeance");
// Put Elesh Norn back on library
activateAbility(5, PhaseStep.END_TURN, playerB, "{1}{B},{T}: Put target creature card", "Elesh Norn, Grand Cenobite");
castSpell(6, PhaseStep.PRECOMBAT_MAIN, playerB, "Elesh Norn, Grand Cenobite");
setStopAt(6, PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 20);
assertLife(playerB, 20);
assertPermanentCount(playerA, "Keiga, the Tide Star", 0);
assertGraveyardCount(playerA, "Keiga, the Tide Star", 1);
assertPermanentCount(playerB, "Elesh Norn, Grand Cenobite", 1);
assertGraveyardCount(playerB, "Elesh Norn, Grand Cenobite", 0);
assertGraveyardCount(playerB, "Akroma's Vengeance", 1);
assertPermanentCount(playerA, "Darksteel Gargoyle", 1);
assertPermanentCount(playerB, "Darksteel Gargoyle", 1);
assertPowerToughness(playerA, "Darksteel Gargoyle", 1, 1);
assertPowerToughness(playerB, "Darksteel Gargoyle", 5, 5);
}
}

View file

@ -1,108 +1,108 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.mage.test.cards.control;
import mage.abilities.keyword.HasteAbility;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class GainControlTargetEffectTest extends CardTestPlayerBase {
/**
* Checks if control has changed and the controlled creature has Haste
*
*/
@Test
public void testPermanentControlEffect() {
// When Smelt-Ward Gatekeepers enters the battlefield, if you control two or more Gates, gain control of target creature an opponent controls until end of turn. Untap that creature. That creature gains haste until end of turn.
addCard(Zone.HAND, playerA, "Smelt-Ward Gatekeepers", 1);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
addCard(Zone.BATTLEFIELD, playerA, "Boros Guildgate", 2);
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Smelt-Ward Gatekeepers");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
// under control
assertPermanentCount(playerA, "Silvercoat Lion", 1);
assertAbility(playerA, "Silvercoat Lion", HasteAbility.getInstance(), true);
}
/**
* I gained control of my opponent's Glen Elendra Archmage with Vedalken
* Shackles. After I sacrificed it to counter a spell, it Persisted back to
* my battlefield, but it should return under its owner's control. Maybe a
* Persist problem, but I am thinking Vedalken Shackles doesn't realize that
* it is a different object when it returns from the graveyard instead.
*/
@Test
public void testGainControlOfCreatureWithPersistEffect() {
// {2},{T}: Gain control of target creature with power less than or equal to the number of Islands you control for as long as Vedalken Shackles remains tapped.
addCard(Zone.BATTLEFIELD, playerA, "Vedalken Shackles", 1);
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
// Lightning Strike deals 3 damage to target creature or player.
addCard(Zone.HAND, playerB, "Lightning Strike", 1);
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 2);
// Flying
// {U}, Sacrifice Glen Elendra Archmage: Counter target noncreature spell.
// Persist (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.)
addCard(Zone.BATTLEFIELD, playerB, "Glen Elendra Archmage");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}: Gain control of target creature with power less than or equal to the number of Islands you control for as long as {this} remains tapped.", "Glen Elendra Archmage");
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Strike", playerA);
activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{U},Sacrifice {this}: Counter target noncreature spell.", "Lightning Strike");
setStopAt(1, PhaseStep.END_TURN);
execute();
assertGraveyardCount(playerB, "Lightning Strike", 1);
assertLife(playerA, 20);
assertLife(playerB, 20);
// under control of the owner after persist triggered
assertPermanentCount(playerA, "Glen Elendra Archmage", 0);
assertPermanentCount(playerB, "Glen Elendra Archmage", 1);
}
/**
* The shackles can maintain control of Mutavault indefinitely, even when
* it's not a creature.
*
*/
@Test
public void testKeepControlOfMutavault() {
// {2},{T}: Gain control of target creature with power less than or equal to the number of Islands you control for as long as Vedalken Shackles remains tapped.
addCard(Zone.BATTLEFIELD, playerA, "Vedalken Shackles", 1);
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
addCard(Zone.BATTLEFIELD, playerB, "Island", 1);
// {T}: Add {1} to your mana pool.
// {1}: Mutavault becomes a 2/2 creature with all creature types until end of turn. It's still a land.
addCard(Zone.BATTLEFIELD, playerB, "Mutavault", 1);
activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{1}: Until end of turn {this} becomes");
activateAbility(2, PhaseStep.POSTCOMBAT_MAIN, playerA, "{2},{T}: Gain control", "Mutavault");
setChoice(playerA, "No"); // Don't untap the Shackles
setStopAt(3, PhaseStep.PRECOMBAT_MAIN);
execute();
// under control of Shackles even if it's no longer a creature
assertPermanentCount(playerB, "Mutavault", 0);
assertPermanentCount(playerA, "Mutavault", 1);
}
}
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.mage.test.cards.control;
import mage.abilities.keyword.HasteAbility;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class GainControlTargetEffectTest extends CardTestPlayerBase {
/**
* Checks if control has changed and the controlled creature has Haste
*
*/
@Test
public void testPermanentControlEffect() {
// When Smelt-Ward Gatekeepers enters the battlefield, if you control two or more Gates, gain control of target creature an opponent controls until end of turn. Untap that creature. That creature gains haste until end of turn.
addCard(Zone.HAND, playerA, "Smelt-Ward Gatekeepers", 1);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
addCard(Zone.BATTLEFIELD, playerA, "Boros Guildgate", 2);
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Smelt-Ward Gatekeepers");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
// under control
assertPermanentCount(playerA, "Silvercoat Lion", 1);
assertAbility(playerA, "Silvercoat Lion", HasteAbility.getInstance(), true);
}
/**
* I gained control of my opponent's Glen Elendra Archmage with Vedalken
* Shackles. After I sacrificed it to counter a spell, it Persisted back to
* my battlefield, but it should return under its owner's control. Maybe a
* Persist problem, but I am thinking Vedalken Shackles doesn't realize that
* it is a different object when it returns from the graveyard instead.
*/
@Test
public void testGainControlOfCreatureWithPersistEffect() {
// {2},{T}: Gain control of target creature with power less than or equal to the number of Islands you control for as long as Vedalken Shackles remains tapped.
addCard(Zone.BATTLEFIELD, playerA, "Vedalken Shackles", 1);
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
// Lightning Strike deals 3 damage to target creature or player.
addCard(Zone.HAND, playerB, "Lightning Strike", 1);
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 2);
// Flying
// {U}, Sacrifice Glen Elendra Archmage: Counter target noncreature spell.
// Persist (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.)
addCard(Zone.BATTLEFIELD, playerB, "Glen Elendra Archmage");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}: Gain control of target creature with power less than or equal to the number of Islands you control for as long as {this} remains tapped.", "Glen Elendra Archmage");
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Strike", playerA);
activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{U},Sacrifice {this}: Counter target noncreature spell.", "Lightning Strike");
setStopAt(1, PhaseStep.END_TURN);
execute();
assertGraveyardCount(playerB, "Lightning Strike", 1);
assertLife(playerA, 20);
assertLife(playerB, 20);
// under control of the owner after persist triggered
assertPermanentCount(playerA, "Glen Elendra Archmage", 0);
assertPermanentCount(playerB, "Glen Elendra Archmage", 1);
}
/**
* The shackles can maintain control of Mutavault indefinitely, even when
* it's not a creature.
*
*/
@Test
public void testKeepControlOfMutavault() {
// {2},{T}: Gain control of target creature with power less than or equal to the number of Islands you control for as long as Vedalken Shackles remains tapped.
addCard(Zone.BATTLEFIELD, playerA, "Vedalken Shackles", 1);
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
addCard(Zone.BATTLEFIELD, playerB, "Island", 1);
// {T}: Add {C} to your mana pool.
// {1}: Mutavault becomes a 2/2 creature with all creature types until end of turn. It's still a land.
addCard(Zone.BATTLEFIELD, playerB, "Mutavault", 1);
activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{1}: Until end of turn {this} becomes");
activateAbility(2, PhaseStep.POSTCOMBAT_MAIN, playerA, "{2},{T}: Gain control", "Mutavault");
setChoice(playerA, "No"); // Don't untap the Shackles
setStopAt(3, PhaseStep.PRECOMBAT_MAIN);
execute();
// under control of Shackles even if it's no longer a creature
assertPermanentCount(playerB, "Mutavault", 0);
assertPermanentCount(playerA, "Mutavault", 1);
}
}

View file

@ -1,144 +1,144 @@
/*
* 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.mana;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class ConditionalManaTest extends CardTestPlayerBase {
@Test
public void testNormalUse() {
// {T}: Add one mana of any color to your mana pool. Spend this mana only to cast a multicolored spell.
addCard(Zone.BATTLEFIELD, playerA, "Pillar of the Paruns", 2);
// Instant {G}{W}
// Target player gains 7 life.
addCard(Zone.HAND, playerA, "Heroes' Reunion", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Heroes' Reunion", playerA);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Heroes' Reunion", 1);
assertHandCount(playerA, "Heroes' Reunion", 0); // player A could not cast it
assertLife(playerA, 27);
}
@Test
public void testNotAllowedUse() {
// {T}: Add one mana of any color to your mana pool. Spend this mana only to cast a multicolored spell.
addCard(Zone.BATTLEFIELD, playerA, "Pillar of the Paruns", 2);
addCard(Zone.HAND, playerA, "Silvercoat Lion", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion");
playerA.addChoice("White");
playerA.addChoice("White");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertHandCount(playerA, "Silvercoat Lion", 1); // player A could not cast Silvercoat Lion because the conditional mana is not available
}
@Test
public void testWorkingWithReflectingPool() {
addCard(Zone.BATTLEFIELD, playerA, "Cavern of Souls", 1);
addCard(Zone.BATTLEFIELD, playerA, "Reflecting Pool", 1); // can create white mana without restriction from the Cavern
addCard(Zone.HAND, playerA, "Silvercoat Lion", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Silvercoat Lion", 1);
}
@Test
public void testWorkingWithReflectingPool2() {
addCard(Zone.BATTLEFIELD, playerA, "Reflecting Pool", 1); // can create white mana without restriction from the Hive
addCard(Zone.BATTLEFIELD, playerA, "Sliver Hive", 1);
addCard(Zone.HAND, playerA, "Silvercoat Lion", 1);
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {1} to your mana pool");
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add to your mana pool one mana of any type");
setChoice(playerA, "White");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Silvercoat Lion", 1);
}
/**
* I wasunable to use "Rosheen Meanderer" ability to pay for "Candelabra of
* Tawnos" ability even thought it has "X" on its cost
*/
@Test
public void testRosheenMeandererUsingAbility() {
// Flying
addCard(Zone.HAND, playerB, "Snapping Drake", 2); // {3}{U}
// {T}: Add {4} to your mana pool. Spend this mana only on costs that contain {X}.
addCard(Zone.BATTLEFIELD, playerB, "Rosheen Meanderer", 1);
// {X}, {T}: Untap X target lands.
addCard(Zone.BATTLEFIELD, playerB, "Candelabra of Tawnos", 1);
addCard(Zone.BATTLEFIELD, playerB, "Island", 4);
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Snapping Drake");
activateManaAbility(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "{T}: Add {4}");
activateAbility(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "{X},{T}: Untap");
setChoice(playerB, "X=4");
addTarget(playerB, "Island");
addTarget(playerB, "Island");
addTarget(playerB, "Island");
addTarget(playerB, "Island");
castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Snapping Drake");
setStopAt(2, PhaseStep.END_TURN);
execute();
assertTappedCount("Island", true, 4);
assertTappedCount("Rosheen Meanderer", true, 1);
assertTappedCount("Candelabra of Tawnos", true, 1);
assertPermanentCount(playerB, "Snapping Drake", 2);
}
}
/*
* 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.mana;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class ConditionalManaTest extends CardTestPlayerBase {
@Test
public void testNormalUse() {
// {T}: Add one mana of any color to your mana pool. Spend this mana only to cast a multicolored spell.
addCard(Zone.BATTLEFIELD, playerA, "Pillar of the Paruns", 2);
// Instant {G}{W}
// Target player gains 7 life.
addCard(Zone.HAND, playerA, "Heroes' Reunion", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Heroes' Reunion", playerA);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Heroes' Reunion", 1);
assertHandCount(playerA, "Heroes' Reunion", 0); // player A could not cast it
assertLife(playerA, 27);
}
@Test
public void testNotAllowedUse() {
// {T}: Add one mana of any color to your mana pool. Spend this mana only to cast a multicolored spell.
addCard(Zone.BATTLEFIELD, playerA, "Pillar of the Paruns", 2);
addCard(Zone.HAND, playerA, "Silvercoat Lion", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion");
playerA.addChoice("White");
playerA.addChoice("White");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertHandCount(playerA, "Silvercoat Lion", 1); // player A could not cast Silvercoat Lion because the conditional mana is not available
}
@Test
public void testWorkingWithReflectingPool() {
addCard(Zone.BATTLEFIELD, playerA, "Cavern of Souls", 1);
addCard(Zone.BATTLEFIELD, playerA, "Reflecting Pool", 1); // can create white mana without restriction from the Cavern
addCard(Zone.HAND, playerA, "Silvercoat Lion", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Silvercoat Lion", 1);
}
@Test
public void testWorkingWithReflectingPool2() {
addCard(Zone.BATTLEFIELD, playerA, "Reflecting Pool", 1); // can create white mana without restriction from the Hive
addCard(Zone.BATTLEFIELD, playerA, "Sliver Hive", 1);
addCard(Zone.HAND, playerA, "Silvercoat Lion", 1);
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {C} to your mana pool");
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add to your mana pool one mana of any type");
setChoice(playerA, "White");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Silvercoat Lion", 1);
}
/**
* I wasunable to use "Rosheen Meanderer" ability to pay for "Candelabra of
* Tawnos" ability even thought it has "X" on its cost
*/
@Test
public void testRosheenMeandererUsingAbility() {
// Flying
addCard(Zone.HAND, playerB, "Snapping Drake", 2); // {3}{U}
// {T}: Add {C}{C}{C}{C} to your mana pool. Spend this mana only on costs that contain {X}.
addCard(Zone.BATTLEFIELD, playerB, "Rosheen Meanderer", 1);
// {X}, {T}: Untap X target lands.
addCard(Zone.BATTLEFIELD, playerB, "Candelabra of Tawnos", 1);
addCard(Zone.BATTLEFIELD, playerB, "Island", 4);
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Snapping Drake");
activateManaAbility(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "{T}: Add {C}{C}{C}{C}");
activateAbility(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "{X},{T}: Untap");
setChoice(playerB, "X=4");
addTarget(playerB, "Island");
addTarget(playerB, "Island");
addTarget(playerB, "Island");
addTarget(playerB, "Island");
castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Snapping Drake");
setStopAt(2, PhaseStep.END_TURN);
execute();
assertTappedCount("Island", true, 4);
assertTappedCount("Rosheen Meanderer", true, 1);
assertTappedCount("Candelabra of Tawnos", true, 1);
assertPermanentCount(playerB, "Snapping Drake", 2);
}
}

View file

@ -16,7 +16,7 @@ public class WardenOfTheWallTest extends CardTestPlayerBase {
/*
* Warden of the Wall
* Warden of the Wall enters the battlefield tapped.
* {T}: Add {1} to your mana pool.
* {T}: Add {C} to your mana pool.
* As long as it's not your turn, Warden of the Wall is a 2/3 Gargoyle artifact creature with flying.
*
*/

View file

@ -89,7 +89,7 @@ public class CavernOfSoulsTest extends CardTestPlayerBase {
public void testDrakeCantBeCountered() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
// As Cavern of Souls enters the battlefield, choose a creature type.
// {T}: Add {1} to your mana pool.
// {T}: Add {C} to your mana pool.
// {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.
addCard(Zone.HAND, playerA, "Cavern of Souls");
addCard(Zone.HAND, playerA, "Azure Drake");

View file

@ -1,156 +1,156 @@
/*
* 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.cards.Card;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Assert;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class PossibilityStormTest extends CardTestPlayerBase {
/**
* There's currently a bug with Possibility Storm and Zoetic Cavern. The way
* it's supposed to work is the P. Storm trigger exiles Zoetic Cavern and
* then uses last known information about the spell to determine the type of
* card the trigger is looking for(creature in this instance). Instead it's
* basing the type solely off what's printed on the card. What happened to
* me earlier was the trigger skipped right over an Emrakul and then
* revealed a Flooded Strand. I was prompted whether or not I wanted to
* "cast" Flooded Strand without paying it's cost. Eventually I clicked yes
* and it produced a Game Error that resulted in rollback. I recreated the
* error against an AI opponent and copied the code. Can't actually post it
* because the filter on this site claims it makes my post look too
* "spammy". Here's a screenshot of it instead(in spoiler tag).
*/
@Test
public void TestWithZoeticCavern() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
// Whenever a player casts a spell from his or her hand, that player exiles it, then exiles cards from
// the top of his or her library until he or she exiles a card that shares a card type with it. That
// player may cast that card without paying its mana cost. Then he or she puts all cards exiled with
// Possibility Storm on the bottom of his or her library in a random order.
addCard(Zone.BATTLEFIELD, playerA, "Possibility Storm", 2);
// {T}: Add {1} to your mana pool.
// Morph {2}
addCard(Zone.HAND, playerA, "Zoetic Cavern");
addCard(Zone.LIBRARY, playerA, "Silvercoat Lion");
skipInitShuffling();
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Zoetic Cavern");
setChoice(playerA, "Yes");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Zoetic Cavern", 0);
boolean zoeticCavernInLibrary = false;
for (Card card : playerA.getLibrary().getCards(currentGame)) {
if (card.getName().equals("Zoetic Cavern")) {
zoeticCavernInLibrary = true;
}
}
Assert.assertEquals("Zoetic Cavern has to be in the library", true, zoeticCavernInLibrary);
assertPermanentCount(playerA, "Silvercoat Lion", 1);
}
/*
* Having another Possibility Storm issue(shocking, I know). This time it
* occurred when trying to finish off my opponent that was at 3 life.
* I cast an Izzet Charm choosing draw 2 discard 2 for mode,
* responded to the Possibility Storm trigger with Remand.
* Remand's trigger revealed a Pact of Negation I chose not to cast, then the trigger for Izzet Charm
* resolved apparently revealing a Cryptic Command. It automatically moved
* the spell from exile to my library, apparently because it believed it did
* not have a target(no spells remaining on the stack). I've seen this
* happen with Mana Leaks that get revealed with no targets, but Cryptic
* being modal means it should always be able to be cast. It's worth
* mentioning that I've revealed Cryptics off triggers with other spells on
* the stack and properly been asked if I wish to cast them. Thanks!
*/
@Test
public void TestWithCrypticCommand() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
// Whenever a player casts a spell from his or her hand, that player exiles it, then exiles cards from
// the top of his or her library until he or she exiles a card that shares a card type with it. That
// player may cast that card without paying its mana cost. Then he or she puts all cards exiled with
// Possibility Storm on the bottom of his or her library in a random order.
addCard(Zone.BATTLEFIELD, playerA, "Possibility Storm", 1);
// Choose one Counter target noncreature spell unless its controller pays {2};
// or Izzet Charm deals 2 damage to target creature;
// or draw two cards, then discard two cards.
addCard(Zone.HAND, playerA, "Izzet Charm"); // {U}{R}
// Counter target spell. If that spell is countered this way, put it into its owner's hand instead of into that player's graveyard.
// Draw a card.
addCard(Zone.HAND, playerA, "Remand");
// Choose two -
// Counter target spell;
// or return target permanent to its owner's hand;
// or tap all creatures your opponents control;
// or draw a card.
addCard(Zone.LIBRARY, playerA, "Cryptic Command");
addCard(Zone.LIBRARY, playerA, "Pact of Negation");
skipInitShuffling();
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Izzet Charm");
setModeChoice(playerA, "3");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Remand", "Izzet Charm", "Whenever a player casts");
setChoice(playerA, "No"); // Don't play Pact of Negotiation
setChoice(playerA, "Yes"); // Play Cryptic Command
setModeChoice(playerA, "3");
setModeChoice(playerA, "4");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertExileCount(playerA, 0);
assertGraveyardCount(playerA, "Cryptic Command", 1);
assertTapped("Silvercoat Lion", true);
assertHandCount(playerA, 1); // from Cryptic Command Draw
}
}
/*
* 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.cards.Card;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Assert;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class PossibilityStormTest extends CardTestPlayerBase {
/**
* There's currently a bug with Possibility Storm and Zoetic Cavern. The way
* it's supposed to work is the P. Storm trigger exiles Zoetic Cavern and
* then uses last known information about the spell to determine the type of
* card the trigger is looking for(creature in this instance). Instead it's
* basing the type solely off what's printed on the card. What happened to
* me earlier was the trigger skipped right over an Emrakul and then
* revealed a Flooded Strand. I was prompted whether or not I wanted to
* "cast" Flooded Strand without paying it's cost. Eventually I clicked yes
* and it produced a Game Error that resulted in rollback. I recreated the
* error against an AI opponent and copied the code. Can't actually post it
* because the filter on this site claims it makes my post look too
* "spammy". Here's a screenshot of it instead(in spoiler tag).
*/
@Test
public void TestWithZoeticCavern() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
// Whenever a player casts a spell from his or her hand, that player exiles it, then exiles cards from
// the top of his or her library until he or she exiles a card that shares a card type with it. That
// player may cast that card without paying its mana cost. Then he or she puts all cards exiled with
// Possibility Storm on the bottom of his or her library in a random order.
addCard(Zone.BATTLEFIELD, playerA, "Possibility Storm", 2);
// {T}: Add {C} to your mana pool.
// Morph {2}
addCard(Zone.HAND, playerA, "Zoetic Cavern");
addCard(Zone.LIBRARY, playerA, "Silvercoat Lion");
skipInitShuffling();
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Zoetic Cavern");
setChoice(playerA, "Yes");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Zoetic Cavern", 0);
boolean zoeticCavernInLibrary = false;
for (Card card : playerA.getLibrary().getCards(currentGame)) {
if (card.getName().equals("Zoetic Cavern")) {
zoeticCavernInLibrary = true;
}
}
Assert.assertEquals("Zoetic Cavern has to be in the library", true, zoeticCavernInLibrary);
assertPermanentCount(playerA, "Silvercoat Lion", 1);
}
/*
* Having another Possibility Storm issue(shocking, I know). This time it
* occurred when trying to finish off my opponent that was at 3 life.
* I cast an Izzet Charm choosing draw 2 discard 2 for mode,
* responded to the Possibility Storm trigger with Remand.
* Remand's trigger revealed a Pact of Negation I chose not to cast, then the trigger for Izzet Charm
* resolved apparently revealing a Cryptic Command. It automatically moved
* the spell from exile to my library, apparently because it believed it did
* not have a target(no spells remaining on the stack). I've seen this
* happen with Mana Leaks that get revealed with no targets, but Cryptic
* being modal means it should always be able to be cast. It's worth
* mentioning that I've revealed Cryptics off triggers with other spells on
* the stack and properly been asked if I wish to cast them. Thanks!
*/
@Test
public void TestWithCrypticCommand() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
// Whenever a player casts a spell from his or her hand, that player exiles it, then exiles cards from
// the top of his or her library until he or she exiles a card that shares a card type with it. That
// player may cast that card without paying its mana cost. Then he or she puts all cards exiled with
// Possibility Storm on the bottom of his or her library in a random order.
addCard(Zone.BATTLEFIELD, playerA, "Possibility Storm", 1);
// Choose one Counter target noncreature spell unless its controller pays {2};
// or Izzet Charm deals 2 damage to target creature;
// or draw two cards, then discard two cards.
addCard(Zone.HAND, playerA, "Izzet Charm"); // {U}{R}
// Counter target spell. If that spell is countered this way, put it into its owner's hand instead of into that player's graveyard.
// Draw a card.
addCard(Zone.HAND, playerA, "Remand");
// Choose two -
// Counter target spell;
// or return target permanent to its owner's hand;
// or tap all creatures your opponents control;
// or draw a card.
addCard(Zone.LIBRARY, playerA, "Cryptic Command");
addCard(Zone.LIBRARY, playerA, "Pact of Negation");
skipInitShuffling();
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Izzet Charm");
setModeChoice(playerA, "3");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Remand", "Izzet Charm", "Whenever a player casts");
setChoice(playerA, "No"); // Don't play Pact of Negotiation
setChoice(playerA, "Yes"); // Play Cryptic Command
setModeChoice(playerA, "3");
setModeChoice(playerA, "4");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertExileCount(playerA, 0);
assertGraveyardCount(playerA, "Cryptic Command", 1);
assertTapped("Silvercoat Lion", true);
assertHandCount(playerA, 1); // from Cryptic Command Draw
}
}

View file

@ -14,7 +14,7 @@ public class BoseijuTest extends CardTestPlayerBase {
* Boseiju, Who Shelters All
* Legendary Land
* Boseiju, Who Shelters All enters the battlefield tapped.
* {T}, Pay 2 life: Add {1} to your mana pool. If that mana is spent on an
* {T}, Pay 2 life: Add {C} to your mana pool. If that mana is spent on an
* instant or sorcery spell, that spell can't be countered by spells or abilities.
*
*/

View file

@ -15,7 +15,7 @@ public class HallOfTheBanditLordTest extends CardTestPlayerBase {
* Hall of the Bandit Lord
* Legendary Land
* Hall of the Bandit Lord enters the battlefield tapped.
* {T}, Pay 3 life: Add {1} to your mana pool. If that mana is spent on a
* {T}, Pay 3 life: Add {C} to your mana pool. If that mana is spent on a
* creature spell, it gains haste.
*
*/

View file

@ -1,68 +1,68 @@
/*
* 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.commander.duel;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestCommanderDuelBase;
/**
*
* @author LevelX2
*/
public class OpalPalaceTest extends CardTestCommanderDuelBase {
/**
* I cast my commander with Opal Palace's second ability and it did not receive a +1/+1 counter
* the first time it was cast (rulings say it should on the first time cast).
*/
@Test
public void testFirstAbility() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 4);
// {T}: Add {1} to your mana pool.
// {1}, {T}: Add to your mana pool one mana of any color in your commander's color identity.
// If you spend this mana to cast your commander, it enters the battlefield with a number of +1/+1 counters on it
// equal to the number of times it's been cast from the command zone this game.
addCard(Zone.BATTLEFIELD, playerA, "Opal Palace", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ob Nixilis of the Black Oath");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 40);
assertLife(playerB, 40);
assertPermanentCount(playerA, "Ob Nixilis of the Black Oath", 1);
assertCounterCount("Ob Nixilis of the Black Oath", CounterType.P1P1, 1);
}
}
/*
* 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.commander.duel;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestCommanderDuelBase;
/**
*
* @author LevelX2
*/
public class OpalPalaceTest extends CardTestCommanderDuelBase {
/**
* I cast my commander with Opal Palace's second ability and it did not receive a +1/+1 counter
* the first time it was cast (rulings say it should on the first time cast).
*/
@Test
public void testFirstAbility() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 4);
// {T}: Add {C} to your mana pool.
// {1}, {T}: Add to your mana pool one mana of any color in your commander's color identity.
// If you spend this mana to cast your commander, it enters the battlefield with a number of +1/+1 counters on it
// equal to the number of times it's been cast from the command zone this game.
addCard(Zone.BATTLEFIELD, playerA, "Opal Palace", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ob Nixilis of the Black Oath");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 40);
assertLife(playerB, 40);
assertPermanentCount(playerA, "Ob Nixilis of the Black Oath", 1);
assertCounterCount("Ob Nixilis of the Black Oath", CounterType.P1P1, 1);
}
}

View file

@ -1,63 +1,63 @@
/*
* 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.turnmod;
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 SkipTurnTest extends CardTestPlayerBase {
@Test
public void testEaterOfDays() {
// At the beginning of your upkeep or whenever you cast a green spell, put a charge counter on Shrine of Boundless Growth.
// {T}, Sacrifice Shrine of Boundless Growth: Add {1} to your mana pool for each charge counter on Shrine of Boundless Growth.
addCard(Zone.HAND, playerA, "Shrine of Boundless Growth", 1);
addCard(Zone.BATTLEFIELD, playerA, "Island", 7);
// Flying
// Trample
// When Eater of Days enters the battlefield, you skip your next two turns.
addCard(Zone.HAND, playerA, "Eater of Days", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Eater of Days");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Shrine of Boundless Growth");
setStopAt(5, PhaseStep.PRECOMBAT_MAIN);
execute();
assertPermanentCount(playerA, "Eater of Days", 1);
assertPermanentCount(playerA, "Shrine of Boundless Growth", 1);
assertCounterCount("Shrine of Boundless Growth", CounterType.CHARGE, 1);
}
}
/*
* 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.turnmod;
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 SkipTurnTest extends CardTestPlayerBase {
@Test
public void testEaterOfDays() {
// At the beginning of your upkeep or whenever you cast a green spell, put a charge counter on Shrine of Boundless Growth.
// {T}, Sacrifice Shrine of Boundless Growth: Add {C} to your mana pool for each charge counter on Shrine of Boundless Growth.
addCard(Zone.HAND, playerA, "Shrine of Boundless Growth", 1);
addCard(Zone.BATTLEFIELD, playerA, "Island", 7);
// Flying
// Trample
// When Eater of Days enters the battlefield, you skip your next two turns.
addCard(Zone.HAND, playerA, "Eater of Days", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Eater of Days");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Shrine of Boundless Growth");
setStopAt(5, PhaseStep.PRECOMBAT_MAIN);
execute();
assertPermanentCount(playerA, "Eater of Days", 1);
assertPermanentCount(playerA, "Shrine of Boundless Growth", 1);
assertCounterCount("Shrine of Boundless Growth", CounterType.CHARGE, 1);
}
}

View file

@ -1,357 +1,357 @@
/*
* 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.utils;
import mage.abilities.mana.ManaOptions;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* This test checks if the calculated possible mana options are correct related
* to the given mana sources available.
*
* @author LevelX2
*/
public class ManaOptionsTest extends CardTestPlayerBase {
@Test
public void testSimpleMana() {
addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
Assert.assertEquals("{G}{G}{G}", getManaOption(0, manaOptions));
}
// Tinder Farm enters the battlefield tapped.
// {T}: Add {G} to your mana pool.
// {T}, Sacrifice Tinder Farm: Add {R}{W} to your mana pool.
@Test
public void testTinderFarm() {
addCard(Zone.BATTLEFIELD, playerA, "Tinder Farm", 3);
setStopAt(2, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 4, manaOptions.size());
Assert.assertEquals("{G}{G}{G}", getManaOption(0, manaOptions));
Assert.assertEquals("{R}{G}{G}{W}", getManaOption(1, manaOptions));
Assert.assertEquals("{R}{R}{G}{W}{W}", getManaOption(2, manaOptions));
Assert.assertEquals("{R}{R}{R}{W}{W}{W}", getManaOption(3, manaOptions));
}
// Adarkar Wastes
// {T}: Add {1} to your mana pool.
// {T}: Add {W} or {U} to your mana pool. Adarkar Wastes deals 1 damage to you.
@Test
public void testAdarkarWastes() {
addCard(Zone.BATTLEFIELD, playerA, "Adarkar Wastes", 3);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 4, manaOptions.size());
Assert.assertEquals("{W}{W}{W}", getManaOption(0, manaOptions));
Assert.assertEquals("{U}{W}{W}", getManaOption(1, manaOptions));
Assert.assertEquals("{U}{U}{W}", getManaOption(2, manaOptions));
Assert.assertEquals("{U}{U}{U}", getManaOption(3, manaOptions));
}
// Chromatic Sphere
// {1}, {T}, Sacrifice Chromatic Sphere: Add one mana of any color to your mana pool. Draw a card.
@Test
public void testChromaticSphere() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.BATTLEFIELD, playerA, "Chromatic Sphere", 2);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
Assert.assertEquals("{Any}{Any}", getManaOption(0, manaOptions));
}
// Orochi Leafcaller
// {G}: Add one mana of any color to your mana pool.
@Test
public void testOrochiLeafcaller() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
addCard(Zone.BATTLEFIELD, playerA, "Orochi Leafcaller", 1);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
Assert.assertEquals("{W}{W}{Any}{Any}", getManaOption(0, manaOptions));
}
// Crystal Quarry
// {T}: {1} Add to your mana pool.
// {5}, {T}: Add {W}{U}{B}{R}{G} to your mana pool.
@Test
public void testCrystalQuarry() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
addCard(Zone.BATTLEFIELD, playerA, "Crystal Quarry", 1);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
Assert.assertEquals("{1}{G}{G}{W}{W}", getManaOption(0, manaOptions));
}
// Crystal Quarry
// {T}: {1} Add to your mana pool.
// {5}, {T}: Add {W}{U}{B}{R}{G} to your mana pool.
@Test
public void testCrystalQuarry2() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
addCard(Zone.BATTLEFIELD, playerA, "Crystal Quarry", 1);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 2, manaOptions.size());
Assert.assertEquals("{1}{G}{G}{G}{W}{W}", getManaOption(0, manaOptions));
Assert.assertEquals("{R}{G}{U}{W}{B}", getManaOption(1, manaOptions));
}
// Nykthos, Shrine to Nyx
// {T}: Add {1} to your mana pool.
// {2}, {T}: Choose a color. Add to your mana pool an amount of mana of that color equal to your devotion to that color. (Your devotion to a color is the number of mana symbols of that color in the mana costs of permanents you control.)
@Test
public void testNykthos1() {
addCard(Zone.BATTLEFIELD, playerA, "Sedge Scorpion", 4);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
addCard(Zone.BATTLEFIELD, playerA, "Nykthos, Shrine to Nyx", 1);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
Assert.assertEquals("{G}{G}{G}{G}{G}", getManaOption(0, manaOptions));
}
@Test
public void testNykthos2() {
addCard(Zone.BATTLEFIELD, playerA, "Sedge Scorpion", 4);
addCard(Zone.BATTLEFIELD, playerA, "Akroan Crusader", 3);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
addCard(Zone.BATTLEFIELD, playerA, "Nykthos, Shrine to Nyx", 1);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 2, manaOptions.size());
Assert.assertEquals("{G}{G}{G}{G}{G}", getManaOption(0, manaOptions));
Assert.assertEquals("{R}{R}{R}{G}", getManaOption(1, manaOptions));
}
@Test
public void testNykthos3() {
addCard(Zone.BATTLEFIELD, playerA, "Sylvan Caryatid", 1);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
addCard(Zone.BATTLEFIELD, playerA, "Nykthos, Shrine to Nyx", 1);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
Assert.assertEquals("{1}{G}{Any}", getManaOption(0, manaOptions));
}
@Test
public void testMix1() {
// {1}, {T}, Sacrifice Chromatic Star: Add one mana of any color to your mana pool.
// When Chromatic Star is put into a graveyard from the battlefield, draw a card.
addCard(Zone.BATTLEFIELD, playerA, "Chromatic Star", 1);
// {1}, {T}, Sacrifice Chromatic Sphere: Add one mana of any color to your mana pool. Draw a card.
addCard(Zone.BATTLEFIELD, playerA, "Chromatic Sphere", 1);
// {T}: Add {1} to your mana pool. If you control an Urza's Mine and an Urza's Power-Plant, add {3} to your mana pool instead.
addCard(Zone.BATTLEFIELD, playerA, "Urza's Tower", 1);
// {T}: Add {1} to your mana pool.
// {T}: Add {R} or {G} to your mana pool. Each opponent gains 1 life.
addCard(Zone.BATTLEFIELD, playerA, "Grove of the Burnwillows", 1);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 2, manaOptions.size());
Assert.assertEquals("{Any}{Any}", getManaOption(0, manaOptions));
Assert.assertEquals("{Any}{Any}", getManaOption(1, manaOptions));
}
@Test
public void testFetidHeath() {
addCard(Zone.BATTLEFIELD, playerA, "Fetid Heath", 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 3, manaOptions.size());
Assert.assertEquals("{W}{W}", getManaOption(0, manaOptions));
Assert.assertEquals("{W}{B}", getManaOption(1, manaOptions));
Assert.assertEquals("{B}{B}", getManaOption(2, manaOptions));
}
/**
* Don't use mana sources that only reduce available mana
*/
@Test
public void testCabalCoffers1() {
addCard(Zone.BATTLEFIELD, playerA, "Cabal Coffers", 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
Assert.assertEquals("{W}{B}", getManaOption(0, manaOptions));
}
@Test
public void testCabalCoffers2() {
addCard(Zone.BATTLEFIELD, playerA, "Cabal Coffers", 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 2, manaOptions.size());
Assert.assertEquals("{W}{B}{B}", getManaOption(0, manaOptions));
Assert.assertEquals("{B}{B}{B}", getManaOption(1, manaOptions));
}
@Test
public void testMageRingNetwork() {
// {T}: Add {1} to your mana pool.
// {T}, {1} : Put a storage counter on Mage-Ring Network.
// {T}, Remove X storage counters from Mage-Ring Network: Add {X} to your mana pool.
addCard(Zone.BATTLEFIELD, playerA, "Mage-Ring Network", 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
Assert.assertEquals("{1}{W}{B}", getManaOption(0, manaOptions));
}
@Test
public void testMageRingNetwork2() {
// {T}: Add {1} to your mana pool.
// {T}, {1} : Put a storage counter on Mage-Ring Network.
// {T}, Remove X storage counters from Mage-Ring Network: Add {X} to your mana pool.
addCard(Zone.BATTLEFIELD, playerA, "Mage-Ring Network", 1);
addCounters(1, PhaseStep.UPKEEP, playerA, "Mage-Ring Network", CounterType.STORAGE, 4);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
setStopAt(1, PhaseStep.DRAW);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
Assert.assertEquals("{4}{W}{B}", getManaOption(0, manaOptions));
}
@Test
@Ignore // TriggeredManaAbilities not supported yet for getAvailableMana
public void testCryptGhast() {
//Extort (Whenever you cast a spell, you may pay {WB}. If you do, each opponent loses 1 life and you gain that much life.)
// Whenever you tap a Swamp for mana, add {B} to your mana pool (in addition to the mana the land produces).
addCard(Zone.BATTLEFIELD, playerA, "Crypt Ghast", 1);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
Assert.assertEquals("{B}{B}", getManaOption(0, manaOptions));
}
// TODO
// Test Calciform Pools combination mana lands
private String getManaOption(int index, ManaOptions manaOptions) {
if (manaOptions.size() < index + 1) {
return "";
}
return manaOptions.get(index).toString();
}
}
/*
* 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.utils;
import mage.abilities.mana.ManaOptions;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* This test checks if the calculated possible mana options are correct related
* to the given mana sources available.
*
* @author LevelX2
*/
public class ManaOptionsTest extends CardTestPlayerBase {
@Test
public void testSimpleMana() {
addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
Assert.assertEquals("{G}{G}{G}", getManaOption(0, manaOptions));
}
// Tinder Farm enters the battlefield tapped.
// {T}: Add {G} to your mana pool.
// {T}, Sacrifice Tinder Farm: Add {R}{W} to your mana pool.
@Test
public void testTinderFarm() {
addCard(Zone.BATTLEFIELD, playerA, "Tinder Farm", 3);
setStopAt(2, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 4, manaOptions.size());
Assert.assertEquals("{G}{G}{G}", getManaOption(0, manaOptions));
Assert.assertEquals("{R}{G}{G}{W}", getManaOption(1, manaOptions));
Assert.assertEquals("{R}{R}{G}{W}{W}", getManaOption(2, manaOptions));
Assert.assertEquals("{R}{R}{R}{W}{W}{W}", getManaOption(3, manaOptions));
}
// Adarkar Wastes
// {T}: Add {C} to your mana pool.
// {T}: Add {W} or {U} to your mana pool. Adarkar Wastes deals 1 damage to you.
@Test
public void testAdarkarWastes() {
addCard(Zone.BATTLEFIELD, playerA, "Adarkar Wastes", 3);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 4, manaOptions.size());
Assert.assertEquals("{W}{W}{W}", getManaOption(0, manaOptions));
Assert.assertEquals("{U}{W}{W}", getManaOption(1, manaOptions));
Assert.assertEquals("{U}{U}{W}", getManaOption(2, manaOptions));
Assert.assertEquals("{U}{U}{U}", getManaOption(3, manaOptions));
}
// Chromatic Sphere
// {1}, {T}, Sacrifice Chromatic Sphere: Add one mana of any color to your mana pool. Draw a card.
@Test
public void testChromaticSphere() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.BATTLEFIELD, playerA, "Chromatic Sphere", 2);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
Assert.assertEquals("{Any}{Any}", getManaOption(0, manaOptions));
}
// Orochi Leafcaller
// {G}: Add one mana of any color to your mana pool.
@Test
public void testOrochiLeafcaller() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
addCard(Zone.BATTLEFIELD, playerA, "Orochi Leafcaller", 1);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
Assert.assertEquals("{W}{W}{Any}{Any}", getManaOption(0, manaOptions));
}
// Crystal Quarry
// {T}: {1} Add to your mana pool.
// {5}, {T}: Add {W}{U}{B}{R}{G} to your mana pool.
@Test
public void testCrystalQuarry() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
addCard(Zone.BATTLEFIELD, playerA, "Crystal Quarry", 1);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
Assert.assertEquals("{1}{G}{G}{W}{W}", getManaOption(0, manaOptions));
}
// Crystal Quarry
// {T}: {1} Add to your mana pool.
// {5}, {T}: Add {W}{U}{B}{R}{G} to your mana pool.
@Test
public void testCrystalQuarry2() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
addCard(Zone.BATTLEFIELD, playerA, "Crystal Quarry", 1);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 2, manaOptions.size());
Assert.assertEquals("{1}{G}{G}{G}{W}{W}", getManaOption(0, manaOptions));
Assert.assertEquals("{R}{G}{U}{W}{B}", getManaOption(1, manaOptions));
}
// Nykthos, Shrine to Nyx
// {T}: Add {C} to your mana pool.
// {2}, {T}: Choose a color. Add to your mana pool an amount of mana of that color equal to your devotion to that color. (Your devotion to a color is the number of mana symbols of that color in the mana costs of permanents you control.)
@Test
public void testNykthos1() {
addCard(Zone.BATTLEFIELD, playerA, "Sedge Scorpion", 4);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
addCard(Zone.BATTLEFIELD, playerA, "Nykthos, Shrine to Nyx", 1);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
Assert.assertEquals("{G}{G}{G}{G}{G}", getManaOption(0, manaOptions));
}
@Test
public void testNykthos2() {
addCard(Zone.BATTLEFIELD, playerA, "Sedge Scorpion", 4);
addCard(Zone.BATTLEFIELD, playerA, "Akroan Crusader", 3);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
addCard(Zone.BATTLEFIELD, playerA, "Nykthos, Shrine to Nyx", 1);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 2, manaOptions.size());
Assert.assertEquals("{G}{G}{G}{G}{G}", getManaOption(0, manaOptions));
Assert.assertEquals("{R}{R}{R}{G}", getManaOption(1, manaOptions));
}
@Test
public void testNykthos3() {
addCard(Zone.BATTLEFIELD, playerA, "Sylvan Caryatid", 1);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
addCard(Zone.BATTLEFIELD, playerA, "Nykthos, Shrine to Nyx", 1);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
Assert.assertEquals("{1}{G}{Any}", getManaOption(0, manaOptions));
}
@Test
public void testMix1() {
// {1}, {T}, Sacrifice Chromatic Star: Add one mana of any color to your mana pool.
// When Chromatic Star is put into a graveyard from the battlefield, draw a card.
addCard(Zone.BATTLEFIELD, playerA, "Chromatic Star", 1);
// {1}, {T}, Sacrifice Chromatic Sphere: Add one mana of any color to your mana pool. Draw a card.
addCard(Zone.BATTLEFIELD, playerA, "Chromatic Sphere", 1);
// {T}: Add {C} to your mana pool. If you control an Urza's Mine and an Urza's Power-Plant, add {C}{C}{C} to your mana pool instead.
addCard(Zone.BATTLEFIELD, playerA, "Urza's Tower", 1);
// {T}: Add {C} to your mana pool.
// {T}: Add {R} or {G} to your mana pool. Each opponent gains 1 life.
addCard(Zone.BATTLEFIELD, playerA, "Grove of the Burnwillows", 1);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 2, manaOptions.size());
Assert.assertEquals("{Any}{Any}", getManaOption(0, manaOptions));
Assert.assertEquals("{Any}{Any}", getManaOption(1, manaOptions));
}
@Test
public void testFetidHeath() {
addCard(Zone.BATTLEFIELD, playerA, "Fetid Heath", 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 3, manaOptions.size());
Assert.assertEquals("{W}{W}", getManaOption(0, manaOptions));
Assert.assertEquals("{W}{B}", getManaOption(1, manaOptions));
Assert.assertEquals("{B}{B}", getManaOption(2, manaOptions));
}
/**
* Don't use mana sources that only reduce available mana
*/
@Test
public void testCabalCoffers1() {
addCard(Zone.BATTLEFIELD, playerA, "Cabal Coffers", 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
Assert.assertEquals("{W}{B}", getManaOption(0, manaOptions));
}
@Test
public void testCabalCoffers2() {
addCard(Zone.BATTLEFIELD, playerA, "Cabal Coffers", 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 2, manaOptions.size());
Assert.assertEquals("{W}{B}{B}", getManaOption(0, manaOptions));
Assert.assertEquals("{B}{B}{B}", getManaOption(1, manaOptions));
}
@Test
public void testMageRingNetwork() {
// {T}: Add {C} to your mana pool.
// {T}, {1} : Put a storage counter on Mage-Ring Network.
// {T}, Remove X storage counters from Mage-Ring Network: Add {X} to your mana pool.
addCard(Zone.BATTLEFIELD, playerA, "Mage-Ring Network", 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
Assert.assertEquals("{1}{W}{B}", getManaOption(0, manaOptions));
}
@Test
public void testMageRingNetwork2() {
// {T}: Add {C} to your mana pool.
// {T}, {1} : Put a storage counter on Mage-Ring Network.
// {T}, Remove X storage counters from Mage-Ring Network: Add {X} to your mana pool.
addCard(Zone.BATTLEFIELD, playerA, "Mage-Ring Network", 1);
addCounters(1, PhaseStep.UPKEEP, playerA, "Mage-Ring Network", CounterType.STORAGE, 4);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
setStopAt(1, PhaseStep.DRAW);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
Assert.assertEquals("{4}{W}{B}", getManaOption(0, manaOptions));
}
@Test
@Ignore // TriggeredManaAbilities not supported yet for getAvailableMana
public void testCryptGhast() {
//Extort (Whenever you cast a spell, you may pay {WB}. If you do, each opponent loses 1 life and you gain that much life.)
// Whenever you tap a Swamp for mana, add {B} to your mana pool (in addition to the mana the land produces).
addCard(Zone.BATTLEFIELD, playerA, "Crypt Ghast", 1);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
setStopAt(1, PhaseStep.UPKEEP);
execute();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
Assert.assertEquals("{B}{B}", getManaOption(0, manaOptions));
}
// TODO
// Test Calciform Pools combination mana lands
private String getManaOption(int index, ManaOptions manaOptions) {
if (manaOptions.size() < index + 1) {
return "";
}
return manaOptions.get(index).toString();
}
}