changes to the way abilities are added to cards

This commit is contained in:
betasteward 2015-03-23 13:04:09 -04:00
parent 65390e09a6
commit 72ff6f27b3
91 changed files with 2003 additions and 217 deletions

View file

@ -0,0 +1,103 @@
/*
* 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 BetaSteward
*/
public class ChampionTest extends CardTestPlayerBase {
/**
* 702.71. Champion
* 702.71a Champion represents two triggered abilities. Champion an [object] means When this
* permanent enters the battlefield, sacrifice it unless you exile another [object] you control and
* When this permanent leaves the battlefield, return the exiled card to the battlefield under its
* owners control.
*
* 702.71b The two abilities represented by champion are linked. See rule 607, Linked Abilities.
*
* 702.71c A permanent is championed by another permanent if the latter exiles the former as the
* direct result of a champion ability.
*
*/
/**
* Lightning Crafter
* Creature Goblin Shaman 3/3, 3R (4)
* Champion a Goblin or Shaman (When this enters the battlefield, sacrifice
* it unless you exile another Goblin or Shaman you control. When this
* leaves the battlefield, that card returns to the battlefield.)
* {T}: Lightning Crafter deals 3 damage to target creature or player.
*
*/
@Test
public void testChampionCreature() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
addCard(Zone.BATTLEFIELD, playerA, "Goblin Roughrider");
addCard(Zone.HAND, playerA, "Lightning Crafter");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Crafter");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Lightning Crafter", 1);
assertExileCount("Goblin Roughrider", 1);
}
@Test
public void testExiledCreatureReturns() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
addCard(Zone.BATTLEFIELD, playerA, "Goblin Roughrider");
addCard(Zone.HAND, playerA, "Lightning Crafter");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Crafter");
activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: {source} deals 3 damage to target creature or player.", "Lightning Crafter");
setStopAt(3, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Lightning Crafter", 0);
assertPermanentCount(playerA, "Goblin Roughrider", 1);
assertExileCount("Goblin Roughrider", 0);
assertGraveyardCount(playerA, "Lightning Crafter", 1);
}
}

View file

@ -0,0 +1,110 @@
/*
* 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 BetaSteward
*/
public class ConspireTest extends CardTestPlayerBase {
/**
* 702.77. Conspire
* 702.77a Conspire is a keyword that represents two abilities. The first is a static ability that functions
* while the spell with conspire is on the stack. The second is a triggered ability that functions
* while the spell with conspire is on the stack. Conspire means As an additional cost to cast
* this spell, you may tap two untapped creatures you control that each share a color with it and
* When you cast this spell, if its conspire cost was paid, copy it. If the spell has any targets, you
* may choose new targets for the copy. Paying a spells conspire cost follows the rules for
* paying additional costs in rules 601.2b and 601.2eg.
*
* 702.77b If a spell has multiple instances of conspire, each is paid separately and triggers based on
* its own payment, not any other instance of conspire
*
*/
/**
* Burn Trail
* Sorcery, 3R (4)
* Burn Trail deals 3 damage to target creature or player.
*
* Conspire (As you cast this spell, you may tap two untapped creatures you
* control that share a color with it. When you do, copy it and you may
* choose a new target for the copy.)
*
*/
@Test
public void testConspire() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
addCard(Zone.BATTLEFIELD, playerA, "Goblin Roughrider");
addCard(Zone.BATTLEFIELD, playerA, "Raging Goblin");
addCard(Zone.HAND, playerA, "Burn Trail");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Burn Trail", playerB);
setChoice(playerA, "Yes");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerB, 14);
assertGraveyardCount(playerA, "Burn Trail", 1);
assertTapped("Goblin Roughrider", true);
assertTapped("Raging Goblin", true);
}
@Test
public void testConspireNotUsed() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
addCard(Zone.BATTLEFIELD, playerA, "Goblin Roughrider");
addCard(Zone.BATTLEFIELD, playerA, "Raging Goblin");
addCard(Zone.HAND, playerA, "Burn Trail");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Burn Trail", playerB);
setChoice(playerA, "No");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerB, 17);
assertGraveyardCount(playerA, "Burn Trail", 1);
assertTapped("Goblin Roughrider", false);
assertTapped("Raging Goblin", false);
}
}

