Commit 603e4105 authored by coppro's avatar coppro

Added color-defining CDA recognition.

Added "always center" option, and added centering controls to all styles
parent 7e88d4a4
mse version: 0.3.4 mse version: 0.3.4
game: magic game: magic
full name: Extended Art full name: Extended Art
short name: Extended Art short name: Extended Art
...@@ -65,6 +65,14 @@ styling field: ...@@ -65,6 +65,14 @@ styling field:
choice: modern choice: modern
choice: old choice: old
choice: diagonal T choice: diagonal T
styling field:
type: choice
name: center text
description: When to center text (short text only means only on one-line cards with no flavor text)
choice: always
choice: short text only
choice: never
initial: never
styling style: styling style:
popup mana symbols: popup mana symbols:
...@@ -199,7 +207,15 @@ card style: ...@@ -199,7 +207,15 @@ card style:
then "magic-mana-large" then "magic-mana-large"
else "magic-mana-small" else "magic-mana-small"
size: 14 size: 14
alignment: bottom left alignment:
script:
if (styling.center_text == "short text only" and
not contains(match:"\n", card.rule_text) and
card.flavor_text == "<i-flavor></i-flavor>" and
card_style.text.content_lines <= 2) or
styling.center_text == "always"
then "bottom center"
else "bottom left"
z index: 2 z index: 2
padding left: 6 padding left: 6
padding top: 2 padding top: 2
......
mse version: 0.3.4 mse version: 0.3.4
game: magic game: magic
full name: FPM's Flip Magic full name: FPM's Flip Magic
short name: FPM Flip short name: FPM Flip
...@@ -59,6 +59,15 @@ styling field: ...@@ -59,6 +59,15 @@ styling field:
choice: modern choice: modern
choice: old choice: old
choice: diagonal T choice: diagonal T
styling field:
type: choice
name: center text
description: When to center text (short text only means only on one-line cards with no flavor text)
choice: always
choice: short text only
choice: never
initial: never
styling style: styling style:
use guild mana symbols: use guild mana symbols:
choice images: choice images:
...@@ -249,7 +258,15 @@ card style: ...@@ -249,7 +258,15 @@ card style:
{ if styling.beveled_mana_symbols then "magic-mana-beveled" { if styling.beveled_mana_symbols then "magic-mana-beveled"
else "magic-mana-small" } else "magic-mana-small" }
size: 14 size: 14
alignment: middle left alignment:
script:
if (styling.center_text == "short text only" and
not contains(match:"\n", card.rule_text) and
card.flavor_text == "<i-flavor></i-flavor>" and
card_style.text.content_lines <= 2) or
styling.center_text == "always"
then "middle center"
else "middle left"
z index: 2 z index: 2
padding left: 6 padding left: 6
padding top: 2 padding top: 2
...@@ -284,7 +301,15 @@ card style: ...@@ -284,7 +301,15 @@ card style:
{ if styling.beveled_mana_symbols then "magic-mana-beveled" { if styling.beveled_mana_symbols then "magic-mana-beveled"
else "magic-mana-small" } else "magic-mana-small" }
size: 14 size: 14
alignment: middle left alignment:
script:
if (styling.center_text == "short text only" and
not contains(match:"\n", card.rule_text) and
card.flavor_text == "<i-flavor></i-flavor>" and
card_style.text.content_lines <= 2) or
styling.center_text == "always"
then "middle center"
else "middle left"
z index: 2 z index: 2
padding left: 6 padding left: 6
padding top: 2 padding top: 2
......
mse version: 0.3.4 mse version: 0.3.4
game: magic game: magic
full name: FPM's Normal Magic full name: FPM's Normal Magic
short name: FPM Normal short name: FPM Normal
...@@ -73,6 +73,14 @@ styling field: ...@@ -73,6 +73,14 @@ styling field:
choice: modern choice: modern
choice: old choice: old
choice: diagonal T choice: diagonal T
styling field:
type: choice
name: center text
description: When to center text (short text only means only on one-line cards with no flavor text)
choice: always
choice: short text only
choice: never
initial: never
styling style: styling style:
green style: green style:
...@@ -216,7 +224,15 @@ card style: ...@@ -216,7 +224,15 @@ card style:
{ if styling.beveled_mana_symbols then "magic-mana-beveled" { if styling.beveled_mana_symbols then "magic-mana-beveled"
else "magic-mana-small" } else "magic-mana-small" }
size: 14 size: 14
alignment: middle left alignment:
script:
if (styling.center_text == "short text only" and
not contains(match:"\n", card.rule_text) and
card.flavor_text == "<i-flavor></i-flavor>" and
card_style.text.content_lines <= 2) or
styling.center_text == "always"
then "middle center"
else "middle left"
z index: 2 z index: 2
padding left: 6 padding left: 6
padding top: 2 padding top: 2
......
mse version: 0.3.4 mse version: 0.3.4
game: magic game: magic
full name: FPM's Promo Magic full name: FPM's Promo Magic
short name: FPM Promo short name: FPM Promo
...@@ -72,6 +72,15 @@ styling field: ...@@ -72,6 +72,15 @@ styling field:
choice: modern choice: modern
choice: old choice: old
choice: diagonal T choice: diagonal T
styling field:
type: choice
name: center text
description: When to center text (short text only means only on one-line cards with no flavor text)
choice: always
choice: short text only
choice: never
initial: never
styling style: styling style:
green style: green style:
render style: both render style: both
...@@ -205,7 +214,15 @@ card style: ...@@ -205,7 +214,15 @@ card style:
{ if styling.beveled_mana_symbols then "magic-mana-beveled" { if styling.beveled_mana_symbols then "magic-mana-beveled"
else "magic-mana-small" } else "magic-mana-small" }
size: 14 size: 14
alignment: middle left alignment:
script:
if (styling.center_text == "short text only" and
not contains(match:"\n", card.rule_text) and
card.flavor_text == "<i-flavor></i-flavor>" and
card_style.text.content_lines <= 2) or
styling.center_text == "always"
then "middle center"
else "middle left"
z index: 2 z index: 2
padding left: 6 padding left: 6
padding top: 2 padding top: 2
......
mse version: 0.3.4 mse version: 0.3.4
game: magic game: magic
full name: FPM's Split Magic full name: FPM's Split Magic
short name: FPM Split short name: FPM Split
...@@ -74,6 +74,15 @@ styling field: ...@@ -74,6 +74,15 @@ styling field:
choice: modern choice: modern
choice: old choice: old
choice: diagonal T choice: diagonal T
styling field:
type: choice
name: center text
description: When to center text (short text only means only on one-line cards with no flavor text)
choice: always
choice: short text only
choice: never
initial: never
styling style: styling style:
green style: green style:
render style: both render style: both
...@@ -293,7 +302,15 @@ card style: ...@@ -293,7 +302,15 @@ card style:
{ if styling.beveled_mana_symbols then "magic-mana-beveled" { if styling.beveled_mana_symbols then "magic-mana-beveled"
else "magic-mana-small" } else "magic-mana-small" }
size: 14 size: 14
alignment: middle left alignment:
script:
if (styling.center_text == "short text only" and
not contains(match:"\n", card.rule_text) and
card.flavor_text == "<i-flavor></i-flavor>" and
card_style.text.content_lines <= 2) or
styling.center_text == "always"
then "middle center"
else "middle left"
z index: 2 z index: 2
padding left: 6 padding left: 6
padding top: 2 padding top: 2
...@@ -318,7 +335,15 @@ card style: ...@@ -318,7 +335,15 @@ card style:
{ if styling.beveled_mana_symbols then "magic-mana-beveled" { if styling.beveled_mana_symbols then "magic-mana-beveled"
else "magic-mana-small" } else "magic-mana-small" }
size: 14 size: 14
alignment: middle left alignment:
script:
if (styling.center_text == "short text only" and
not contains(match:"\n", card.rule_text) and
card.flavor_text == "<i-flavor></i-flavor>" and
card_style.text.content_lines <= 2) or
styling.center_text == "always"
then "middle center"
else "middle left"
z index: 2 z index: 2
padding left: 6 padding left: 6
padding top: 2 padding top: 2
...@@ -326,6 +351,7 @@ card style: ...@@ -326,6 +351,7 @@ card style:
padding bottom: 2 padding bottom: 2
line height hard: 1.2 line height hard: 1.2
line height line: 1.5 line height line: 1.5
line height soft: 0.9
watermark: watermark:
left: 95.96 left: 95.96
top : 240 top : 240
......
mse version: 0.3.2 mse version: 0.3.2
game: magic game: magic
full name: FPM's Token Magic full name: FPM's Token Magic
short name: FPM Token short name: FPM Token
...@@ -69,6 +69,15 @@ styling field: ...@@ -69,6 +69,15 @@ styling field:
choice: modern choice: modern
choice: old choice: old
choice: diagonal T choice: diagonal T
styling field:
type: choice
name: center text
description: When to center text (short text only means only on one-line cards with no flavor text)
choice: always
choice: short text only
choice: never
initial: never
styling style: styling style:
green style: green style:
render style: both render style: both
...@@ -213,7 +222,15 @@ card style: ...@@ -213,7 +222,15 @@ card style:
{ if styling.beveled_mana_symbols then "magic-mana-beveled" { if styling.beveled_mana_symbols then "magic-mana-beveled"
else "magic-mana-small" } else "magic-mana-small" }
size: 14 size: 14
alignment: middle left alignment:
script:
if (styling.center_text == "short text only" and
not contains(match:"\n", card.rule_text) and
card.flavor_text == "<i-flavor></i-flavor>" and
card_style.text.content_lines <= 2) or
styling.center_text == "always"
then "middle center"
else "middle left"
z index: 3 z index: 3
padding left: 6 padding left: 6
padding top: 2 padding top: 2
......
mse version: 0.3.4 mse version: 0.3.4
game: magic game: magic
short name: Flip Cards short name: Flip Cards
full name: Modern flip cards full name: Modern flip cards
...@@ -59,6 +59,14 @@ styling field: ...@@ -59,6 +59,14 @@ styling field:
choice: modern choice: modern
choice: old choice: old
choice: diagonal T choice: diagonal T
styling field:
type: choice
name: center text
description: When to center text (short text only means only on one-line cards with no flavor text)
choice: always
choice: short text only
choice: never
initial: never
styling style: styling style:
use guild mana symbols: use guild mana symbols:
...@@ -239,7 +247,15 @@ card style: ...@@ -239,7 +247,15 @@ card style:
then "magic-mana-large" then "magic-mana-large"
else "magic-mana-small" else "magic-mana-small"
size: 14 size: 14
alignment: middle left alignment:
script:
if (styling.center_text == "short text only" and
not contains(match:"\n", card.rule_text) and
card.flavor_text == "<i-flavor></i-flavor>" and
card_style.text.content_lines <= 2) or
styling.center_text == "always"
then "middle center"
else "middle left"
z index: 2 z index: 2
padding left: 4 padding left: 4
padding top: -1 padding top: -1
...@@ -268,7 +284,15 @@ card style: ...@@ -268,7 +284,15 @@ card style:
then "magic-mana-large" then "magic-mana-large"
else "magic-mana-small" else "magic-mana-small"
size: 14 size: 14
alignment: middle left alignment:
script:
if (styling.center_text == "short text only" and
not contains(match:"\n", card.rule_text) and
card.flavor_text == "<i-flavor></i-flavor>" and
card_style.text.content_lines <= 2) or
styling.center_text == "always"
then "middle center"
else "middle left"
z index: 2 z index: 2
padding left: 4 padding left: 4
padding top: -1 padding top: -1
......
mse version: 0.3.4 mse version: 0.3.4
game: magic game: magic
short name: Promotional short name: Promotional
full name: Large image full name: Large image
...@@ -68,6 +68,14 @@ styling field: ...@@ -68,6 +68,14 @@ styling field:
choice: modern choice: modern
choice: old choice: old
choice: diagonal T choice: diagonal T
styling field:
type: choice
name: center text
description: When to center text (short text only means only on one-line cards with no flavor text)
choice: always
choice: short text only
choice: never
initial: never
styling style: styling style:
use guild mana symbols: use guild mana symbols:
...@@ -161,7 +169,15 @@ card style: ...@@ -161,7 +169,15 @@ card style:
top : 317 top : 317
width: 286 width: 286
height: 18 height: 18
alignment: top shrink-overflow alignment:
script:
if (styling.center_text == "short text only" and
not contains(match:"\n", card.rule_text) and
card.flavor_text == "<i-flavor></i-flavor>" and
card_style.text.content_lines <= 2) or
styling.center_text == "always"
then "top center shrink-overflow"
else "top left shrink-overflow"
z index: 1 z index: 1
font: font:
name: Matrix name: Matrix
......
mse version: 0.3.4 mse version: 0.3.4
game: magic game: magic
short name: Split Cards short name: Split Cards
full name: Modern split cards full name: Modern split cards
...@@ -70,6 +70,14 @@ styling field: ...@@ -70,6 +70,14 @@ styling field:
choice: modern choice: modern
choice: old choice: old
choice: diagonal T choice: diagonal T
styling field:
type: choice
name: center text
description: When to center text (short text only means only on one-line cards with no flavor text)
choice: always
choice: short text only
choice: never
initial: never
styling style: styling style:
use guild mana symbols: use guild mana symbols:
...@@ -265,7 +273,15 @@ card style: ...@@ -265,7 +273,15 @@ card style:
then "magic-mana-large" then "magic-mana-large"
else "magic-mana-small" else "magic-mana-small"
size: 14 size: 14
alignment: middle left alignment:
script:
if (styling.center_text == "short text only" and
not contains(match:"\n", card.rule_text) and
card.flavor_text == "<i-flavor></i-flavor>" and
card_style.text.content_lines <= 2) or
styling.center_text == "always"
then "middle center"
else "middle left"
z index: 2 z index: 2
padding left: 2 padding left: 2
padding top: 2 padding top: 2
...@@ -292,7 +308,15 @@ card style: ...@@ -292,7 +308,15 @@ card style:
then "magic-mana-large" then "magic-mana-large"
else "magic-mana-small" else "magic-mana-small"
size: 14 size: 14
alignment: middle left alignment:
script:
if (styling.center_text == "short text only" and
not contains(match:"\n", card.rule_text) and
card.flavor_text == "<i-flavor></i-flavor>" and
card_style.text.content_lines <= 2) or
styling.center_text == "always"
then "middle center"
else "middle left"
z index: 2 z index: 2
padding left: 2 padding left: 2
padding top: 2 padding top: 2
......
mse version: 0.3.4 mse version: 0.3.4
game: magic game: magic
short name: Tokens short name: Tokens
full name: Modern style full name: Modern style
...@@ -73,6 +73,14 @@ styling field: ...@@ -73,6 +73,14 @@ styling field:
choice: modern choice: modern
choice: old choice: old
choice: diagonal T choice: diagonal T
styling field:
type: choice
name: center text
description: When to center text (short text only means only on one-line cards with no flavor text)
choice: always
choice: short text only
choice: never
initial: short text only
styling style: styling style:
popup mana symbols: popup mana symbols:
...@@ -208,14 +216,16 @@ card style: ...@@ -208,14 +216,16 @@ card style:
size: 14 size: 14
alignment: alignment:
script: script:
if card_style.text.content_lines == 2 and if (styling.center_text == "short text only" and
card_style.text.content_lines <= 2 and
not contains(match:",", card.rule_text) and not contains(match:",", card.rule_text) and
not contains(match: ".", card.rule_text) and not contains(match: ".", card.rule_text) and
not contains(match: ";", card.rule_text) and not contains(match: ";", card.rule_text) and
not contains(match: ":", card.rule_text) and not contains(match: ":", card.rule_text) and
not contains (match: "!", card.rule_text) and not contains(match: "!", card.rule_text) and
not contains (match: "?", card.rule_text) and not contains(match: "?", card.rule_text) and
card.flavor_text == "<i-flavor></i-flavor>" card.flavor_text == "<i-flavor></i-flavor>") or
styling.center_text == "always"
then "middle center shrink-overflow" then "middle center shrink-overflow"
else "middle left shrink-overflow" else "middle left shrink-overflow"
z index: 2 z index: 2
......
mse version: 0.3.4 mse version: 0.3.4
game: magic game: magic
short name: Modern style short name: Modern style
full name: After 8th edition full name: After 8th edition
...@@ -94,9 +94,12 @@ styling field: ...@@ -94,9 +94,12 @@ styling field:
choice: old choice: old
choice: diagonal T choice: diagonal T
styling field: styling field:
type: boolean type: choice
name: center short text name: center text
description: Center the text on cards with short rule text and no flavor text. description: When to center text (short text only means only on one-line cards with no flavor text)
choice: always
choice: short text only
choice: never
initial: no initial: no
styling style: styling style:
...@@ -243,10 +246,11 @@ card style: ...@@ -243,10 +246,11 @@ card style:
size: 14 size: 14
alignment: alignment:
script: script:
if styling.center_short_text and if (styling.center_text == "short text only" and
not contains(match:"\n", card.rule_text) and not contains(match:"\n", card.rule_text) and
card.flavor_text == "<i-flavor></i-flavor>" and card.flavor_text == "<i-flavor></i-flavor>" and
card_style.text.content_lines <= 2 card_style.text.content_lines <= 2) or
styling.center_text == "always"
then "middle center" then "middle center"
else "middle left" else "middle left"
z index: 2 z index: 2
......
mse version: 0.3.4 mse version: 0.3.4
game: magic game: magic
full name: Magic Old Split Cards full name: Magic Old Split Cards
short name: Old Splits short name: Old Splits
...@@ -71,6 +71,14 @@ styling field: ...@@ -71,6 +71,14 @@ styling field:
choice: modern choice: modern
choice: old choice: old
choice: diagonal T choice: diagonal T
styling field:
type: choice
name: center text
description: When to center text (short text only means only on one-line cards with no flavor text)
choice: always
choice: short text only
choice: never
initial: never
styling style: styling style:
use guild mana symbols: use guild mana symbols:
...@@ -274,7 +282,15 @@ card style: ...@@ -274,7 +282,15 @@ card style:
then "magic-mana-large" then "magic-mana-large"
else "magic-mana-small" else "magic-mana-small"
size: 14 size: 14
alignment: middle left alignment:
script:
if (styling.center_text == "short text only" and
not contains(match:"\n", card.rule_text) and
card.flavor_text == "<i-flavor></i-flavor>" and
card_style.text.content_lines <= 2) or
styling.center_text == "always"
then "middle center"
else "middle left"
z index: 2 z index: 2
padding left: 2 padding left: 2
padding top: 2 padding top: 2
...@@ -302,7 +318,15 @@ card style: ...@@ -302,7 +318,15 @@ card style:
then "magic-mana-large" then "magic-mana-large"
else "magic-mana-small" else "magic-mana-small"
size: 14 size: 14
alignment: middle left alignment:
script:
if (styling.center_text == "short text only" and
not contains(match:"\n", card.rule_text) and
card.flavor_text == "<i-flavor></i-flavor>" and
card_style.text.content_lines <= 2) or
styling.center_text == "always"
then "middle center"
else "middle left"
z index: 2 z index: 2
padding left: 2 padding left: 2
padding top: 2 padding top: 2
......
############################################################## ##############################################################
############################################################## ##############################################################
############################################################## Old Tokens ############################################################## Old Tokens
############################################################## ##############################################################
...@@ -74,6 +74,14 @@ styling field: ...@@ -74,6 +74,14 @@ styling field:
choice: modern choice: modern
choice: old choice: old
choice: diagonal T choice: diagonal T
styling field:
type: choice
name: center text
description: When to center text (short text only means only on one-line cards with no flavor text)
choice: always
choice: short text only
choice: never
initial: short text only
styling style: styling style:
use guild mana symbols: use guild mana symbols:
...@@ -192,7 +200,20 @@ card style: ...@@ -192,7 +200,20 @@ card style:
then "magic-mana-large" then "magic-mana-large"
else "magic-mana-small" else "magic-mana-small"
size: 13 size: 13
alignment: middle center alignment:
script:
if (styling.center_text == "short text only" and
card_style.text.content_lines <= 2 and
not contains(match:",", card.rule_text) and
not contains(match: ".", card.rule_text) and
not contains(match: ";", card.rule_text) and
not contains(match: ":", card.rule_text) and
not contains(match: "!", card.rule_text) and
not contains(match: "?", card.rule_text) and
card.flavor_text == "<i-flavor></i-flavor>") or
styling.center_text == "always"
then "middle center shrink-overflow"
else "middle left shrink-overflow"
z index: 2 z index: 2
padding left: 2 padding left: 2
padding top: 2 padding top: 2
......
############################################################## ##############################################################
############################################################## ##############################################################
############################################################## OLD STYLE MAGIC ############################################################## OLD STYLE MAGIC
############################################################## ##############################################################
...@@ -88,6 +88,14 @@ styling field: ...@@ -88,6 +88,14 @@ styling field:
choice: modern choice: modern
choice: old choice: old
choice: diagonal T choice: diagonal T
styling field:
type: choice
name: center text
description: When to center text (short text only means only on one-line cards with no flavor text)
choice: always
choice: short text only
choice: never
initial: never
styling style: styling style:
use guild mana symbols: use guild mana symbols:
...@@ -227,7 +235,15 @@ card style: ...@@ -227,7 +235,15 @@ card style:
then "magic-mana-large" then "magic-mana-large"
else "magic-mana-small" else "magic-mana-small"
size: 13 size: 13
alignment: middle left alignment:
script:
if (styling.center_text == "short text only" and
not contains(match:"\n", card.rule_text) and
card.flavor_text == "<i-flavor></i-flavor>" and
card_style.text.content_lines <= 2) or
styling.center_text == "always"
then "middle center"
else "middle left"
z index: 2 z index: 2
padding left: 2 padding left: 2
padding top: 2 padding top: 2
......
mse version: 0.3.4 mse version: 0.3.4
game: magic game: magic
short name: Planeshifted short name: Planeshifted
full name: Planar Chaos Timeshifts full name: Planar Chaos Timeshifts
...@@ -57,6 +57,14 @@ styling field: ...@@ -57,6 +57,14 @@ styling field:
choice: modern choice: modern
choice: old choice: old
choice: diagonal T choice: diagonal T
styling field:
type: choice
name: center text
description: When to center text (short text only means only on one-line cards with no flavor text)
choice: always
choice: short text only
choice: never
initial: never
styling style: styling style:
use guild mana symbols: use guild mana symbols:
...@@ -199,7 +207,15 @@ card style: ...@@ -199,7 +207,15 @@ card style:
then "magic-mana-large" then "magic-mana-large"
else "magic-mana-small" else "magic-mana-small"
size: 14 size: 14
alignment: middle left alignment:
script:
if (styling.center_text == "short text only" and
not contains(match:"\n", card.rule_text) and
card.flavor_text == "<i-flavor></i-flavor>" and
card_style.text.content_lines <= 2) or
styling.center_text == "always"
then "middle center"
else "middle left"
z index: 2 z index: 2
padding left: 6 padding left: 6
padding top: 2 padding top: 2
......
...@@ -77,8 +77,6 @@ init script: ...@@ -77,8 +77,6 @@ init script:
color_filter := sort_rule(order: "<WUBRG>") color_filter := sort_rule(order: "<WUBRG>")
color_filterH := sort_rule(order: "</>") color_filterH := sort_rule(order: "</>")
mana_to_color := { mana_to_color := {
colors := color_filter()
hybrid := color_filterH()
count := number_of_items(in: colors) count := number_of_items(in: colors)
if hybrid == "" then if hybrid == "" then
# not a hybrid # not a hybrid
...@@ -108,34 +106,58 @@ init script: ...@@ -108,34 +106,58 @@ init script:
) + ) +
# keep only mana # keep only mana
filter_rule(match: "<sym[^>]*>([^<]+)") + color_filter; filter_rule(match: "<sym[^>]*>([^<]+)") + color_filter;
# get the land frame for a "WUBRG"-style input.
land_multicolor := {
count := number_of_items(in: colors)
if count == 0 then "land"
else if count == 1 then color_names_1() + ", land"
else if count == 2 then color_names_2() + ", land"
else if count == 3 then color_names_3() + ", land"
else "land, multicolor"
}
land_to_color := { land_to_color := {
# Based on watermark # Based on watermark
if card.watermark = "mana symbol white" then "white, land" if watermark = "mana symbol white" then "white, land"
else if card.watermark = "mana symbol blue" then "blue, land" else if watermark = "mana symbol blue" then "blue, land"
else if card.watermark = "mana symbol black" then "black, land" else if watermark = "mana symbol black" then "black, land"
else if card.watermark = "mana symbol red" then "red, land" else if watermark = "mana symbol red" then "red, land"
else if card.watermark = "mana symbol green" then "green, land" else if watermark = "mana symbol green" then "green, land"
else ( else land_multicolor(colors:color_text_filter(input: card.rule_text))
# Based on colors in text box
colors := color_text_filter(input: card.rule_text);
count := number_of_items(in: colors)
if count == 0 then "land"
else if count == 1 then color_names_1() + ", land"
else if count == 2 then color_names_2() + ", land"
else if count == 3 then color_names_3() + ", land"
else "land, multicolor"
)
}; };
# Look for a CDA that defines colors
text_to_color := {
text := filter_text(match: card_name+"(</[-a-z]+>)? is (colorless|all colors|((blue|white|green|red|black)((,|,? and) (blue|white|green|red|black))*))\\.")
if text == "" then ""
else if contains(text, match: "all colors") then (
colors := "WUBRG"
if land = "land" then land_multicolor()
else mana_to_color(hybrid: "")
) else (
colors := ""
if contains(text, match: "white") then colors := colors + "W"
if contains(text, match: "blue") then colors := colors + "U"
if contains(text, match: "black") then colors := colors + "B"
if contains(text, match: "red") then colors := colors + "R"
if contains(text, match: "green") then colors := colors + "G"
if land = "land" then land_multicolor()
else mana_to_color(hybrid: "")
)
}
# The color of a card # The color of a card
is_artifact := match_rule(match: "(?i)Artifact") is_artifact := match_rule(match: "(?i)Artifact")
is_land := match_rule(match: "(?i)Land") is_land := match_rule(match: "(?i)Land")
card_color := { card_color := {
# usually the color of mana # usually the color of mana
mana_color := mana_to_color(casting_cost); text_color := text_to_color(rules_text, land: is_land(type), card_name: card_name);
if mana_color == "colorless" and is_land (card.super_type) then land_to_color() if text_color == "" then (
else if mana_color == "colorless" and is_artifact(card.super_type) then "artifact" mana_color := mana_to_color(colors: color_filter(casting_cost), hybrid: color_filterH(casting_cost))
else mana_color if mana_color == "colorless" and is_land (type) then land_to_color(watermark)
else if mana_color == "colorless" and is_artifact(type) then "artifact"
else mana_color
)
else text_color
}; };
# Number of colors in a card_color # Number of colors in a card_color
...@@ -631,7 +653,12 @@ card field: ...@@ -631,7 +653,12 @@ card field:
save value: false save value: false
show statistics: false show statistics: false
editable: false editable: false
script: if card_shape() == "split" then card.name + "/" + card.name_2 else card.name card list visible: true
card list name: Name
card list column: 1
card list width: 150
description: The name of the card
script: if card_shape() == "split" then card.name + "//" + card.name_2 else card.name
############################# Background stuff ############################# Background stuff
card field: card field:
...@@ -689,20 +716,17 @@ card field: ...@@ -689,20 +716,17 @@ card field:
name: reversed name: reversed
enabled: { card_color_color_count(card.card_color) >= 2 and not chosen(choice:"overlay",card.card_color) } enabled: { card_color_color_count(card.card_color) >= 2 and not chosen(choice:"overlay",card.card_color) }
script: card_color_filter(value) script: card_color_filter(value)
default: card_color(casting_cost: card.casting_cost) default: card_color(casting_cost: card.casting_cost, rules_text: card.rule_text, type: card.super_type, watermark: card.watermark, card_name: card.name)
show statistics: false show statistics: false
############################# Name line ############################# Name line
card field: card field:
type: text type: text
name: name name: name
card list visible: false
script: name_filter(value) script: name_filter(value)
identifying: true identifying: true
show statistics: false show statistics: false
card list visible: true
card list column: 1
card list width: 150
description: The name of the card
card field: card field:
type: text type: text
name: casting cost name: casting cost
...@@ -919,7 +943,7 @@ card field: ...@@ -919,7 +943,7 @@ card field:
name: reversed name: reversed
enabled: { card_color_color_count(card.card_color) >= 2 and not chosen(choice:"overlay",card.card_color_2) } enabled: { card_color_color_count(card.card_color) >= 2 and not chosen(choice:"overlay",card.card_color_2) }
script: card_color_filter(value) script: card_color_filter(value)
default: card_color(casting_cost: card.casting_cost_2) default: card_color(casting_cost: card.casting_cost_2, type: card.super_type_2, rules_text: card.rule_text_2, watermark: card.watermark_2, card_name: card.name_2)
show statistics: false show statistics: false
card field: card field:
type: text type: text
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment