Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better custom card detection for Card Index #808

Merged
merged 2 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"level": 3,
"traits": "Item. Clothing.",
"agilityIcons": 1,
"cycle": "Standalone"
"cycle": "Beta"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"level": 2,
"traits": "Item. Relic. Weapon. Melee.",
"combatIcons": 1,
"cycle": "Standalone"
"cycle": "Beta"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"traits": "Item. Relic.",
"willpowerIcons": 1,
"wildIcons": 2,
"cycle": "Red Ride Rising"
"cycle": "Red Tide Rising"
}
40 changes: 37 additions & 3 deletions src/playercards/AllCardsBag.ttslua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -254,7 +288,7 @@ function buildSupplementalIndexes()
end
end

-- maybe initialize table
-- add to cycle index
writeToNestedTable(cycleIndex, cycleName, cardId)
end
end
Expand Down
Loading