card-drop/docs/cards.md
Ethan Lane 136bc0805e
All checks were successful
Test / build (push) Successful in 11s
Document how to start the bot
2024-07-26 18:31:20 +01:00

3 KiB

Cards

This document will describe how to add cards to the bot. This is from the perspective of the development side and doesn't go into details of syncing from an external place such as with the Google Drive Sync function.

The cards will be put into the $DATA_DIR/cards folder. $DATA_DIR is configured in the .env file.

Folder Structure

The general structure of the cards folder is as follows:

cards           # The main cards folder
| Series 1      # Series folder
| | BRONZE      # Type folder
| | | 1000.jpg  # Card image
| | | 1001.jpg
| | 1.json      # Card metadata file
| Series 2
| | SILVER
| | | 2000.jpg
| | 2.json
  • The root of the cards folder will have a folder foor each series
  • Each series will contain folders for each of the card types containing the card images.
  • The series folder will also contain a metadata JSON folder containing the metadata of the cards within that series.

The bot when loading will search the cards folder recursively for each json, and then read them to determine what cards should be used for the bot.

Series Metadata

An example of what the metadata files could look like are as follows:

[
    {
        "id": 1,
        "name": "Series 1",
        "cards": [
            {
                "id": "1000",
                "name": "Card 1000 of Series 1",
                "type": 1,
                "path": "Series 1/BRONZE/1000.jpg"
            },
            {
                "id": "1001",
                "name": "Card 1001 of Series 1",
                "type": 1,
                "path": "Series 2/BRONZE?1001.jpg",
                "subseries": "Custom Series Name"
            }
        ]
    }
]

This file will load a series called "Series 1" with the id of 1, containing 2 cards:

  • Card 1000, with type 1 (Bronze), with its image located at (from root) "Series 1/BRONZE/1000.jpg"
  • Card 1001 is the same, except has a custom "subseries" name which will override the main series name if shown, helpful for an "other" category.

Card Type

Number Name Chance Sacrifice Cost (Coins)
0 Unknown - -
1 Bronze 62% 5
2 Silver 31% 10
3 Gold 4.4% 30
4 Manga 2% 40
5 Legendary 0.6% 100