View file

@ -0,0 +1,99 @@
/*
* 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 BetaSteward
*/
public class DashTest extends CardTestPlayerBase {
/**
* 702.108. Dash
* 702.108a Dash represents three abilities: two static abilities that function while the card with dash is
* on the stack, one of which may create a delayed triggered ability, and a static ability that
* functions while the object with dash is on the battlefield. Dash [cost] means You may cast
* this card by paying [cost] rather that its mana cost, If this spells dash cost was paid, return the
* permanent this spell becomes to its owners hand at the beginning of the next end step, and As
* long as this permanents dash cost was paid, it has haste. Paying a cards dash cost follows the
* rules for paying alternative costs in rules 601.2b and 601.2eg.
*
*/
/**
* Screamreach Brawler
* Creature Orc Berserker 2/3, 2R (3)
* Dash {1}{R} (You may cast this spell for its dash cost. If you do, it
* gains haste, and it's returned from the battlefield to its owner's hand
* at the beginning of the next end step.)
*
*/
@Test
public void testDash() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
addCard(Zone.HAND, playerA, "Screamreach Brawler");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Screamreach Brawler");
setChoice(playerA, "Yes");
attack(1, playerA, "Screamreach Brawler");
setStopAt(2, PhaseStep.UNTAP);
execute();
assertLife(playerB, 18);
assertPermanentCount(playerA, "Screamreach Brawler", 0);
assertHandCount(playerA, "Screamreach Brawler", 1);
}
@Test
public void testNoDash() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
addCard(Zone.HAND, playerA, "Screamreach Brawler");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Screamreach Brawler");
setChoice(playerA, "No");
attack(1, playerA, "Screamreach Brawler");
setStopAt(2, PhaseStep.UNTAP);
execute();
assertLife(playerB, 20);
assertPermanentCount(playerA, "Screamreach Brawler", 1);
assertHandCount(playerA, "Screamreach Brawler", 0);
}
}

View file

@ -0,0 +1,105 @@
/*
* 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 mage.counters.CounterType;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author BetaSteward
*/
public class FadingTest extends CardTestPlayerBase {
/**
* 702.31. Fading
* 702.31a Fading is a keyword that represents two abilities. Fading N means This permanent
* enters the battlefield with N fade counters on it and At the beginning of your upkeep, remove
* a fade counter from this permanent. If you cant, sacrifice the permanent.
*/
/**
* Blastoderm
* Creature Beast 5/5, 2GG (4)
* Shroud (This creature can't be the target of spells or abilities.)
* Fading 3 (This creature enters the battlefield with three fade counters
* on it. At the beginning of your upkeep, remove a fade counter from it.
* If you can't, sacrifice it.)
*
*/
@Test
public void testFading() {
addCard(Zone.BATTLEFIELD, playerA, "Forest", 4);
addCard(Zone.HAND, playerA, "Blastoderm");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Blastoderm");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Blastoderm", 1);
this.assertCounterCount("Blastoderm", CounterType.FADE, 3);
}
@Test
public void testFades() {
addCard(Zone.BATTLEFIELD, playerA, "Forest", 4);
addCard(Zone.HAND, playerA, "Blastoderm");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Blastoderm");
setStopAt(5, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Blastoderm", 1);
this.assertCounterCount("Blastoderm", CounterType.FADE, 1);
}
@Test
public void testFadesAway() {
addCard(Zone.BATTLEFIELD, playerA, "Forest", 4);
addCard(Zone.HAND, playerA, "Blastoderm");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Blastoderm");
setStopAt(9, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Blastoderm", 0);
assertGraveyardCount(playerA, "Blastoderm", 1);
}
}

View file

@ -0,0 +1,133 @@
/*
* 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 mage.counters.CounterType;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author BetaSteward
*/
public class GraftTest extends CardTestPlayerBase {
/**
* 702.57. Graft
* 702.57a Graft represents both a static ability and a triggered ability. Graft N means This
* permanent enters the battlefield with N +1/+1 counters on it and Whenever another creature
* enters the battlefield, if this permanent has a +1/+1 counter on it, you may move a +1/+1
* counter from this permanent onto that creature.
* 702.57b If a creature has multiple instances of graft, each one works separately.
*
*/
/**
* Sporeback Troll
* Creature Troll Mutant 0/0, 3G (4)
* Graft 2 (This creature enters the battlefield with two +1/+1 counters on it.
* Whenever another creature enters the battlefield, you may move a +1/+1
* counter from this creature onto it.)
* {1}{G}: Regenerate target creature with a +1/+1 counter on it.
*
*/
/**
* Cytoplast Root-Kin
* Creature Elemental Mutant 0/0, 2GG (4)
* Graft 4 (This creature enters the battlefield with four +1/+1 counters on
* it. Whenever another creature enters the battlefield, you may move a +1/+1
* counter from this creature onto it.)
* When Cytoplast Root-Kin enters the battlefield, put a +1/+1 counter on
* each other creature you control with a +1/+1 counter on it.
* {2}: Move a +1/+1 counter from target creature you control onto Cytoplast Root-Kin.
*
*/
@Test
public void testGraft() {
addCard(Zone.BATTLEFIELD, playerA, "Forest", 4);
addCard(Zone.HAND, playerA, "Sporeback Troll");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sporeback Troll");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Sporeback Troll", 1);
assertPowerToughness(playerA, "Sporeback Troll", 2, 2);
assertCounterCount("Sporeback Troll", CounterType.P1P1, 2);
}
@Test
public void testMoveCounters() {
addCard(Zone.BATTLEFIELD, playerA, "Forest", 8);
addCard(Zone.HAND, playerA, "Cytoplast Root-Kin");
addCard(Zone.HAND, playerA, "Sporeback Troll");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cytoplast Root-Kin");
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Sporeback Troll");
setChoice(playerA, "Yes");
setStopAt(1, PhaseStep.END_TURN);
execute();
assertPermanentCount(playerA, "Sporeback Troll", 1);
assertPermanentCount(playerA, "Cytoplast Root-Kin", 1);
assertPowerToughness(playerA, "Sporeback Troll", 3, 3);
assertPowerToughness(playerA, "Cytoplast Root-Kin", 3, 3);
assertCounterCount("Sporeback Troll", CounterType.P1P1, 3);
assertCounterCount("Cytoplast Root-Kin", CounterType.P1P1, 3);
}
@Test
public void testDontMoveCounters() {
addCard(Zone.BATTLEFIELD, playerA, "Forest", 8);
addCard(Zone.HAND, playerA, "Cytoplast Root-Kin");
addCard(Zone.HAND, playerA, "Sporeback Troll");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cytoplast Root-Kin");
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Sporeback Troll");
setChoice(playerA, "No");
setStopAt(1, PhaseStep.END_TURN);
execute();
assertPermanentCount(playerA, "Sporeback Troll", 1);
assertPermanentCount(playerA, "Cytoplast Root-Kin", 1);
assertPowerToughness(playerA, "Sporeback Troll", 2, 2);
assertPowerToughness(playerA, "Cytoplast Root-Kin", 4, 4);
assertCounterCount("Sporeback Troll", CounterType.P1P1, 2);
assertCounterCount("Cytoplast Root-Kin", CounterType.P1P1, 4);
}
}

View file

@ -0,0 +1,84 @@
/*
* 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.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 BetaSteward
*/
public class HideawayTest extends CardTestPlayerBase {
/**
* 702.74. Hideaway
* 702.74a Hideaway represents a static ability and a triggered ability. Hideaway means This
* permanent enters the battlefield tapped and When this permanent enters the battlefield, look at
* the top four cards of your library. Exile one of them face down and put the rest on the bottom of
* your library in any order. The exiled card gains Any player who has controlled the permanent
* that exiled this card may look at this card in the exile zone.
*
*/
/**
* Shelldock Isle
* Land
* Hideaway (This land enters the battlefield tapped. When it does, look at
* the top four cards of your library, exile one face down, then put the
* rest on the bottom of your library.)
* {T}: Add {U} to your mana pool.
* {U}, {T}: You may play the exiled card without paying its mana cost if a
* library has twenty or fewer cards in it.
*
*/
@Test
public void testHideaway() {
addCard(Zone.HAND, playerA, "Shelldock Isle");
this.playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Shelldock Isle");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Shelldock Isle", 1);
assertExileCount(playerA, 1);
for (Card card :currentGame.getExile().getAllCards(currentGame)){
Assert.assertTrue("Exiled card is not face down", card.isFaceDown(currentGame));
}
}
}

View file

@ -0,0 +1,115 @@
/*
* 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 BetaSteward
*/
public class MadnessTest extends CardTestPlayerBase {
/**
* 702.34. Madness
* 702.34a Madness is a keyword that represents two abilities. The first is a static ability that functions
* while the card with madness is in a players hand. The second is a triggered ability that
* functions when the first ability is applied. Madness [cost] means If a player would discard
* this card, that player discards it, but may exile it instead of putting it into his or her graveyard
* and When this card is exiled this way, its owner may cast it by paying [cost] rather than paying
* its mana cost. If that player doesnt, he or she puts this card into his or her graveyard.
* 702.34b Casting a spell using its madness ability follows the rules for paying alternative costs in
* rules 601.2b and 601.2eg.
*
*/
/**
* Arrogant Wurm
* 3GG
* Creature -- Wurm
* 4/4
* Trample
* Madness {2}{G} (If you discard this card, you may cast it for its
* madness cost instead of putting it into your graveyard.)
*
*/
/**
* Raven's Crime
* B
* Sorcery
* Target player discards a card.
* Retrace (You may cast this card from your graveyard by discarding a land
* card in addition to paying its other costs.)
*
*/
@Test
public void testMadness() {
addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
addCard(Zone.HAND, playerA, "Arrogant Wurm");
addCard(Zone.HAND, playerA, "Raven's Crime");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Raven's Crime", playerA);
setChoice(playerA, "Yes");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Arrogant Wurm", 1);
assertGraveyardCount(playerA, "Raven's Crime", 1);
assertHandCount(playerA, 0);
}
@Test
public void testNoMadness() {
addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
addCard(Zone.HAND, playerA, "Arrogant Wurm");
addCard(Zone.HAND, playerA, "Raven's Crime");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Raven's Crime", playerA);
setChoice(playerA, "No");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Arrogant Wurm", 0);
assertGraveyardCount(playerA, "Raven's Crime", 1);
assertGraveyardCount(playerA, "Arrogant Wurm", 1);
assertHandCount(playerA, 0);
}
}

View file

@ -0,0 +1,111 @@
/*
* 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 BetaSteward
*/
public class ModularTest extends CardTestPlayerBase {
/**
* 702.42. Modular
* 702.42a Modular represents both a static ability and a triggered ability. Modular N means This
* permanent enters the battlefield with N +1/+1 counters on it and When this permanent is put
* into a graveyard from the battlefield, you may put a +1/+1 counter on target artifact creature for
* each +1/+1 counter on this permanent.
* 702.42b If a creature has multiple instances of modular, each one works separately.
*
*/
/**
* Arcbound Bruiser
* Artifact Creature Golem 0/0, 5 (5)
* Modular 3 (This enters the battlefield with three +1/+1 counters on it.
* When it dies, you may put its +1/+1 counters on target artifact creature.)
*
*/
/**
* Arcbound Hybrid
* Artifact Creature Beast 0/0, 4 (4)
* Haste
* Modular 2 (This enters the battlefield with two +1/+1 counters on it.
* When it dies, you may put its +1/+1 counters on target artifact creature.)
*
*/
@Test
public void testModularEnters() {
addCard(Zone.BATTLEFIELD, playerA, "Forest", 5);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4);
addCard(Zone.HAND, playerA, "Arcbound Bruiser");
addCard(Zone.HAND, playerA, "Arcbound Hybrid");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Arcbound Bruiser");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Arcbound Hybrid");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Arcbound Bruiser", 1);
assertPermanentCount(playerA, "Arcbound Hybrid", 1);
assertPowerToughness(playerA, "Arcbound Bruiser", 3, 3);
assertPowerToughness(playerA, "Arcbound Hybrid", 2, 2);
}
@Test
public void testModularLeaves() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5);
addCard(Zone.HAND, playerA, "Arcbound Bruiser");
addCard(Zone.HAND, playerA, "Arcbound Hybrid");
addCard(Zone.HAND, playerA, "Lightning Bolt");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Arcbound Bruiser");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Arcbound Hybrid");
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Arcbound Bruiser");
setStopAt(3, PhaseStep.BEGIN_COMBAT);
setChoice(playerA, "Yes");
execute();
assertPermanentCount(playerA, "Arcbound Bruiser", 0);
assertPermanentCount(playerA, "Arcbound Hybrid", 1);
assertGraveyardCount(playerA, "Arcbound Bruiser", 1);
assertPowerToughness(playerA, "Arcbound Hybrid", 5, 5);
}
}

