Playing a tableRow 3 card from the stack puts it to grave. (#3547)
* Playing a tableRow 3 card from the stack puts it to grave. * move to top by resetting pos * Zach touch Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
This commit is contained in:
parent
ba985f97e5
commit
5e38214675
2 changed files with 13 additions and 6 deletions
|
@ -2052,14 +2052,21 @@ void Player::playCard(CardItem *card, bool faceDown, bool tapped)
|
|||
if (!info) {
|
||||
return;
|
||||
}
|
||||
if (!faceDown && ((!settingsCache->getPlayToStack() && info->getTableRow() == 3) ||
|
||||
((settingsCache->getPlayToStack() && info->getTableRow() != 0) &&
|
||||
card->getZone()->getName().toStdString() != "stack"))) {
|
||||
|
||||
int tableRow = info->getTableRow();
|
||||
bool playToStack = settingsCache->getPlayToStack();
|
||||
QString currentZone = card->getZone()->getName();
|
||||
if (currentZone == "stack" && tableRow == 3) {
|
||||
cmd.set_target_zone("grave");
|
||||
cmd.set_x(0);
|
||||
cmd.set_y(0);
|
||||
} else if (!faceDown &&
|
||||
((!playToStack && tableRow == 3) || ((playToStack && tableRow != 0) && currentZone != "stack"))) {
|
||||
cmd.set_target_zone("stack");
|
||||
cmd.set_x(0);
|
||||
cmd.set_y(0);
|
||||
} else {
|
||||
int tableRow = faceDown ? 2 : info->getTableRow();
|
||||
tableRow = faceDown ? 2 : info->getTableRow();
|
||||
QPoint gridPoint = QPoint(-1, TableZone::clampValidTableRow(2 - tableRow));
|
||||
cardToMove->set_face_down(faceDown);
|
||||
cardToMove->set_pt(info->getPowTough().toStdString());
|
||||
|
|
|
@ -40,7 +40,7 @@ class CommandContainer;
|
|||
class GameCommand;
|
||||
class GameEvent;
|
||||
class GameEventContext;
|
||||
class Event_ConnectionStateChanged;
|
||||
// class Event_ConnectionStateChanged;
|
||||
class Event_GameSay;
|
||||
class Event_Shuffle;
|
||||
class Event_RollDie;
|
||||
|
@ -265,7 +265,7 @@ private:
|
|||
|
||||
void initSayMenu();
|
||||
|
||||
void eventConnectionStateChanged(const Event_ConnectionStateChanged &event);
|
||||
// void eventConnectionStateChanged(const Event_ConnectionStateChanged &event);
|
||||
void eventGameSay(const Event_GameSay &event);
|
||||
void eventShuffle(const Event_Shuffle &event);
|
||||
void eventRollDie(const Event_RollDie &event);
|
||||
|
|
Loading…
Reference in a new issue