Compare commits

11 Commits

Author SHA1 Message Date
Sebastian Lundegård Kylander
4549264da7 Add orange field 2026-03-29 20:57:59 +02:00
Sebastian Lundegård Kylander
3358ea5521 WUBRG -> WUBRGO 2026-03-29 20:55:06 +02:00
Sebastian Lundegård Kylander
d412bcda69 - 2026-03-29 20:53:22 +02:00
Sebastian Lundegård Kylander
6d66fa5781 Add desert 2026-03-29 20:51:30 +02:00
Sebastian Lundegård Kylander
8dbee8f063 - 2026-03-29 20:49:37 +02:00
Sebastian Lundegård Kylander
54046e813f Move order of pre-existing orange cases 2026-03-29 20:49:01 +02:00
Sebastian Lundegård Kylander
90d089b9ab Handle strings and keys involving orange 2026-03-29 20:46:55 +02:00
Sebastian Lundegård Kylander
396fc63213 Prepare for more colors 2026-03-29 20:38:24 +02:00
Sebastian Lundegård Kylander
e089b18cac - 2026-03-29 19:55:15 +02:00
Sebastian Lundegård Kylander
f0811fe783 Rename wubrgc_break_statistic to color_code_break_statistic 2026-03-29 19:49:29 +02:00
Sebastian Lundegård Kylander
39969237fc Add orange mana symbol 2026-03-29 19:43:51 +02:00
9 changed files with 189 additions and 93 deletions

View File

