add support for adventures to oracle (#3836)
* add support for adventures to oracle this causes cockatrice to correctly fetch the front of the card for the adventure portion rather than sending lots of bad requests to scryfall * treat adventures more like split cards * dont hardcode `maintype: creature`
This commit is contained in:
parent
a3fc9b6ee5
commit
e8fd2ce2aa
1 changed files with 4 additions and 1 deletions
|
@ -316,7 +316,7 @@ int OracleImporter::importCardsFromSet(CardSetPtr currentSet, const QList<QVaria
|
|||
}
|
||||
|
||||
// split cards are considered a single card, enqueue for later merging
|
||||
if (layout == "split" || layout == "aftermath") {
|
||||
if (layout == "split" || layout == "aftermath" || layout == "adventure") {
|
||||
// get the position of this card part
|
||||
int index = additionalNames.indexOf(name);
|
||||
// construct full card name
|
||||
|
@ -370,12 +370,15 @@ int OracleImporter::importCardsFromSet(CardSetPtr currentSet, const QList<QVaria
|
|||
setInfo = tmp.getSetInfo();
|
||||
} else {
|
||||
const QVariantHash &props = tmp.getProperties();
|
||||
layout = properties.value("layout").toString();
|
||||
for (const QString &prop : props.keys()) {
|
||||
QString originalPropertyValue = properties.value(prop).toString();
|
||||
QString thisCardPropertyValue = props.value(prop).toString();
|
||||
if (originalPropertyValue != thisCardPropertyValue) {
|
||||
if (prop == "colors") {
|
||||
properties.insert(prop, originalPropertyValue + thisCardPropertyValue);
|
||||
} else if (prop == "maintype" && layout == "adventure") {
|
||||
properties.insert(prop, originalPropertyValue);
|
||||
} else {
|
||||
properties.insert(prop,
|
||||
originalPropertyValue + splitCardPropSeparator + thisCardPropertyValue);
|
||||
|
|
Loading…
Reference in a new issue