View file

@ -0,0 +1,115 @@
/*
* 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 BetaSteward
*/
public class ReplicateTest extends CardTestPlayerBase {
/**
* 702.55. Replicate
* 702.55a Replicate is a keyword that represents two abilities. The first is a static ability that
* functions while the spell with replicate is on the stack. The second is a triggered ability that
* functions while the spell with replicate is on the stack. Replicate [cost] means As an
* additional cost to cast this spell, you may pay [cost] any number of times and When you cast
* this spell, if a replicate cost was paid for it, copy it for each time its replicate cost was paid. If
* the spell has any targets, you may choose new targets for any of the copies. Paying a spells
* replicate cost follows the rules for paying additional costs in rules 601.2b and 601.2eg.
* 702.55b If a spell has multiple instances of replicate, each is paid separately and triggers based on
* the payments made for it, not any other instance of replicate.
*
*/
/**
* Train of Thought
* Sorcery, 1U (2)
* Replicate {1}{U} (When you cast this spell, copy it for each time you paid its replicate cost.)
* Draw a card.
*
*/
@Test
public void testReplicate1Time() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 6);
addCard(Zone.HAND, playerA, "Train of Thought");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Train of Thought");
setChoice(playerA, "Yes");
setChoice(playerA, "No");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Train of Thought", 1);
assertHandCount(playerA, 2);
}
@Test
public void testReplicate2Times() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 6);
addCard(Zone.HAND, playerA, "Train of Thought");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Train of Thought");
setChoice(playerA, "Yes");
setChoice(playerA, "Yes");
setChoice(playerA, "No");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Train of Thought", 1);
assertHandCount(playerA, 3);
}
@Test
public void testNotReplicate() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 6);
addCard(Zone.HAND, playerA, "Train of Thought");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Train of Thought");
setChoice(playerA, "No");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Train of Thought", 1);
assertHandCount(playerA, 1);
}
}

View file

@ -0,0 +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.cards.abilities.other;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Ignore;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author BetaSteward
*/
public class ChiefEngineerTest extends CardTestPlayerBase {
/**
* Chief Engineer
* Creature Vedalken Artificer 1/3, 1U (2)
* Artifact spells you cast have convoke. (Your creatures can help cast
* those spells. Each creature you tap while casting an artifact spell pays
* for {1} or one mana of that creature's color.)
*
*/
@Ignore // at this time player.getPlayable() does not take into account convoke payments
@Test
public void testGainsConvoke() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
addCard(Zone.BATTLEFIELD, playerA, "Chief Engineer");
addCard(Zone.BATTLEFIELD, playerA, "Alpha Myr");
addCard(Zone.HAND, playerA, "Goblin Roughrider");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Goblin Roughrider");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Goblin Roughrider", 1);
assertTapped("Alpha Myr", true);
}
}

View file

@ -0,0 +1,73 @@
/*
* 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 mage.counters.CounterType;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author BetaSteward
*/
public class ChorusOfTheConclaveTest extends CardTestPlayerBase {
/**
* Chorus of the Conclave
* 4GGWW
* Legendary Creature -- Dryad
* 3/8
* Forestwalk
* As an additional cost to cast creature spells, you may pay any amount of
* mana. If you do, that creature enters the battlefield with that many
* additional +1/+1 counters on it.
*
*/
@Test
public void testPlayCreature() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
addCard(Zone.BATTLEFIELD, playerA, "Chorus of the Conclave");
addCard(Zone.HAND, playerA, "Goblin Roughrider");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Goblin Roughrider");
setChoice(playerA, "Yes");
setChoice(playerA, "X=1");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Goblin Roughrider", 1);
assertCounterCount("Goblin Roughrider", CounterType.P1P1, 1);
}
}

