2.0.97 • Published 2 days ago

@flesh-and-blood/cards v2.0.97

Weekly downloads
-
License
MIT
Repository
github
Last release
2 days ago

Flesh and Blood cards

8.0 breaking changes

  • card.images has been deprecated in favor of card.printings
  • defaultImageName has been renamed defaultImage for brevity
  • specialImageName has been renamed specialImage for brevity

7.0 breaking changes

  • card.rarity has been deprecated in favor of card.rarities

Overview and installation

A library of all Flesh and Blood cards, available as a bundled TypeScript file with matching interfaces. Source data comes from the amazing the-fab-cube/flesh-and-blood-cards repository maintained by Tyler Luce - all credit goes to him, and all errors are probably added by me in this project 😅.

To install run npm i --save fab-cards.

Access the card data in your project:

import { cards } from "fab-cards";

cards.forEach((card) => {
  // do stuff with the card data
});

Card interfaces

Card contains all of the fields that could show up for any particular card. Required fields can be found on every card, while optional fields may or may not exist on any given card.

Required

FieldData typeExamples
artistsstring array[ "Riordan Delmiro" ]
cardIdentifierstring"snatch-red", "aether-wildfire-red"
classesClass enum array["Generic"], ["Warrior","Wizard"]
defaultImagestring"1HP001.width-450"
printingsPrinting arraysee Printing
namestring"Rain Razors", "Pummel"
raritiesRarity enum array["Super Rare"], ["Token", "Majestic"]
setIdentifiersstring array[ "1HP009", "CRU006" ]
setsRelease enum array[ "History Pack 1", "Crucible of War" ]
specialImagestring"1HP001.width-450"
subtypesSubtype enum array["OneHanded", "Dagger"], ["Aura"]
typesType enum array["Action"], ["Hero"]
typeTextstring"Elemental Ranger Action – Arrow Attack"

Optional

FieldData typeExamples
costnumber0, 10
defensenumber3, 4
functionalTextstring"If Snatch hits, draw a card."
fusionsFusion enum array[ "Earth", "Ice" ]
heroHero enum"Rhinar", "Dori"
intellectnumber3, 4
isCardBackbooleantrue
keywordsKeyword enum array[ "Boost" ]
lifenumber18, 40
oppositeSideCardIdentifierstring"invoke-kyloria-red", "tomeltai"
pitchnumber1, 2, 3
powernumber3, 14
restrictedFormatsFormat enum array[ "Blitz" ]
specialCoststring"XX", "3X"
specialDefensestring"*"
specialPowerstring"*"
specializationsHero enum array["Dromai","Fai"]
talentsTalent enum array[ "Draconic" ]
youngbooleantrue

Printing contains information about the different printings a card has had (e.g. different sets, foilings)

FieldData typeExamples
editionstring of ReleaseEdition enum"Alpha", "Unlimited"
foilingstring of Foiling enum"Cold", "Rainbow"
identifierstring"1HP001"
imagestring"1HP001.width-450"
setstring of Release enum"Dynasty", "Uprising"
treatmentstring of Treatment enum"Alternate Art", "Extended Art"

Enums

Class

"NotClassed", "Generic", "Adjudicator", "Bard", "Brute", "Guardian", "Illusionist", "Mechanologist", "Merchant", "Ninja", "Ranger", "Runeblade", "Shapeshifter", "Warrior", "Wizard",

Format

"Blitz", "Clash", "Classic Constructed", "Commoner",

Fusion

"Earth", "Ice", "Lightning",

Rarity

"Token", "Common", "Rare", "Super Rare", "Majestic", "Legendary", "Fabled", "Promo",

Release

// Full sets
"Arcane Rising", "Crucible of War", "Dynasty", "Everfest", "History Pack 1", "Monarch", "Tales of Aria", "Uprising", "Welcome to Rathe",

// Hero/blitz decks
"Boltyn Blitz Deck", "Briar Blitz Deck", "Bravo Blitz Deck", "Chane Blitz Deck", "Classic Battles: Rhinar vs Dorinthea", "Dorinthea Hero Deck", "Ira Welcome Deck", "Katsu Hero Deck", "LeviaBlitzDeck", "Lexi Blitz Deck", "Oldhim Blitz Deck", "Prism Blitz Deck", "Rhinar Hero Deck",

// One-offs
"Promos",

Talent

"Draconic", "Earth", "Elemental", "Ice", "Light", "Lightning", "Royal", "Shadow",

Type

"Action", "Attack Action", "Attack Reaction", "Defense Reaction", "Equipment", "Hero", "Instant", "Mentor", "Resource", "Token", "Weapon",

Hero

"Arakni", "Azalea", "Benji", "Boltyn", "Bravo", "Briar", "Chane", "Dash", "Data Doll", "Dorinthea", "Emperor", "Genis Wotchuneed", "Ira", "Iyslander", "Kano", "Kassai", "Katsu", "Kavdaen", "Kayo", "Levia", "Lexi", "Oldhim", "Prism", "Rhinar", "Ruu’di", "Shiyana", "Taylor", "Valda", "Viserai", "Yorick",

Keyword

"Arcane Barrier", "Battleworn", "Blade Break", "Blood Debt", "Boost", "Channel", "Charge", "Combo", "Crush", "Dominate", "Essence", "Freeze", "Fusion", "Go Again", "Heave", "Intimidate", "Legendary", "Mentor", "Negate", "Opt", "Phantasm", "Reload", "Reprise", "Specialization", "Spectra", "Spellvoid", "Temper", "Thaw", "Unfreeze",

Working with this project

Card data

Data transformations

There are three steps involved in transforming the .tsv source data into typed .ts code - executed via npm run transform.

  1. src/parser.ts reads from the .tsv file and converts the data into JavaScript objects (performing basic steps like converting comma-delimited lists into arrays)
  2. src/mapper.ts takes the parsed card data and transforms it to match the interfaces in src/interfaces.ts
  3. src/writer.ts creates .ts files containing the card information and all types

Bundling the library

To generate the distributed package code run npm run build after transforming the data.

2.0.97

2 days ago

2.0.95

3 days ago

2.0.96

3 days ago

2.0.93

4 days ago

2.0.94

4 days ago

2.0.92

4 days ago

2.0.91

5 days ago

2.0.90

5 days ago

2.0.88

6 days ago

2.0.89

6 days ago

2.0.87

7 days ago

2.0.86

10 days ago

2.0.85

10 days ago

2.0.84

12 days ago

2.0.83

17 days ago

2.0.82

18 days ago

2.0.81

19 days ago

2.0.80

25 days ago

2.0.79

27 days ago

2.0.78

28 days ago

2.0.77

29 days ago

2.0.75

1 month ago

2.0.76

30 days ago

2.0.73

1 month ago

2.0.74

1 month ago

2.0.72

1 month ago

2.0.71

1 month ago

2.0.68

1 month ago

2.0.69

1 month ago

2.0.66

1 month ago

2.0.67

1 month ago

2.0.64

1 month ago

2.0.65

1 month ago

2.0.70

1 month ago

2.0.62

1 month ago

2.0.63

1 month ago

2.0.60

1 month ago

2.0.61

1 month ago

2.0.59

1 month ago

2.0.57

1 month ago

2.0.58

1 month ago

2.0.55

1 month ago

2.0.56

1 month ago

2.0.54

1 month ago

2.0.53

1 month ago

2.0.51

1 month ago

2.0.52

1 month ago

2.0.48

2 months ago

2.0.46

2 months ago

2.0.44

3 months ago

2.0.42

3 months ago

2.0.43

3 months ago

2.0.41

3 months ago

2.0.40

3 months ago

2.0.38

3 months ago

2.0.39

3 months ago

2.0.37

4 months ago

2.0.35

4 months ago

2.0.36

4 months ago

2.0.28

4 months ago

2.0.29

4 months ago

2.0.33

4 months ago

2.0.34

4 months ago

2.0.31

4 months ago

2.0.32

4 months ago

2.0.30

4 months ago

2.0.26

4 months ago

2.0.27

4 months ago

2.0.24

4 months ago

2.0.25

4 months ago

2.0.3

4 months ago

2.0.2

4 months ago

2.0.5

4 months ago

2.0.4

4 months ago

2.0.7

4 months ago

2.0.6

4 months ago

2.0.9

4 months ago

2.0.8

4 months ago

2.0.1

4 months ago

2.0.0

4 months ago

2.0.15

4 months ago

2.0.16

4 months ago

2.0.13

4 months ago

2.0.14

4 months ago

2.0.11

4 months ago

2.0.12

4 months ago

2.0.10

4 months ago

2.0.19

4 months ago

2.0.17

4 months ago

2.0.18

4 months ago

2.0.22

4 months ago

2.0.23

4 months ago

2.0.20

4 months ago

2.0.21

4 months ago

1.0.20

4 months ago

1.0.19

4 months ago

1.0.18

4 months ago

1.0.16

4 months ago

1.0.15

4 months ago

1.0.14

4 months ago

1.0.13

4 months ago

1.0.12

4 months ago

1.0.11

4 months ago

1.0.10

4 months ago

1.0.9

4 months ago

1.0.8

4 months ago

1.0.7

4 months ago

1.0.6

4 months ago

1.0.5

4 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago

0.1.0

5 months ago

0.0.134

5 months ago

0.0.133

5 months ago

0.0.132

5 months ago

0.0.130

5 months ago

0.0.128

5 months ago

0.0.127

5 months ago

0.0.129

5 months ago

0.0.126

5 months ago

0.0.125

5 months ago

0.0.122

5 months ago

0.0.121

5 months ago

0.0.120

5 months ago

0.0.119

6 months ago

0.0.118

6 months ago

0.0.117

6 months ago

0.0.116

6 months ago

0.0.115

6 months ago

0.0.114

6 months ago

0.0.113

6 months ago

0.0.112

6 months ago

0.0.111

6 months ago

0.0.110

6 months ago

0.0.109

6 months ago

0.0.108

6 months ago

0.0.107

6 months ago

0.0.106

6 months ago

0.0.105

6 months ago

0.0.104

6 months ago

0.0.103

7 months ago

0.0.102

7 months ago

0.0.101

7 months ago

0.0.100

7 months ago

0.0.98

7 months ago

0.0.97

7 months ago

0.0.95

7 months ago

0.0.94

7 months ago

0.0.93

7 months ago

0.0.92

7 months ago

0.0.91

7 months ago

0.0.90

7 months ago

0.0.89

7 months ago

0.0.88

8 months ago

0.0.87

8 months ago

0.0.86

8 months ago

0.0.85

8 months ago

0.0.84

8 months ago

0.0.82

8 months ago

0.0.81

8 months ago

0.0.80

8 months ago

0.0.79

8 months ago

0.0.78

8 months ago

0.0.77

8 months ago

0.0.76

8 months ago

0.0.75

8 months ago

0.0.74

8 months ago

0.0.73

8 months ago

0.0.72

8 months ago

0.0.71

8 months ago

0.0.70

8 months ago

0.0.69

8 months ago

0.0.68

8 months ago

0.0.67

8 months ago

0.0.65

8 months ago

0.0.64

8 months ago

0.0.63

8 months ago

0.0.62

8 months ago

0.0.61

8 months ago

0.0.60

8 months ago

0.0.59

8 months ago

0.0.57

8 months ago

0.0.56

8 months ago

0.0.55

8 months ago

0.0.54

8 months ago

0.0.53

8 months ago

0.0.52

8 months ago

0.0.51

8 months ago

0.0.50

8 months ago

0.0.49

8 months ago

0.0.48

8 months ago

0.0.47

8 months ago

0.0.46

8 months ago

0.0.45

8 months ago

0.0.44

8 months ago

0.0.43

8 months ago

0.0.42

8 months ago

0.0.41

8 months ago

0.0.40

8 months ago

0.0.39

8 months ago

0.0.38

8 months ago

0.0.37

8 months ago

0.0.36

8 months ago

0.0.35

8 months ago

0.0.34

8 months ago

0.0.33

8 months ago

0.0.32

8 months ago

0.0.31

8 months ago

0.0.30

8 months ago

0.0.29

8 months ago

0.0.28

8 months ago

0.0.27

8 months ago

0.0.26

8 months ago

0.0.25

8 months ago

0.0.24

8 months ago

0.0.23

8 months ago

0.0.22

8 months ago

0.0.21

8 months ago

0.0.20

8 months ago

0.0.19

8 months ago

0.0.18

8 months ago

0.0.17

8 months ago

0.0.15

8 months ago

0.0.14

8 months ago

0.0.13

8 months ago

0.0.12

8 months ago

0.0.11

8 months ago

0.0.9

8 months ago

0.0.7

8 months ago

0.0.6

8 months ago

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago