* Player searches library - The search info is now only put out to game log if the search is not replaced.

This commit is contained in:
LevelX2 2015-01-08 14:35:24 +01:00
parent aa1925051f
commit 59f232fece
2 changed files with 6 additions and 4 deletions

View file

@ -52,8 +52,8 @@ public class PathToExile extends CardImpl {
public PathToExile(UUID ownerId) {
super(ownerId, 15, "Path to Exile", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}");
this.expansionSetCode = "CON";
this.color.setWhite(true);
this.expansionSetCode = "CON";
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new PathToExileEffect());
}

View file

@ -1988,13 +1988,14 @@ public abstract class PlayerImpl implements Player, Serializable {
public boolean searchLibrary(TargetCardInLibrary target, Game game, UUID targetPlayerId) {
//20091005 - 701.14c
Library searchedLibrary = null;
String searchInfo = null;
if (targetPlayerId.equals(playerId)) {
game.informPlayers(new StringBuilder(getName()).append(" searches his or her library").toString());
searchInfo = getName() + " searches his or her library";
searchedLibrary = library;
} else {
Player targetPlayer = game.getPlayer(targetPlayerId);
if (targetPlayer != null) {
game.informPlayers(new StringBuilder(getName()).append(" searches the library of ").append(targetPlayer.getName()).toString());
searchInfo = getName() + " searches the library of " + targetPlayer.getName();
searchedLibrary = targetPlayer.getLibrary();
}
}
@ -2003,6 +2004,7 @@ public abstract class PlayerImpl implements Player, Serializable {
}
GameEvent event = GameEvent.getEvent(GameEvent.EventType.SEARCH_LIBRARY, targetPlayerId, playerId, playerId, Integer.MAX_VALUE);
if (!game.replaceEvent(event)) {
game.informPlayers(searchInfo);
TargetCardInLibrary newTarget = target.copy();
int count;
int librarySearchLimit = event.getAmount();