mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 03:51:58 -08:00
- Fixed Starfield of Nyx test.
This commit is contained in:
parent
b11e2a0fe9
commit
7cbf999e9b
2 changed files with 38 additions and 32 deletions
|
|
@ -4,7 +4,8 @@ import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.effects.ContinuousEffect;
|
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||||
|
import mage.abilities.decorator.ConditionalContinuousEffect;
|
||||||
import mage.abilities.effects.ContinuousEffectImpl;
|
import mage.abilities.effects.ContinuousEffectImpl;
|
||||||
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
|
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
|
@ -56,7 +57,9 @@ public final class StarfieldOfNyx extends CardImpl {
|
||||||
// As long as you control five or more enchantments, each other non-Aura enchantment
|
// As long as you control five or more enchantments, each other non-Aura enchantment
|
||||||
// you control is a creature in addition to its other types and has base power and
|
// you control is a creature in addition to its other types and has base power and
|
||||||
// base toughness each equal to its converted mana cost.
|
// base toughness each equal to its converted mana cost.
|
||||||
ContinuousEffect effect = new StarfieldOfNyxEffect();
|
ConditionalContinuousEffect effect = new ConditionalContinuousEffect(
|
||||||
|
new StarfieldOfNyxEffect(), new PermanentsOnTheBattlefieldCondition(
|
||||||
|
filterEnchantmentYouControl, ComparisonType.MORE_THAN, 4), rule1);
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
|
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -106,34 +109,31 @@ public final class StarfieldOfNyx extends CardImpl {
|
||||||
filter.add(CardType.ENCHANTMENT.getPredicate());
|
filter.add(CardType.ENCHANTMENT.getPredicate());
|
||||||
filter.add(Predicates.not(SubType.AURA.getPredicate()));
|
filter.add(Predicates.not(SubType.AURA.getPredicate()));
|
||||||
filter.add(AnotherPredicate.instance);
|
filter.add(AnotherPredicate.instance);
|
||||||
if (game.getState().getBattlefield().getActivePermanents(filter2,
|
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter,
|
||||||
source.getControllerId(), source.getSourceId(), game).size() > 4) {
|
source.getControllerId(), source.getSourceId(), game)) {
|
||||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter,
|
switch (layer) {
|
||||||
source.getControllerId(), source.getSourceId(), game)) {
|
case TypeChangingEffects_4:
|
||||||
switch (layer) {
|
if (sublayer == SubLayer.NA) {
|
||||||
case TypeChangingEffects_4:
|
if (!permanent.isCreature()
|
||||||
if (sublayer == SubLayer.NA) {
|
|
||||||
if (!permanent.isCreature()
|
|
||||||
&& !permanent.getSubtype(game).contains(SubType.AURA)) {
|
|
||||||
permanent.addCardType(CardType.CREATURE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PTChangingEffects_7:
|
|
||||||
if (sublayer == SubLayer.SetPT_7b
|
|
||||||
&& permanent.isCreature()
|
|
||||||
&& !permanent.getSubtype(game).contains(SubType.AURA)) {
|
&& !permanent.getSubtype(game).contains(SubType.AURA)) {
|
||||||
int manaCost = permanent.getConvertedManaCost();
|
permanent.addCardType(CardType.CREATURE);
|
||||||
permanent.getPower().setValue(manaCost);
|
|
||||||
permanent.getToughness().setValue(manaCost);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PTChangingEffects_7:
|
||||||
|
if (sublayer == SubLayer.SetPT_7b
|
||||||
|
&& permanent.isCreature()
|
||||||
|
&& !permanent.getSubtype(game).contains(SubType.AURA)) {
|
||||||
|
int manaCost = permanent.getConvertedManaCost();
|
||||||
|
permanent.getPower().setValue(manaCost);
|
||||||
|
permanent.getToughness().setValue(manaCost);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,8 @@ public class StarfieldOfNyxTest extends CardTestPlayerBase {
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testCloudform() {
|
public void testCloudform() {
|
||||||
// At the beginning of your upkeep, if you control an artifact, put a 1/1 colorless Thopter artifact creature token with flying onto the battlefield.
|
// At the beginning of your upkeep, if you control an artifact, put a 1/1
|
||||||
|
// colorless Thopter artifact creature token with flying onto the battlefield.
|
||||||
// Whenever one or more artifact creatures you control deal combat damage to a player, draw a card.
|
// Whenever one or more artifact creatures you control deal combat damage to a player, draw a card.
|
||||||
addCard(Zone.BATTLEFIELD, playerA, "Thopter Spy Network", 2); // {2}{U}{U} - added to come to 5 enchantments on the battlefield
|
addCard(Zone.BATTLEFIELD, playerA, "Thopter Spy Network", 2); // {2}{U}{U} - added to come to 5 enchantments on the battlefield
|
||||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 8);
|
addCard(Zone.BATTLEFIELD, playerA, "Island", 8);
|
||||||
|
|
@ -34,7 +35,8 @@ public class StarfieldOfNyxTest extends CardTestPlayerBase {
|
||||||
// As long as you control five or more enchantments, each other non-Aura enchantment you control is a creature in
|
// As long as you control five or more enchantments, each other non-Aura enchantment you control is a creature in
|
||||||
// addition to its other types and has base power and base toughness each equal to its converted mana cost.
|
// addition to its other types and has base power and base toughness each equal to its converted mana cost.
|
||||||
addCard(Zone.HAND, playerA, "Starfield of Nyx"); // "{4}{W}"
|
addCard(Zone.HAND, playerA, "Starfield of Nyx"); // "{4}{W}"
|
||||||
// When Cloudform enters the battlefield, it becomes an Aura with enchant creature. Manifest the top card of your library and attach Cloudform to it.
|
// When Cloudform enters the battlefield, it becomes an Aura with enchant creature.
|
||||||
|
// Manifest the top card of your library and attach Cloudform to it.
|
||||||
// Enchanted creature has flying and hexproof.
|
// Enchanted creature has flying and hexproof.
|
||||||
addCard(Zone.HAND, playerA, "Cloudform"); // {1}{U}{U}
|
addCard(Zone.HAND, playerA, "Cloudform"); // {1}{U}{U}
|
||||||
addCard(Zone.GRAVEYARD, playerA, "Cloudform");
|
addCard(Zone.GRAVEYARD, playerA, "Cloudform");
|
||||||
|
|
@ -46,9 +48,11 @@ public class StarfieldOfNyxTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
setStopAt(3, PhaseStep.PRECOMBAT_MAIN);
|
setStopAt(3, PhaseStep.PRECOMBAT_MAIN);
|
||||||
execute();
|
execute();
|
||||||
|
assertAllCommandsUsed();
|
||||||
|
|
||||||
assertGraveyardCount(playerA, "Thopter Spy Network", 0);
|
assertGraveyardCount(playerA, "Thopter Spy Network", 0);
|
||||||
assertPowerToughness(playerA, EmptyNames.FACE_DOWN_CREATURE.toString(), 2, 2, Filter.ComparisonScope.All); // the manifested cards
|
assertPowerToughness(playerA, EmptyNames.FACE_DOWN_CREATURE.toString(),
|
||||||
|
2, 2, Filter.ComparisonScope.All); // the manifested cards
|
||||||
assertPermanentCount(playerA, "Starfield of Nyx", 1);
|
assertPermanentCount(playerA, "Starfield of Nyx", 1);
|
||||||
assertPowerToughness(playerA, "Thopter Spy Network", 4, 4, Filter.ComparisonScope.All);
|
assertPowerToughness(playerA, "Thopter Spy Network", 4, 4, Filter.ComparisonScope.All);
|
||||||
assertPermanentCount(playerA, "Cloudform", 2);
|
assertPermanentCount(playerA, "Cloudform", 2);
|
||||||
|
|
@ -62,7 +66,8 @@ public class StarfieldOfNyxTest extends CardTestPlayerBase {
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testHexproof() {
|
public void testHexproof() {
|
||||||
// At the beginning of your upkeep, if you control an artifact, put a 1/1 colorless Thopter artifact creature token with flying onto the battlefield.
|
// At the beginning of your upkeep, if you control an artifact, put a 1/1 colorless
|
||||||
|
// Thopter artifact creature token with flying onto the battlefield.
|
||||||
// Whenever one or more artifact creatures you control deal combat damage to a player, draw a card.
|
// Whenever one or more artifact creatures you control deal combat damage to a player, draw a card.
|
||||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 5);
|
addCard(Zone.BATTLEFIELD, playerA, "Plains", 5);
|
||||||
// At the beginning of your upkeep, you may return target enchantment card from your graveyard to the battlefield.
|
// At the beginning of your upkeep, you may return target enchantment card from your graveyard to the battlefield.
|
||||||
|
|
@ -102,14 +107,15 @@ public class StarfieldOfNyxTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
addCard(Zone.BATTLEFIELD, playerA, "Starfield of Nyx"); // enchantments you control become creatures
|
addCard(Zone.BATTLEFIELD, playerA, "Starfield of Nyx"); // enchantments you control become creatures
|
||||||
addCard(Zone.BATTLEFIELD, playerA, "Humility"); // creatures lose all abilities and are 1/1
|
addCard(Zone.BATTLEFIELD, playerA, "Humility"); // creatures lose all abilities and are 1/1
|
||||||
addCard(Zone.BATTLEFIELD, playerA, "Pharika, God of Affliction"); // enchantment
|
addCard(Zone.BATTLEFIELD, playerA, "Master of the Feast"); // enchantment creature 5/5
|
||||||
addCard(Zone.BATTLEFIELD, playerA, "Emrakul, the Aeons Torn"); //15/15 creature
|
addCard(Zone.BATTLEFIELD, playerA, "Emrakul, the Aeons Torn"); //15/15 creature
|
||||||
addCard(Zone.BATTLEFIELD, playerA, "Crusade", 4); // enchantments to fulfill requirement of Starfield of Nyx
|
addCard(Zone.BATTLEFIELD, playerA, "Crusade", 4); // enchantments to fulfill requirement of Starfield of Nyx
|
||||||
|
|
||||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||||
execute();
|
execute();
|
||||||
|
assertAllCommandsUsed();
|
||||||
|
|
||||||
assertPowerToughness(playerA, "Pharika, God of Affliction", 3, 3, Filter.ComparisonScope.All);
|
assertPowerToughness(playerA, "Master of the Feast", 3, 3, Filter.ComparisonScope.All);
|
||||||
assertPowerToughness(playerA, "Humility", 4, 4, Filter.ComparisonScope.All);
|
assertPowerToughness(playerA, "Humility", 4, 4, Filter.ComparisonScope.All);
|
||||||
// Humility loses its ability in layer 6. Layer 7 never gets Humility's effect
|
// Humility loses its ability in layer 6. Layer 7 never gets Humility's effect
|
||||||
assertPowerToughness(playerA, "Emrakul, the Aeons Torn", 15, 15, Filter.ComparisonScope.All); // PT not affected
|
assertPowerToughness(playerA, "Emrakul, the Aeons Torn", 15, 15, Filter.ComparisonScope.All); // PT not affected
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue