XMage 1.4.23V2

This commit is contained in:
LevelX2 2017-04-23 01:57:26 +02:00
parent 74dd2878ed
commit 900e7b29ba
4 changed files with 74 additions and 43 deletions

View file

@ -41,7 +41,7 @@ public class MageVersion implements Serializable, Comparable<MageVersion> {
public final static int MAGE_VERSION_MAJOR = 1;
public final static int MAGE_VERSION_MINOR = 4;
public final static int MAGE_VERSION_PATCH = 23;
public final static String MAGE_VERSION_MINOR_PATCH = "V1";
public final static String MAGE_VERSION_MINOR_PATCH = "V2";
public final static String MAGE_VERSION_INFO = "";
private final int major;

View file

@ -25,7 +25,6 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package org.mage.test.cards.abilities.keywords;
import mage.constants.PhaseStep;
@ -40,25 +39,29 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
public class CyclingTest extends CardTestPlayerBase {
/**
* 702.28. Cycling
* 702.28a Cycling is an activated ability that functions only while the card with cycling is in a players hand.
* Cycling [cost] means [Cost], Discard this card: Draw a card.
* 702.28b Although the cycling ability is playable only if the card is in a players hand, it continues to exist
* while the object is in play and in all other zones. Therefore objects with cycling will be affected by
* effects that depend on objects having one or more activated abilities.
* 702.28c Some cards with cycling have abilities that trigger when theyre cycled. When you cycle [this card] means
* When you discard [this card] to pay a cycling cost. These abilities trigger from whatever zone the card
* winds up in after its cycled.
* 702.28d Typecycling is a variant of the cycling ability. [Type]cycling [cost] means [Cost], Discard this card:
* Search your library for a [type] card, reveal it, and put it into your hand. Then shuffle your library.
* This type is usually a subtype (as in mountaincycling) but can be any card type, subtype, supertype, or
* combination thereof (as in basic landcycling).
* 702.28e Typecycling abilities are cycling abilities, and typecycling costs are cycling costs. Any cards that trigger
* when a player cycles a card will trigger when a card is discarded to pay a typecycling cost. Any effect that
* stops players from cycling cards will stop players from activating cards typecycling abilities. Any effect
* that increases or reduces a cycling cost will increase or reduce a typecycling cost.
* 702.28. Cycling 702.28a Cycling is an activated ability that functions
* only while the card with cycling is in a players hand. Cycling [cost]
* means [Cost], Discard this card: Draw a card. 702.28b Although the
* cycling ability is playable only if the card is in a players hand, it
* continues to exist while the object is in play and in all other zones.
* Therefore objects with cycling will be affected by effects that depend on
* objects having one or more activated abilities. 702.28c Some cards with
* cycling have abilities that trigger when theyre cycled. When you cycle
* [this card] means When you discard [this card] to pay a cycling cost.
* These abilities trigger from whatever zone the card winds up in after
* its cycled. 702.28d Typecycling is a variant of the cycling ability.
* [Type]cycling [cost] means [Cost], Discard this card: Search your
* library for a [type] card, reveal it, and put it into your hand. Then
* shuffle your library. This type is usually a subtype (as in
* mountaincycling) but can be any card type, subtype, supertype, or
* combination thereof (as in basic landcycling). 702.28e Typecycling
* abilities are cycling abilities, and typecycling costs are cycling costs.
* Any cards that trigger when a player cycles a card will trigger when a
* card is discarded to pay a typecycling cost. Any effect that stops
* players from cycling cards will stop players from activating cards
* typecycling abilities. Any effect that increases or reduces a cycling
* cost will increase or reduce a typecycling cost.
*/
@Test
public void cycleAndTriggerTest() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5);
@ -66,7 +69,7 @@ public class CyclingTest extends CardTestPlayerBase {
// Cycling {3}{B}{B}
// When you cycle Decree of Pain, all creatures get -2/-2 until end of turn.
addCard(Zone.HAND, playerA, "Decree of Pain");
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1);
addCard(Zone.BATTLEFIELD, playerB, "Pillarfield Ox", 1);
@ -75,11 +78,11 @@ public class CyclingTest extends CardTestPlayerBase {
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertHandCount(playerA, 1);
assertHandCount(playerA, 1);
assertGraveyardCount(playerA, "Decree of Pain", 1);
assertPermanentCount(playerA, "Silvercoat Lion", 0);
assertPermanentCount(playerB, "Pillarfield Ox", 1);
assertPowerToughness(playerB, "Pillarfield Ox", 0, 2);
}
@ -97,21 +100,21 @@ public class CyclingTest extends CardTestPlayerBase {
// Protection from black
// Cycling {2} ({2}, Discard this card: Draw a card.)
addCard(Zone.BATTLEFIELD, playerB, "Disciple of Grace");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cycling {3}{B}{B}");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Cycling {2}");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertHandCount(playerA, 0);
assertHandCount(playerB, 0);
assertHandCount(playerA, 0);
assertHandCount(playerB, 0);
assertGraveyardCount(playerA, "Decree of Pain", 1);
assertPermanentCount(playerB, "Disciple of Grace", 1);
}
/**
* Type cycling for sliver
*/
@ -122,21 +125,43 @@ public class CyclingTest extends CardTestPlayerBase {
addCard(Zone.BATTLEFIELD, playerA, "Homing Sliver");
// All Sliver creatures have flying.
addCard(Zone.HAND, playerA, "Winged Sliver");
addCard(Zone.LIBRARY, playerA, "Horned Sliver");
addCard(Zone.LIBRARY, playerA, "Silvercoat Lion", 10);
skipInitShuffling();
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Slivercycling {3}");
addTarget(playerA, "Horned Sliver");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertHandCount(playerA, 1);
assertHandCount(playerA, 1);
assertGraveyardCount(playerA, "Winged Sliver", 1);
assertHandCount(playerA, "Horned Sliver", 1); // searched by slivercyclibng
}
@Test
public void cycleWithNewPerspectives() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 6);
// When New Perspectives enters the battlefield, draw three cards.
// As long as you have seven or more cards in hand, you may pay {0} rather than pay cycling costs.
addCard(Zone.HAND, playerA, "New Perspectives"); // Enchantment {5}{U}
// Destroy all artifacts, creatures, and enchantments.
// Cycling ({3}, Discard this card: Draw a card.)
addCard(Zone.HAND, playerA, "Akroma's Vengeance");
addCard(Zone.HAND, playerA, "Island", 3);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "New Perspectives");
activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Cycling");
setChoice(playerA, "Yes");
setStopAt(1, PhaseStep.END_TURN);
execute();
assertGraveyardCount(playerA, "Akroma's Vengeance", 1);
assertHandCount(playerA, 7);
}
}

