mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-29 01:53:54 -07:00
Merge 2f1bab6b3a into 5ffe344779
This commit is contained in:
commit
99e1bcb9cc
6 changed files with 44 additions and 13 deletions
|
|
@ -1018,8 +1018,9 @@ void PlayerActions::actCreateAllRelatedCards()
|
|||
if (!cardRelationAll->getDoesAttach() && !cardRelationAll->getIsVariable()) {
|
||||
dbName = cardRelationAll->getName();
|
||||
bool persistent = cardRelationAll->getIsPersistent();
|
||||
bool faceDown = cardRelationAll->getIsFaceDown();
|
||||
for (int i = 0; i < cardRelationAll->getDefaultCount(); ++i) {
|
||||
createCard(sourceCard, dbName, CardRelationType::DoesNotAttach, persistent);
|
||||
createCard(sourceCard, dbName, CardRelationType::DoesNotAttach, persistent, faceDown);
|
||||
}
|
||||
++tokensTypesCreated;
|
||||
if (tokensTypesCreated == 1) {
|
||||
|
|
@ -1034,8 +1035,9 @@ void PlayerActions::actCreateAllRelatedCards()
|
|||
if (!cardRelationNotExcluded->getDoesAttach() && !cardRelationNotExcluded->getIsVariable()) {
|
||||
dbName = cardRelationNotExcluded->getName();
|
||||
bool persistent = cardRelationNotExcluded->getIsPersistent();
|
||||
bool faceDown = cardRelationNotExcluded->getIsFaceDown();
|
||||
for (int i = 0; i < cardRelationNotExcluded->getDefaultCount(); ++i) {
|
||||
createCard(sourceCard, dbName, CardRelationType::DoesNotAttach, persistent);
|
||||
createCard(sourceCard, dbName, CardRelationType::DoesNotAttach, persistent, faceDown);
|
||||
}
|
||||
++tokensTypesCreated;
|
||||
if (tokensTypesCreated == 1) {
|
||||
|
|
@ -1073,6 +1075,7 @@ bool PlayerActions::createRelatedFromRelation(const CardItem *sourceCard,
|
|||
|
||||
const QString dbName = cardRelation->getName();
|
||||
const bool persistent = cardRelation->getIsPersistent();
|
||||
const bool faceDown = cardRelation->getIsFaceDown();
|
||||
|
||||
// Variable relations always use DoesNotAttach, regardless of the count the user
|
||||
// entered.
|
||||
|
|
@ -1081,7 +1084,7 @@ bool PlayerActions::createRelatedFromRelation(const CardItem *sourceCard,
|
|||
return false;
|
||||
}
|
||||
for (int i = 0; i < variableCount; ++i) {
|
||||
createCard(sourceCard, dbName, CardRelationType::DoesNotAttach, persistent);
|
||||
createCard(sourceCard, dbName, CardRelationType::DoesNotAttach, persistent, faceDown);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1090,7 +1093,7 @@ bool PlayerActions::createRelatedFromRelation(const CardItem *sourceCard,
|
|||
|
||||
if (count > 1) {
|
||||
for (int i = 0; i < count; ++i) {
|
||||
createCard(sourceCard, dbName, CardRelationType::DoesNotAttach, persistent);
|
||||
createCard(sourceCard, dbName, CardRelationType::DoesNotAttach, persistent, faceDown);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1110,7 +1113,7 @@ bool PlayerActions::createRelatedFromRelation(const CardItem *sourceCard,
|
|||
playCardToTable(sourceCard, false);
|
||||
}
|
||||
|
||||
createCard(sourceCard, dbName, attachType, persistent);
|
||||
createCard(sourceCard, dbName, attachType, persistent, faceDown);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1137,7 +1140,8 @@ void PlayerActions::onRelatedCardCreated(const CardItem *sourceCard, const CardR
|
|||
void PlayerActions::createCard(const CardItem *sourceCard,
|
||||
const QString &dbCardName,
|
||||
CardRelationType attachType,
|
||||
bool persistent)
|
||||
bool persistent,
|
||||
bool faceDown)
|
||||
{
|
||||
CardInfoPtr cardInfo = CardDatabaseManager::query()->getCardInfo(dbCardName);
|
||||
|
||||
|
|
@ -1172,6 +1176,7 @@ void PlayerActions::createCard(const CardItem *sourceCard,
|
|||
cmd.set_destroy_on_zone_change(!persistent);
|
||||
cmd.set_x(gridPoint.x());
|
||||
cmd.set_y(gridPoint.y());
|
||||
cmd.set_face_down(faceDown);
|
||||
|
||||
ExactCard relatedCard =
|
||||
CardDatabaseManager::query()->getCardFromSameSet(cardInfo->getName(), sourceCard->getCard().getPrinting());
|
||||
|
|
|
|||
|
|
@ -240,7 +240,8 @@ private:
|
|||
void createCard(const CardItem *sourceCard,
|
||||
const QString &dbCardName,
|
||||
CardRelationType attach = CardRelationType::DoesNotAttach,
|
||||
bool persistent = false);
|
||||
bool persistent = false,
|
||||
bool faceDown = false);
|
||||
|
||||
void playSelectedCards(QList<CardItem *> selectedCards, bool faceDown = false);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue