@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.
Files changed (97) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +95 -0
  3. package/package.json +30 -0
  4. package/src/core/MagicCard.js +250 -0
  5. package/src/core/helpers.js +6 -0
  6. package/src/core/index.js +3 -0
  7. package/src/data/abilityWords.js +66 -0
  8. package/src/data/colors.js +15 -0
  9. package/src/data/gameFormats.js +25 -0
  10. package/src/data/games.js +5 -0
  11. package/src/data/guilds.js +33 -0
  12. package/src/data/languages.js +30 -0
  13. package/src/data/rarities.js +25 -0
  14. package/src/expressions/ArrayLengthExpression.js +15 -0
  15. package/src/expressions/ColorExpression.js +40 -0
  16. package/src/expressions/DevotionExpression.js +56 -0
  17. package/src/expressions/EvenOddExpression.js +43 -0
  18. package/src/expressions/ExactStringExpression.js +11 -0
  19. package/src/expressions/FormatExpression.js +19 -0
  20. package/src/expressions/GameExpression.js +19 -0
  21. package/src/expressions/KeywordAbilityExpression.js +33 -0
  22. package/src/expressions/LanguageExpression.js +34 -0
  23. package/src/expressions/ManaExpression.js +36 -0
  24. package/src/expressions/PowTouExpression.js +41 -0
  25. package/src/expressions/ProducesExpression.js +35 -0
  26. package/src/expressions/RarityExpression.js +30 -0
  27. package/src/expressions/has/IndicatorExpression.js +11 -0
  28. package/src/expressions/has/WatermarkExpression.js +11 -0
  29. package/src/expressions/is/BoosterExpression.js +11 -0
  30. package/src/expressions/is/DFCExpression.js +11 -0
  31. package/src/expressions/is/EtchedExpression.js +11 -0
  32. package/src/expressions/is/FlipExpression.js +11 -0
  33. package/src/expressions/is/FoilExpression.js +11 -0
  34. package/src/expressions/is/FrenchVanillaExpression.js +11 -0
  35. package/src/expressions/is/FullArtExpression.js +11 -0
  36. package/src/expressions/is/GlossyExpression.js +11 -0
  37. package/src/expressions/is/HistoricExpression.js +11 -0
  38. package/src/expressions/is/HybridExpression.js +11 -0
  39. package/src/expressions/is/LevelerExpression.js +11 -0
  40. package/src/expressions/is/MDFCExpression.js +11 -0
  41. package/src/expressions/is/MeldExpression.js +11 -0
  42. package/src/expressions/is/ModalExpression.js +11 -0
  43. package/src/expressions/is/NonFoilExpression.js +11 -0
  44. package/src/expressions/is/PartyExpression.js +11 -0
  45. package/src/expressions/is/PermanentExpression.js +11 -0
  46. package/src/expressions/is/PhyrexianExpression.js +11 -0
  47. package/src/expressions/is/PromoExpression.js +11 -0
  48. package/src/expressions/is/ReprintExpression.js +11 -0
  49. package/src/expressions/is/ReservedExpression.js +11 -0
  50. package/src/expressions/is/SpellExpression.js +11 -0
  51. package/src/expressions/is/SplitExpression.js +11 -0
  52. package/src/expressions/is/SpotlightExpression.js +11 -0
  53. package/src/expressions/is/TextlessExpression.js +11 -0
  54. package/src/expressions/is/TransformExpression.js +11 -0
  55. package/src/expressions/is/UniversesBeyondExpression.js +11 -0
  56. package/src/expressions/is/VanillaExpression.js +11 -0
  57. package/src/expressions/is/index.js +59 -0
  58. package/src/extensions/ColorExtension.js +22 -0
  59. package/src/extensions/FormatExtension.js +15 -0
  60. package/src/extensions/GameExtension.js +15 -0
  61. package/src/extensions/KeywordExtension.js +11 -0
  62. package/src/extensions/LanguageExtension.js +15 -0
  63. package/src/extensions/RarityExtension.js +20 -0
  64. package/src/extensions/SetExtension.js +13 -0
  65. package/src/index.js +36 -0
  66. package/src/keywords/AbilityKeyword.js +16 -0
  67. package/src/keywords/ArtistKeyword.js +11 -0
  68. package/src/keywords/BannedKeyword.js +21 -0
  69. package/src/keywords/BorderKeyword.js +21 -0
  70. package/src/keywords/CardTypeKeyword.js +11 -0
  71. package/src/keywords/CollectorNumberKeyword.js +16 -0
  72. package/src/keywords/ColorIdentityKeyword.js +11 -0
  73. package/src/keywords/ColorKeyword.js +17 -0
  74. package/src/keywords/DevotionKeyword.js +21 -0
  75. package/src/keywords/FlavorTextKeyword.js +11 -0
  76. package/src/keywords/FormatKeyword.js +21 -0
  77. package/src/keywords/FrameKeyword.js +22 -0
  78. package/src/keywords/GameKeyword.js +21 -0
  79. package/src/keywords/HasKeyword.js +13 -0
  80. package/src/keywords/IsKeyword.js +17 -0
  81. package/src/keywords/LanguageKeyword.js +16 -0
  82. package/src/keywords/LoyaltyKeyword.js +16 -0
  83. package/src/keywords/ManaCostKeyword.js +20 -0
  84. package/src/keywords/ManaValueKeyword.js +17 -0
  85. package/src/keywords/NameKeyword.js +11 -0
  86. package/src/keywords/NotKeyword.js +21 -0
  87. package/src/keywords/PowerKeyword.js +29 -0
  88. package/src/keywords/ProducesKeyword.js +16 -0
  89. package/src/keywords/RarityKeyword.js +16 -0
  90. package/src/keywords/RestrictedKeyword.js +21 -0
  91. package/src/keywords/RulesTextKeyword.js +11 -0
  92. package/src/keywords/SetKeyword.js +21 -0
  93. package/src/keywords/SetTypeKeyword.js +21 -0
  94. package/src/keywords/StampKeyword.js +21 -0
  95. package/src/keywords/ToughnessKeyword.js +29 -0
  96. package/src/keywords/WatermarkKeyword.js +16 -0
  97. package/src/keywords/index.js +65 -0
