mirror of
https://github.com/magefree/mage.git
synced 2025-12-27 22:12:03 -08:00
This reverts commit fe93d68b1c.
This commit is contained in:
parent
66cc15ed4b
commit
4d03deda12
4 changed files with 5 additions and 101 deletions
|
|
@ -60,11 +60,11 @@ public abstract class SearchTargetGraveyardHandLibraryForCardNameAndExileEffect
|
|||
if (cardName != null && controller != null) {
|
||||
Player targetPlayer = game.getPlayer(targetPlayerId);
|
||||
if (targetPlayer != null) {
|
||||
FilterCard filter = new FilterCard("card named \"" + cardName + "\"");
|
||||
FilterCard filter = new FilterCard("card named " + cardName);
|
||||
filter.add(new NamePredicate(cardName));
|
||||
|
||||
// cards in Graveyard
|
||||
int cardsCount = targetPlayer.getGraveyard().count(filter, game);
|
||||
int cardsCount = (cardName.isEmpty() ? 0 : targetPlayer.getGraveyard().count(filter, game));
|
||||
if (cardsCount > 0) {
|
||||
filter.setMessage("card named " + cardName + " in the graveyard of " + targetPlayer.getName());
|
||||
TargetCard target = new TargetCard((graveyardExileOptional ? 0 : cardsCount), cardsCount, Zone.GRAVEYARD, filter);
|
||||
|
|
@ -74,7 +74,7 @@ public abstract class SearchTargetGraveyardHandLibraryForCardNameAndExileEffect
|
|||
}
|
||||
|
||||
// cards in Hand
|
||||
cardsCount = targetPlayer.getHand().count(filter, game);
|
||||
cardsCount = (cardName.isEmpty() ? 0 : targetPlayer.getHand().count(filter, game));
|
||||
filter.setMessage("card named " + cardName + " in the hand of " + targetPlayer.getName());
|
||||
TargetCard target = new TargetCard(0, cardsCount, Zone.HAND, filter);
|
||||
if (controller.choose(Outcome.Exile, targetPlayer.getHand(), target, source, game)) {
|
||||
|
|
@ -84,7 +84,7 @@ public abstract class SearchTargetGraveyardHandLibraryForCardNameAndExileEffect
|
|||
// cards in Library
|
||||
Cards cardsInLibrary = new CardsImpl();
|
||||
cardsInLibrary.addAllCards(targetPlayer.getLibrary().getCards(game));
|
||||
cardsCount = cardsInLibrary.count(filter, game);
|
||||
cardsCount = (cardName.isEmpty() ? 0 : cardsInLibrary.count(filter, game));
|
||||
filter.setMessage("card named " + cardName + " in the library of " + targetPlayer.getLogName());
|
||||
TargetCardInLibrary targetLib = new TargetCardInLibrary(0, cardsCount, filter);
|
||||
if (controller.choose(Outcome.Exile, cardsInLibrary, targetLib, source, game)) {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class NamePredicate implements Predicate<MageObject> {
|
|||
|
||||
@Override
|
||||
public boolean apply(MageObject input, Game game) {
|
||||
if (name == null || name.isEmpty()) {
|
||||
if (name == null) {
|
||||
return false;
|
||||
}
|
||||
// If a player names a card, the player may name either half of a split card, but not both.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue