diff --git a/cockatrice/src/carddatabase.cpp b/cockatrice/src/carddatabase.cpp index 0877cced..57ffe297 100644 --- a/cockatrice/src/carddatabase.cpp +++ b/cockatrice/src/carddatabase.cpp @@ -587,9 +587,9 @@ void CardDatabase::refreshCachedReverseRelatedCards() continue; } - auto *newCardRelation = new CardRelation(card->getName(), cardRelation->getDoesAttach(), - cardRelation->getIsCreateAllExclusion(), - cardRelation->getIsVariable(), cardRelation->getDefaultCount()); + auto *newCardRelation = new CardRelation( + card->getName(), cardRelation->getDoesAttach(), cardRelation->getIsCreateAllExclusion(), + cardRelation->getIsVariable(), cardRelation->getDefaultCount(), cardRelation->getIsPersistent()); cards.value(targetCard)->addReverseRelatedCards2Me(newCardRelation); } } diff --git a/oracle/src/oracleimporter.cpp b/oracle/src/oracleimporter.cpp index 1ae718c2..2ccdbcef 100644 --- a/oracle/src/oracleimporter.cpp +++ b/oracle/src/oracleimporter.cpp @@ -334,7 +334,7 @@ int OracleImporter::importCardsFromSet(const CardSetPtr ¤tSet, power = getStringPropertyFromMap(card, "power"); toughness = getStringPropertyFromMap(card, "toughness"); - if (power.isEmpty() || toughness.isEmpty()){ + if (power.isEmpty() || toughness.isEmpty()) { ptSeparator = ""; } if (!(power.isEmpty() && toughness.isEmpty())) { @@ -381,6 +381,18 @@ int OracleImporter::importCardsFromSet(const CardSetPtr ¤tSet, name = faceName; } + // mtgjon related cards + if (card.contains("relatedCards")) { + QVariantMap givenRelated = card.value("relatedCards").toMap(); + // conjured cards from a spellbook + if (givenRelated.contains("spellbook")) { + auto spbk = givenRelated.value("spellbook").toStringList(); + for (const QString &spbkName : spbk) { + relatedCards.append(new CardRelation(spbkName, false, false, false, 1, true)); + } + } + } + CardInfoPtr newCard = addCard(name + numComponent, text, isToken, properties, relatedCards, setInfo); numCards++; }