* Game log - Some minor changes to card move game log messages.

This commit is contained in:
LevelX2 2014-06-02 14:58:06 +02:00
parent 55d9809b6c
commit 7198804796
2 changed files with 19 additions and 15 deletions

View file

@ -34,6 +34,7 @@ import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
* @author Loki
@ -64,21 +65,24 @@ public class ReturnToHandSourceEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Card card = game.getCard(source.getSourceId());
if (card != null) {
switch (game.getState().getZone(card.getId())) {
case BATTLEFIELD:
Permanent p = game.getPermanent(source.getSourceId());
if (p != null) {
return p.moveToZone(Zone.HAND, source.getId(), game, false);
}
break;
case GRAVEYARD:
if (!fromBattlefieldOnly) {
return card.moveToZone(Zone.HAND, source.getId(), game, true);
}
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Card card = game.getCard(source.getSourceId());
if (card != null) {
switch (game.getState().getZone(card.getId())) {
case BATTLEFIELD:
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.BATTLEFIELD);
}
break;
case GRAVEYARD:
if (!fromBattlefieldOnly) {
controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD);
}
}
}
}
}
return false;
}

View file

@ -2236,7 +2236,7 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
boolean result = false;
if (card.moveToZone(Zone.HAND, sourceId, game, false)) {
game.informPlayers(new StringBuilder(this.getName())
.append(" puts ").append(card.getName()).append(" ")
.append(" puts ").append(card.isFaceDown() ? " a face down card":card.getName()).append(" ")
.append(fromZone != null ? new StringBuilder("from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(" "):"")
.append(card.getOwnerId().equals(this.getId()) ? "into his or her hand":"into its owner's hand").toString());
result = true;