# This file is used by GenCard to simplify spoiler files as they are read. # # Each line of this file can contain a simplification rule. # Rules have "before" and "after" text separated by -> or => # for example if the line was # Tap,->[T], # Then the text "Tap," would be changed into the text "[T]," # within any lines loaded from a spoiler file. # These simplification rules occur before any other parsing of the # spoiler file. # # The purpose of this file is to allow GenCard to read a variety of # different spoiler files which follow slightly varying conventions. # For example, one spoiler might say "Pwr/Tou:" so a rule which # says Pwr/Tou:->Pow/Tgh: would allow that spoiler to be read # correctly by GenCard. # # Field lines: # # If a line doesn't contain -> but it ends in a colon : # then all subsequent lines apply only to the field written left # of the colon. For example, if the following lines appeared # Pow/Tgh: # /-> # X/X->*/* # Casting Cost: # W->[W] # U->[U] # B->[B] # R->[R] # G->[G] # then there are now two rules defined which only apply within # the Pow/Tgh field, and five rules defined which only apply # within the Casting Cost field. Only another field line will # change which field is matched against. # Hence, all rules which affect the entire spoiler file must # be given at the top of this file before any field lines. # # Substring matching versus whole string matching: # # Both -> and => can be used but they mean different things. # The rule X->Y will replace all instances of X with Y. # The rule X=>Y will only replace a field value if it is exactly X. # Hence, common=>Common won't turn Uncommon into UnCommon. # Note, the whole field must match with => so a field must have been named. # For example, Rarity: might be given above that previous example, # so that would change the line "Rarity: common" into "Rarity: Common". # # Rule language syntax: # # Here's a more complete description of this file's rule language. # Blank lines in this file are ignored. # Lines starting with # are comments, but the # must be the first thing. # Comments cannot be written on the same line as rules. # Lines with -> are rules lines. All instances of the pattern are replaced. # Lines which end in : but don't include -> specify a field name to match. # Subsequent rules lines only apply to the last named field. # Lines with => are rules lines. The pattern only matches a whole field value, # so this is only useful after a field has been named. # Various special characters are allowed in this file: # \r means carriage-return # \n means newline # \t means tab # \# means hash (not a comment) # \> means > # \< means < (for consistency) # \\ means back-slash # Spaces and tabs and case are significant in this file. # # -> and => are searched for only after the first character on a rule line, # so it's possible to write a rule such as # =>=>-> which would turn => into -> (because the first = in => # will be treated as an ordinary character to find). # The other way to write this rule is =\>=>-> because # \> will be converted to > only after => has been located. # # Note the order of these rules is important. Rules can # produce side-effects. For example, the following rules # U/W=>W/U # W/U=>[WU] # would trigger one after the other if U/W was in the spoiler # and together they would convert U/W=>[WU] # # Global rules start here. # Handle uppercase markup by making it lowercase.
->

->

->
-> -> -> -> CARDNAME-> -> -> \r\n->\n

->

->

# 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