View file

@ -0,0 +1,83 @@
/*
* 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 BetaSteward
*/
public class CrucibleOfWorldsTest extends CardTestPlayerBase {
/**
* Crucible of Worlds
* Artifact, 3 (3)
* You may play land cards from your graveyard.
*
*/
@Test
public void testPlayLand() {
addCard(Zone.BATTLEFIELD, playerA, "Crucible of Worlds");
addCard(Zone.GRAVEYARD, playerA, "Swamp");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Play Swamp");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Swamp", 1);
assertGraveyardCount(playerA, "Swamp", 0);
}
@Test
public void testCantPlayMoreThanOneLandPerTurn() {
addCard(Zone.BATTLEFIELD, playerA, "Crucible of Worlds");
addCard(Zone.GRAVEYARD, playerA, "Swamp");
addCard(Zone.GRAVEYARD, playerA, "Plains");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Play Swamp");
activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Play Plains");
setStopAt(1, PhaseStep.END_TURN);
execute();
assertPermanentCount(playerA, "Swamp", 1);
assertGraveyardCount(playerA, "Swamp", 0);
assertPermanentCount(playerA, "Plains", 0);
assertGraveyardCount(playerA, "Plains", 1);
}
}

View file

@ -0,0 +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.cards.abilities.other;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Ignore;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author BetaSteward
*/
public class MycosynthGolemTest extends CardTestPlayerBase {
/**
* Mycosynth Golem
* Artifact Creature Golem 4/5, 11 (11)
* Affinity for artifacts (This spell costs {1} less to cast for each
* artifact you control.)
* Artifact creature spells you cast have affinity for artifacts. (They cost
* {1} less to cast for each artifact you control.)
*
*/
@Ignore // at this time player.getPlayable() does not account for spells that gain abilities
@Test
public void testSpellsAffinity() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
addCard(Zone.BATTLEFIELD, playerA, "Mycosynth Golem");
addCard(Zone.HAND, playerA, "Alpha Myr");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Alpha Myr");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Alpha Myr", 1);
assertHandCount(playerA, "Alpha Myr", 0);
}
}

View file

@ -0,0 +1,127 @@
/*
* 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 BetaSteward
*/
public class NecromancyTest extends CardTestPlayerBase {
/**
* Necromancy
* Enchantment, 2B (3)
* You may cast Necromancy as though it had flash. If you cast it any time a
* sorcery couldn't have been cast, the controller of the permanent it
* becomes sacrifices it at the beginning of the next cleanup step.
* When Necromancy enters the battlefield, if it's on the battlefield, it
* becomes an Aura with "enchant creature put onto the battlefield with
* Necromancy." Put target creature card from a graveyard onto the
* battlefield under your control and attach Necromancy to it. When
* Necromancy leaves the battlefield, that creature's controller sacrifices it.
*
*/
@Test
public void testNecromancy() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
addCard(Zone.HAND, playerA, "Necromancy");
addCard(Zone.GRAVEYARD, playerA, "Craw Wurm");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Necromancy");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Craw Wurm", 1);
assertPermanentCount(playerA, "Necromancy", 1);
assertGraveyardCount(playerA, "Craw Wurm", 0);
}
@Test
public void testNecromancyFlash() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
addCard(Zone.HAND, playerA, "Necromancy");
addCard(Zone.GRAVEYARD, playerA, "Craw Wurm");
castSpell(1, PhaseStep.UPKEEP, playerA, "Necromancy");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Craw Wurm", 1);
assertPermanentCount(playerA, "Necromancy", 1);
assertGraveyardCount(playerA, "Craw Wurm", 0);
}
@Test
public void testNecromancyFlashSacrifice() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
addCard(Zone.HAND, playerA, "Necromancy");
addCard(Zone.GRAVEYARD, playerA, "Craw Wurm");
castSpell(1, PhaseStep.UPKEEP, playerA, "Necromancy");
setStopAt(2, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Craw Wurm", 0);
assertPermanentCount(playerA, "Necromancy", 0);
assertGraveyardCount(playerA, "Craw Wurm", 1);
assertGraveyardCount(playerA, "Necromancy", 1);
}
@Test
public void testNecromancyLeaves() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.HAND, playerA, "Necromancy");
addCard(Zone.HAND, playerA, "Disenchant");
addCard(Zone.GRAVEYARD, playerA, "Craw Wurm");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Necromancy");
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Disenchant", "Necromancy");
setStopAt(2, PhaseStep.END_TURN);
execute();
assertPermanentCount(playerA, "Craw Wurm", 0);
assertPermanentCount(playerA, "Necromancy", 0);
assertGraveyardCount(playerA, "Necromancy", 1);
assertGraveyardCount(playerA, "Craw Wurm", 1);
}
}

