diff --git a/cockatrice/src/messagelogwidget.cpp b/cockatrice/src/messagelogwidget.cpp
index 15542509..2d257bb8 100644
--- a/cockatrice/src/messagelogwidget.cpp
+++ b/cockatrice/src/messagelogwidget.cpp
@@ -125,8 +125,8 @@ void MessageLogWidget::containerProcessingDone()
for (auto &i : moveCardQueue)
logDoMoveCard(i);
moveCardQueue.clear();
- moveCardPT.clear();
moveCardTapped.clear();
+ moveCardExtras.clear();
} else if (currentContext == MessageContext_Mulligan) {
logMulligan(mulliganPlayer, mulliganNumber);
mulliganPlayer = nullptr;
@@ -318,13 +318,15 @@ void MessageLogWidget::logDoMoveCard(LogMoveCard &lmc)
else if (targetZone == handConstant())
finalStr = tr("%1 moves %2%3 to their hand.");
else if (targetZone == deckConstant()) {
- if (lmc.newX == -1)
+ if (moveCardExtras.contains("shuffle_partial")) {
+ finalStr = tr("%1 puts %2%3 on bottom of their library randomly.");
+ } else if (lmc.newX == -1) {
finalStr = tr("%1 puts %2%3 into their library.");
- else if (lmc.newX == lmc.targetZone->getCards().size() - 1)
+ } else if (lmc.newX == lmc.targetZone->getCards().size() - 1) {
finalStr = tr("%1 puts %2%3 on bottom of their library.");
- else if (lmc.newX == 0)
+ } else if (lmc.newX == 0) {
finalStr = tr("%1 puts %2%3 on top of their library.");
- else {
+ } else {
lmc.newX++;
usesNewX = true;
finalStr = tr("%1 puts %2%3 into their library %4 cards from the top.");
@@ -698,20 +700,20 @@ void MessageLogWidget::logSetDoesntUntap(Player *player, CardItem *card, bool do
void MessageLogWidget::logSetPT(Player *player, CardItem *card, QString newPT)
{
if (currentContext == MessageContext_MoveCard) {
- moveCardPT.insert(card, newPT);
+ return;
+ }
+
+ QString name = card->getName();
+ if (name.isEmpty()) {
+ name = QString("card #%1").arg(sanitizeHtml(QString::number(card->getId())));
} else {
- QString name = card->getName();
- if (name.isEmpty()) {
- name = QString("card #%1").arg(sanitizeHtml(QString::number(card->getId())));
- } else {
- name = cardLink(name);
- }
- if (newPT.isEmpty()) {
- appendHtmlServerMessage(tr("%1 removes the PT of %2.").arg(sanitizeHtml(player->getName())).arg(name));
- } else {
- appendHtmlServerMessage(
- tr("%1 sets PT of %2 to %3.").arg(sanitizeHtml(player->getName())).arg(name).arg(newPT));
- }
+ name = cardLink(name);
+ }
+ if (newPT.isEmpty()) {
+ appendHtmlServerMessage(tr("%1 removes the PT of %2.").arg(sanitizeHtml(player->getName())).arg(name));
+ } else {
+ appendHtmlServerMessage(
+ tr("%1 sets PT of %2 to %3.").arg(sanitizeHtml(player->getName())).arg(name).arg(newPT));
}
}
@@ -751,6 +753,11 @@ void MessageLogWidget::logShuffle(Player *player, CardZone *zone, int start, int
return;
}
+ if (currentContext == MessageContext_MoveCard && start == 0 && end == -1) {
+ moveCardExtras.append("shuffle_partial");
+ return;
+ }
+
// start and end are indexes into the portion of the deck that was shuffled
// with negitive numbers counging from the bottom up.
if (start == 0 && end == -1) {
diff --git a/cockatrice/src/messagelogwidget.h b/cockatrice/src/messagelogwidget.h
index 8f9217a9..7bbccb24 100644
--- a/cockatrice/src/messagelogwidget.h
+++ b/cockatrice/src/messagelogwidget.h
@@ -36,8 +36,8 @@ private:
Player *mulliganPlayer;
MessageContext currentContext;
QList moveCardQueue;
- QMap moveCardPT;
QMap moveCardTapped;
+ QList moveCardExtras;
const QString tableConstant() const;
const QString graveyardConstant() const;
diff --git a/cockatrice/src/player.cpp b/cockatrice/src/player.cpp
index 224d50d9..b69ac9a1 100644
--- a/cockatrice/src/player.cpp
+++ b/cockatrice/src/player.cpp
@@ -1039,7 +1039,7 @@ void Player::actMoveTopCardsToGrave()
cmd.set_x(0);
cmd.set_y(0);
- for (int i = 0; i < number; ++i) {
+ for (int i = number - 1; i >= 0; --i) {
cmd.mutable_cards_to_move()->add_card()->set_card_id(i);
}
@@ -1065,7 +1065,7 @@ void Player::actMoveTopCardsToExile()
cmd.set_x(0);
cmd.set_y(0);
- for (int i = 0; i < number; ++i) {
+ for (int i = number - 1; i >= 0; --i) {
cmd.mutable_cards_to_move()->add_card()->set_card_id(i);
}