Git Product home page Git Product logo

marvelsdb-json-data's Introduction

MarvelsDB cards JSON data

The goal of this repository is to store marvelsdb card data in a format that can be easily updated by multiple people and their changes reviewed.

Validating and Formatting JSON

Steps have been verified with Python 2.7.x and 3.7.x.

Set Up Python Environment

The validation script requires python package jsonschema which can be installed using pip via pip install jsonschema. It is recommended that you use a virtual environment, but this is strictly optional.

# use a virtual environment (optional)
virtualenv venv
source venv/bin/activate
pip install jsonschema

If you see an error like "No module named jsonschema" when running the script, you have not installed the jsonschema package correctly.

Run the Validation Script

To check the JSON files:

./validate.py

# or for more detailed output, include the --verbose flag

./validate.py --verbose

To check and apply formatting to JSON files:

./validate.py --fix_formatting

# or for more detailed output, include the --verbose flag

./validate.py --verbose --fix_formatting

Pack schema

  • code - identifier of the pack. The acronym of the pack name, with matching case, except for Core Set. Examples: "Core" for Core Set.
  • name - properly formatted name of the pack. Examples: "Core Set"
  • position - number of the pack within the cycle. Examples: 1 for Core Set
  • released - date when the pack was officially released by FFG. When in doubt, look at the date of the pack release news on FFG's news page. Format of the date is YYYY-MM-DD. May be null - this value is used when the date is unknown. Examples: "2016-10-08" for Core Set
  • size - number of different cards in the pack. May be null - this value is used when the pack is just an organizational entity, not a physical pack. Examples: 120 for Core Set

Card schema

  • attack - Character's attack value. Format is integer or null. Possible values:
    • null: Shows up as dash or a star if attack_star is defined
    • -1: Shows up as X
    • 0+: Shows up as the given integer
  • attack_cost - Cost for the character to attack (commonly, the amount of consequential damage)
  • attack_star - Whether a star appears in the attack field indicating a special ability
  • back_flavor - The flavor text on the back of a card
  • back_text - The text on the back of a card
  • base_threat - The starting threat on a card. By default, it is per hero.
  • base_threat_fixed - Whether the base_threat is fixed and not per hero
  • boost - The number of boost icons on a card
  • boost_star - Whether a star appears in the boost field indicating a special ability
  • code - 5 digit card identifier. Consists of two zero-padded numbers: first two digits are the cycle position, last three are position of the card within the cycle (printed on the card).
  • cost - Play cost of the card. Relevant for most cards. Possible values:
    • -1: Shows up as X
    • 0+: Shows up as the given integer
  • deck_limit - The max number of the given card that can be in a deck
  • deck_requirements - Alter-ego/hero only - describes the character's requirements for an investigator. e.g.:
    "deck_requirements": [
      {
        "aspects": 2
      }
    ]
  • defense - Character's defense value
  • defense_star - Whether a star appears in the defense field indicating a special ability
  • double_sided - Whether the card is a double sided card
  • duplicate_of - A link to the original card code for duplicate cards in other packs
  • escalation_threat - The acceleration threat to apply to main/side schemes. By default, it is per hero. Possible values:
    • -1: Shows up as X
    • 0+: Shows up as the given number
  • escalation_threat_fixed - Whether the escalation_threat is fixed and not per hero
  • escalation_threat_star - Whether a star appears in the escalation threat field indicating a special ability
  • faction_code - The faction code type for a card. Possible values:
    • aggression
    • basic
    • campaign
    • encounter
    • hero
    • justice
    • leadership
    • pool
    • protection
  • flavor - The flavor text on a card
  • hand_size - Character's hand size
  • health - Character's health. By default, it is fixed.
  • health_per_hero - Whether the health is per hero
  • health_star - Whether a star appears in the health field indicating a special ability
  • illustrator - The name(s) of the artist(s) on the card
  • is_unique - Whether the card is unique
  • name - The name of the card
  • octgn_id - A UUID required for each card
  • pack_code - The code for the card's pack. Possible values found in packs.json.
  • permanent - Whether the card is permanent
  • position - The position of the card in the pack
  • quantity - The quantity of the given card found in a pack
  • recover - Character's recover value
  • recover_star - Whether a star appears in the recover field indicating a special ability
  • resource_[energy|mental|physical|wild] - Amount of resources of the given type
  • scheme_acceleration - The acceleration amount on schemes
  • scheme_crisis - The number of crisis icons on a scheme
  • scheme_hazard - The number of hazard icons on a scheme
  • scheme_star - Whether a star appears in the scheme field indicating a special ability
  • set_code - The code for the card's set. Possible values found in sets.json.
  • set_position - The position of the card in the set
  • stage - The stage number on a villain or main scheme. Possible values:
    • null: There is no stage for the villain or main scheme
    • 0+: Shows up as the given integer
  • subname - Subname associated with a character (e.g. Carol Danvers is a subname for Captain Marvel)
  • text - The text on a card
  • threat - The target threat on a card before it advances. By default, it is per hero.
  • threat_fixed - Whether the threat is fixed and not per hero
  • threat_star - Whether a star appears in the threat field indicating a special ability
  • thwart - Character's thwart value. Possible values:
    • null: Shows up as dash or a star if thwart_star is defined
    • -1: Shows up as X
    • 0+: Shows up as the given integer
  • thwart_cost - Cost for the character to thwart (commonly, the amount of consequential damage)
  • thwart_star - Whether a star appears in the thwart field indicating a special ability
  • traits - List of traits following the pattern Trait1. Trait2.
  • type_code - Type of the card. Possible values (found in types.json):
    • ally
    • alter_ego
    • attachment
    • environment
    • event
    • hero
    • main_scheme
    • minion
    • obligation
    • resource
    • side_scheme
    • support
    • treachery
    • upgrade
    • villain