View file

@ -0,0 +1,71 @@
/*
* 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 BetaSteward
*/
public class PastInFlamesTest extends CardTestPlayerBase {
/**
* Past in Flames
* Sorcery, 3R (4)
* Each instant and sorcery card in your graveyard gains flashback until end
* of turn. The flashback cost is equal to its mana cost.
* Flashback {4}{R} (You may cast this card from your graveyard for its
* flashback cost. Then exile it.)
*
*/
@Test
public void testSpellsGainFlashback() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5);
addCard(Zone.HAND, playerA, "Past in Flames");
addCard(Zone.GRAVEYARD, playerA, "Lightning Bolt");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Past in Flames");
activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Flashback");
setStopAt(1, PhaseStep.END_TURN);
execute();
assertExileCount("Lightning Bolt", 1);
assertGraveyardCount(playerA, "Lightning Bolt", 0);
assertLife(playerB, 17);
assertLife(playerA, 20);
}
}

View file

@ -0,0 +1,93 @@
/*
* 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.Ignore;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author BetaSteward
*/
public class SoulfireGrandMasterTest extends CardTestPlayerBase {
/**
* Soulfire Grand Master
* Creature Human Monk 2/2, 1W (2)
* Lifelink
* Instant and sorcery spells you control have lifelink.
* {2}{U/R}{U/R}: The next time you cast an instant or sorcery spell from
* your hand this turn, put that card into your hand instead of into your
* graveyard as it resolves.
*
*/
@Ignore // at this time player.getPlayable() does not account for spells that gain abilities
@Test
public void testSpellsGainLifelink() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
addCard(Zone.BATTLEFIELD, playerA, "Soulfire Grand Master");
addCard(Zone.HAND, playerA, "Lightning Bolt");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Lightning Bolt", 1);
assertHandCount(playerA, "Lightning Bolt", 0);
assertLife(playerB, 17);
assertLife(playerA, 23);
}
@Ignore // at this time player.getPlayable() does not account for spells that gain abilities
@Test
public void testSpellsReturnToHand() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5);
addCard(Zone.BATTLEFIELD, playerA, "Soulfire Grand Master");
addCard(Zone.HAND, playerA, "Lightning Bolt");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}{U/R}{U/R}:");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Lightning Bolt", 0);
assertHandCount(playerA, "Lightning Bolt", 1);
assertLife(playerA, 23);
assertLife(playerB, 17);
}
}

View file

@ -0,0 +1,73 @@
/*
* 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 mage.counters.CounterType;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author BetaSteward
*/
public class VarolzTheScarStripedTest extends CardTestPlayerBase {
/**
* Varolz, the Scar-Striped
* Legendary Creature Troll Warrior 2/2, 1BG (3)
* Each creature card in your graveyard has scavenge. The scavenge cost is
* equal to its mana cost. (Exile a creature card from your graveyard and
* pay its mana cost: Put a number of +1/+1 counters equal to that card's
* power on target creature. Scavenge only as a sorcery.)
* Sacrifice another creature: Regenerate Varolz, the Scar-Striped.
*
*/
@Test
public void testUseScavenge() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
addCard(Zone.BATTLEFIELD, playerA, "Varolz, the Scar-Striped");
addCard(Zone.BATTLEFIELD, playerA, "Goblin Roughrider");
addCard(Zone.GRAVEYARD, playerA, "Goblin Roughrider");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Scavenge", "Goblin Roughrider");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Goblin Roughrider", 1);
assertGraveyardCount(playerA, "Goblin Roughrider", 0);
assertExileCount("Goblin Roughrider", 1);
assertCounterCount("Goblin Roughrider", CounterType.P1P1, 3);
}
}