@sigil-sifter/magic 1.0.0
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/LICENSE +7 -0
- package/README.md +95 -0
- package/package.json +30 -0
- package/src/core/MagicCard.js +250 -0
- package/src/core/helpers.js +6 -0
- package/src/core/index.js +3 -0
- package/src/data/abilityWords.js +66 -0
- package/src/data/colors.js +15 -0
- package/src/data/gameFormats.js +25 -0
- package/src/data/games.js +5 -0
- package/src/data/guilds.js +33 -0
- package/src/data/languages.js +30 -0
- package/src/data/rarities.js +25 -0
- package/src/expressions/ArrayLengthExpression.js +15 -0
- package/src/expressions/ColorExpression.js +40 -0
- package/src/expressions/DevotionExpression.js +56 -0
- package/src/expressions/EvenOddExpression.js +43 -0
- package/src/expressions/ExactStringExpression.js +11 -0
- package/src/expressions/FormatExpression.js +19 -0
- package/src/expressions/GameExpression.js +19 -0
- package/src/expressions/KeywordAbilityExpression.js +33 -0
- package/src/expressions/LanguageExpression.js +34 -0
- package/src/expressions/ManaExpression.js +36 -0
- package/src/expressions/PowTouExpression.js +41 -0
- package/src/expressions/ProducesExpression.js +35 -0
- package/src/expressions/RarityExpression.js +30 -0
- package/src/expressions/has/IndicatorExpression.js +11 -0
- package/src/expressions/has/WatermarkExpression.js +11 -0
- package/src/expressions/is/BoosterExpression.js +11 -0
- package/src/expressions/is/DFCExpression.js +11 -0
- package/src/expressions/is/EtchedExpression.js +11 -0
- package/src/expressions/is/FlipExpression.js +11 -0
- package/src/expressions/is/FoilExpression.js +11 -0
- package/src/expressions/is/FrenchVanillaExpression.js +11 -0
- package/src/expressions/is/FullArtExpression.js +11 -0
- package/src/expressions/is/GlossyExpression.js +11 -0
- package/src/expressions/is/HistoricExpression.js +11 -0
- package/src/expressions/is/HybridExpression.js +11 -0
- package/src/expressions/is/LevelerExpression.js +11 -0
- package/src/expressions/is/MDFCExpression.js +11 -0
- package/src/expressions/is/MeldExpression.js +11 -0
- package/src/expressions/is/ModalExpression.js +11 -0
- package/src/expressions/is/NonFoilExpression.js +11 -0
- package/src/expressions/is/PartyExpression.js +11 -0
- package/src/expressions/is/PermanentExpression.js +11 -0
- package/src/expressions/is/PhyrexianExpression.js +11 -0
- package/src/expressions/is/PromoExpression.js +11 -0
- package/src/expressions/is/ReprintExpression.js +11 -0
- package/src/expressions/is/ReservedExpression.js +11 -0
- package/src/expressions/is/SpellExpression.js +11 -0
- package/src/expressions/is/SplitExpression.js +11 -0
- package/src/expressions/is/SpotlightExpression.js +11 -0
- package/src/expressions/is/TextlessExpression.js +11 -0
- package/src/expressions/is/TransformExpression.js +11 -0
- package/src/expressions/is/UniversesBeyondExpression.js +11 -0
- package/src/expressions/is/VanillaExpression.js +11 -0
- package/src/expressions/is/index.js +59 -0
- package/src/extensions/ColorExtension.js +22 -0
- package/src/extensions/FormatExtension.js +15 -0
- package/src/extensions/GameExtension.js +15 -0
- package/src/extensions/KeywordExtension.js +11 -0
- package/src/extensions/LanguageExtension.js +15 -0
- package/src/extensions/RarityExtension.js +20 -0
- package/src/extensions/SetExtension.js +13 -0
- package/src/index.js +36 -0
- package/src/keywords/AbilityKeyword.js +16 -0
- package/src/keywords/ArtistKeyword.js +11 -0
- package/src/keywords/BannedKeyword.js +21 -0
- package/src/keywords/BorderKeyword.js +21 -0
- package/src/keywords/CardTypeKeyword.js +11 -0
- package/src/keywords/CollectorNumberKeyword.js +16 -0
- package/src/keywords/ColorIdentityKeyword.js +11 -0
- package/src/keywords/ColorKeyword.js +17 -0
- package/src/keywords/DevotionKeyword.js +21 -0
- package/src/keywords/FlavorTextKeyword.js +11 -0
- package/src/keywords/FormatKeyword.js +21 -0
- package/src/keywords/FrameKeyword.js +22 -0
- package/src/keywords/GameKeyword.js +21 -0
- package/src/keywords/HasKeyword.js +13 -0
- package/src/keywords/IsKeyword.js +17 -0
- package/src/keywords/LanguageKeyword.js +16 -0
- package/src/keywords/LoyaltyKeyword.js +16 -0
- package/src/keywords/ManaCostKeyword.js +20 -0
- package/src/keywords/ManaValueKeyword.js +17 -0
- package/src/keywords/NameKeyword.js +11 -0
- package/src/keywords/NotKeyword.js +21 -0
- package/src/keywords/PowerKeyword.js +29 -0
- package/src/keywords/ProducesKeyword.js +16 -0
- package/src/keywords/RarityKeyword.js +16 -0
- package/src/keywords/RestrictedKeyword.js +21 -0
- package/src/keywords/RulesTextKeyword.js +11 -0
- package/src/keywords/SetKeyword.js +21 -0
- package/src/keywords/SetTypeKeyword.js +21 -0
- package/src/keywords/StampKeyword.js +21 -0
- package/src/keywords/ToughnessKeyword.js +29 -0
- package/src/keywords/WatermarkKeyword.js +16 -0
- package/src/keywords/index.js +65 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2025 Colin A
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# @sigil-sifter/magic
|
|
2
|
+
|
|
3
|
+
This is a module which provides the keywords, expressions, and data extensions to filter Magic: The Gathering cards with sigil-sifter.
|
|
4
|
+
|
|
5
|
+
## installation
|
|
6
|
+
```bash
|
|
7
|
+
npm i @sigil-sifter/magic
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## usage
|
|
11
|
+
```js
|
|
12
|
+
import Sifter from 'sigil-sifter';
|
|
13
|
+
import Magic from '@sigil-sifter/magic';
|
|
14
|
+
import { MagicCard } from '@sigil-sifter/magic/core';
|
|
15
|
+
|
|
16
|
+
class CardClass extends MagicCard {
|
|
17
|
+
// implement your custom card data wrapper here
|
|
18
|
+
// see the base MagicCard class for all methods
|
|
19
|
+
get names() {
|
|
20
|
+
return [this.card.name];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// you can pass the library data to override default
|
|
25
|
+
// behavior or enable certain keywords
|
|
26
|
+
const GameData = {
|
|
27
|
+
colors: null,
|
|
28
|
+
guilds: null,
|
|
29
|
+
gameFormats: null,
|
|
30
|
+
abilityWords: null,
|
|
31
|
+
languages: null,
|
|
32
|
+
rarities: null,
|
|
33
|
+
sets: null
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
Magic(sifter, CardClass, GameData);
|
|
37
|
+
|
|
38
|
+
// invoke sifter to filter an array of cards
|
|
39
|
+
const cards = [{
|
|
40
|
+
name: 'Black Lotus'
|
|
41
|
+
}, {
|
|
42
|
+
name: 'Mox Emerald'
|
|
43
|
+
}, {
|
|
44
|
+
name: 'Mox Sapphire'
|
|
45
|
+
}]
|
|
46
|
+
sifter.filter(cards, 'black lotus');
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## implemented keywords
|
|
50
|
+
Pretty much every keyword defined on the [scryfall search syntax](https://scryfall.com/docs/syntax) page is implemented by this module. You can use the `@sigil-sifter/magic-scryfall` package with this module to search downloaded scryfall card data directly.
|
|
51
|
+
|
|
52
|
+
## unimplemented keywords
|
|
53
|
+
|
|
54
|
+
**TAGGING**
|
|
55
|
+
- otag/oracletag/function
|
|
56
|
+
- art/atag/arttag
|
|
57
|
+
|
|
58
|
+
**PRICING**
|
|
59
|
+
- usd
|
|
60
|
+
- eur
|
|
61
|
+
- tix
|
|
62
|
+
|
|
63
|
+
**SET**
|
|
64
|
+
- block
|
|
65
|
+
- year
|
|
66
|
+
- date
|
|
67
|
+
|
|
68
|
+
**PRINTINGS**
|
|
69
|
+
- in
|
|
70
|
+
- sets
|
|
71
|
+
- cheapest
|
|
72
|
+
- prints
|
|
73
|
+
|
|
74
|
+
**OTHERS**
|
|
75
|
+
- fulloracle, ~ support in oracle text
|
|
76
|
+
- artists
|
|
77
|
+
- illustrations
|
|
78
|
+
- is:hires
|
|
79
|
+
- new
|
|
80
|
+
- is:reserved
|
|
81
|
+
- is:duelcommander
|
|
82
|
+
- is:commander
|
|
83
|
+
- is:brawler
|
|
84
|
+
- is:companion
|
|
85
|
+
- cube
|
|
86
|
+
- is:\[product]
|
|
87
|
+
- include:extras
|
|
88
|
+
- is:funny
|
|
89
|
+
- is:bear
|
|
90
|
+
- is:\[landgroup]
|
|
91
|
+
- is:masterpiece
|
|
92
|
+
- order
|
|
93
|
+
- prefer
|
|
94
|
+
- direction
|
|
95
|
+
- unique
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sigil-sifter/magic",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "mator",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "src/index.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./src/index.js",
|
|
11
|
+
"./core": "./src/core/index.js"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"prepublishOnly": "cp ../../LICENSE ."
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"mana-scribe": "^1.1.0"
|
|
18
|
+
},
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"sigil-sifter": "^1.0.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"sigil-sifter": "^1.0.0"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"src/*",
|
|
27
|
+
"README.md",
|
|
28
|
+
"LICENSE"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { NotImplementedError } from 'sigil-sifter/core';
|
|
2
|
+
|
|
3
|
+
const permanentTypes = [
|
|
4
|
+
'land', 'creature', 'artifact', 'enchantment',
|
|
5
|
+
'planeswalker', 'battle', 'summon', 'eaturecray'
|
|
6
|
+
];
|
|
7
|
+
|
|
8
|
+
const spellTypes = [
|
|
9
|
+
'instant', 'sorcery', 'creature', 'artifact', 'enchantment',
|
|
10
|
+
'planeswalker', 'battle', 'summon', 'eaturecray'
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
const historicTypes = ['artifact', 'saga', 'legendary'];
|
|
14
|
+
const partyTypes = ['wizard', 'rogue', 'warrior', 'cleric', 'rogue'];
|
|
15
|
+
|
|
16
|
+
export default class MagicCard {
|
|
17
|
+
constructor(sifter, card) {
|
|
18
|
+
this.sifter = sifter;
|
|
19
|
+
this.card = card;
|
|
20
|
+
this._cache = {};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
cache(key, initFn) {
|
|
24
|
+
if (!this._cache.hasOwnProperty(key))
|
|
25
|
+
this._cache[key] = initFn();
|
|
26
|
+
return this._cache[key];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
get artists() {
|
|
30
|
+
throw new NotImplementedError();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
get banned() {
|
|
34
|
+
throw new NotImplementedError();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
get border() {
|
|
38
|
+
throw new NotImplementedError();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
get collectorNumber() {
|
|
42
|
+
throw new NotImplementedError();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
get colors() {
|
|
46
|
+
throw new NotImplementedError();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
get colorIdentity() {
|
|
50
|
+
throw new NotImplementedError();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
get flavorTexts() {
|
|
54
|
+
throw new NotImplementedError();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
get formats() {
|
|
58
|
+
throw new NotImplementedError();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
get frame() {
|
|
62
|
+
throw new NotImplementedError();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
get frameEffects() {
|
|
66
|
+
throw new NotImplementedError();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
get game() {
|
|
70
|
+
throw new NotImplementedError();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
get keywords() {
|
|
74
|
+
throw new NotImplementedError();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
get loyalty() {
|
|
78
|
+
throw new NotImplementedError();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
get manaValues() {
|
|
82
|
+
throw new NotImplementedError();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
get produces() {
|
|
86
|
+
throw new NotImplementedError();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
get pts() {
|
|
90
|
+
throw new NotImplementedError();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
get rarity() {
|
|
94
|
+
throw new NotImplementedError();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
get restricted() {
|
|
98
|
+
throw new NotImplementedError();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
get rulesTexts() {
|
|
102
|
+
throw new NotImplementedError();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
get set() {
|
|
106
|
+
throw new NotImplementedError();
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
get setType() {
|
|
110
|
+
throw new NotImplementedError();
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
get stamp() {
|
|
114
|
+
throw new NotImplementedError();
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
get typeLines() {
|
|
118
|
+
throw new NotImplementedError();
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
get typeParts() {
|
|
122
|
+
return this.typeLines.flatMap(typeLine => {
|
|
123
|
+
return typeLine.toLowerCase().split(/\s+/);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
get watermarks() {
|
|
128
|
+
throw new NotImplementedError();
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
get hasIndicator() {
|
|
132
|
+
throw new NotImplementedError();
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
get hasWatermark() {
|
|
136
|
+
return this.watermarks.length > 0;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
get isBooster() {
|
|
140
|
+
throw new NotImplementedError();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
get isDFC() {
|
|
144
|
+
throw new NotImplementedError();
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
get isEtched() {
|
|
148
|
+
throw new NotImplementedError();
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
get isFlip() {
|
|
152
|
+
throw new NotImplementedError();
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
get isFoil() {
|
|
156
|
+
throw new NotImplementedError();
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
get isFrenchVanilla() {
|
|
160
|
+
throw new NotImplementedError();
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
get isFullArt() {
|
|
164
|
+
throw new NotImplementedError();
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
get isGlossy() {
|
|
168
|
+
throw new NotImplementedError();
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
get isHistoric() {
|
|
172
|
+
return this.typeParts.some(part => historicTypes.includes(part));
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
get isHybrid() {
|
|
176
|
+
throw new NotImplementedError();
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
get isLeveler() {
|
|
180
|
+
return this.keywords.includes('level up');
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
get isMDFC() {
|
|
184
|
+
throw new NotImplementedError();
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
get isMeld() {
|
|
188
|
+
throw new NotImplementedError();
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
get isModal() {
|
|
192
|
+
throw new NotImplementedError();
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
get isNonFoil() {
|
|
196
|
+
throw new NotImplementedError();
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
get isParty() {
|
|
200
|
+
return this.typeParts.some(part => partyTypes.includes(part));
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
get isPermanent() {
|
|
204
|
+
return this.typeParts.some(part => permanentTypes.includes(part));
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
get isPhyrexian() {
|
|
208
|
+
throw new NotImplementedError();
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
get isPromo() {
|
|
212
|
+
throw new NotImplementedError();
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
get isReprint() {
|
|
216
|
+
throw new NotImplementedError();
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
get isReserved() {
|
|
220
|
+
throw new NotImplementedError();
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
get isSpell() {
|
|
224
|
+
return this.typeParts.some(part => spellTypes.includes(part));
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
get isSplit() {
|
|
228
|
+
throw new NotImplementedError();
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
get isSpotlight() {
|
|
232
|
+
throw new NotImplementedError();
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
get isTextless() {
|
|
236
|
+
throw new NotImplementedError();
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
get isTransform() {
|
|
240
|
+
throw new NotImplementedError();
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
get isUniversesBeyond() {
|
|
244
|
+
throw new NotImplementedError();
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
get isVanilla() {
|
|
248
|
+
return this.rulesTexts.some(rt => rt === '');
|
|
249
|
+
}
|
|
250
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
"Eerie",
|
|
3
|
+
"Battalion",
|
|
4
|
+
"Bloodrush",
|
|
5
|
+
"Channel",
|
|
6
|
+
"Chroma",
|
|
7
|
+
"Cohort",
|
|
8
|
+
"Constellation",
|
|
9
|
+
"Converge",
|
|
10
|
+
"Delirium",
|
|
11
|
+
"Domain",
|
|
12
|
+
"Fateful hour",
|
|
13
|
+
"Ferocious",
|
|
14
|
+
"Formidable",
|
|
15
|
+
"Grandeur",
|
|
16
|
+
"Hellbent",
|
|
17
|
+
"Heroic",
|
|
18
|
+
"Imprint",
|
|
19
|
+
"Inspired",
|
|
20
|
+
"Join forces",
|
|
21
|
+
"Kinship",
|
|
22
|
+
"Landfall",
|
|
23
|
+
"Lieutenant",
|
|
24
|
+
"Metalcraft",
|
|
25
|
+
"Morbid",
|
|
26
|
+
"Parley",
|
|
27
|
+
"Radiance",
|
|
28
|
+
"Raid",
|
|
29
|
+
"Rally",
|
|
30
|
+
"Spell mastery",
|
|
31
|
+
"Strive",
|
|
32
|
+
"Sweep",
|
|
33
|
+
"Tempting offer",
|
|
34
|
+
"Threshold",
|
|
35
|
+
"Will of the council",
|
|
36
|
+
"Adamant",
|
|
37
|
+
"Addendum",
|
|
38
|
+
"Council's dilemma",
|
|
39
|
+
"Eminence",
|
|
40
|
+
"Enrage",
|
|
41
|
+
"Hero's Reward",
|
|
42
|
+
"Kinfall",
|
|
43
|
+
"Landship",
|
|
44
|
+
"Legacy",
|
|
45
|
+
"Revolt",
|
|
46
|
+
"Underdog",
|
|
47
|
+
"Undergrowth",
|
|
48
|
+
"Void",
|
|
49
|
+
"Descend",
|
|
50
|
+
"Fathomless descent",
|
|
51
|
+
"Magecraft",
|
|
52
|
+
"Teamwork",
|
|
53
|
+
"Pack tactics",
|
|
54
|
+
"Coven",
|
|
55
|
+
"Alliance",
|
|
56
|
+
"Corrupted",
|
|
57
|
+
"Secret council",
|
|
58
|
+
"Celebration",
|
|
59
|
+
"Paradox",
|
|
60
|
+
"Will of the Planeswalkers",
|
|
61
|
+
"Survival",
|
|
62
|
+
"Flurry",
|
|
63
|
+
"Valiant",
|
|
64
|
+
"Start your engines!",
|
|
65
|
+
"Renew"
|
|
66
|
+
];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const color = (id, name) => ({
|
|
2
|
+
id,
|
|
3
|
+
name,
|
|
4
|
+
expr: new RegExp('^' + name + '$', 'i'),
|
|
5
|
+
colorChars: [id]
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export default [
|
|
9
|
+
color('W', 'White'),
|
|
10
|
+
color('U', 'Blue'),
|
|
11
|
+
color('B', 'Black'),
|
|
12
|
+
color('R', 'Red'),
|
|
13
|
+
color('G', 'Green'),
|
|
14
|
+
color('C', 'Colorless'),
|
|
15
|
+
];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const format = (name) => ({ name });
|
|
2
|
+
|
|
3
|
+
export default [
|
|
4
|
+
format('standard'),
|
|
5
|
+
format('future'),
|
|
6
|
+
format('historic'),
|
|
7
|
+
format('timeless'),
|
|
8
|
+
format('gladiator'),
|
|
9
|
+
format('pioneer'),
|
|
10
|
+
format('modern'),
|
|
11
|
+
format('legacy'),
|
|
12
|
+
format('pauper'),
|
|
13
|
+
format('vintage'),
|
|
14
|
+
format('penny'),
|
|
15
|
+
format('commander'),
|
|
16
|
+
format('oathbreaker'),
|
|
17
|
+
format('standardbrawl'),
|
|
18
|
+
format('brawl'),
|
|
19
|
+
format('alchemy'),
|
|
20
|
+
format('paupercommander'),
|
|
21
|
+
format('duel'),
|
|
22
|
+
format('oldschool'),
|
|
23
|
+
format('premodern'),
|
|
24
|
+
format('predh'),
|
|
25
|
+
];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const colorCombo = (name, colors) => ({
|
|
2
|
+
name,
|
|
3
|
+
expr: new RegExp('^' + name + '$', 'i'),
|
|
4
|
+
colorChars: colors.split('')
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
export default [
|
|
8
|
+
colorCombo('Azorius', 'WU'),
|
|
9
|
+
colorCombo('Dimir', 'UB'),
|
|
10
|
+
colorCombo('Rakdos', 'BR'),
|
|
11
|
+
colorCombo('Gruul', 'RG'),
|
|
12
|
+
colorCombo('Selesnya', 'WG'),
|
|
13
|
+
colorCombo('Orzhov', 'WB'),
|
|
14
|
+
colorCombo('Izzet', 'UR'),
|
|
15
|
+
colorCombo('Golgari', 'BG'),
|
|
16
|
+
colorCombo('Boros', 'WR'),
|
|
17
|
+
colorCombo('Simic', 'UG'),
|
|
18
|
+
colorCombo('Bant', 'WUG'),
|
|
19
|
+
colorCombo('Esper', 'WUB'),
|
|
20
|
+
colorCombo('Grixis', 'UBR'),
|
|
21
|
+
colorCombo('Jund', 'BRG'),
|
|
22
|
+
colorCombo('Naya', 'WRG'),
|
|
23
|
+
colorCombo('Abzan', 'WBG'),
|
|
24
|
+
colorCombo('Jeskai', 'WUR'),
|
|
25
|
+
colorCombo('Sultai', 'UBG'),
|
|
26
|
+
colorCombo('Mardu', 'WBR'),
|
|
27
|
+
colorCombo('Temur', 'URG'),
|
|
28
|
+
colorCombo('Chaos', 'UBRG'),
|
|
29
|
+
colorCombo('Aggression', 'WBRG'),
|
|
30
|
+
colorCombo('Altruism', 'WURG'),
|
|
31
|
+
colorCombo('Growth', 'WUBG'),
|
|
32
|
+
colorCombo('Artifice', 'WUBR'),
|
|
33
|
+
];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const language = (acronym, name, expr) => ({
|
|
2
|
+
acronyms: Array.isArray(acronym) ? acronym : [acronym],
|
|
3
|
+
name,
|
|
4
|
+
expr: expr || new RegExp('^' + name + '$', 'i')
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
// https://cran.r-project.org/web/packages/scryr/vignettes/languages.html
|
|
8
|
+
export default [
|
|
9
|
+
language('en', 'English'),
|
|
10
|
+
language('es', 'Spanish'),
|
|
11
|
+
language('fr', 'French'),
|
|
12
|
+
language('de', 'German'),
|
|
13
|
+
language('it', 'Italian'),
|
|
14
|
+
language('pt', 'Portuguese'),
|
|
15
|
+
language(['ja', 'jp'], 'Japanese'),
|
|
16
|
+
language(['ko', 'kr'], 'Korean'),
|
|
17
|
+
language('ru', 'Russian'),
|
|
18
|
+
language(['zhs', 'cs'], 'Chinese (Simplified)',
|
|
19
|
+
/^(Chinese \(Simplified\)|Simplified Chinese)$/i
|
|
20
|
+
),
|
|
21
|
+
language(['zht', 'ct'], 'Chinese (Traditional)',
|
|
22
|
+
/^(Chinese \(Traditional\)|Traditional Chinese)$/i
|
|
23
|
+
),
|
|
24
|
+
language('he', 'Hebrew'),
|
|
25
|
+
language('la', 'Latin'),
|
|
26
|
+
language('grc', 'Ancient Greek'),
|
|
27
|
+
language('ar', 'Arabic'),
|
|
28
|
+
language('sa', 'Sanskrit'),
|
|
29
|
+
language('ph', 'Phyrexian')
|
|
30
|
+
];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export default [{
|
|
2
|
+
index: 0,
|
|
3
|
+
char: 'C',
|
|
4
|
+
name: 'Common',
|
|
5
|
+
}, {
|
|
6
|
+
index: 1,
|
|
7
|
+
char: 'U',
|
|
8
|
+
name: 'Uncommon',
|
|
9
|
+
}, {
|
|
10
|
+
index: 2,
|
|
11
|
+
char: 'R',
|
|
12
|
+
name: 'Rare'
|
|
13
|
+
}, {
|
|
14
|
+
index: 3,
|
|
15
|
+
char: 'M',
|
|
16
|
+
name: 'Mythic'
|
|
17
|
+
}, {
|
|
18
|
+
index: 3,
|
|
19
|
+
char: 'S',
|
|
20
|
+
name: 'Special'
|
|
21
|
+
}, {
|
|
22
|
+
index: 4,
|
|
23
|
+
char: 'B',
|
|
24
|
+
name: 'Bonus'
|
|
25
|
+
}];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NumericExpression } from 'sigil-sifter/expressions';
|
|
2
|
+
|
|
3
|
+
export default class ArrayLengthExpression extends NumericExpression {
|
|
4
|
+
equals(val) {
|
|
5
|
+
return val.length === this.value;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
greaterThan(val) {
|
|
9
|
+
return val.length > this.value;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
lessThan(val) {
|
|
13
|
+
return val.length < this.value;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Expression } from 'sigil-sifter/expressions';
|
|
2
|
+
|
|
3
|
+
export default class ColorExpression extends Expression {
|
|
4
|
+
static match(sifter, str) {
|
|
5
|
+
return str.match(sifter.ColorExtension.colorNamesExpr)
|
|
6
|
+
|| str.match(/^([wubrgc]+)/i);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
constructor(sifter, match, str) {
|
|
10
|
+
super(sifter, match, str);
|
|
11
|
+
this.value = match[0];
|
|
12
|
+
this.colors = sifter.ColorExtension.resolveColors(this.value);
|
|
13
|
+
this.colorless = this.colors.includes('C');
|
|
14
|
+
if (this.colorless && this.colors.length > 1)
|
|
15
|
+
throw new Error('A card cannot be both colorless and colored.');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
includes(val) {
|
|
19
|
+
if (this.colorless) return val.length === 0;
|
|
20
|
+
return this.colors.every(c => val.includes(c));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
equals(val) {
|
|
24
|
+
if (this.colorless) return val.length === 0;
|
|
25
|
+
return val.length === this.colors.length
|
|
26
|
+
&& val.every(c => this.colors.includes(c));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
greaterThan(val) {
|
|
30
|
+
if (this.colorless) return val.length > 0;
|
|
31
|
+
return val.length > this.colors.length
|
|
32
|
+
&& this.colors.every(c => val.includes(c));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
lessThan(val) {
|
|
36
|
+
if (this.colorless) return false;
|
|
37
|
+
return val.length < this.colors.length
|
|
38
|
+
&& val.every(c => this.colors.includes(c));
|
|
39
|
+
}
|
|
40
|
+
}
|