JSON text editing tips

Full description of (very simple) JSON format can be found here, below there are a few tips most relevant to editing this repository.

Non-ASCII symbols

When symbols outside the regular ASCII range are needed, UTF-8 symbols come in play. These need to be escaped using \u<4 letter hexcode>.

To get the 4-letter hexcode of a UTF-8 symbol (or look up what a particular hexcode represents), you can use a UTF-8 converter, such as this online tool.

Quotes and breaking text into multiple lines

To have text spanning multiple lines, use \n to separate them. To have quotes as part of the text, use \". For example, "flavor": "\"I'd run if I were you.\"\n - Scott Lang", results in following flavor text:

"I'd run if I were you." - Scott Lang

Game Symbols

These can be used in a card's text section. It will get converted to the appropriate icon.

  • [boost]
  • [cost]
  • [energy]
  • [mental]
  • [per_hero]
  • [physical]
  • [star]
  • [unique]
  • [wild]

Translations

To merge new changes in default language in all locales, run the CoffeeScript script update_locales.

Pre-requisites:

  • node and npm installed
  • npm -g install coffee-script

Usage: coffee update_locales.coffee

marvelsdb-json-data's People

Contributors

alberto-bottarini avatar alexandrepiquet avatar anbf avatar daedalica avatar dcarriger avatar fafranco82 avatar flo06800 avatar freakmod avatar fredmilhau avatar gcmznt avatar grtll avatar jensen1989 avatar jordanweiler avatar kamalisk avatar lostie avatar m3rten avatar magnuspihlimplicit avatar ouroboros009 avatar q3c0 avatar rdonnelly avatar scappy64 avatar simongeorges avatar slymcfr avatar spcyclops avatar steverodrigue avatar tomasloow avatar twistedsistem avatar visnup avatar wargfn avatar zzorba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

marvelsdb-json-data's Issues

[FR] Some Typos on FR translations

Hi.

There are some Typos on FR Translations:

Card code number 06005 -> traits change "ataque" to "attaque".
Card code number 07049 -> traits change "armor" to "armure".
Card code number 06019 -> traits change "arma" to "arme". ( Already mark by @SlyMCFr )
Card code number 18026 -> traits change "elite" to "élite" ( To be consistent with others).

Maybe @SlyMCFr can Open PR, Or I can too if you want. I'm available to contribute to this project for FR translations :)

[Wave 6 + Mojo] Cards code Vs FFG's code

