Add Oracle support for persistent & Fix persistent on reverse-related (#4742)
* fix persistent reverse-related * create relations from spellbook property * run format.sh
This commit is contained in:
parent
f25e4785ae
commit
44d1ab348b
2 changed files with 16 additions and 4 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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++;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue