Fix multiple cards not saying which revealed cards were chosen to put into hand. Closes #9949

This commit is contained in:
PurpleCrowbar 2023-03-12 22:01:11 +00:00
parent e2271d79fb
commit 03b82ff7ee
10 changed files with 36 additions and 10 deletions

View file

@ -89,8 +89,7 @@ class AtraxaGrandUnifierEffect extends OneShotEffect {
TargetCard target = new AtraxaGrandUnifierTarget(); TargetCard target = new AtraxaGrandUnifierTarget();
player.choose(outcome, cards, target, game); player.choose(outcome, cards, target, game);
Cards toHand = new CardsImpl(target.getTargets()); Cards toHand = new CardsImpl(target.getTargets());
player.revealCards(source, toHand, game); player.moveCardsToHandWithInfo(toHand, source, game, true);
player.moveCards(toHand, Zone.HAND, source, game);
cards.retainZone(Zone.LIBRARY, game); cards.retainZone(Zone.LIBRARY, game);
player.putCardsOnBottomOfLibrary(cards, game, source, false); player.putCardsOnBottomOfLibrary(cards, game, source, false);
return true; return true;

View file

@ -84,7 +84,7 @@ class BountyOfSkemfarEffect extends OneShotEffect {
player.choose(outcome, cards, target, game); player.choose(outcome, cards, target, game);
Card elf = cards.get(target.getFirstTarget(), game); Card elf = cards.get(target.getFirstTarget(), game);
if (elf != null) { if (elf != null) {
player.moveCards(elf, Zone.HAND, source, game); player.moveCardToHandWithInfo(elf, source, game, true);
} }
cards.removeIf(uuid -> game.getState().getZone(uuid) != Zone.LIBRARY); cards.removeIf(uuid -> game.getState().getZone(uuid) != Zone.LIBRARY);
player.putCardsOnBottomOfLibrary(cards, game, source, false); player.putCardsOnBottomOfLibrary(cards, game, source, false);

View file

@ -94,7 +94,7 @@ class HurkylMasterWizardEffect extends OneShotEffect {
TargetCard target = new HurkylMasterWizardTarget(source, game); TargetCard target = new HurkylMasterWizardTarget(source, game);
player.choose(outcome, cards, target, game); player.choose(outcome, cards, target, game);
Cards toHand = new CardsImpl(target.getTargets()); Cards toHand = new CardsImpl(target.getTargets());
player.moveCards(toHand, Zone.HAND, source, game); player.moveCardsToHandWithInfo(toHand, source, game, true);
cards.retainZone(Zone.LIBRARY, game); cards.retainZone(Zone.LIBRARY, game);
player.putCardsOnBottomOfLibrary(cards, game, source, false); player.putCardsOnBottomOfLibrary(cards, game, source, false);
return true; return true;

View file

@ -78,7 +78,7 @@ class InscribedTabletEffect extends OneShotEffect {
Card land = game.getCard(target.getFirstTarget()); Card land = game.getCard(target.getFirstTarget());
if (land != null) { if (land != null) {
cards.remove(land); cards.remove(land);
landToHand = controller.moveCards(land, Zone.HAND, source, game); landToHand = controller.moveCardToHandWithInfo(land, source, game, true);
} }
} }
controller.putCardsOnBottomOfLibrary(cards, game, source, false); controller.putCardsOnBottomOfLibrary(cards, game, source, false);

View file

@ -86,10 +86,7 @@ class NivMizzetRebornEffect extends OneShotEffect {
TargetCard target = new NivMizzetRebornTarget(); TargetCard target = new NivMizzetRebornTarget();
player.choose(outcome, cards, target, game); player.choose(outcome, cards, target, game);
Cards toHand = new CardsImpl(target.getTargets()); Cards toHand = new CardsImpl(target.getTargets());
player.moveCards(toHand, Zone.HAND, source, game); player.moveCardsToHandWithInfo(toHand, source, game, true);
game.informPlayers(player.getLogName() + " moves " + CardUtil.concatWithAnd(
toHand.getCards(game).stream().map(MageObject::getName).collect(Collectors.toList())
) + " to hand");
cards.retainZone(Zone.LIBRARY, game); cards.retainZone(Zone.LIBRARY, game);
player.putCardsOnBottomOfLibrary(cards, game, source, false); player.putCardsOnBottomOfLibrary(cards, game, source, false);
return true; return true;

View file

@ -95,7 +95,7 @@ class TajuruParagonEffect extends OneShotEffect {
player.choose(outcome, cards, target, game); player.choose(outcome, cards, target, game);
Card card = game.getCard(target.getFirstTarget()); Card card = game.getCard(target.getFirstTarget());
if (card != null) { if (card != null) {
player.moveCards(card, Zone.HAND, source, game); player.moveCardToHandWithInfo(card, source, game, true);
cards.remove(card); cards.remove(card);
} }
} }

View file

@ -3813,6 +3813,11 @@ public class TestPlayer implements Player {
return computerPlayer.moveCardToHandWithInfo(card, source, game, withName); return computerPlayer.moveCardToHandWithInfo(card, source, game, withName);
} }
@Override
public boolean moveCardsToHandWithInfo(Cards cards, Ability source, Game game, boolean withName) {
return computerPlayer.moveCardsToHandWithInfo(cards, source, game, withName);
}
@Override @Override
public boolean moveCardsToExile(Card card, Ability source, Game game, boolean withName, UUID exileId, String exileZoneName) { public boolean moveCardsToExile(Card card, Ability source, Game game, boolean withName, UUID exileId, String exileZoneName) {
return computerPlayer.moveCardsToExile(card, source, game, withName, exileId, exileZoneName); return computerPlayer.moveCardsToExile(card, source, game, withName, exileId, exileZoneName);

View file

@ -1204,6 +1204,11 @@ public class PlayerStub implements Player {
return false; return false;
} }
@Override
public boolean moveCardsToHandWithInfo(Cards cards, Ability source, Game game, boolean withName) {
return false;
}
@Override @Override
public boolean moveCardToExileWithInfo(Card card, UUID exileId, String exileName, Ability source, Game game, Zone fromZone, boolean withName) { public boolean moveCardToExileWithInfo(Card card, UUID exileId, String exileName, Ability source, Game game, Zone fromZone, boolean withName) {
return false; return false;

View file

@ -908,6 +908,17 @@ public interface Player extends MageItem, Copyable<Player> {
*/ */
boolean moveCardToHandWithInfo(Card card, Ability source, Game game, boolean withName); boolean moveCardToHandWithInfo(Card card, Ability source, Game game, boolean withName);
/**
* Iterates through a set of cards and runs moveCardToHandWithInfo on each item
*
* @param cards
* @param source
* @param game
* @param withName show the card names in the log
* @return
*/
boolean moveCardsToHandWithInfo(Cards cards, Ability source, Game game, boolean withName);
/** /**
* Uses card.moveToExile and posts a inform message about moving the card to * Uses card.moveToExile and posts a inform message about moving the card to
* exile into the game log. Don't use this in replacement effects, because * exile into the game log. Don't use this in replacement effects, because

View file

@ -4642,6 +4642,15 @@ public abstract class PlayerImpl implements Player, Serializable {
return result; return result;
} }
@Override
public boolean moveCardsToHandWithInfo(Cards cards, Ability source, Game game, boolean withName) {
Player player = this;
for (Card card : cards.getCards(game)) {
player.moveCardToHandWithInfo(card, source, game, withName);
}
return true;
}
@Override @Override
public boolean moveCardToHandWithInfo(Card card, Ability source, Game game, boolean withName) { public boolean moveCardToHandWithInfo(Card card, Ability source, Game game, boolean withName) {
boolean result = false; boolean result = false;