diff --git a/Mage.Sets/src/mage/sets/bornofthegods/Peregrination.java b/Mage.Sets/src/mage/sets/bornofthegods/Peregrination.java index a5dc610a0c..3897013aaf 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/Peregrination.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/Peregrination.java @@ -113,18 +113,20 @@ class PeregrinationEffect extends OneShotEffect { target2.setRequired(true); player.choose(Outcome.Benefit, revealed, target2, game); Card card = revealed.get(target2.getFirstTarget(), game); - card.putOntoBattlefield(game, Zone.LIBRARY, source.getId(), source.getControllerId()); + + player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + revealed.remove(card); Permanent permanent = game.getPermanent(card.getId()); if (permanent != null) { permanent.setTapped(true); } card = revealed.getCards(game).iterator().next(); - card.moveToZone(Zone.HAND, source.getId(), game, false); + player.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY); } else if (target.getTargets().size() == 1) { Card card = revealed.getCards(game).iterator().next(); - card.putOntoBattlefield(game, Zone.LIBRARY, source.getId(), source.getControllerId()); + player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); Permanent permanent = game.getPermanent(card.getId()); if (permanent != null) { permanent.setTapped(true); diff --git a/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToHandTargetEffect.java b/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToHandTargetEffect.java index 6010e95193..5de27373eb 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToHandTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToHandTargetEffect.java @@ -72,9 +72,11 @@ public class ReturnFromGraveyardToHandTargetEffect extends OneShotEffect { * @param card */ UUID getCommanderId(); + + /** + * Uses card.moveToZone and posts a inform message about moving the card + * into the game log + * + * @param card + * @param sourceId + * @param game + * @param fromZone if null, this info isn't postet + * @return + */ + boolean moveCardToHandWithInfo(Card card, UUID sourceId, Game game, Zone fromZone); + + /** + * Uses putOntoBattlefield and posts also a info message about in the game log + * + * @param card + * @param game + * @param fromZone + * @param sourceId + * @param game + * @return + */ + boolean putOntoBattlefieldWithInfo(Card card, Game game, Zone fromZone, UUID sourceId); + } diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index 2ef5706a8a..5c8338cfc3 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -35,6 +35,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Map.Entry; import java.util.Random; @@ -2091,4 +2092,36 @@ public abstract class PlayerImpl> implements Player, Ser public UUID getCommanderId() { return this.commanderId; } + + /** + * {@inheritDoc} + */ + @Override + public boolean moveCardToHandWithInfo(Card card, UUID sourceId, Game game, Zone fromZone) { + boolean result = false; + if (card.moveToZone(Zone.HAND, sourceId, game, false)) { + game.informPlayers(new StringBuilder(this.getName()) + .append(" puts ").append(card.getName()).append(" ") + .append(fromZone != null ? new StringBuilder("from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(" "):"") + .append("onto his or her hand").toString()); + } + return result; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean putOntoBattlefieldWithInfo(Card card, Game game, Zone fromZone, UUID sourceId) { + boolean result = false; + if (card.putOntoBattlefield(game, fromZone, sourceId, this.getId())) { + game.informPlayers(new StringBuilder(this.getName()) + .append(" puts ").append(card.getName()) + .append("from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(" ") + .append("onto the Battlefield").toString()); + } + return result; + } + + }