->
# Handle some mana symbols specially.
# Curly braces are equivalent to square brackets in GenCard.
{->[
}->]
# Round parentheses can be confusing because parentheses
# are also used for reminder text. So, we convert the standard
# mana symbols from parentheses to square brackets to avoid
# any confusion.
(W)->[W]
(U)->[U]
(B)->[B]
(R)->[R]
(G)->[G]
(X)->[X]
# Lowercase standard mana symbols too.
(w)->[W]
(u)->[U]
(b)->[B]
(r)->[R]
(g)->[G]
(x)->[X]
# And numerical mana symbols.
(0)->[0]
(1)->[1]
(2)->[2]
(3)->[3]
(4)->[4]
(5)->[5]
(6)->[6]
(7)->[7]
(8)->[8]
(9)->[9]
(10)->[10]
(11)->[11]
(12)->[12]
(13)->[13]
(14)->[14]
(15)->[15]
(16)->[16]
(17)->[17]
(18)->[18]
(19)->[19]
(20)->[20]
# Handle some variants on the TAP symbol.
# Note the order of these rules is somewhat important,
# because of the rule TAP->[T] which must come after [TAP]->[T]
# otherwise you'd get [TAP] turning into [[T]] which would be wrong.
(T)->[T]
(t)->[T]
(TAP)->[T]
[TAP]->[T]
TAP->[T]
(Tap)->[T]
[Tap]->[T]
T, ->[T],
T: ->[T]:
Tap, ->[T],
Tap: ->[T]:
# Also handle split-mana symbols which use a slash and parentheses.
(W/U)->[W/U]
(U/W)->[U/W]
(W/B)->[W/B]
(B/W)->[B/W]
(U/B)->[U/B]
(B/U)->[B/U]
(U/R)->[U/R]
(R/U)->[R/U]
(B/R)->[B/R]
(R/B)->[R/B]
(B/G)->[B/G]
(G/B)->[G/B]
(R/G)->[R/G]
(G/R)->[G/R]
(R/W)->[R/W]
(W/R)->[W/R]
(G/W)->[G/W]
(W/G)->[W/G]
(G/U)->[G/U]
(U/G)->[U/G]
# Also handle lowercase split-mana symbols which use a slash and parentheses.
o(w/u)->[W/U]
o(u/w)->[U/W]
o(w/b)->[W/B]
o(b/w)->[B/W]
o(u/b)->[U/B]
o(b/u)->[B/U]
o(u/r)->[U/R]
o(r/u)->[R/U]
o(b/r)->[B/R]
o(r/b)->[R/B]
o(b/g)->[B/G]
o(g/b)->[G/B]
o(r/g)->[R/G]
o(g/r)->[G/R]
o(r/w)->[R/W]
o(w/r)->[W/R]
o(g/w)->[G/W]
o(w/g)->[W/G]
o(g/u)->[G/U]
o(u/g)->[U/G]
(w/u)->[W/U]
(u/w)->[U/W]
(w/b)->[W/B]
(b/w)->[B/W]
(u/b)->[U/B]
(b/u)->[B/U]
(u/r)->[U/R]
(r/u)->[R/U]
(b/r)->[B/R]
(r/b)->[R/B]
(b/g)->[B/G]
(g/b)->[G/B]
(r/g)->[R/G]
(g/r)->[G/R]
(r/w)->[R/W]
(w/r)->[W/R]
(g/w)->[G/W]
(w/g)->[W/G]
(g/u)->[G/U]
(u/g)->[U/G]
# Fix split-mana symbols that use brackets and a slash and lowercase.
[w/u]->[W/U]
[u/w]->[U/W]
[w/b]->[W/B]
[b/w]->[B/W]
[u/b]->[U/B]
[b/u]->[B/U]
[u/r]->[U/R]
[r/u]->[R/U]
[b/r]->[B/R]
[r/b]->[R/B]
[b/g]->[B/G]
[g/b]->[G/B]
[r/g]->[R/G]
[g/r]->[G/R]
[r/w]->[R/W]
[w/r]->[W/R]
[g/w]->[G/W]
[w/g]->[W/G]
[g/u]->[G/U]
[u/g]->[U/G]
# Fix wrong order in split-mana symbols that use brackets and a slash.
# These are commented out currently, in case the set designer wants
# unusual inverted mana symbols.
#[U/W]->[W/U]
#[B/W]->[W/B]
#[B/U]->[U/B]
#[R/U]->[U/R]
#[R/B]->[B/R]
#[G/B]->[B/G]
#[G/R]->[R/G]
#[W/R]->[R/W]
#[W/G]->[G/W]
#[U/G]->[G/U]
# Standardise the field names.
Card Title:->Name:
Card Name:->Name:
CardName:->Name:
Casting Cost:->Cost:
Mana Cost:->Cost:
Type & Class:->Type:
Card Type:->Type:
Card Text:->Rules Text:
Flavor:->Flavor Text:
Flavour:->Flavor Text:
Flavour Text:->Flavor Text:
Pow/Tou:->Pow/Tgh:
Pow/Tough:->Pow/Tgh:
Loyalty:->Pow/Tgh:
Set/Rarity:->Rarity:
Colour:->Color:
Expansion Set:->Expansion:
Set:->Expansion:
Card Number:->Number:
Card #:->Number:
Art File:->Artfile:
Artwork:->Artfile:
Art:->Artfile:
Artist Name:->Artist:
Artist's Name:->Artist:
Designer's Name:->Designer:
# The following rules apply only to the card name field.
# Note ~ is used to turn italics on and off in GenCard.
# Also we don't want tab characters so we turn them into spaces.
Name:
->~
->~
\t->
# The following rules apply only to the casting cost field.
# Basically, discard spaces, tabs, etc.
# Also if the whole value is N/A or Land throw it away.
Cost:
->
->
->
\t->
\n->
n/a=>
N/A=>
Land=>
# Fix colourless mana costs which are greater than 9.
10->[10]
11->[11]
12->[12]
13->[13]
14->[14]
15->[15]
16->[16]
17->[17]
18->[18]
19->[19]
20->[20]
# Kamangawa's spoiler used Cost: { } to indicate no cost.
{ }=>
# The following rules apply only to the card type field.
Type:
->
->
# Modernise some archaic types.
Enchant Land=>Enchantment - Aura
Enchant Player=>Enchantment - Aura
Enchant Artifact=>Enchantment - Aura
Enchant Creature=>Enchantment - Aura
Enchant Permanent=>Enchantment - Aura
Enchant Enchantment=>Enchantment - Aura
Enchant Dead Creature=>Enchantment
# The following rules apply only to the rules text field.
Rules Text:
->~
->~
n/a=>
N/A=>
# Ravnica's spoilers used the following unadorned split mana symbols.
W/U can be paid with either->[W/U] can be paid with either
W/B can be paid with either->[W/B] can be paid with either
U/B can be paid with either->[U/B] can be paid with either
U/R can be paid with either->[U/R] can be paid with either
B/R can be paid with either->[B/R] can be paid with either
B/G can be paid with either->[B/G] can be paid with either
R/G can be paid with either->[R/G] can be paid with either
R/W can be paid with either->[R/W] can be paid with either
G/W can be paid with either->[G/W] can be paid with either
G/U can be paid with either->[G/U] can be paid with either
# Coldsnap uses oSi to refer to [Snow] mana.
oSi->[Snow]
# Unglued still uses oG to refer to [G] mana.
oG->[G]
# The following rules apply only to the flavor text field.
Flavor Text:
->~
->~
n/a=>
N/A=>
# The following rules apply only to the power/toughness field.
Pow/Tgh:
->
->
n/a=>
N/A=>
/=>
/0=>0
/1=>1
/2=>2
/3=>3
/4=>4
/5=>5
/6=>6
/7=>7
/8=>8
/9=>9
/10=>10
/11=>11
/12=>12
/X=>X
/*=>*
(->
)->
[->
]->
# The following rules apply only to the card color field.
# Whole line rules using => are used exclusively here to
# avoid conflicting with user-defined colours.
Color:
n/a=>
N/A=>
W=>White
U=>Blue
B=>Black
R=>Red
G=>Green
A=>Artifact
Z=>Multi
L=>Land
white->White
blue->Blue
black->Black
red->Red
green->Green
artifact->Artifact
multi->Multi
land=>Land
Non Basic Land=>Land
Artifact /Brown=>Artifact
Multi-colored->Multi
Multicolored->Multi
Multi-color->Multi
Multi-Color->Multi
Multicolor->Multi
Gold->Multi
WU=>White/Blue
UB=>Blue/Black
BR=>Black/Red
RG=>Red/Green
GW=>Green/White
WB=>White/Black
UR=>Blue/Red
BG=>Black/Green
RW=>Red/White
GU=>Green/Blue
UW=>Blue/White
BU=>Black/Blue
RB=>Red/Black
GR=>Green/Red
WG=>White/Green
BW=>Black/White
RU=>Red/Blue
GB=>Green/Black
WR=>White/Red
UG=>Blue/Green
# The following rules apply only to the rarity field.
# The final rule ensures cards lacking a rarity are designated Common.
Rarity:
Land=>Common
land=>Common
rare 6=>Uncommon
Rare 6=>Uncommon
Rare=>R
rare=>R
Uncommon=>U
uncommon=>U
Common=>C
common=>C
r=>R
u=>U
c=>C
l=>C
=>C