mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-22 18:32:17 -07:00
play action now applies to all selected cards
This commit is contained in:
parent
c9d5d5609c
commit
ee8164efa8
1 changed files with 21 additions and 7 deletions
|
|
@ -3481,10 +3481,17 @@ static bool isUnwritableRevealZone(CardZone *zone)
|
||||||
|
|
||||||
void Player::actPlay()
|
void Player::actPlay()
|
||||||
{
|
{
|
||||||
auto *card = game->getActiveCard();
|
QList<CardItem *> selectedCards;
|
||||||
if (card) {
|
for (const auto &item : scene()->selectedItems()) {
|
||||||
const bool cipt = card->getInfo() ? card->getInfo()->getCipt() : false;
|
auto *card = static_cast<CardItem *>(item);
|
||||||
playCard(card, false, cipt);
|
selectedCards.append(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto &card : selectedCards) {
|
||||||
|
if (card) {
|
||||||
|
const bool cipt = card->getInfo() ? card->getInfo()->getCipt() : false;
|
||||||
|
playCard(card, false, cipt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3500,9 +3507,16 @@ void Player::actHide()
|
||||||
|
|
||||||
void Player::actPlayFacedown()
|
void Player::actPlayFacedown()
|
||||||
{
|
{
|
||||||
auto *card = game->getActiveCard();
|
QList<CardItem *> selectedCards;
|
||||||
if (card) {
|
for (const auto &item : scene()->selectedItems()) {
|
||||||
playCard(card, true, false);
|
auto *card = static_cast<CardItem *>(item);
|
||||||
|
selectedCards.append(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto &card : selectedCards) {
|
||||||
|
if (card) {
|
||||||
|
playCard(card, true, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue