Merge pull request #808 from argonui/better-custom-card-detection
Better custom card detection for Card Index
This commit is contained in:
commit
5a9cd953ab
@ -6,5 +6,5 @@
|
||||
"level": 3,
|
||||
"traits": "Item. Clothing.",
|
||||
"agilityIcons": 1,
|
||||
"cycle": "Standalone"
|
||||
"cycle": "Beta"
|
||||
}
|
||||
|
@ -6,5 +6,5 @@
|
||||
"level": 2,
|
||||
"traits": "Item. Relic. Weapon. Melee.",
|
||||
"combatIcons": 1,
|
||||
"cycle": "Standalone"
|
||||
"cycle": "Beta"
|
||||
}
|
||||
|
@ -7,5 +7,5 @@
|
||||
"traits": "Item. Relic.",
|
||||
"willpowerIcons": 1,
|
||||
"wildIcons": 2,
|
||||
"cycle": "Red Ride Rising"
|
||||
"cycle": "Red Tide Rising"
|
||||
}
|
||||
|
@ -30,7 +30,37 @@ local classesInOrder = {
|
||||
"Survivor",
|
||||
"Neutral"
|
||||
}
|
||||
|
||||
local OFFICIAL_CYCLE_LIST = {
|
||||
-- campaigns
|
||||
["investigator packs"] = true,
|
||||
["core"] = true,
|
||||
["the dunwich legacy"] = true,
|
||||
["the path to carcosa"] = true,
|
||||
["the forgotten age"] = true,
|
||||
["the circle undone"] = true,
|
||||
["the dream-eaters"] = true,
|
||||
["the innsmouth conspiracy"] = true,
|
||||
["edge of the earth"] = true,
|
||||
["the scarlet keys"] = true,
|
||||
["the feast of hemlock vale"] = true,
|
||||
["the drowned city"] = true,
|
||||
-- standalones / parallels etc.
|
||||
["standalone"] = true,
|
||||
["the blob that ate everything else"] = true,
|
||||
["all or nothing"] = true,
|
||||
["bad blood"] = true,
|
||||
["read or die"] = true,
|
||||
["by the book"] = true,
|
||||
["red tide rising"] = true,
|
||||
["on the road again"] = true,
|
||||
["laid to rest"] = true,
|
||||
["path of the righteous"] = true,
|
||||
["relics of the past"] = true,
|
||||
["hunting for answers"] = true,
|
||||
["pistols and pearls"] = true,
|
||||
["beta"] = true,
|
||||
["promo"] = true
|
||||
}
|
||||
-- conversion tables to simplify type sorting
|
||||
local typeConversion = {
|
||||
Investigator = 1,
|
||||
@ -209,7 +239,7 @@ function buildSupplementalIndexes()
|
||||
end
|
||||
end
|
||||
|
||||
-- add to cycle index
|
||||
-- start parsing the cycle data
|
||||
local cycleName = card.metadata.cycle
|
||||
|
||||
-- if this is a minicard without cycle, check the parent card for cycle data
|
||||
@ -232,6 +262,10 @@ function buildSupplementalIndexes()
|
||||
else
|
||||
-- track cards without defined cycle (should only be fan-made cards)
|
||||
cycleName = "other"
|
||||
end
|
||||
|
||||
-- check if card is not from an official cycle
|
||||
if OFFICIAL_CYCLE_LIST[cycleName] ~= true then
|
||||
otherCardsDetected = true
|
||||
|
||||
-- maybe add to special investigator / minicard index
|
||||
@ -254,7 +288,7 @@ function buildSupplementalIndexes()
|
||||
end
|
||||
end
|
||||
|
||||
-- maybe initialize table
|
||||
-- add to cycle index
|
||||
writeToNestedTable(cycleIndex, cycleName, cardId)
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user