@flesh-and-blood/cards 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,184 @@
1
+ # Flesh and Blood cards
2
+
3
+ - [Overview & installation](#overview-and-installation)
4
+ - [Card interfaces](#card-interfaces)
5
+ - [Enums](#enums)
6
+ - [Working with this project](#working-with-this-project)
7
+
8
+ # 8.0 breaking changes
9
+
10
+ - `card.images` has been deprecated in favor of `card.printings`
11
+ - `defaultImageName` has been renamed `defaultImage` for brevity
12
+ - `specialImageName` has been renamed `specialImage` for brevity
13
+
14
+ # 7.0 breaking changes
15
+
16
+ - `card.rarity` has been deprecated in favor of `card.rarities`
17
+
18
+ ## Overview and installation
19
+
20
+ 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](https://github.com/the-fab-cube/flesh-and-blood-cards) repository maintained by [Tyler Luce](https://github.com/luceleaftea) - all credit goes to him, and all errors are probably added by me in this project 😅.
21
+
22
+ To install run `npm i --save fab-cards`.
23
+
24
+ Access the card data in your project:
25
+
26
+ ```ts
27
+ import { cards } from "fab-cards";
28
+
29
+ cards.forEach((card) => {
30
+ // do stuff with the card data
31
+ });
32
+ ```
33
+
34
+ ## Card interfaces
35
+
36
+ **`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.
37
+
38
+ ### Required
39
+
40
+ | Field | Data type | Examples |
41
+ | -------------- | -------------------- | ------------------------------------------ |
42
+ | artists | `string` array | `[ "Riordan Delmiro" ]` |
43
+ | cardIdentifier | `string` | `"snatch-red"`, `"aether-wildfire-red"` |
44
+ | classes | `Class` enum array | `["Generic"]`, `["Warrior","Wizard"]` |
45
+ | defaultImage | `string` | `"1HP001.width-450"` |
46
+ | printings | `Printing` array | see **`Printing`** |
47
+ | name | `string` | `"Rain Razors"`, `"Pummel"` |
48
+ | rarities | `Rarity` enum array | `["Super Rare"]`, `["Token", "Majestic"]` |
49
+ | setIdentifiers | `string` array | `[ "1HP009", "CRU006" ]` |
50
+ | sets | `Release` enum array | `[ "History Pack 1", "Crucible of War" ]` |
51
+ | specialImage | `string` | `"1HP001.width-450"` |
52
+ | subtypes | `Subtype` enum array | `["OneHanded", "Dagger"]`, `["Aura"]` |
53
+ | types | `Type` enum array | `["Action"]`, `["Hero"]` |
54
+ | typeText | `string` | `"Elemental Ranger Action – Arrow Attack"` |
55
+
56
+ ### Optional
57
+
58
+ | Field | Data type | Examples |
59
+ | -------------------------- | -------------------- | ------------------------------------ |
60
+ | cost | `number` | `0`, `10` |
61
+ | defense | `number` | `3`, `4` |
62
+ | functionalText | `string` | `"If Snatch hits, draw a card."` |
63
+ | fusions | `Fusion` enum array | `[ "Earth", "Ice" ]` |
64
+ | hero | `Hero` enum | `"Rhinar"`, `"Dori"` |
65
+ | intellect | `number` | `3`, `4` |
66
+ | isCardBack | `boolean` | `true` |
67
+ | keywords | `Keyword` enum array | `[ "Boost" ]` |
68
+ | life | `number` | `18`, `40` |
69
+ | oppositeSideCardIdentifier | `string` | `"invoke-kyloria-red"`, `"tomeltai"` |
70
+ | pitch | `number` | `1`, `2`, `3` |
71
+ | power | `number` | `3`, `14` |
72
+ | restrictedFormats | `Format` enum array | `[ "Blitz" ]` |
73
+ | specialCost | `string` | `"XX"`, `"3X"` |
74
+ | specialDefense | `string` | `"*"` |
75
+ | specialPower | `string` | `"*"` |
76
+ | specializations | `Hero` enum array | `["Dromai","Fai"]` |
77
+ | talents | `Talent` enum array | `[ "Draconic" ]` |
78
+ | young | `boolean` | `true` |
79
+
80
+ **`Printing`** contains information about the different printings a card has had (e.g. different sets, foilings)
81
+
82
+ | Field | Data type | Examples |
83
+ | ---------- | --------------------------------- | ----------------------------------- |
84
+ | edition | `string` of `ReleaseEdition` enum | `"Alpha"`, `"Unlimited"` |
85
+ | foiling | `string` of `Foiling` enum | `"Cold"`, `"Rainbow"` |
86
+ | identifier | `string` | `"1HP001"` |
87
+ | image | `string` | `"1HP001.width-450"` |
88
+ | set | `string` of `Release` enum | `"Dynasty"`, `"Uprising"` |
89
+ | treatment | `string` of `Treatment` enum | `"Alternate Art"`, `"Extended Art"` |
90
+
91
+ ## Enums
92
+
93
+ **`Class`**
94
+
95
+ ```ts
96
+ "NotClassed", "Generic", "Adjudicator", "Bard", "Brute", "Guardian", "Illusionist", "Mechanologist", "Merchant", "Ninja", "Ranger", "Runeblade", "Shapeshifter", "Warrior", "Wizard",
97
+ ```
98
+
99
+ <br/>
100
+
101
+ **`Format`**
102
+
103
+ ```ts
104
+ "Blitz", "Clash", "Classic Constructed", "Commoner",
105
+ ```
106
+
107
+ <br/>
108
+
109
+ **`Fusion`**
110
+
111
+ ```ts
112
+ "Earth", "Ice", "Lightning",
113
+ ```
114
+
115
+ <br/>
116
+
117
+ **`Rarity`**
118
+
119
+ ```ts
120
+ "Token", "Common", "Rare", "Super Rare", "Majestic", "Legendary", "Fabled", "Promo",
121
+ ```
122
+
123
+ <br/>
124
+
125
+ **`Release`**
126
+
127
+ ```ts
128
+ // Full sets
129
+ "Arcane Rising", "Crucible of War", "Dynasty", "Everfest", "History Pack 1", "Monarch", "Tales of Aria", "Uprising", "Welcome to Rathe",
130
+
131
+ // Hero/blitz decks
132
+ "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",
133
+
134
+ // One-offs
135
+ "Promos",
136
+ ```
137
+
138
+ <br/>
139
+
140
+ **`Talent`**
141
+
142
+ ```ts
143
+ "Draconic", "Earth", "Elemental", "Ice", "Light", "Lightning", "Royal", "Shadow",
144
+ ```
145
+
146
+ <br/>
147
+
148
+ **`Type`**
149
+
150
+ ```ts
151
+ "Action", "Attack Action", "Attack Reaction", "Defense Reaction", "Equipment", "Hero", "Instant", "Mentor", "Resource", "Token", "Weapon",
152
+ ```
153
+
154
+ **`Hero`**
155
+
156
+ ```ts
157
+ "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",
158
+ ```
159
+
160
+ <br/>
161
+
162
+ **`Keyword`**
163
+
164
+ ```ts
165
+ "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",
166
+ ```
167
+
168
+ ## Working with this project
169
+
170
+ ### Card data
171
+
172
+ - [src/cards.csv](src/cards.csv) is the source of truth for all generated data. The data is managed in Google Sheets and sourced from [the-fab-cube/flesh-and-blood-cards](https://github.com/the-fab-cube/flesh-and-blood-cards).
173
+
174
+ ### Data transformations
175
+
176
+ There are three steps involved in transforming the `.tsv` source data into typed `.ts` code - executed via `npm run transform`.
177
+
178
+ 1. [src/parser.ts](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)
179
+ 1. [src/mapper.ts](src/mapper.ts) takes the parsed card data and transforms it to match the interfaces in [src/interfaces.ts](src/interfaces.ts)
180
+ 1. [src/writer.ts](src/writer.ts) creates `.ts` files containing the card information and all types
181
+
182
+ ### Bundling the library
183
+
184
+ To generate the distributed package code run `npm run build` after transforming the data.
@@ -0,0 +1,3 @@
1
+ import { Card } from './interfaces';
2
+ export declare const cards: Card[];
3
+ export declare const artists: string[];