mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 11:32:00 -08:00
* Fixed a bug that non permanent cards could be moved to battlefield instead of staying in the zone they are.
This commit is contained in:
parent
82fa86cc24
commit
22e6fee101
4 changed files with 94 additions and 4 deletions
|
|
@ -27,7 +27,7 @@ public final class ParadiseMantle extends CardImpl {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{0}");
|
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{0}");
|
||||||
this.subtype.add(SubType.EQUIPMENT);
|
this.subtype.add(SubType.EQUIPMENT);
|
||||||
|
|
||||||
// Equipped creature has "{tap}: Add one mana of any color."
|
// Equipped creature has "{T}: Add one mana of any color."
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
|
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
|
||||||
new GainAbilityAttachedEffect(new AnyColorManaAbility(new TapSourceCost()), AttachmentType.EQUIPMENT, Duration.WhileOnBattlefield)));
|
new GainAbilityAttachedEffect(new AnyColorManaAbility(new TapSourceCost()), AttachmentType.EQUIPMENT, Duration.WhileOnBattlefield)));
|
||||||
// Equip {1}
|
// Equip {1}
|
||||||
|
|
|
||||||
|
|
@ -482,4 +482,56 @@ public class ManifestTest extends CardTestPlayerBase {
|
||||||
assertHandCount(playerB, "Mountain", 1);
|
assertHandCount(playerB, "Mountain", 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test_ManifestSorceryAndBlinkIt() {
|
||||||
|
|
||||||
|
addCard(Zone.BATTLEFIELD, playerB, "Swamp", 1);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerB, "Plains", 2);
|
||||||
|
|
||||||
|
// {1}{B}, {T}, Sacrifice another creature: Manifest the top card of your library.
|
||||||
|
addCard(Zone.BATTLEFIELD, playerB, "Qarsi High Priest", 1);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
|
||||||
|
|
||||||
|
// Exile target creature you control, then return that card to the battlefield under your control.
|
||||||
|
addCard(Zone.HAND, playerB, "Cloudshift", 1); //Instant {W}
|
||||||
|
|
||||||
|
|
||||||
|
// Devoid
|
||||||
|
// Flying
|
||||||
|
// At the beginning of your upkeep, sacrifice a creature
|
||||||
|
// Whenever you sacrifice a creature, draw a card.
|
||||||
|
addCard(Zone.LIBRARY, playerB, "Mountain", 1);
|
||||||
|
addCard(Zone.LIBRARY, playerB, "Lightning Bolt", 1);
|
||||||
|
addCard(Zone.LIBRARY, playerB, "Mountain", 1);
|
||||||
|
|
||||||
|
skipInitShuffling();
|
||||||
|
|
||||||
|
activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{1}{B}, {T}, Sacrifice another creature");
|
||||||
|
setChoice(playerB, "Silvercoat Lion");
|
||||||
|
|
||||||
|
waitStackResolved(2, PhaseStep.PRECOMBAT_MAIN, playerB);
|
||||||
|
|
||||||
|
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Cloudshift", EmptyNames.FACE_DOWN_CREATURE.toString());
|
||||||
|
|
||||||
|
setStrictChooseMode(true);
|
||||||
|
setStopAt(2, PhaseStep.END_TURN);
|
||||||
|
execute();
|
||||||
|
assertAllCommandsUsed();
|
||||||
|
|
||||||
|
// no life gain
|
||||||
|
assertLife(playerA, 20);
|
||||||
|
assertLife(playerB, 20);
|
||||||
|
|
||||||
|
assertPermanentCount(playerB, "Qarsi High Priest", 1);
|
||||||
|
|
||||||
|
assertGraveyardCount(playerB, "Silvercoat Lion", 1);
|
||||||
|
assertGraveyardCount(playerB, "Cloudshift", 1);
|
||||||
|
|
||||||
|
assertPermanentCount(playerB, "Lightning Bolt", 0);
|
||||||
|
assertExileCount(playerB, "Lightning Bolt", 1);
|
||||||
|
|
||||||
|
assertHandCount(playerB, "Mountain", 1);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import mage.abilities.mana.ManaOptions;
|
||||||
import mage.constants.PhaseStep;
|
import mage.constants.PhaseStep;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.counters.CounterType;
|
import mage.counters.CounterType;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
@ -309,5 +310,35 @@ public class TappedForManaRelatedTest extends CardTestPlayerBase {
|
||||||
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
|
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
|
||||||
assertManaOptions("{B}{B}{B}{B}{B}", manaOptions);
|
assertManaOptions("{B}{B}{B}{B}{B}", manaOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void TestParadiseMantle() {
|
||||||
|
setStrictChooseMode(true);
|
||||||
|
|
||||||
|
// Equipped creature has "{T}: Add one mana of any color."
|
||||||
|
// Equip {1}
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Paradise Mantle", 1); // Creature {1}{B} 1/2
|
||||||
|
|
||||||
|
// Flying;
|
||||||
|
// {2}, {untap}: Add one mana of any color.
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Pili-Pala", 1); // Artifact Creature (1/1)
|
||||||
|
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
|
||||||
|
|
||||||
|
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip");
|
||||||
|
addTarget(playerA, "Pili-Pala"); // Select a creature you control
|
||||||
|
|
||||||
|
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||||
|
execute();
|
||||||
|
|
||||||
|
assertAllCommandsUsed();
|
||||||
|
|
||||||
|
Permanent pp = getPermanent("Pili-Pala");
|
||||||
|
Assert.assertTrue("Pili-Pala has 1 attachment", pp.getAttachments().size() == 1);
|
||||||
|
|
||||||
|
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
|
||||||
|
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
|
||||||
|
assertManaOptions("{Any}", manaOptions);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import mage.players.Player;
|
||||||
import mage.target.TargetCard;
|
import mage.target.TargetCard;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import mage.abilities.keyword.TransformAbility;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by samuelsandeen on 9/6/16.
|
* Created by samuelsandeen on 9/6/16.
|
||||||
|
|
@ -53,7 +54,7 @@ public final class ZonesHandler {
|
||||||
|
|
||||||
public static List<ZoneChangeInfo> moveCards(List<ZoneChangeInfo> zoneChangeInfos, Game game) {
|
public static List<ZoneChangeInfo> moveCards(List<ZoneChangeInfo> zoneChangeInfos, Game game) {
|
||||||
// Handle Unmelded Meld Cards
|
// Handle Unmelded Meld Cards
|
||||||
for (ListIterator<ZoneChangeInfo> itr = zoneChangeInfos.listIterator(); itr.hasNext(); ) {
|
for (ListIterator<ZoneChangeInfo> itr = zoneChangeInfos.listIterator(); itr.hasNext();) {
|
||||||
ZoneChangeInfo info = itr.next();
|
ZoneChangeInfo info = itr.next();
|
||||||
MeldCard card = game.getMeldCard(info.event.getTargetId());
|
MeldCard card = game.getMeldCard(info.event.getTargetId());
|
||||||
// Copies should be handled as normal cards.
|
// Copies should be handled as normal cards.
|
||||||
|
|
@ -202,7 +203,7 @@ public final class ZonesHandler {
|
||||||
if (info instanceof ZoneChangeInfo.Unmelded) {
|
if (info instanceof ZoneChangeInfo.Unmelded) {
|
||||||
ZoneChangeInfo.Unmelded unmelded = (ZoneChangeInfo.Unmelded) info;
|
ZoneChangeInfo.Unmelded unmelded = (ZoneChangeInfo.Unmelded) info;
|
||||||
MeldCard meld = game.getMeldCard(info.event.getTargetId());
|
MeldCard meld = game.getMeldCard(info.event.getTargetId());
|
||||||
for (Iterator<ZoneChangeInfo> itr = unmelded.subInfo.iterator(); itr.hasNext(); ) {
|
for (Iterator<ZoneChangeInfo> itr = unmelded.subInfo.iterator(); itr.hasNext();) {
|
||||||
ZoneChangeInfo subInfo = itr.next();
|
ZoneChangeInfo subInfo = itr.next();
|
||||||
if (!maybeRemoveFromSourceZone(subInfo, game)) {
|
if (!maybeRemoveFromSourceZone(subInfo, game)) {
|
||||||
itr.remove();
|
itr.remove();
|
||||||
|
|
@ -230,6 +231,12 @@ public final class ZonesHandler {
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
if (info.faceDown) {
|
if (info.faceDown) {
|
||||||
card.setFaceDown(true, game);
|
card.setFaceDown(true, game);
|
||||||
|
} else if (info.event.getToZone().equals(Zone.BATTLEFIELD)) {
|
||||||
|
if (!card.isPermanent()
|
||||||
|
&& (!card.isTransformable() || Boolean.FALSE.equals(game.getState().getValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + card.getId())))) {
|
||||||
|
// Non permanents (Instants, Sorceries, ... stay in the zone they are if an abilty/effect tries to move it to the battlefield
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!game.replaceEvent(event)) {
|
if (!game.replaceEvent(event)) {
|
||||||
Zone fromZone = event.getFromZone();
|
Zone fromZone = event.getFromZone();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue