mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 12:02:01 -08:00
Fixed that to manifest an aura enchantments did not work correctly.
This commit is contained in:
parent
b7b54cd464
commit
1b90730aeb
3 changed files with 46 additions and 2 deletions
|
|
@ -251,5 +251,40 @@ public class ManifestTest extends CardTestPlayerBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Qarsi High Priest went to manifest Illusory Gains,
|
||||||
|
// but it made me choose a target for gains, then enchanted the card to that creature.
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testManifestAura() {
|
||||||
|
|
||||||
|
addCard(Zone.BATTLEFIELD, playerB, "Swamp", 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);
|
||||||
|
|
||||||
|
addCard(Zone.LIBRARY, playerB, "Illusory Gains", 1);
|
||||||
|
addCard(Zone.LIBRARY, playerB, "Mountain", 1);
|
||||||
|
|
||||||
|
skipInitShuffling();
|
||||||
|
|
||||||
|
activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{1}{B},{T}, Sacrifice another creature");
|
||||||
|
addTarget(playerB, "Silvercoat Lion");
|
||||||
|
|
||||||
|
setStopAt(2, PhaseStep.BEGIN_COMBAT);
|
||||||
|
execute();
|
||||||
|
|
||||||
|
// no life gain
|
||||||
|
assertLife(playerA, 20);
|
||||||
|
assertLife(playerB, 20);
|
||||||
|
|
||||||
|
assertGraveyardCount(playerB, "Illusory Gains", 0);
|
||||||
|
assertGraveyardCount(playerB, "Silvercoat Lion", 1);
|
||||||
|
|
||||||
|
|
||||||
|
// a facedown creature is on the battlefield
|
||||||
|
assertPermanentCount(playerB, "face down creature", 1);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ public class ManifestEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MageObjectReference objectReference= new MageObjectReference(card.getId(), card.getZoneChangeCounter() +1, game);
|
MageObjectReference objectReference= new MageObjectReference(card.getId(), card.getZoneChangeCounter() +1, game);
|
||||||
game.addEffect(new BecomesFaceDownCreatureEffect(manaCosts, objectReference, Duration.Custom, FaceDownType.MANIFESTED), newSource);
|
game.addEffect(new BecomesFaceDownCreatureEffect(manaCosts, objectReference, Duration.Custom, FaceDownType.MANIFESTED), newSource);
|
||||||
controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, newSource.getSourceId(), false, true);
|
controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, newSource.getSourceId(), false, true);
|
||||||
Permanent permanent = game.getPermanent(card.getId());
|
Permanent permanent = game.getPermanent(card.getId());
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
|
|
|
||||||
|
|
@ -499,7 +499,13 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
||||||
@Override
|
@Override
|
||||||
public boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId, boolean tapped, boolean facedown, ArrayList<UUID> appliedEffects){
|
public boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId, boolean tapped, boolean facedown, ArrayList<UUID> appliedEffects){
|
||||||
ZoneChangeEvent event = new ZoneChangeEvent(this.objectId, sourceId, controllerId, fromZone, Zone.BATTLEFIELD, appliedEffects, tapped);
|
ZoneChangeEvent event = new ZoneChangeEvent(this.objectId, sourceId, controllerId, fromZone, Zone.BATTLEFIELD, appliedEffects, tapped);
|
||||||
|
if (facedown) {
|
||||||
|
this.setFaceDown(true, game);
|
||||||
|
}
|
||||||
if (!game.replaceEvent(event)) {
|
if (!game.replaceEvent(event)) {
|
||||||
|
if (facedown) {
|
||||||
|
this.setFaceDown(false, game);
|
||||||
|
}
|
||||||
if (fromZone != null) {
|
if (fromZone != null) {
|
||||||
boolean removed = false;
|
boolean removed = false;
|
||||||
switch (fromZone) {
|
switch (fromZone) {
|
||||||
|
|
@ -546,6 +552,9 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
||||||
game.fireEvent(new ZoneChangeEvent(permanent, event.getPlayerId(), fromZone, Zone.BATTLEFIELD));
|
game.fireEvent(new ZoneChangeEvent(permanent, event.getPlayerId(), fromZone, Zone.BATTLEFIELD));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (facedown) {
|
||||||
|
this.setFaceDown(false, game);
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue