Holding lorcana data only
Raw JSON
You can access to the raw jsons inside data.
Gradle
A Kotlin Multiplatform library is available using
implementation("eu.codlab:lorcana-data:$version")
This will work on the following platforms :
- Mobile (Android/iOS)
- Web (js)
- Native (MacOS/Linux/Windows)
- JVM (MacOS/Linux/Windows)
val lorcana = Lorcana().loadFromResources()
# load eiher from the resources or github, in this sample it'll be resources
The API will give you either the flatten list of cards or the condensed version. The difference between boths is that when using the condensed version, you will be able to get the various other versions of the card :
- enchanted vs non enchanted
- regular set vs promos (or any other version in the future)
Get the list of flatten cards
val tfc = lorcana.set(SetDescription.TFC).cards
println("This will give you ${tfc.size} = 204+12 cards")
Get the list of virtual cards
val tfc = lorcana.set(SetDescription.TFC).virtualCards
println("This will give you ${tfc.size} = 204 cards")
The cards are defined in the data folder
The model is as the following :
lore: int?
cost: int
inkwell: int
attack: int
defence: int
move_cost: int?
color: amber|amethyst|emerald|ruby|sapphire|steel
type: string
# in the regular raw cards, this will be
classifications: string[]?
# in the virtual cards
classifications: ClassificationHolder[]? # slug, en, fr, de
illustrator: string
languages:
key:
name: string
title: string?
flavour: string?
franchise_id: string
third_party:
card_market: string?
tcg_player: string?
# in the "cards" output, it will be the actual abilities (translations + values)
actions: string[], it can be mapped to the following abilities list
# in case of condensed cards:
variants: []
set: string
id: int
rarity: common|uncommon|rare|super_rare|enchanted
illustrator: string?
erratas: Map<Lang, Erratas>?
lang: Erratas
- classifications: ClassificationHolder[]? # slug, en, fr, de
# in case of regular flatten version:
number: int
setCode: string
Note : to accomodate the condensed version of cards, the third_party links will move in the variants as the URLs will depend on the variant.
Abilities are set in the abilities.json file And follow the below structure :
name:
logic: string, the logic that can be used to automate the effects
values:
_optional_
song_cost: int?, the cost of the song
cost: int?
count: int?
damages: int?
title:
_optional_
en: the english translation
fr: the french translation
de: the german translation
text:
en: the english translation
fr: the french translation
de: the german translation
or as json
{
"name": {
"logic": "",
"values": {
"new_cost": 0
},
"text": {
"en": "",
"fr": "",
"de": "",
}
}
}
Franchises are set in the franchises.json file And follow the below structure :
name:
translations:
en: the english translation
fr: the french translation
de: the german translation
or as json
{
"name": {
"translations": {
"en": "",
"fr": "",
"de": "",
}
}
}
Each card, description, annotations can use placeholders, those are described in the placeholders.json.
It consists of a map of placeholder and their representations. Currently only for utf
{
"name": "value"
}
Currently, the abilities is made in a really dumb way but with reference to overriden ability if required There were 2 obvious solutions, I chose the later
- make singer in abilities while removing singer_4
- making each cards set the values to use
or
- make singer in abilities to be by default with 5
- add ability for ... abilities to be either a regular ability or just have new "values" holder + "reference" name for the ability to use
{
"singer": {
"logic": "",
"values": {
"cost": 0
},
"text": {
"en": "",
"fr": "",
"de": "",
}
}
} | {
"singer_4": {
"reference": "singer"
"values": {
"cost": 0
}
}
}