View file

@ -38,10 +38,11 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
public class FluctuatorTest extends CardTestPlayerBase {
/**
* NOTE: As of 4/19/2017 this test is failing due to a bug in code. See issue #3148
*
* Fluctuator makes 'Akroma's Vengeance' cyclic cost reduced to {1}
* Test it with one Plains on battlefield.
* NOTE: As of 4/19/2017 this test is failing due to a bug in code. See
* issue #3148
*
* Fluctuator makes 'Akroma's Vengeance' cyclic cost reduced to {1} Test it
* with one Plains on battlefield.
*/
@Test
public void testFluctuatorReducedBy2() {
@ -57,6 +58,7 @@ public class FluctuatorTest extends CardTestPlayerBase {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cycling");
setChoice(playerA, "2"); // reduce 2 generic mana
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
@ -81,6 +83,7 @@ public class FluctuatorTest extends CardTestPlayerBase {
addCard(Zone.BATTLEFIELD, playerA, "Fluctuator");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cycling");
setChoice(playerA, "2"); // reduce 1 generic mana
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
@ -90,8 +93,9 @@ public class FluctuatorTest extends CardTestPlayerBase {
}
/**
* NOTE: As of 4/19/2017 this test is failing due to a bug in code. See issue #3148
*
* NOTE: As of 4/19/2017 this test is failing due to a bug in code. See
* issue #3148
*
* Test 2 Fluctuators reduce cycling cost up to 4.
*/
@Test
@ -105,6 +109,8 @@ public class FluctuatorTest extends CardTestPlayerBase {
addCard(Zone.BATTLEFIELD, playerA, "Fluctuator", 2); // 2 copies
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cycling");
setChoice(playerA, "2"); // reduce 2 generic mana
setChoice(playerA, "1"); // reduce 1 generic mana
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();

View file

@ -58,7 +58,7 @@ public enum CardRepository {
// raise this if db structure was changed
private static final long CARD_DB_VERSION = 51;
// raise this if new cards were added to the server
private static final long CARD_CONTENT_VERSION = 76;
private static final long CARD_CONTENT_VERSION = 77;
private final TreeSet<String> landTypes = new TreeSet<>();
private Dao<CardInfo, Object> cardDao;
private Set<String> classNames;
@ -419,7 +419,7 @@ public enum CardRepository {
}
return null;
}
public CardInfo findCardWPreferredSet(String name, String expansion, boolean caseInsensitive) {
List<CardInfo> cards;
if (caseInsensitive) {
@ -436,7 +436,7 @@ public enum CardRepository {
}
}
return findPreferedCoreExpansionCard(name, true);
}
}
public List<CardInfo> findCards(String name) {
try {