- Mill cards in correct order

- Roll up shuffles into bottom message
- Remove unused variable
This commit is contained in:
Rob Blanckaert 2019-02-10 22:28:55 -08:00
parent d49ec0088f
commit c32f2190bd
3 changed files with 28 additions and 21 deletions

View file

@ -125,8 +125,8 @@ void MessageLogWidget::containerProcessingDone()
for (auto &i : moveCardQueue) for (auto &i : moveCardQueue)
logDoMoveCard(i); logDoMoveCard(i);
moveCardQueue.clear(); moveCardQueue.clear();
moveCardPT.clear();
moveCardTapped.clear(); moveCardTapped.clear();
moveCardExtras.clear();
} else if (currentContext == MessageContext_Mulligan) { } else if (currentContext == MessageContext_Mulligan) {
logMulligan(mulliganPlayer, mulliganNumber); logMulligan(mulliganPlayer, mulliganNumber);
mulliganPlayer = nullptr; mulliganPlayer = nullptr;
@ -318,13 +318,15 @@ void MessageLogWidget::logDoMoveCard(LogMoveCard &lmc)
else if (targetZone == handConstant()) else if (targetZone == handConstant())
finalStr = tr("%1 moves %2%3 to their hand."); finalStr = tr("%1 moves %2%3 to their hand.");
else if (targetZone == deckConstant()) { 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."); 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."); 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."); finalStr = tr("%1 puts %2%3 on top of their library.");
else { } else {
lmc.newX++; lmc.newX++;
usesNewX = true; usesNewX = true;
finalStr = tr("%1 puts %2%3 into their library %4 cards from the top."); finalStr = tr("%1 puts %2%3 into their library %4 cards from the top.");
@ -698,8 +700,9 @@ void MessageLogWidget::logSetDoesntUntap(Player *player, CardItem *card, bool do
void MessageLogWidget::logSetPT(Player *player, CardItem *card, QString newPT) void MessageLogWidget::logSetPT(Player *player, CardItem *card, QString newPT)
{ {
if (currentContext == MessageContext_MoveCard) { if (currentContext == MessageContext_MoveCard) {
moveCardPT.insert(card, newPT); return;
} else { }
QString name = card->getName(); QString name = card->getName();
if (name.isEmpty()) { if (name.isEmpty()) {
name = QString("<font color=\"blue\">card #%1</font>").arg(sanitizeHtml(QString::number(card->getId()))); name = QString("<font color=\"blue\">card #%1</font>").arg(sanitizeHtml(QString::number(card->getId())));
@ -713,7 +716,6 @@ void MessageLogWidget::logSetPT(Player *player, CardItem *card, QString newPT)
tr("%1 sets PT of %2 to %3.").arg(sanitizeHtml(player->getName())).arg(name).arg(newPT)); tr("%1 sets PT of %2 to %3.").arg(sanitizeHtml(player->getName())).arg(name).arg(newPT));
} }
} }
}
void MessageLogWidget::logSetSideboardLock(Player *player, bool locked) void MessageLogWidget::logSetSideboardLock(Player *player, bool locked)
{ {
@ -751,6 +753,11 @@ void MessageLogWidget::logShuffle(Player *player, CardZone *zone, int start, int
return; 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 // start and end are indexes into the portion of the deck that was shuffled
// with negitive numbers counging from the bottom up. // with negitive numbers counging from the bottom up.
if (start == 0 && end == -1) { if (start == 0 && end == -1) {

View file

@ -36,8 +36,8 @@ private:
Player *mulliganPlayer; Player *mulliganPlayer;
MessageContext currentContext; MessageContext currentContext;
QList<LogMoveCard> moveCardQueue; QList<LogMoveCard> moveCardQueue;
QMap<CardItem *, QString> moveCardPT;
QMap<CardItem *, bool> moveCardTapped; QMap<CardItem *, bool> moveCardTapped;
QList<QString> moveCardExtras;
const QString tableConstant() const; const QString tableConstant() const;
const QString graveyardConstant() const; const QString graveyardConstant() const;

View file

@ -1039,7 +1039,7 @@ void Player::actMoveTopCardsToGrave()
cmd.set_x(0); cmd.set_x(0);
cmd.set_y(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); cmd.mutable_cards_to_move()->add_card()->set_card_id(i);
} }
@ -1065,7 +1065,7 @@ void Player::actMoveTopCardsToExile()
cmd.set_x(0); cmd.set_x(0);
cmd.set_y(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); cmd.mutable_cards_to_move()->add_card()->set_card_id(i);
} }