Hi,

I saw in packs.json that mojo, wolverine and stom have been preconfigured : Mojo is marked a "35", Wolverine "36" and Storm "37".
But, if you check on FFG web site, Mojo is referenced as "MC39en", Wolverine "MC35en" and Storm "MC36en".

I thought it could generate troubles in future json files.
(Same things for incoming Gambit (38 here but MC37en on FFG) and Rogue (39 here Vs MC38en on FFG). )

So, don't you think it could be better keeping the FFG's code for all these packs ?

Link of [Go to card page] loses the current locale

When viewing a deck in any non-english locale (URL starts with the locale code: es, it,...), card names are view correctly.
Example deck
On clicking on it the "preview" is displayed in the same locale.
Example card preview
But the button below [Go to card page] rendered with the URL without locale, so text is displayed in english.
Link URL for the given card, without locale
Card page in english

I recall that a few months ago, going to that card also was being seen in the current locale.
Is this change expected new behaviour? It is a little bit weird and uncomfortable to keep changing language when viewing cards from deck this way.
This happens in any browser.
Checked with other users.

Thanks.

Expert Marksman

Expert Marksman is listed as a Support card in the text, but shows as an Upgrade on the actual card.

attributes attack_text & scheme_text for hero/ally

In several data packs, there is attack_text or scheme_text used for heros or allies.
This does not work:
cap.json (example: Wonder Man)
vnm.json (example: Star-Lord)
wsp.json (example: Wasp (Giant))

Utopia missing ability text

Utopia only has half its ability text.

It's missing:

Response: After an X-Men ally enters play, exhaust Utopia -> ready an X-Men character.

Dr. Strange Invocation deck

Even though the Invocation deck cards are added to the JSON data, we still require some sort of configuration to set them as part as the default build for Dr. Strange. I was trying to look into the ArkhamDB to understand how that is achieved for Joe Diamond that has a similar requirement.

Any ideas on how this can be enabled? /cc @zzorba @Kamalisk

[FR] Translations not appears

Hi !
I checked french translations files, (codes , text, names, names of files, ...) and french translations not appears for Gambit and Rogue (and their encounters cards too).

According me, I create FR files as usually => is something wrong with the files ? or anything else ?

Thanks for checking !

X-Men Alt art duplicates

This is more a question than an issue... But, Did you think something about x-men duplicates with alt art (and flavor text)? Should I use the "duplicate_of" attribute as with other duplicates or instead treat them like they were new cards?

Untranslated modular set in result of "find" page

Hi,

1/ when you search cards in "find" page, whith the "m" options, in the result table, if you are not in english language, in the last column "set", sets are not translated : they are in english.
I tested with modular "risky_business" and "running_interference", with FR and ES language, and I checked : translations are filled in FR and ES sets.json files.

Can you displayed the name of the modular set ?

ex :
https://es.marvelcdb.com/find?q=m%3A%22running_interference%22&sort=name&view=list&decks=all
https://fr.marvelcdb.com/find?q=m%3A%22running_interference%22&sort=name&view=list&decks=all

2/ I think it's the same thing, but searching, with the "m" options, a translated name of a modular set find nothing. For all languages, you have to search with the english name of the set.

Thanks by advance.

Flavor text missing quote in Luke Cage ally

card 01076

Expected text:
"Power Man for hire — Cage speakin'."
Actual text:
"Power Man for hire — Cage speakin'.

Might seem super trivial but the missing quote caused some confusion when reading the string into a card analyzing tool.

Defense Event

"text": "Play under any player's control.\nMax 1 per player.\n<b>Resource</b>: Exhaust Nerves of Steel → generate a [energy] resource for a <b?Defense</b> event.",

There is a <b?Defense in the line, should be Defense

Domino ally text not displayed

the "attack_text" seems to not work with allies:

on the Domino ally, the following should be displayed, but is not:
"attack_text": "Response: After you use one of Domino's basic powers, swap a card in your hand with the top card of your deck.",

image

Currently Havok is well displayed, but using "text" instead of "attack_text"
"text": "[star] Forced Interrupt: When Havok attacks, discard the top card of the encounter deck.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.