@@ -31,6 +31,7 @@ watermark_colors := {
else if trim_colors(check_colors) == "black" then "bb" else if trim_colors(check_colors) == "black" then "bb"
else if trim_colors(check_colors) == "red" then "rr" else if trim_colors(check_colors) == "red" then "rr"
else if trim_colors(check_colors) == "green" then "gg" else if trim_colors(check_colors) == "green" then "gg"
else if trim_colors(check_colors) == "orange" then "oo"
else if contains(check_colors, match:"multi") or else if contains(check_colors, match:"multi") or
contains(check_colors, match:"hybrid") or contains(check_colors, match:"hybrid") or
contains(check_colors, match:", land") then hybrid_color(face:face) contains(check_colors, match:", land") then hybrid_color(face:face)
@@ -45,22 +46,32 @@ hybrid_color := {
else if trimmed == "white, black" then "wb" else if trimmed == "white, black" then "wb"
else if trimmed == "white, red" then "rw" else if trimmed == "white, red" then "rw"
else if trimmed == "white, green" then "gw" else if trimmed == "white, green" then "gw"
else if trimmed == "white, orange" then "wo"
else if trimmed == "blue, black" then "ub" else if trimmed == "blue, black" then "ub"
else if trimmed == "blue, red" then "ur" else if trimmed == "blue, red" then "ur"
else if trimmed == "blue, green" then "gu" else if trimmed == "blue, green" then "gu"
else if trimmed == "blue, orange" then "uo"
else if trimmed == "black, red" then "br" else if trimmed == "black, red" then "br"
else if trimmed == "black, green" then "bg" else if trimmed == "black, green" then "bg"
else if trimmed == "black, orange" then "bo"
else if trimmed == "red, green" then "rg" else if trimmed == "red, green" then "rg"
else if trimmed == "red, orange" then "ro"
else if trimmed == "green, orange" then "go"
else if trimmed == "white, blue, reversed" then "uw" else if trimmed == "white, blue, reversed" then "uw"
else if trimmed == "white, black, reversed" then "bw" else if trimmed == "white, black, reversed" then "bw"
else if trimmed == "white, red, reversed" then "wr" else if trimmed == "white, red, reversed" then "wr"
else if trimmed == "white, green, reversed" then "wg" else if trimmed == "white, green, reversed" then "wg"
else if trimmed == "white, orange, reversed" then "ow"
else if trimmed == "blue, black, reversed" then "bu" else if trimmed == "blue, black, reversed" then "bu"
else if trimmed == "blue, red, reversed" then "ru" else if trimmed == "blue, red, reversed" then "ru"
else if trimmed == "blue, green, reversed" then "ug" else if trimmed == "blue, green, reversed" then "ug"
else if trimmed == "blue, orange, reversed" then "ou"
else if trimmed == "black, red, reversed" then "rb" else if trimmed == "black, red, reversed" then "rb"
else if trimmed == "black, green, reversed" then "bg" else if trimmed == "black, green, reversed" then "gb"
else if trimmed == "black, orange, reversed" then "ob"
else if trimmed == "red, green, reversed" then "gr" else if trimmed == "red, green, reversed" then "gr"
else if trimmed == "red, orange, reversed" then "or"
else if trimmed == "green, orange, reversed" then "og"
else "mm" else "mm"
}@(face:"") }@(face:"")
######################################################################## ########################################################################
@@ -818,12 +829,14 @@ stamp_hybrid := [
# Putting it all together. # Putting it all together.
######################################################################## ########################################################################
blend_colors := { blend_colors := {
colors := sort_text( order: if card_is_wedge(input) then "(wbgur)" else "(wubrg)" colors := sort_text( order: if card_is_wedge(input) then "(wbguro)" else "(wubrgo)"
, (if chosen(choice:"white" ) then "w") , (if chosen(choice:"white" ) then "w")
+ (if chosen(choice:"blue" ) then "u") + (if chosen(choice:"blue" ) then "u")
+ (if chosen(choice:"black" ) then "b") + (if chosen(choice:"black" ) then "b")
+ (if chosen(choice:"red" ) then "r") + (if chosen(choice:"red" ) then "r")
+ (if chosen(choice:"green" ) then "g")) + (if chosen(choice:"green" ) then "g")
+ (if chosen(choice:"orange") then "o")
)
if multi and (hybrid or colors == "") then ( if multi and (hybrid or colors == "") then (
colors := colors + "m" colors := colors + "m"
) )
@@ -1103,13 +1116,14 @@ font_color_positions := [
font_white := { font_white := {
hybrid := chosen(choice:"hybrid" ) hybrid := chosen(choice:"hybrid" )
artifact := chosen(choice:"artifact" ) artifact := chosen(choice:"artifact" )
colors := sort_text( order: "(wubrg)" colors := sort_text( order: "(wubrgo)"
, (if chosen(choice:"white" ) then "w") , (if chosen(choice:"white" ) then "w")
+ (if chosen(choice:"blue" ) then "u") + (if chosen(choice:"blue" ) then "u")
+ (if chosen(choice:"black" ) then "b") + (if chosen(choice:"black" ) then "b")
+ (if chosen(choice:"red" ) then "r") + (if chosen(choice:"red" ) then "r")
+ (if chosen(choice:"green" ) then "g")) + (if chosen(choice:"green" ) then "g")
+ (if artifact then "a") + (if chosen(choice:"orange" ) then "o")
) + (if artifact then "a")
font_colors_white( font_colors_white(
if chosen(choice:"land") then "l" if chosen(choice:"land") then "l"
else if input == "artifact, multicolor" then "a" else if input == "artifact, multicolor" then "a"

View File

@@ -790,6 +790,9 @@ symbol:
symbol: symbol:
code: G code: G
image: mana_g.png image: mana_g.png
symbol:
code: O
image: mana_o.png
symbol: symbol:
code: C code: C
image: mana_c.png image: mana_c.png
@@ -803,7 +806,7 @@ symbol:
text margin right: .21 text margin right: .21
text margin top: -.15 text margin top: -.15
text margin bottom: -.06 text margin bottom: -.06
code: [0-9](?!/[WUBRGCSTQ2])|. code: [0-9](?!/[WUBRGOCSTQ2])|.
regex: yes regex: yes
draw text: 0 draw text: 0
text font: text font:
@@ -861,6 +864,7 @@ insert symbol menu:
item: B item: B
item: R item: R
item: G item: G
item: O
item: S item: S
item: item:
type: line type: line

View File

@@ -7,11 +7,11 @@ card list color script:
else if input == "black" then rgb(0,0,0) else if input == "black" then rgb(0,0,0)
else if input == "red" then rgb(168,0,0) else if input == "red" then rgb(168,0,0)
else if input == "green" then rgb(0,168,0) else if input == "green" then rgb(0,168,0)
else if input == "orange" then rgb(253,196,41)
else if input == "pink" then rgb(210,60,140) else if input == "pink" then rgb(210,60,140)
else if input == "purple" then rgb(150,100,160) else if input == "purple" then rgb(150,100,160)
else if input == "yellow" then rgb(190,200,50) else if input == "yellow" then rgb(190,200,50)
else if input == "brown" then rgb(51, 10, 0) else if input == "brown" then rgb(51, 10, 0)
else if input == "orange" then rgb(255, 51, 0)
else ( else (
artifact := chosen(choice:"artifact") artifact := chosen(choice:"artifact")
land := chosen(choice:"land") land := chosen(choice:"land")

View File

@@ -29,7 +29,7 @@ keyword mode:
keyword parameter type: keyword parameter type:
name: mana name: mana
match: [HSVCTQXYZI0-9WUBRG/|]+ match: [HSVCTQXYZI0-9WUBRGO/|]+
refer script: refer script:
name: normal name: normal
description: No changes made description: No changes made
@@ -48,7 +48,7 @@ keyword parameter type:
# By pichoro and bunnierein # By pichoro and bunnierein
keyword parameter type: keyword parameter type:
name: cost name: cost
match: [ ][HSVECTQXYZI0-9WUBRG/|]*|[-—][^(\r\n]* match: [ ][HSVECTQXYZI0-9WUBRGO/|]*|[-—][^(\r\n]*
separator before is: [ —-] separator before is: [ —-]
separator after is: [.] separator after is: [.]
optional: false optional: false

View File

@@ -1304,12 +1304,12 @@ reverse_list :=
cost_parameter_script := cost_parameter_script :=
{ {
input := remove_tag(input, tag:"<sym-auto>") input := remove_tag(input, tag:"<sym-auto>")
replace(input, match:"\\b([HSVECTQXYZI0-9WUBRG/|]+)\\b(|,|<|$)", replace:"<sym-auto>\\1</sym-auto>\\2") replace(input, match:"\\b([HSVECTQXYZI0-9WUBRGO/|]+)\\b(|,|<|$)", replace:"<sym-auto>\\1</sym-auto>\\2")
} }
cost_parameter_script_nonspace := cost_parameter_script_nonspace :=
{ {
input := remove_tag(input, tag:"<sym-auto>") input := remove_tag(input, tag:"<sym-auto>")
replace(input, match:"(?<!<)([HSVECTQXYZI0-9WUBRG/|]+)", replace:"<sym-auto>\\1</sym-auto>") replace(input, match:"(?<!<)([HSVECTQXYZI0-9WUBRGO/|]+)", replace:"<sym-auto>\\1</sym-auto>")
} }
cost_parameter_dash := cost_parameter_dash :=
{ {
@@ -1318,7 +1318,7 @@ cost_parameter_dash :=
} }
localized_phy_reminder := localized_phy_reminder :=
{ {
phy_matches := break_text(card.casting_cost, match:"H(/[WUBRGC])*") phy_matches := break_text(card.casting_cost, match:"H(/[WUBRGOC])*")
if length(phy_matches) < 1 then "" else ( if length(phy_matches) < 1 then "" else (
multiple := length(phy_matches) > 1 multiple := length(phy_matches) > 1
phy_matches := make_list_unique(reverse_list(sort_list(phy_matches, order_by: length))) #First symbol is used for reminder text. Prefer using hybrid mana. phy_matches := make_list_unique(reverse_list(sort_list(phy_matches, order_by: length))) #First symbol is used for reminder text. Prefer using hybrid mana.

View File

@@ -819,6 +819,7 @@ languages := [
is_swamp : match@(match: "(?i)Swamp") is_swamp : match@(match: "(?i)Swamp")
is_mountain : match@(match: "(?i)Mountain") is_mountain : match@(match: "(?i)Mountain")
is_forest : match@(match: "(?i)Forest") is_forest : match@(match: "(?i)Forest")
is_desert : match@(match: "(?i)Desert")
is_wastes : match@(match: "(?i)Wastes") is_wastes : match@(match: "(?i)Wastes")
is_class : match@(match: "(?i)Class") is_class : match@(match: "(?i)Class")
@@ -846,21 +847,22 @@ languages := [
is_black : match@(match: "(?i)black") is_black : match@(match: "(?i)black")
is_red : match@(match: "(?i)red") is_red : match@(match: "(?i)red")
is_green : match@(match: "(?i)green") is_green : match@(match: "(?i)green")
is_orange : match@(match: "(?i)orange")
is_colorless : match@(match: "(?i)colorless") is_colorless : match@(match: "(?i)colorless")
is_cda_colorless : match@(match: "(?i)is colorless") is_cda_colorless : match@(match: "(?i)is colorless")
is_cda_all_colors : match@(match: "(?i)is all colors") is_cda_all_colors : match@(match: "(?i)is all colors")
cda_colors : filter_text@(match: "is (white|blue|black|red|green)((,|, and| and) (white|blue|black|red|green))*") cda_colors : filter_text@(match: "is (white|blue|black|red|green|orange)((,|, and| and) (white|blue|black|red|green|orange))*")
white : "White" white : "White"
blue : "Blue" blue : "Blue"
black : "Black" black : "Black"
red : "Red" red : "Red"
green : "Green" green : "Green"
orange : "Orange"
purple : "Purple" purple : "Purple"
pink : "Pink" pink : "Pink"
yellow : "Yellow" yellow : "Yellow"
orange : "Orange"
brown : "Brown" brown : "Brown"
multicolor : "Multicolor" multicolor : "Multicolor"
hybrid : "Hybrid" hybrid : "Hybrid"

View File

@@ -312,7 +312,7 @@ get_alpha_percentage :=
############################################################## For the user ############################################################## For the user
#### Remove card codes #### Remove card codes
cc_filter := replace@(match:"^[CURMSL][WUBRGMZACL][0-9]+ ?[-—]? ?", replace:"") cc_filter := replace@(match:"^[CURMSL][WUBRGOMZACL][0-9]+ ?[-—]? ?", replace:"")
has_alchemy := contains@(match:"alchemy") has_alchemy := contains@(match:"alchemy")
strip_card_codes := { strip_card_codes := {
save := input save := input
@@ -438,6 +438,7 @@ colors_from_mana_symbols := {
if contains(input, match:"B") then str := str + ["black"] if contains(input, match:"B") then str := str + ["black"]
if contains(input, match:"R") then str := str + ["red"] if contains(input, match:"R") then str := str + ["red"]
if contains(input, match:"G") then str := str + ["green"] if contains(input, match:"G") then str := str + ["green"]
if contains(input, match:"O") then str := str + ["orange"]
join(str, sep:", ") join(str, sep:", ")
} }
@@ -506,25 +507,25 @@ crop_multi_image := {
############################################################## Sorting mana symbols ############################################################## Sorting mana symbols
#### correctly sort a mana symbol (no guild mana) #### correctly sort a mana symbol (no guild mana)
mana_sort := sort_text@(order: "\\?XYZI[0123456789]VHSFCAI(EKPLO)(WUBRG)") mana_sort := sort_text@(order: "\\?XYZI[0123456789]VHSFCAI(EKPLO)(WUBRGO)")
#### correctly sort wedge mana #### correctly sort wedge mana
mana_sort_wedge := sort_text@(order: "\\?XYZI[0123456789]VHSFCAI(EPOKL)(WBGUR)") mana_sort_wedge := sort_text@(order: "\\?XYZI[0123456789]VHSFCAI(EPOKL)(WBGUR)")
#### sort nothing #### sort nothing
mana_unsort := sort_text@(order:"[/\\?XYZI0123456789VHSCAIEKPLOMWUBRG]") mana_unsort := sort_text@(order:"[/\\?XYZI0123456789VHSCAIEKPLOMWUBRGO]")
#### correctly sort guild mana #### correctly sort guild mana
mana_sort_guild := sort_text@(order: "[\\?XYZI01234567890VHSFCAIEKPLOWUBRG/|]") + mana_sort_guild := sort_text@(order: "[\\?XYZI01234567890VHSFCAIEKPLOWUBRGO/|]") +
replace@( replace@(
#### No lookbehind :( #### No lookbehind :(
#match: "(?<!/)(./.|././.|./././.|.[|])(?!/)", #match: "(?<!/)(./.|././.|./././.|.[|])(?!/)",
match: "./.|././.|./././.|.[|]", match: "./.|././.|./././.|.[|]",
in_context: "(^|[^/])<match>($|[^/])", in_context: "(^|[^/])<match>($|[^/])",
replace: {sort_text(order:"in_place((WUBRG))")} replace: {sort_text(order:"in_place((WUBRGO))")}
) )
#### mana filter helpers #### mana filter helpers
mana_has_guild := match@(match: "[/|]") #### Is there guild or half mana in the input? mana_has_guild := match@(match: "[/|]") #### Is there guild or half mana in the input?
mana_is_wedge := { chosen(set.mana_cost_sorting, choice: "tarkir wedge sorting") and ( number_of_items(in: sort_text(order:"<WUBRG>", input), filter: "<WUBRG>") == 3 ) } mana_is_wedge := { chosen(set.mana_cost_sorting, choice: "tarkir wedge sorting") and ( number_of_items(in: sort_text(order:"<WUBRGO>", input), filter: "<WUBRGO>") == 3 ) }
mana_has_wedge := { mana_has_wedge := {
wedge_check := sort_text(order:"<WUBRG>", input) wedge_check := sort_text(order:"<WUBRGO>", input)
mana_is_wedge() and (wedge_check == "WUR" or wedge_check == "WBR" or wedge_check == "WBG" or wedge_check == "UBG" or wedge_check == "URG") mana_is_wedge() and (wedge_check == "WUR" or wedge_check == "WBR" or wedge_check == "WBG" or wedge_check == "UBG" or wedge_check == "URG")
} }
@@ -590,6 +591,7 @@ colorless_color := {
else if cc == "black" then "b" else if cc == "black" then "b"
else if cc == "red" then "r" else if cc == "red" then "r"
else if cc == "green" then "g" else if cc == "green" then "g"
else if cc == "orange" then "o"
else "c" else "c"
} }
@@ -620,6 +622,7 @@ color_name := {
else if input == "B" then "black" else if input == "B" then "black"
else if input == "R" then "red" else if input == "R" then "red"
else if input == "G" then "green" else if input == "G" then "green"
else if input == "O" then "orange"
else "" else ""
} }
mana_name := { mana_name := {
@@ -628,6 +631,7 @@ mana_name := {
else if input == "black" then "B" else if input == "black" then "B"
else if input == "red" then "R" else if input == "red" then "R"
else if input == "green" then "G" else if input == "green" then "G"
else if input == "orange" then "O"
else "C" else "C"
} }
color_names_1 := { color_name(colors.0) } color_names_1 := { color_name(colors.0) }
@@ -636,7 +640,7 @@ color_names_3 := { color_name(colors.0) + ", " + color_name(colors.1) + ", " + c
color_names_4 := { color_name(colors.0) + ", " + color_name(colors.1) + ", " + color_name(colors.2) + ", " + color_name(colors.3) } color_names_4 := { color_name(colors.0) + ", " + color_name(colors.1) + ", " + color_name(colors.2) + ", " + color_name(colors.3) }
color_names_5 := { color_name(colors.0) + ", " + color_name(colors.1) + ", " + color_name(colors.2) + ", " + color_name(colors.3) + ", " + color_name(colors.4) } color_names_5 := { color_name(colors.0) + ", " + color_name(colors.1) + ", " + color_name(colors.2) + ", " + color_name(colors.3) + ", " + color_name(colors.4) }
#### color based on mana cost, input == a mana cost #### color based on mana cost, input == a mana cost
color_filter := sort_text@(order: "<WUBRG>") color_filter := sort_text@(order: "<WUBRGO>")
color_filterH := sort_text@(order: "</>") color_filterH := sort_text@(order: "</>")
mana_to_color := { mana_to_color := {
count := number_of_items(in: colors) count := number_of_items(in: colors)
@@ -686,7 +690,7 @@ color_text_filter :=
) + ) +
#### keep only mana #### keep only mana
filter_text@(match: "<sym[^>]*>([^<]+)") + color_filter; filter_text@(match: "<sym[^>]*>([^<]+)") + color_filter;
#### get the land frame for a "WUBRG"-style input. #### get the land frame for a "WUBRGO"-style input.
land_multicolor := { land_multicolor := {
count := number_of_items(in: colors) count := number_of_items(in: colors)
if count == 0 then "land" if count == 0 then "land"
@@ -701,6 +705,7 @@ land_to_color := {
else if watermark == "mana symbol black" then "black, land" else if watermark == "mana symbol black" then "black, land"
else if watermark == "mana symbol red" then "red, land" else if watermark == "mana symbol red" then "red, land"
else if watermark == "mana symbol green" then "green, land" else if watermark == "mana symbol green" then "green, land"
else if watermark == "mana symbol orange" then "orange, land"
else land_multicolor(colors:color_text_filter(input: rules)) else land_multicolor(colors:color_text_filter(input: rules))
}@(rules:card.rule_text) }@(rules:card.rule_text)
@@ -708,10 +713,10 @@ land_to_color := {
text_to_color := { text_to_color := {
#### Note: running filter_text is quite slow, do a quick 'contains' check first #### Note: running filter_text is quite slow, do a quick 'contains' check first
if contains(match: card_name + " is") then ( if contains(match: card_name + " is") then (
text := filter_text(match: "is (colorless|all colors|((blue|white|green|red|black)((,|,? and) (blue|white|green|red|black))*))", in_context: regex_escape(card_name)+"(</[-a-z]+>)* <match>\\.") text := filter_text(match: "is (colorless|all colors|((blue|white|green|red|black|orange)((,|,? and) (blue|white|green|red|black|orange))*))", in_context: regex_escape(card_name)+"(</[-a-z]+>)* <match>\\.")
if text != "" then ( if text != "" then (
if contains(text, match: "all colors") then ( if contains(text, match: "all colors") then (
colors := "WUBRG" colors := "WUBRGO"
if land == true then land_multicolor() if land == true then land_multicolor()
else mana_to_color(hybrid: "") else mana_to_color(hybrid: "")
) else ( ) else (
@@ -721,6 +726,7 @@ text_to_color := {
if contains(text, match: "black") then colors := colors + "B" if contains(text, match: "black") then colors := colors + "B"
if contains(text, match: "red") then colors := colors + "R" if contains(text, match: "red") then colors := colors + "R"
if contains(text, match: "green") then colors := colors + "G" if contains(text, match: "green") then colors := colors + "G"
if contains(text, match: "orange") then colors := colors + "O"
if land == true then land_multicolor() if land == true then land_multicolor()
else mana_to_color(hybrid: "") else mana_to_color(hybrid: "")
) )
@@ -743,7 +749,7 @@ card_color := {
else text_color else text_color
}; };
#### Number of colors in a card_color #### Number of colors in a card_color
card_color_color_count := count_chosen@(choices: "white,blue,black,red,green,artifact") card_color_color_count := count_chosen@(choices: "white,blue,black,red,green,orange,artifact")
#### Clean up color field #### Clean up color field
card_color_filter := { card_color_filter := {
colors := card_color_color_count() colors := card_color_color_count()
@@ -769,7 +775,7 @@ list_colors := {
list := replace(list, match:", ", replace:", and ", in_context:"<match>[^ ]+$") list := replace(list, match:", ", replace:", and ", in_context:"<match>[^ ]+$")
list list
} }
#### convert card_color to WUBRG #### convert card_color to WUBRGO
card_color_to_letters := { card_color_to_letters := {
color_string := trim_colors(input) color_string := trim_colors(input)
(if contains(color_string, match:"white") then "W" else "") (if contains(color_string, match:"white") then "W" else "")
@@ -777,6 +783,7 @@ card_color_to_letters := {
+(if contains(color_string, match:"black") then "B" else "") +(if contains(color_string, match:"black") then "B" else "")
+(if contains(color_string, match:"red") then "R" else "") +(if contains(color_string, match:"red") then "R" else "")
+(if contains(color_string, match:"green") then "G" else "") +(if contains(color_string, match:"green") then "G" else "")
+(if contains(color_string, match:"orange") then "O" else "")
} }
card_color_field := { if input <= 1 then card.card_color else card["card_color_" + input] } card_color_field := { if input <= 1 then card.card_color else card["card_color_" + input] }
@@ -867,10 +874,11 @@ basic_land_sort := {
else if contains(name, match:"Swamp") then "MD" #### Swamps else if contains(name, match:"Swamp") then "MD" #### Swamps
else if contains(name, match:"Mountain") then "ME" #### Mountains else if contains(name, match:"Mountain") then "ME" #### Mountains
else if contains(name, match:"Forest") then "MF" #### Forests else if contains(name, match:"Forest") then "MF" #### Forests
else if contains(name, match:"Desert") then "MG" #### Desert
else "MA" #### other basic lands else "MA" #### other basic lands
} }
hybrid_color_pair_sort := { hybrid_color_pair_sort := {
colors := sort_text(casting_cost, order: "<WUBRG>") colors := sort_text(casting_cost, order: "<WUBRGO>")
if not set.sort_hybrid_in_pairs then "HK" if not set.sort_hybrid_in_pairs then "HK"
else if colors == "WU" then "HA" else if colors == "WU" then "HA"
else if colors == "UB" then "HB" else if colors == "UB" then "HB"
@@ -885,7 +893,7 @@ hybrid_color_pair_sort := {
else "HK" else "HK"
} }
multi_color_pair_sort := { multi_color_pair_sort := {
colors := sort_text(casting_cost, order: "<WUBRG>") colors := sort_text(casting_cost, order: "<WUBRGO>")
if not set.sort_multicolor_in_pairs then "GK" if not set.sort_multicolor_in_pairs then "GK"
else if colors == "WU" then "GA" else if colors == "WU" then "GA"
else if colors == "UB" then "GB" else if colors == "UB" then "GB"
@@ -1032,11 +1040,11 @@ rarity_code := {
is_unsorted := { false } is_unsorted := { false }
############################################################## Statistics utilities ############################################################## Statistics utilities
#### Converted mana cost #### Converted mana cost
is_half_mana := match@(match: "1/2|[|][WUBRGS]") is_half_mana := match@(match: "1/2|[|][WUBRGOS]")
is_half_generic := match@(match: "1/2") is_half_generic := match@(match: "1/2")
is_colored_mana := match@(match: "[WUBRG]") is_colored_mana := match@(match: "[WUBRGO]")
only_numbers := filter_text@(match: "^[0123456789]+") only_numbers := filter_text@(match: "^[0123456789]+")
cmc_split := break_text@(match: "(?ix) 1/2 | [|][WUBRGC] | TK | [0-9](/[WUBRGCVHSCEKPLOTQ2]) | [0-9]+(?!/[WUBRGCVHSCEKPLOTQ2]) | [WUBRGCVHS0-9](/[WUBRGCVHS])\{0,4} ") cmc_split := break_text@(match: "(?ix) 1/2 | [|][WUBRGOC] | TK | [0-9](/[WUBRGOCVHSCEKPLOTQ2]) | [0-9]+(?!/[WUBRGOCVHSCEKPLOTQ2]) | [WUBRGOCVHS0-9](/[WUBRGOCVHS])\{0,4} ")
cmc := {to_number( cmc := {to_number(
for each sym in cmc_split(to_text()) do ( for each sym in cmc_split(to_text()) do (
numbers := only_numbers(sym) numbers := only_numbers(sym)
@@ -1054,12 +1062,12 @@ remove_type := replace@(match: "(Artifact|Creature|Enchantment|Instant|Land|Plan
replace@(match: "[ ]+", in_context: "^<match>", replace: "")+ replace@(match: "[ ]+", in_context: "^<match>", replace: "")+
replace@(match: "[ ]+", in_context: "<match>$", replace: "") replace@(match: "[ ]+", in_context: "<match>$", replace: "")
write_wubrg := { write_wubrg := {(if match(input, match:"white") then "W" else "")
(if match(input, match:"white") then "W" else "")+ + (if match(input, match:"blue") then "U" else "")
(if match(input, match:"blue") then "U" else "")+ + (if match(input, match:"black") then "B" else "")
(if match(input, match:"black") then "B" else "")+ + (if match(input, match:"red") then "R" else "")
(if match(input, match:"red") then "R" else "")+ + (if match(input, match:"green") then "G" else "")
(if match(input, match:"green") then "G" else "") + (if match(input, match:"orange") then "O" else "")
} }
colored_mana := {to_number( colored_mana := {to_number(
for each sym in cmc_split(to_text()) do ( for each sym in cmc_split(to_text()) do (
@@ -1079,7 +1087,14 @@ generic_mana := {to_number(
} }
primary_card_color := { primary_card_color := {
artifact := chosen(choice:"artifact") and not (chosen(choice:"white") or chosen(choice:"blue") or chosen(choice:"black") or chosen(choice:"red") or chosen(choice:"green")) artifact := chosen(choice:"artifact")
and not ( chosen(choice:"white")
or chosen(choice:"blue")
or chosen(choice:"black")
or chosen(choice:"red")
or chosen(choice:"green")
or chosen(choice:"orange")
)
land := chosen(choice:"land") land := chosen(choice:"land")
multi := chosen(choice:"multicolor") multi := chosen(choice:"multicolor")
hybrid := chosen(choice:"hybrid") hybrid := chosen(choice:"hybrid")
@@ -1088,7 +1103,8 @@ primary_card_color := {
black := chosen(choice:"black") black := chosen(choice:"black")
red := chosen(choice:"red") red := chosen(choice:"red")
green := chosen(choice:"green") green := chosen(choice:"green")
multi_color := count_chosen(choices:"white, blue, black, red, green") orange := chosen(choice:"orange")
multi_color := count_chosen(choices:"white, blue, black, red, green, orange")
if land then "land" if land then "land"
else if multi then "multicolor" else if multi then "multicolor"
else if multi_color == 2 and chosen(choice:"artifact") then "hybrid" #### hybrid artifacts would show as their first color else if multi_color == 2 and chosen(choice:"artifact") then "hybrid" #### hybrid artifacts would show as their first color
@@ -1099,10 +1115,18 @@ primary_card_color := {
else if black then "black" else if black then "black"
else if red then "red" else if red then "red"
else if green then "green" else if green then "green"
else if orange then "orange"
else input else input
} }
sparker_card_color := { sparker_card_color := {
artifact := chosen(choice:"artifact") and not (chosen(choice:"white") or chosen(choice:"blue") or chosen(choice:"black") or chosen(choice:"red") or chosen(choice:"green")) artifact := chosen(choice:"artifact")
and not ( chosen(choice:"white")
or chosen(choice:"blue")
or chosen(choice:"black")
or chosen(choice:"red")
or chosen(choice:"green")
or chosen(choice:"orange")
)
land := chosen(choice:"land") land := chosen(choice:"land")
multi := chosen(choice:"multicolor") multi := chosen(choice:"multicolor")
hybrid := chosen(choice:"hybrid") hybrid := chosen(choice:"hybrid")
@@ -1111,7 +1135,8 @@ sparker_card_color := {
black := chosen(choice:"black") black := chosen(choice:"black")
red := chosen(choice:"red") red := chosen(choice:"red")
green := chosen(choice:"green") green := chosen(choice:"green")
multi_color := count_chosen(choices:"white, blue, black, red, green") orange := chosen(choice:"orange")
multi_color := count_chosen(choices:"white, blue, black, red, green, orange")
if land then "colorless" if land then "colorless"
else if multi then "multicolor" else if multi then "multicolor"
else if multi_color >= 2 then "multicolor" else if multi_color >= 2 then "multicolor"
@@ -1122,6 +1147,7 @@ sparker_card_color := {
else if black then "black" else if black then "black"
else if red then "red" else if red then "red"
else if green then "green" else if green then "green"
else if orange then "orange"
else "colorless" else "colorless"
} }
@@ -1137,11 +1163,12 @@ contains_target := match@(match:"(?i)([^a-z]|^)targets?([^a-z]|$)")
is_targeted := { contains_target(card.rule_text) } is_targeted := { contains_target(card.rule_text) }
#### convert color word to mana symbol #### convert color word to mana symbol
color_to_mana := replace@(match: "white", replace: "[W]")+ color_to_mana := replace@(match: "white", replace: "[W]")
replace@(match: "blue", replace: "[U]")+ + replace@(match: "blue", replace: "[U]")
replace@(match: "black", replace: "[B]")+ + replace@(match: "black", replace: "[B]")
replace@(match: "red", replace: "[R]")+ + replace@(match: "red", replace: "[R]")
replace@(match: "green", replace: "[G]") + replace@(match: "green", replace: "[G]")
+ replace@(match: "orange", replace: "[O]")
#### convert number word to digit #### convert number word to digit
digital_number := { digital_number := {
@@ -1212,11 +1239,11 @@ digital_map := [
for_mana_costs := { for_mana_costs := {
if input.separator_before == "—" and contains(input.param, match: " ") then ( #### multi word if input.separator_before == "—" and contains(input.param, match: " ") then ( #### multi word
if comma_count(input.param) == "," then ( #### two part if comma_count(input.param) == "," then ( #### two part
if match(match: "^[VHSCAIETKPLOQ\\?XYZIWUBRG0-9/|]+,", input.param) then #### starts with mana if match(match: "^[VHSCAIETKPLOQ\\?XYZIWUBRGO0-9/|]+,", input.param) then #### starts with mana
"{add}<param-cost>{alternative_cost(input.param, trim:combined_cost, s:action)}</param-cost>" #### "add" mana "{add}<param-cost>{alternative_cost(input.param, trim:combined_cost, s:action)}</param-cost>" #### "add" mana
else "<param-cost>{alternative_cost(input.param, trim:combined_cost, s:action)}</param-cost>{non}" #### else cost "non" else "<param-cost>{alternative_cost(input.param, trim:combined_cost, s:action)}</param-cost>{non}" #### else cost "non"
) else if contains(input.param, match: ",") then ( #### three+ parts ) else if contains(input.param, match: ",") then ( #### three+ parts
if match(match: "^[VHSCAIETKPLOQ\\?XYZIWUBRG0-9/|]+,", input.param) then #### starts with mana if match(match: "^[VHSCAIETKPLOQ\\?XYZIWUBRGO0-9/|]+,", input.param) then #### starts with mana
"{add}<param-cost>{alternative_cost(input.param, trim:long_cost, s:action)}</param-cost>" #### "add" mana with long formatting "{add}<param-cost>{alternative_cost(input.param, trim:long_cost, s:action)}</param-cost>" #### "add" mana with long formatting
else "<param-cost>{alternative_cost(input.param, trim:long_nomana_cost, s:action)}</param-cost>{non}" #### else cost "non" with long formatting else "<param-cost>{alternative_cost(input.param, trim:long_nomana_cost, s:action)}</param-cost>{non}" #### else cost "non" with long formatting
) else ) else
@@ -1228,7 +1255,7 @@ for_mana_costs := {
}@(non:" in addition to any other costs", action:false, add:"") }@(non:" in addition to any other costs", action:false, add:"")
#### return bool; is the input is a simple mana cost? #### return bool; is the input is a simple mana cost?
is_mana_cost := { is_mana_cost := {
match(match: "^[VHSCAIETKPLOQ\\?XYZIWUBRG0-9/|]+$", input.param) match(match: "^[VHSCAIETKPLOQ\\?XYZIWUBRGO0-9/|]+$", input.param)
} }
#### Convert extra costs #### Convert extra costs
long_cost := replace@(match:", [A-Z]", replace: { to_lower() } ) long_cost := replace@(match:", [A-Z]", replace: { to_lower() } )
@@ -1237,7 +1264,7 @@ long_nomana_cost := replace@(match:"[A-Z]", replace: { to_lower() })
lower_first := replace@(match:"^[A-Z]", replace: { to_lower() }) lower_first := replace@(match:"^[A-Z]", replace: { to_lower() })
combined_cost := replace@(match:", [A-Z]", replace: { to_lower() })+ combined_cost := replace@(match:", [A-Z]", replace: { to_lower() })+
replace@(match:",", replace:" and")+ replace@(match:",", replace:" and")+
replace@(match:"^[VHSCETKPLOQ\\?XYZIWUBRG0-9/|]+", in_context: "(^|[[:space:]])<match>(?![a-z])", replace: "<sym-auto>&</sym-auto>")+ replace@(match:"^[VHSCETKPLOQ\\?XYZIWUBRGO0-9/|]+", in_context: "(^|[[:space:]])<match>(?![a-z])", replace: "<sym-auto>&</sym-auto>")+
replace@(match:"^[A-Z]", replace: { to_lower() }) replace@(match:"^[A-Z]", replace: { to_lower() })
alternative_cost := { alternative_cost := {
input := trim(input) input := trim(input)
@@ -1324,7 +1351,7 @@ protection_code := {
output output
} }
phy_reminder := { phy_reminder := {
phy_match := filter_text(input, match:"(/[WUBRG])+", in_context:"H<match>") phy_match := filter_text(input, match:"(/[WUBRGO])+", in_context:"H<match>")
letters := split_text(phy_match, match:"/") letters := split_text(phy_match, match:"/")
reminder_text := "" reminder_text := ""
if length(letters) == 2 then if length(letters) == 2 then
@@ -1508,8 +1535,8 @@ mana_context :=
| <match>[ ]can[ ]be[ ]paid | <match>[ ]can[ ]be[ ]paid
| (pays?|additional|costs?|the|adds?|pay(ed)?[ ](with|using)) #### pay X. creatures cost 1 less. pay an additional G. | (pays?|additional|costs?|the|adds?|pay(ed)?[ ](with|using)) #### pay X. creatures cost 1 less. pay an additional G.
([ ]either)? #### pay either X or Y ([ ]either)? #### pay either X or Y
([ ](<sym[^>]*>)?[-+=]?[VHSCETKPLOQ\\?XYZIEWUBRG0-9/|]+(</sym[^>]*>)?,)* #### pay X, Y or Z ([ ](<sym[^>]*>)?[-+=]?[VHSCETKPLOQ\\?XYZIEWUBRGO0-9/|]+(</sym[^>]*>)?,)* #### pay X, Y or Z
([ ](<sym[^>]*>)?[-+=]?[VHSCETKPLOQ\\?XYZIEWUBRG0-9/|]+(</sym[^>]*>)?[ ](and|or|and/or))* #### pay X or Y ([ ](<sym[^>]*>)?[-+=]?[VHSCETKPLOQ\\?XYZIEWUBRGO0-9/|]+(</sym[^>]*>)?[ ](and|or|and/or))* #### pay X or Y
[ ]<match> [ ]<match>
( (
[,.)\"”]|$ #### (end of word) [,.)\"”]|$ #### (end of word)
@@ -1869,7 +1896,7 @@ text_filter :=
} + } +
#### step 4 : explict non mana symbols #### step 4 : explict non mana symbols
replace@( replace@(
match: "\\][-+=]?[VHSCEKPLOTQINF\\?XYZIWUBRG0-9/|]+\\[", match: "\\][-+=]?[VHSCEKPLOTQINF\\?XYZIWUBRGO0-9/|]+\\[",
replace: {"<nosym>" + mana_filter_t() + "</nosym>"} replace: {"<nosym>" + mana_filter_t() + "</nosym>"}
) + ) +
#### step 5 : add mana & tap symbols #### step 5 : add mana & tap symbols
@@ -1884,13 +1911,13 @@ text_filter :=
replace: {"<sym-auto>" + _1 + "</sym-auto>" + _3} replace: {"<sym-auto>" + _1 + "</sym-auto>" + _3}
) + ) +
replace@( replace@(
match: "\\b[VHSCEKPLOTQ\\?XYZIWUBRG0-9/|]+\\b", match: "\\b[VHSCEKPLOTQ\\?XYZIWUBRGO0-9/|]+\\b",
in_context: mana_context, in_context: mana_context,
replace: {"<sym-auto>" + mana_filter_t() + "</sym-auto>"} replace: {"<sym-auto>" + mana_filter_t() + "</sym-auto>"}
) + ) +
#### step 5b : remove false positive mana & tap symbols #### step 5b : remove false positive mana & tap symbols
replace@( replace@(
match: "<sym-auto>([VHSCEKPLOTQ\\?XYZIWUBRG0-9/|]+)</sym-auto>", match: "<sym-auto>([VHSCEKPLOTQ\\?XYZIWUBRGO0-9/|]+)</sym-auto>",
in_context: mana_un_context, in_context: mana_un_context,
replace: "\\1" replace: "\\1"
) + ) +
@@ -1900,7 +1927,7 @@ text_filter :=
replace: {"<sym>INF</sym>" } replace: {"<sym>INF</sym>" }
) + ) +
replace@( replace@(
match: "\\[[-+=]?[VHSCEKPLOTQ\\?XYZIWUBRG0-9/|]+\\]", match: "\\[[-+=]?[VHSCEKPLOTQ\\?XYZIWUBRGO0-9/|]+\\]",
replace: {"<sym>" + mana_filter_t() + "</sym>"} replace: {"<sym>" + mana_filter_t() + "</sym>"}
) + ) +
#### step 6a : auto reminder #### step 6a : auto reminder
@@ -2627,6 +2654,7 @@ card_new_color := {
else if card.card_color == "black" then "b" else if card.card_color == "black" then "b"
else if card.card_color == "red" then "r" else if card.card_color == "red" then "r"
else if card.card_color == "green" then "g" else if card.card_color == "green" then "g"
else if card.card_color == "orange" then "o"
else if contains(card.card_color, match:"artifact") then "a" else if contains(card.card_color, match:"artifact") then "a"
else if contains(card.card_color, match:"multi") or contains(card.card_color, match:"hybrid") then "m" else if contains(card.card_color, match:"multi") or contains(card.card_color, match:"hybrid") then "m"
else "c" else "c"
@@ -5557,6 +5585,7 @@ alias_colors := {
b: rgb(39, 38, 36), b: rgb(39, 38, 36),
r: rgb(168, 88, 81), r: rgb(168, 88, 81),
g: rgb(6, 120, 69), g: rgb(6, 120, 69),
o: rgb(253, 196, 41),
a: rgb(239, 238, 236), a: rgb(239, 238, 236),
m: rgb(243, 210, 105), m: rgb(243, 210, 105),
c: rgb(173, 151, 137) c: rgb(173, 151, 137)
@@ -5758,7 +5787,20 @@ apply_index := {
} }
color: {fill_len(color_of_card(), lead:"A")}, color: {fill_len(color_of_card(), lead:"A")},
"color category": { "color category": {
indexes := [[lang_setting("colorless")], [lang_setting("white")], [lang_setting("blue")], [lang_setting("black")], [lang_setting("red")], [lang_setting("green")], [lang_setting("purple")], [lang_setting("pink")], [lang_setting("yellow")], [lang_setting("orange")], [lang_setting("brown")], [lang_setting("multicolor")], [lang_setting("hybrid")]] indexes := [[lang_setting("colorless")]
,[lang_setting("white")]
,[lang_setting("blue")]
,[lang_setting("black")]
,[lang_setting("red")]
,[lang_setting("green")]
,[lang_setting("orange")]
,[lang_setting("purple")]
,[lang_setting("pink")]
,[lang_setting("yellow")]
,[lang_setting("brown")]
,[lang_setting("multicolor")]
,[lang_setting("hybrid")]
]
fill_len(position(of:[card.color_category], in:indexes, lead:"0", fill_to:2)) fill_len(position(of:[card.color_category], in:indexes, lead:"0", fill_to:2))
}, },
"exact color": { "exact color": {
@@ -5860,7 +5902,27 @@ skeleton_runner := {
(cards := cards + [new_card([name:prefix+letter_list[x]+fill_len(y, lead:"0"), rarity:rarity, super_type:super_type, casting_cost:mana_list[x]])];) (cards := cards + [new_card([name:prefix+letter_list[x]+fill_len(y, lead:"0"), rarity:rarity, super_type:super_type, casting_cost:mana_list[x]])];)
) )
cards cards
}@(count:1, rarity:"common", type:"", prefix:"C", super_type:"", color_list:["white", "blue", "black", "red", "green"], letter_list:["W", "U", "B", "R", "G"], mana_list:"nope") }@(count:1
,rarity:"common"
,type:""
,prefix:"C"
,super_type:""
,color_list:["white"
,"blue"
,"black"
,"red"
,"green"
,"orange"
]
,letter_list:["W"
,"U"
,"B"
,"R"
,"G"
,"O"
]
,mana_list:"nope"
)
#### outside to make singleton scripts easier #### outside to make singleton scripts easier
blank_list_5 := ["","","","",""] blank_list_5 := ["","","","",""]
blank_list_10 := ["","","","","","","","","",""] blank_list_10 := ["","","","","","","","","",""]

View File

@@ -1322,10 +1322,10 @@ statistics dimension:
group: Black group: Black
group: Red group: Red
group: Green group: Green
group: Orange
group: Purple group: Purple
group: Pink group: Pink
group: Yellow group: Yellow
group: Orange
group: Brown group: Brown
group: Multicolor group: Multicolor
group: Hybrid group: Hybrid
@@ -1335,10 +1335,10 @@ statistics dimension:
Black : rgb(33,33,33) Black : rgb(33,33,33)
Red : rgb(156,15,15) Red : rgb(156,15,15)
Green : rgb(68,144,15) Green : rgb(68,144,15)
Orange : rgb(253,196,41)
Purple : rgb(150,100,160) Purple : rgb(150,100,160)
Pink : rgb(255,175,200) Pink : rgb(255,175,200)
Yellow : rgb(242,247,94) Yellow : rgb(242,247,94)
Orange : rgb(255,181,121)
Brown : rgb(191,171,144) Brown : rgb(191,171,144)
Colorless : rgb(101,104,94) Colorless : rgb(101,104,94)
Artifact : rgb(109,132,158) Artifact : rgb(109,132,158)

View File

@@ -219,7 +219,14 @@ color_category_statistic :=
} }
face_color_category_statistic := face_color_category_statistic :=
{ {
artifact := chosen(choice:"artifact") and not (chosen(choice:"white") or chosen(choice:"blue") or chosen(choice:"black") or chosen(choice:"red") or chosen(choice:"green")) artifact := (chosen(choice:"artifact"))
and not ( chosen(choice:"white")
or chosen(choice:"blue")
or chosen(choice:"black")
or chosen(choice:"red")
or chosen(choice:"green")
or chosen(choice:"orange")
)
land := chosen(choice:"land") land := chosen(choice:"land")
multi := chosen(choice:"multicolor") multi := chosen(choice:"multicolor")
hybrid := chosen(choice:"hybrid") hybrid := chosen(choice:"hybrid")
@@ -228,7 +235,8 @@ face_color_category_statistic :=
black := chosen(choice:"black") black := chosen(choice:"black")
red := chosen(choice:"red") red := chosen(choice:"red")
green := chosen(choice:"green") green := chosen(choice:"green")
multi_color := count_chosen(choices:"white, blue, black, red, green") orange := chosen(choice:"orange")
multi_color := count_chosen(choices:"white, blue, black, red, green, orange")
if land then all_en_space_statistic(lang_setting("land")) if land then all_en_space_statistic(lang_setting("land"))
else if multi then all_en_space_statistic(lang_setting("multicolor")) else if multi then all_en_space_statistic(lang_setting("multicolor"))
else if multi_color == 2 else if multi_color == 2
@@ -240,6 +248,7 @@ face_color_category_statistic :=
else if black then all_en_space_statistic(lang_setting("black")) else if black then all_en_space_statistic(lang_setting("black"))
else if red then all_en_space_statistic(lang_setting("red")) else if red then all_en_space_statistic(lang_setting("red"))
else if green then all_en_space_statistic(lang_setting("green")) else if green then all_en_space_statistic(lang_setting("green"))
else if orange then all_en_space_statistic(lang_setting("orange"))
else all_en_space_statistic(lang_setting("colorless")) else all_en_space_statistic(lang_setting("colorless"))
} }
@@ -254,7 +263,7 @@ face_omniverse_color_statistic :=
{ {
if chosen(choice: "land") then all_en_space_statistic(lang_setting("land")) if chosen(choice: "land") then all_en_space_statistic(lang_setting("land"))
else if chosen(choice: "multicolor") then all_en_space_statistic(lang_setting("multicolor")) else if chosen(choice: "multicolor") then all_en_space_statistic(lang_setting("multicolor"))
else if count_chosen(choices: "white, blue, black, red, green, pink, purple, yellow, orange, brown") == 2 else if count_chosen(choices: "white, blue, black, red, green, orange, pink, purple, yellow, brown") == 2
and chosen(choice: "artifact") then all_en_space_statistic(lang_setting("hybrid")) ##hybrid artifacts would show as their first color and chosen(choice: "artifact") then all_en_space_statistic(lang_setting("hybrid")) ##hybrid artifacts would show as their first color
else if chosen(choice: "hybrid") then all_en_space_statistic(lang_setting("hybrid")) else if chosen(choice: "hybrid") then all_en_space_statistic(lang_setting("hybrid"))
else if (chosen(choice: "artifact") else if (chosen(choice: "artifact")
@@ -263,20 +272,20 @@ face_omniverse_color_statistic :=
or chosen(choice: "black") or chosen(choice: "black")
or chosen(choice: "red") or chosen(choice: "red")
or chosen(choice: "green") or chosen(choice: "green")
or chosen(choice: "orange")
or chosen(choice: "pink") or chosen(choice: "pink")
or chosen(choice: "purple") or chosen(choice: "purple")
or chosen(choice: "yellow") or chosen(choice: "yellow")
or chosen(choice: "orange")
or chosen(choice: "brown"))) then all_en_space_statistic(lang_setting("artifact")) or chosen(choice: "brown"))) then all_en_space_statistic(lang_setting("artifact"))
else if chosen(choice: "white") then all_en_space_statistic(lang_setting("white")) else if chosen(choice: "white") then all_en_space_statistic(lang_setting("white"))
else if chosen(choice: "blue") then all_en_space_statistic(lang_setting("blue")) else if chosen(choice: "blue") then all_en_space_statistic(lang_setting("blue"))
else if chosen(choice: "black") then all_en_space_statistic(lang_setting("black")) else if chosen(choice: "black") then all_en_space_statistic(lang_setting("black"))
else if chosen(choice: "red") then all_en_space_statistic(lang_setting("red")) else if chosen(choice: "red") then all_en_space_statistic(lang_setting("red"))
else if chosen(choice: "green") then all_en_space_statistic(lang_setting("green")) else if chosen(choice: "green") then all_en_space_statistic(lang_setting("green"))
else if chosen(choice: "orange") then all_en_space_statistic(lang_setting("orange"))
else if chosen(choice: "pink") then all_en_space_statistic(lang_setting("pink")) else if chosen(choice: "pink") then all_en_space_statistic(lang_setting("pink"))
else if chosen(choice: "purple") then all_en_space_statistic(lang_setting("purple")) else if chosen(choice: "purple") then all_en_space_statistic(lang_setting("purple"))
else if chosen(choice: "yellow") then all_en_space_statistic(lang_setting("yellow")) else if chosen(choice: "yellow") then all_en_space_statistic(lang_setting("yellow"))
else if chosen(choice: "orange") then all_en_space_statistic(lang_setting("orange"))
else if chosen(choice: "brown") then all_en_space_statistic(lang_setting("brown")) else if chosen(choice: "brown") then all_en_space_statistic(lang_setting("brown"))
else input else input
} }
@@ -292,12 +301,14 @@ cc_colored_pips_statistic :=
symbol_aggregate_statistic(cc, symbol: "B") + symbol_aggregate_statistic(cc, symbol: "B") +
symbol_aggregate_statistic(cc, symbol: "R") + symbol_aggregate_statistic(cc, symbol: "R") +
symbol_aggregate_statistic(cc, symbol: "G") + symbol_aggregate_statistic(cc, symbol: "G") +
symbol_aggregate_statistic(cc, symbol: "O") +
symbol_aggregate_statistic(cc, symbol: "C") + symbol_aggregate_statistic(cc, symbol: "C") +
symbol_aggregate_statistic(cc2, symbol: "W") + symbol_aggregate_statistic(cc2, symbol: "W") +
symbol_aggregate_statistic(cc2, symbol: "U") + symbol_aggregate_statistic(cc2, symbol: "U") +
symbol_aggregate_statistic(cc2, symbol: "B") + symbol_aggregate_statistic(cc2, symbol: "B") +
symbol_aggregate_statistic(cc2, symbol: "R") + symbol_aggregate_statistic(cc2, symbol: "R") +
symbol_aggregate_statistic(cc2, symbol: "G") + symbol_aggregate_statistic(cc2, symbol: "G") +
symbol_aggregate_statistic(cc2, symbol: "O") +
symbol_aggregate_statistic(cc2, symbol: "C") symbol_aggregate_statistic(cc2, symbol: "C")
substring(result, begin: 1) substring(result, begin: 1)
} }
@@ -307,7 +318,7 @@ cc_colored_pips_totals_statistic :=
{ {
cc := card.casting_cost + (if check_2_statistic() then " " + card.casting_cost_2 else "") cc := card.casting_cost + (if check_2_statistic() then " " + card.casting_cost_2 else "")
join(wubrgc_break_statistic(cc), sep:",") join(color_code_break_statistic(cc), sep:",")
} }
# Count how many cards have one white pip in their ability costs. Repeat for two white pips. Repeat for three, then four+, then again for other colors. # Count how many cards have one white pip in their ability costs. Repeat for two white pips. Repeat for three, then four+, then again for other colors.
@@ -323,6 +334,7 @@ ability_colored_pips_statistic :=
symbol_aggregate_statistic(costs[x], symbol: "B") + symbol_aggregate_statistic(costs[x], symbol: "B") +
symbol_aggregate_statistic(costs[x], symbol: "R") + symbol_aggregate_statistic(costs[x], symbol: "R") +
symbol_aggregate_statistic(costs[x], symbol: "G") + symbol_aggregate_statistic(costs[x], symbol: "G") +
symbol_aggregate_statistic(costs[x], symbol: "O") +
symbol_aggregate_statistic(costs[x], symbol: "C") symbol_aggregate_statistic(costs[x], symbol: "C")
) )
substring(result, begin: 1)) substring(result, begin: 1))
@@ -336,7 +348,7 @@ ability_colored_pips_totals_statistic :=
count := length(costs) - 1 count := length(costs) - 1
result := for x from 0 to count do result := for x from 0 to count do
( (
"," + join(wubrgc_break_statistic(costs[x]), sep:",") "," + join(color_code_break_statistic(costs[x]), sep:",")
) )
substring(result, begin: 1)) substring(result, begin: 1))
} }
@@ -383,10 +395,11 @@ devotion_filters_statistic := [
B: filter_text@(match:"B") B: filter_text@(match:"B")
R: filter_text@(match:"R") R: filter_text@(match:"R")
G: filter_text@(match:"G") G: filter_text@(match:"G")
G: filter_text@(match:"O")
C: filter_text@(match:"C") C: filter_text@(match:"C")
] ]
color_pip_break_statistic := break_text@(match:"([A-Z0-9]/|[|])*[WUBRG]") color_pip_break_statistic := break_text@(match:"([A-Z0-9]/|[|])*[WUBRGO]")
wubrgc_break_statistic := break_text@(match:"[WUBRGC]") color_code_break_statistic := break_text@(match:"[WUBRGOC]")
symbol_aggregate_statistic := symbol_aggregate_statistic :=
{ {
devotion := devotion_filters_statistic[symbol](input) devotion := devotion_filters_statistic[symbol](input)
@@ -461,13 +474,14 @@ face_mana_production_list_statistic :=
can_Chosen := lang_setting("chosen_mana_production")(combined_text) != "" can_Chosen := lang_setting("chosen_mana_production")(combined_text) != ""
# the mana symbols we can produce # the mana symbols we can produce
produced_symbols := wubrgc_break_statistic(lang_setting("mana_symbol_production")(combined_text)) produced_symbols := color_code_break_statistic(lang_setting("mana_symbol_production")(combined_text))
(if lang_setting("is_plains")(sub) or contains_element(produced_symbols, element:"W") then ",W" else "") + (if lang_setting("is_plains")(sub) or contains_element(produced_symbols, element:"W") then ",W" else "") +
(if lang_setting("is_island")(sub) or contains_element(produced_symbols, element:"U") then ",U" else "") + (if lang_setting("is_island")(sub) or contains_element(produced_symbols, element:"U") then ",U" else "") +
(if lang_setting("is_swamp")(sub) or contains_element(produced_symbols, element:"B") then ",B" else "") + (if lang_setting("is_swamp")(sub) or contains_element(produced_symbols, element:"B") then ",B" else "") +
(if lang_setting("is_mountain")(sub) or contains_element(produced_symbols, element:"R") then ",R" else "") + (if lang_setting("is_mountain")(sub) or contains_element(produced_symbols, element:"R") then ",R" else "") +
(if lang_setting("is_forest")(sub) or contains_element(produced_symbols, element:"G") then ",G" else "") + (if lang_setting("is_forest")(sub) or contains_element(produced_symbols, element:"G") then ",G" else "") +
(if lang_setting("is_desert")(sub) or contains_element(produced_symbols, element:"O") then ",O" else "") +
(if lang_setting("is_wastes")(name) or contains_element(produced_symbols, element:"C") then ",C" else "") + (if lang_setting("is_wastes")(name) or contains_element(produced_symbols, element:"C") then ",C" else "") +
(if can_Any then ","+all_en_space_statistic(lang_setting("mana_any")) else "") + (if can_Any then ","+all_en_space_statistic(lang_setting("mana_any")) else "") +
(if can_Chosen then ","+all_en_space_statistic(lang_setting("mana_chosen")) else "") (if can_Chosen then ","+all_en_space_statistic(lang_setting("mana_chosen")) else "")