diff --git a/Mage.Sets/src/mage/sets/fatereforged/GhastlyConscription.java b/Mage.Sets/src/mage/sets/fatereforged/GhastlyConscription.java index f02135eedf..a1e5cedd51 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/GhastlyConscription.java +++ b/Mage.Sets/src/mage/sets/fatereforged/GhastlyConscription.java @@ -108,19 +108,9 @@ class GhastlyConscriptionEffect extends OneShotEffect { Collections.shuffle(cardsToManifest); game.informPlayers(controller.getName() + " shuffles the face-down pile"); for (Card card: cardsToManifest) { - //Manual zone change to keep the cards face-down. - ZoneChangeEvent event = new ZoneChangeEvent(card.getId(), source.getSourceId(), source.getControllerId(), Zone.EXILED, Zone.BATTLEFIELD); - if (!game.replaceEvent(event)) { - game.getExile().removeCard(card, game); - game.rememberLKI(card.getId(), event.getFromZone(), card); - PermanentCard permanent = new PermanentCard(card, event.getPlayerId()); - game.addPermanent(permanent); - game.setZone(card.getId(), Zone.BATTLEFIELD); - game.setScopeRelevant(true); - permanent.entersBattlefield(source.getSourceId(), game, event.getFromZone(), true); - game.setScopeRelevant(false); - game.applyEffects(); - game.fireEvent(new ZoneChangeEvent(permanent, event.getPlayerId(), Zone.EXILED, Zone.BATTLEFIELD)); + if (card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false)) { + game.informPlayers(new StringBuilder(controller.getName()) + .append(" puts facedown card from exile onto the battlefield").toString()); ManaCosts manaCosts = null; if (card.getCardType().contains(CardType.CREATURE)) { manaCosts = card.getSpellAbility().getManaCosts(); @@ -131,7 +121,6 @@ class GhastlyConscriptionEffect extends OneShotEffect { ContinuousEffect effect = new BecomesFaceDownCreatureEffect(manaCosts, true, Duration.Custom, FaceDownType.MANIFESTED); effect.setTargetPointer(new FixedTarget(card.getId())); game.addEffect(effect, source); - game.informPlayers(controller.getName() + " puts facedown card from exile onto the battlefield"); } } return true; diff --git a/Mage.Sets/src/mage/sets/fatereforged/JeskaiInfiltrator.java b/Mage.Sets/src/mage/sets/fatereforged/JeskaiInfiltrator.java index 49288ffabe..ef252aecee 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/JeskaiInfiltrator.java +++ b/Mage.Sets/src/mage/sets/fatereforged/JeskaiInfiltrator.java @@ -54,9 +54,7 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; -import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; -import mage.game.permanent.PermanentCard; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -116,32 +114,23 @@ class JeskaiInfiltratorEffect extends OneShotEffect { List cardsToManifest = new ArrayList<>(2); Permanent sourcePermanent = game.getPermanent(source.getSourceId()); Card sourceCard = game.getCard(source.getSourceId()); - if (sourcePermanent != null && sourceCard != null) { + if (sourcePermanent != null && sourceCard != null) { + player.moveCardToExileWithInfo(sourcePermanent, sourcePermanent.getId(), sourcePermanent.getName(), source.getSourceId(), game, Zone.BATTLEFIELD); sourceCard.setFaceDown(true); - player.moveCardToExileWithInfo(sourcePermanent, null, "", source.getSourceId(), game, Zone.BATTLEFIELD); cardsToManifest.add(sourceCard); } if (player.getLibrary().size() > 0) { Card cardFromLibrary = player.getLibrary().removeFromTop(game); cardFromLibrary.setFaceDown(true); - player.moveCardToExileWithInfo(cardFromLibrary, null, "", source.getSourceId(), game, Zone.LIBRARY); + player.moveCardToExileWithInfo(cardFromLibrary, sourcePermanent.getId(), sourcePermanent.getName(), source.getSourceId(), game, Zone.LIBRARY); cardsToManifest.add(cardFromLibrary); } Collections.shuffle(cardsToManifest); + game.fireUpdatePlayersEvent(); // removes Jeskai from Battlefield, so he returns as a fresh permanent to the battlefield with new position for (Card card : cardsToManifest) { - //Manual zone change to keep the cards face-down. - ZoneChangeEvent event = new ZoneChangeEvent(card.getId(), source.getSourceId(), source.getControllerId(), Zone.EXILED, Zone.BATTLEFIELD); - if (!game.replaceEvent(event)) { - game.getExile().removeCard(card, game); - game.rememberLKI(card.getId(), event.getFromZone(), card); - PermanentCard permanent = new PermanentCard(card, event.getPlayerId()); - game.addPermanent(permanent); - game.setZone(card.getId(), Zone.BATTLEFIELD); - game.setScopeRelevant(true); - permanent.entersBattlefield(source.getSourceId(), game, event.getFromZone(), true); - game.setScopeRelevant(false); - game.applyEffects(); - game.fireEvent(new ZoneChangeEvent(permanent, event.getPlayerId(), Zone.EXILED, Zone.BATTLEFIELD)); + if (card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false)) { + game.informPlayers(new StringBuilder(player.getName()) + .append(" puts facedown card from exile onto the battlefield").toString()); ManaCosts manaCosts = null; if (card.getCardType().contains(CardType.CREATURE)) { manaCosts = card.getSpellAbility().getManaCosts(); @@ -149,11 +138,15 @@ class JeskaiInfiltratorEffect extends OneShotEffect { manaCosts = new ManaCostsImpl<>("{0}"); } } - ContinuousEffect effect = new BecomesFaceDownCreatureEffect(manaCosts, true, Duration.Custom, FaceDownType.MANIFESTED); + ContinuousEffect effect = new BecomesFaceDownCreatureEffect( + manaCosts, + true, + Duration.Custom, + FaceDownType.MANIFESTED + ); effect.setTargetPointer(new FixedTarget(card.getId())); game.addEffect(effect, source); - game.informPlayers(new StringBuilder(player.getName()) - .append(" puts facedown card from exile onto the battlefield").toString()); + } } return true; diff --git a/Mage/src/mage/abilities/effects/common/continious/BecomesFaceDownCreatureEffect.java b/Mage/src/mage/abilities/effects/common/continious/BecomesFaceDownCreatureEffect.java index 96761f2529..24d81a422e 100644 --- a/Mage/src/mage/abilities/effects/common/continious/BecomesFaceDownCreatureEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/BecomesFaceDownCreatureEffect.java @@ -149,7 +149,6 @@ public class BecomesFaceDownCreatureEffect extends ContinuousEffectImpl implemen permanent.getCardType().clear(); permanent.getCardType().add(CardType.CREATURE); permanent.getSubtype().clear(); - permanent.getManaCost().clear(); break; case ColorChangingEffects_5: permanent.getColor().setColor(new ObjectColor()); diff --git a/Mage/src/mage/game/permanent/PermanentCard.java b/Mage/src/mage/game/permanent/PermanentCard.java index 5918fb6b85..1e209403ab 100644 --- a/Mage/src/mage/game/permanent/PermanentCard.java +++ b/Mage/src/mage/game/permanent/PermanentCard.java @@ -264,7 +264,7 @@ public class PermanentCard extends PermanentImpl { public ManaCosts getManaCost() { if (isFaceDown()) { // face down permanent has always {0} mana costs manaCost.clear(); - manaCost.add(new GenericManaCost(0)); + return manaCost; } return super.getManaCost(); }