@@ -0,0 +1,56 @@
1
+ import {SearchSyntaxError} from 'sigil-sifter/core';
2
+ import ManaExpression from './ManaExpression.js';
3
+
4
+ const allowedSymbolTypes = [
5
+ 'coloredMana',
6
+ 'twoColorHybridMana',
7
+ 'threeColorHybridMana',
8
+ 'fourColorHybridMana',
9
+ 'fiveColorHybridMana'
10
+ ];
11
+
12
+ function isAllowedColor(prevSymbol, sym) {
13
+ const inputValue = sym.colors.sort().join('/');
14
+ if (prevSymbol.length)
15
+ return prevSymbol[0] === inputValue;
16
+ prevSymbol.push(inputValue);
17
+ return true;
18
+ }
19
+
20
+ export default class DevotionExpression extends ManaExpression {
21
+ constructor(sifter, match, str) {
22
+ super(sifter, match, str);
23
+ let prevSymbol = [];
24
+ const invalidInput = this.searchManaCost.symbols.some(sym => {
25
+ return !allowedSymbolTypes.includes(sym.type)
26
+ || !isAllowedColor(prevSymbol, sym);
27
+ });
28
+ if (invalidInput)
29
+ throw new SearchSyntaxError(
30
+ 'Devotion can only match single color and hybrid mana',
31
+ match[0]
32
+ );
33
+ }
34
+
35
+ includes(val) {
36
+ return this.greaterThan(val) || this.equals(val);
37
+ }
38
+
39
+ equals(val) {
40
+ return this.searchManaCost.colors.some(c => {
41
+ return val.getDevotionTo(c) === this.searchManaCost.getDevotionTo(c);
42
+ });
43
+ }
44
+
45
+ greaterThan(val) {
46
+ return this.searchManaCost.colors.some(c => {
47
+ return val.getDevotionTo(c) > this.searchManaCost.getDevotionTo(c);
48
+ });
49
+ }
50
+
51
+ lessThan(val) {
52
+ return this.searchManaCost.colors.every(c => {
53
+ return val.getDevotionTo(c) < this.searchManaCost.getDevotionTo(c);
54
+ });
55
+ }
56
+ }
@@ -0,0 +1,43 @@
1
+ import { SearchSyntaxError } from 'sigil-sifter/core';
2
+ import { Expression } from 'sigil-sifter/expressions';
3
+
4
+ export default class EvenOddExpression extends Expression {
5
+ static match(sifter, str) {
6
+ return str.match(/^(even|odd)/i);
7
+ }
8
+
9
+ static parse(sifter, match, str) {
10
+ return new EvenOddExpression(sifter, match, str);
11
+ }
12
+
13
+ constructor(sifter, match, str) {
14
+ super(sifter, match, str);
15
+ const isOdd = match[1].toLowerCase() === 'odd';
16
+ this.expectedRemainder = isOdd ? 1 : 0;
17
+ }
18
+
19
+ includes(val) {
20
+ return (val % 2) === this.expectedRemainder;
21
+ }
22
+
23
+ equals(val) {
24
+ throw new SearchSyntaxError(
25
+ 'Equality operators are not supported for even/odd ' +
26
+ 'expressions, use the includes operator (\':\') instead.'
27
+ );
28
+ }
29
+
30
+ greaterThan(val) {
31
+ throw new SearchSyntaxError(
32
+ 'Comparison operators are not supported for even/odd ' +
33
+ 'expressions, use the includes operator (\':\') instead.'
34
+ );
35
+ }
36
+
37
+ lessThan(val) {
38
+ throw new SearchSyntaxError(
39
+ 'Comparison operators are not supported for even/odd ' +
40
+ 'expressions, use the includes operator (\':\') instead.'
41
+ );
42
+ }
43
+ }
@@ -0,0 +1,11 @@
1
+ import { StringExpression } from 'sigil-sifter/expressions';
2
+
3
+ export default class ExactStringExpression extends StringExpression {
4
+ includes(value) {
5
+ return this.equals(value);
6
+ }
7
+
8
+ equals(value) {
9
+ return value.toLowerCase() === this.value;
10
+ }
11
+ }
@@ -0,0 +1,19 @@
1
+ import { SearchSyntaxError } from 'sigil-sifter/core';
2
+ import { StringExpression } from 'sigil-sifter/expressions';
3
+
4
+ export default class FormatExpression extends StringExpression {
5
+ constructor(sifter, match, str) {
6
+ super(sifter, match, str);
7
+ this.format = sifter.FormatExtension.resolveFormat(this.value);
8
+ if (!this.format)
9
+ throw new SearchSyntaxError('Unknown game format', match[0]);
10
+ }
11
+
12
+ includes(val) {
13
+ return this.equals(val);
14
+ }
15
+
16
+ equals(val) {
17
+ return this.format.expr.test(val);
18
+ }
19
+ }
@@ -0,0 +1,19 @@
1
+ import { SearchSyntaxError } from 'sigil-sifter/core';
2
+ import { StringExpression } from 'sigil-sifter/expressions';
3
+
4
+ export default class GameExpression extends StringExpression {
5
+ constructor(sifter, match, str) {
6
+ super(sifter, match, str);
7
+ this.game = sifter.GameExtension.resolveGame(this.value);
8
+ if (!this.game)
9
+ throw new SearchSyntaxError('Unknown game', match[0]);
10
+ }
11
+
12
+ includes(val) {
13
+ return val.some(g => this.game.expr.test(g));
14
+ }
15
+
16
+ equals(val) {
17
+ return this.includes(val);
18
+ }
19
+ }
@@ -0,0 +1,33 @@
1
+ import { SearchSyntaxError } from 'sigil-sifter/core';
2
+ import { StringExpression } from 'sigil-sifter/expressions';
3
+
4
+ export default class KeywordAbilityExpression extends StringExpression {
5
+ static parse(sifter, match, str) {
6
+ return new KeywordAbilityExpression(sifter, match, str);
7
+ }
8
+
9
+ includes(val) {
10
+ return val.includes(this.value);
11
+ }
12
+
13
+ equals(val) {
14
+ throw new SearchSyntaxError(
15
+ 'Keyword expressions do not support the equals operator',
16
+ this.remainingStr
17
+ );
18
+ }
19
+
20
+ greaterThan(val) {
21
+ throw new SearchSyntaxError(
22
+ 'Keyword expressions do not support the greater than operator',
23
+ this.remainingStr
24
+ );
25
+ }
26
+
27
+ lessThan(val) {
28
+ throw new SearchSyntaxError(
29
+ 'Keyword expressions do not support the less than operator',
30
+ this.remainingStr
31
+ );
32
+ }
33
+ }
@@ -0,0 +1,34 @@
1
+ import { SearchSyntaxError } from 'sigil-sifter/core';
2
+ import { StringExpression } from 'sigil-sifter/expressions';
3
+
4
+ export default class LanguageExpression extends StringExpression {
5
+ constructor(sifter, match, str) {
6
+ super(sifter, match, str);
7
+ this.value = match[1];
8
+ this.language = sifter.LanguageExtension.resolveLanguage(this.value);
9
+ if (!this.language)
10
+ throw new SearchSyntaxError('Unknown language', this.value);
11
+ }
12
+
13
+ includes(val) {
14
+ return this.equals(val);
15
+ }
16
+
17
+ equals(val) {
18
+ return val === this.language.acronyms[0];
19
+ }
20
+
21
+ greaterThan(val) {
22
+ throw new SearchSyntaxError(
23
+ 'Comparison operators are not supported for language ' +
24
+ 'expressions, use the includes operator (\':\') instead.'
25
+ );
26
+ }
27
+
28
+ lessThan(val) {
29
+ throw new SearchSyntaxError(
30
+ 'Comparison operators are not supported for language ' +
31
+ 'expressions, use the includes operator (\':\') instead.'
32
+ );
33
+ }
34
+ }
@@ -0,0 +1,36 @@
1
+ import { StringExpression } from 'sigil-sifter/expressions';
2
+ import {SearchSyntaxError} from 'sigil-sifter/core';
3
+ import { ManaCost } from 'mana-scribe';
4
+
5
+ export default class ManaExpression extends StringExpression {
6
+ static parse(sifter, match, str) {
7
+ return new this(sifter, match, str);
8
+ }
9
+
10
+ constructor(sifter, match, str) {
11
+ super(sifter, match, str);
12
+ this.searchManaCost = ManaCost.parse(this.value);
13
+ const unparsedManaCost = this.searchManaCost.remainingStr;
14
+ if (unparsedManaCost.length > 0)
15
+ throw new SearchSyntaxError(
16
+ 'Failed to parse mana cost',
17
+ unparsedManaCost
18
+ );
19
+ }
20
+
21
+ includes(val) {
22
+ return this.greaterThan(val) || this.equals(val);
23
+ }
24
+
25
+ equals(val) {
26
+ return val.equals(this.searchManaCost);
27
+ }
28
+
29
+ greaterThan(val) {
30
+ return val.greaterThan(this.searchManaCost);
31
+ }
32
+
33
+ lessThan(val) {
34
+ return val.lessThan(this.searchManaCost);
35
+ }
36
+ }
@@ -0,0 +1,41 @@
1
+ import { SearchSyntaxError } from 'sigil-sifter/core';
2
+ import { Expression } from 'sigil-sifter/expressions';
3
+
4
+ export default class PowTouExpression extends Expression {
5
+ static match(sifter, str) {
6
+ return str.match(/^(pow(er)?|tou(ghness)?)/i);
7
+ }
8
+
9
+ static parse(sifter, match, str) {
10
+ return new PowTouExpression(sifter, match, str);
11
+ }
12
+
13
+ constructor(sifter, match, str) {
14
+ super(sifter, match, str);
15
+ const key = match[1].toLowerCase();
16
+ this.powerMode = key === 'pow' || key === 'power';
17
+ }
18
+
19
+ includes() {
20
+ throw new SearchSyntaxError(
21
+ 'Includes operator is not supported for pow/tou expressions, ' +
22
+ 'use a comparison or equality operator instead.'
23
+ );
24
+ }
25
+
26
+ equals({ power, toughness }) {
27
+ return power === toughness;
28
+ }
29
+
30
+ greaterThan({ power, toughness }) {
31
+ return this.powerMode
32
+ ? power < toughness
33
+ : toughness < power;
34
+ }
35
+
36
+ lessThan({ power, toughness }) {
37
+ return this.powerMode
38
+ ? power > toughness
39
+ : toughness > power;
40
+ }
41
+ }
@@ -0,0 +1,35 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class ProducesExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(sifter.ColorExtension.colorNamesExpr)
6
+ || str.match(/^([wubrgc]+)/i);
7
+ }
8
+
9
+ static parse(sifter, match, str) {
10
+ return new this(sifter, match, str);
11
+ }
12
+
13
+ constructor(sifter, match, str) {
14
+ super(sifter, match, str);
15
+ this.value = match[0];
16
+ this.colors = sifter.ColorExtension.resolveColors(this.value);
17
+ }
18
+
19
+ includes(val) {
20
+ return this.colors.every(c => val.includes(c));
21
+ }
22
+
23
+ equals(val) {
24
+ return val.length === this.colors.length && this.includes(val);
25
+ }
26
+
27
+ greaterThan(val) {
28
+ return val.length > this.colors.length && this.includes(val);
29
+ }
30
+
31
+ lessThan(val) {
32
+ return val.length < this.colors.length
33
+ && val.every(c => this.colors.includes(c));
34
+ }
35
+ }
@@ -0,0 +1,30 @@
1
+ import { StringExpression } from 'sigil-sifter/expressions';
2
+
3
+ export default class RarityExpression extends StringExpression {
4
+ static match(sifter, str) {
5
+ return str.match(sifter.RarityExtension.rarityExpr);
6
+ }
7
+
8
+ constructor(sifter, match, str) {
9
+ super(sifter, match, str);
10
+ this.rarity = sifter.RarityExtension.resolveRarity(this.value);
11
+ }
12
+
13
+ includes(val) {
14
+ return this.equals(val);
15
+ }
16
+
17
+ equals(val) {
18
+ return this.rarity.name.toLowerCase() === val;
19
+ }
20
+
21
+ greaterThan(val) {
22
+ const valGroup = this.sifter.RarityExtension.resolveRarity(val);
23
+ return this.rarity.index < valGroup.index;
24
+ }
25
+
26
+ lessThan(val) {
27
+ const valGroup = this.sifter.RarityExtension.resolveRarity(val);
28
+ return this.rarity.index > valGroup.index;
29
+ }
30
+ }
@@ -0,0 +1,11 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class IndicatorExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(/^indicator/i);
6
+ }
7
+
8
+ includes(card) {
9
+ return card.hasIndicator;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class WatermarkExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(/^watermark/i);
6
+ }
7
+
8
+ includes(card) {
9
+ return card.hasWatermark;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class BoosterExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(/^booster/i);
6
+ }
7
+
8
+ includes(card) {
9
+ return card.isBooster;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class DFCExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(/^dfc/i);
6
+ }
7
+
8
+ includes(card) {
9
+ return card.isDFC;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class EtchedExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(/^etched/i);
6
+ }
7
+
8
+ includes(card) {
9
+ return card.isEtched;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class FlipExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(/^flip/i);
6
+ }
7
+
8
+ includes(card) {
9
+ return card.isFlip;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class FoilExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(/^foil/i);
6
+ }
7
+
8
+ includes(card) {
9
+ return card.isFoil;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class FrenchVanillaExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(/^frenchvanilla/i);
6
+ }
7
+
8
+ includes(card) {
9
+ return card.isFrenchVanilla;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class FullArtExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(/^full(art)?/i);
6
+ }
7
+
8
+ includes(card) {
9
+ return card.isFullArt;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class GlossyExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(/^glossy/i);
6
+ }
7
+
8
+ includes(card) {
9
+ return card.isGlossy;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class HistoricExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(/^historic/i);
6
+ }
7
+
8
+ includes(card) {
9
+ return card.isHistoric;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class HybridExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(/^hybrid/i);
6
+ }
7
+
8
+ includes(card) {
9
+ return card.isHybrid;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class LevelerExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(/^leveler/i);
6
+ }
7
+
8
+ includes(card) {
9
+ return card.isLeveler;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class MDFCExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(/^mdfc/i);
6
+ }
7
+
8
+ includes(card) {
9
+ return card.isMDFC;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class MeldExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(/^meld/i);
6
+ }
7
+
8
+ includes(card) {
9
+ return card.isMeld;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class ModalExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(/^modal/i);
6
+ }
7
+
8
+ includes(card) {
9
+ return card.isModal;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class NonFoilExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(/^nonfoil/i);
6
+ }
7
+
8
+ includes(card) {
9
+ return card.isNonFoil;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class PartyExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(/^party/i);
6
+ }
7
+
8
+ includes(card) {
9
+ return card.isParty;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class PermanentExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(/^permanent/i);
6
+ }
7
+
8
+ includes(card) {
9
+ return card.isPermanent;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class PhyrexianExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(/^phyrexian/i);
6
+ }
7
+
8
+ includes(card) {
9
+ return card.isPhyrexian;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class PromoExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(/^promo/i);
6
+ }
7
+
8
+ includes(card) {
9
+ return card.isPromo;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class ReprintExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(/^reprint/i);
6
+ }
7
+
8
+ includes(card) {
9
+ return card.isReprint;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class ReservedExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(/^reserved/i);
6
+ }
7
+
8
+ includes(card) {
9
+ return card.isReserved;
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Expression } from 'sigil-sifter/expressions';
2
+
3
+ export default class SpellExpression extends Expression {
4
+ static match(sifter, str) {
5
+ return str.match(/^spell/i);
6
+ }
7
+
8
+ includes(card) {
9
+ return card.isSpell;
10
+ }
11
+ }