Commit 8c90f3b9 authored by twanvl's avatar twanvl

Mana costs like 123/C are now parsed as {12}{3/C} instead of {123/C}. The...

Mana costs like 123/C are now parsed as {12}{3/C} instead of {123/C}. The reasoning is that a cost of {10/C} or more is very unbalanced, so you want that.
parent 6d6721b6
...@@ -181,7 +181,7 @@ symbol: ...@@ -181,7 +181,7 @@ symbol:
image: mana_s.png image: mana_s.png
symbol: symbol:
image: mana_nw.png image: mana_nw.png
code: ([XYZ0-9]+)/W code: ([XYZ0-9])/W
regex: yes regex: yes
draw text: 1 draw text: 1
text margin left: -.05 text margin left: -.05
...@@ -195,7 +195,7 @@ symbol: ...@@ -195,7 +195,7 @@ symbol:
max stretch: 0.5 max stretch: 0.5
symbol: symbol:
image: mana_nu.png image: mana_nu.png
code: ([XYZ0-9]+)/U code: ([XYZ0-9])/U
regex: yes regex: yes
draw text: 1 draw text: 1
text margin left: -.05 text margin left: -.05
...@@ -209,7 +209,7 @@ symbol: ...@@ -209,7 +209,7 @@ symbol:
max stretch: 0.5 max stretch: 0.5
symbol: symbol:
image: mana_nb.png image: mana_nb.png
code: ([XYZ0-9]+)/B code: ([XYZ0-9])/B
regex: yes regex: yes
draw text: 1 draw text: 1
text margin left: -.05 text margin left: -.05
...@@ -223,7 +223,7 @@ symbol: ...@@ -223,7 +223,7 @@ symbol:
max stretch: 0.5 max stretch: 0.5
symbol: symbol:
image: mana_nr.png image: mana_nr.png
code: ([XYZ0-9]+)/R code: ([XYZ0-9])/R
regex: yes regex: yes
draw text: 1 draw text: 1
text margin left: -.05 text margin left: -.05
...@@ -237,7 +237,7 @@ symbol: ...@@ -237,7 +237,7 @@ symbol:
max stretch: 0.5 max stretch: 0.5
symbol: symbol:
image: mana_ng.png image: mana_ng.png
code: ([XYZ0-9]+)/G code: ([XYZ0-9])/G
regex: yes regex: yes
draw text: 1 draw text: 1
text margin left: -.05 text margin left: -.05
...@@ -263,7 +263,7 @@ symbol: ...@@ -263,7 +263,7 @@ symbol:
image: mana_infinite.png image: mana_infinite.png
symbol: symbol:
image: mana_circle.png image: mana_circle.png
code: [0-9]+(?!/2)|. code: [0-9]+(?!/[WUBRGSTQ2])|.
regex: yes regex: yes
draw text: 0 draw text: 0
text font: text font:
......
...@@ -187,7 +187,7 @@ symbol: ...@@ -187,7 +187,7 @@ symbol:
symbol: symbol:
image: mana_circle_w.png image: mana_circle_w.png
enabled: { colorless_color() == "w" } enabled: { colorless_color() == "w" }
code: [0-9]+(?!/2)|. code: [0-9]+(?!/[WUBRGSTQ2])|.
regex: yes regex: yes
draw text: 0 draw text: 0
text font: text font:
...@@ -203,7 +203,7 @@ symbol: ...@@ -203,7 +203,7 @@ symbol:
symbol: symbol:
image: mana_circle_u.png image: mana_circle_u.png
enabled: { colorless_color() == "u" } enabled: { colorless_color() == "u" }
code: [0-9]+(?!/2)|. code: [0-9]+(?!/[WUBRGSTQ2])|.
regex: yes regex: yes
draw text: 0 draw text: 0
text font: text font:
...@@ -219,7 +219,7 @@ symbol: ...@@ -219,7 +219,7 @@ symbol:
symbol: symbol:
image: mana_circle_b.png image: mana_circle_b.png
enabled: { colorless_color() == "b" } enabled: { colorless_color() == "b" }
code: [0-9]+(?!/2)|. code: [0-9]+(?!/[WUBRGSTQ2])|.
regex: yes regex: yes
draw text: 0 draw text: 0
text font: text font:
...@@ -235,7 +235,7 @@ symbol: ...@@ -235,7 +235,7 @@ symbol:
symbol: symbol:
image: mana_circle_r.png image: mana_circle_r.png
enabled: { colorless_color() == "r" } enabled: { colorless_color() == "r" }
code: [0-9]+(?!/2)|. code: [0-9]+(?!/[WUBRGSTQ2])|.
regex: yes regex: yes
draw text: 0 draw text: 0
text font: text font:
...@@ -251,7 +251,7 @@ symbol: ...@@ -251,7 +251,7 @@ symbol:
symbol: symbol:
image: mana_circle_g.png image: mana_circle_g.png
enabled: { colorless_color() == "g" } enabled: { colorless_color() == "g" }
code: [0-9]+(?!/2)|. code: [0-9]+(?!/[WUBRGSTQ2])|.
regex: yes regex: yes
draw text: 0 draw text: 0
text font: text font:
...@@ -266,7 +266,7 @@ symbol: ...@@ -266,7 +266,7 @@ symbol:
text margin bottom: 0.1 text margin bottom: 0.1
symbol: symbol:
image: mana_circle.png image: mana_circle.png
code: [0-9]+(?!/2)|. code: [0-9]+(?!/[WUBRGSTQ2])|.
regex: yes regex: yes
draw text: 0 draw text: 0
text font: text font:
......
...@@ -204,7 +204,7 @@ symbol: ...@@ -204,7 +204,7 @@ symbol:
image: mana_s.png image: mana_s.png
symbol: symbol:
image: mana_nw.png image: mana_nw.png
code: ([XYZ0-9]+)/W code: ([XYZ0-9])/W
regex: yes regex: yes
draw text: 1 draw text: 1
text margin left: -.25 text margin left: -.25
...@@ -219,7 +219,7 @@ symbol: ...@@ -219,7 +219,7 @@ symbol:
image font size: 145 image font size: 145
symbol: symbol:
image: mana_nu.png image: mana_nu.png
code: ([XYZ0-9]+)/U code: ([XYZ0-9])/U
regex: yes regex: yes
draw text: 1 draw text: 1
text margin left: -.25 text margin left: -.25
...@@ -234,7 +234,7 @@ symbol: ...@@ -234,7 +234,7 @@ symbol:
image font size: 145 image font size: 145
symbol: symbol:
image: mana_nb.png image: mana_nb.png
code: ([XYZ0-9]+)/B code: ([XYZ0-9])/B
regex: yes regex: yes
draw text: 1 draw text: 1
text margin left: -.25 text margin left: -.25
...@@ -249,7 +249,7 @@ symbol: ...@@ -249,7 +249,7 @@ symbol:
image font size: 145 image font size: 145
symbol: symbol:
image: mana_nr.png image: mana_nr.png
code: ([XYZ0-9]+)/R code: ([XYZ0-9])/R
regex: yes regex: yes
draw text: 1 draw text: 1
text margin left: -.25 text margin left: -.25
...@@ -264,7 +264,7 @@ symbol: ...@@ -264,7 +264,7 @@ symbol:
image font size: 145 image font size: 145
symbol: symbol:
image: mana_ng.png image: mana_ng.png
code: ([XYZ0-9]+)/G code: ([XYZ0-9])/G
regex: yes regex: yes
draw text: 1 draw text: 1
text margin left: -.25 text margin left: -.25
...@@ -295,7 +295,7 @@ symbol: ...@@ -295,7 +295,7 @@ symbol:
text margin right: .20 text margin right: .20
text margin top: -.15 text margin top: -.15
text margin bottom: -.06 text margin bottom: -.06
code: [0-9]+(?!/2)|. code: [0-9]+(?!/[WUBRGSTQ2])|.
regex: yes regex: yes
draw text: 0 draw text: 0
text font: text font:
......
...@@ -211,7 +211,7 @@ symbol: ...@@ -211,7 +211,7 @@ symbol:
image: mana_s.png image: mana_s.png
symbol: symbol:
image: mana_nw.png image: mana_nw.png
code: ([XYZ0-9]+)/W code: ([XYZ0-9])/W
regex: yes regex: yes
draw text: 1 draw text: 1
text margin left: -.30 text margin left: -.30
...@@ -226,7 +226,7 @@ symbol: ...@@ -226,7 +226,7 @@ symbol:
image font size: 145 image font size: 145
symbol: symbol:
image: mana_nu.png image: mana_nu.png
code: ([XYZ0-9]+)/U code: ([XYZ0-9])/U
regex: yes regex: yes
draw text: 1 draw text: 1
text margin left: -.30 text margin left: -.30
...@@ -241,7 +241,7 @@ symbol: ...@@ -241,7 +241,7 @@ symbol:
image font size: 145 image font size: 145
symbol: symbol:
image: mana_nb.png image: mana_nb.png
code: ([XYZ0-9]+)/B code: ([XYZ0-9])/B
regex: yes regex: yes
draw text: 1 draw text: 1
text margin left: -.30 text margin left: -.30
...@@ -256,7 +256,7 @@ symbol: ...@@ -256,7 +256,7 @@ symbol:
image font size: 145 image font size: 145
symbol: symbol:
image: mana_nr.png image: mana_nr.png
code: ([XYZ0-9]+)/R code: ([XYZ0-9])/R
regex: yes regex: yes
draw text: 1 draw text: 1
text margin left: -.30 text margin left: -.30
...@@ -271,7 +271,7 @@ symbol: ...@@ -271,7 +271,7 @@ symbol:
image font size: 145 image font size: 145
symbol: symbol:
image: mana_ng.png image: mana_ng.png
code: ([XYZ0-9]+)/G code: ([XYZ0-9])/G
regex: yes regex: yes
draw text: 1 draw text: 1
text margin left: -.30 text margin left: -.30
...@@ -298,7 +298,7 @@ symbol: ...@@ -298,7 +298,7 @@ symbol:
image: mana_infinite.png image: mana_infinite.png
symbol: symbol:
image: mana_circle.png image: mana_circle.png
code: [0-9]+(?!/2)|. code: [0-9]+(?!/[WUBRGSTQ2])|.
regex: yes regex: yes
draw text: 0 draw text: 0
text margin left: .26 text margin left: .26
......
...@@ -214,7 +214,7 @@ symbol: ...@@ -214,7 +214,7 @@ symbol:
image: mana_infinite.png image: mana_infinite.png
symbol: symbol:
image: mana_nw.png image: mana_nw.png
code: ([XYZ0-9]+)/W code: ([XYZ0-9])/W
regex: yes regex: yes
draw text: 1 draw text: 1
text margin left: -.30 text margin left: -.30
...@@ -229,7 +229,7 @@ symbol: ...@@ -229,7 +229,7 @@ symbol:
image font size: 145 image font size: 145
symbol: symbol:
image: mana_nu.png image: mana_nu.png
code: ([XYZ0-9]+)/U code: ([XYZ0-9])/U
regex: yes regex: yes
draw text: 1 draw text: 1
text margin left: -.30 text margin left: -.30
...@@ -244,7 +244,7 @@ symbol: ...@@ -244,7 +244,7 @@ symbol:
image font size: 145 image font size: 145
symbol: symbol:
image: mana_nb.png image: mana_nb.png
code: ([XYZ0-9]+)/B code: ([XYZ0-9])/B
regex: yes regex: yes
draw text: 1 draw text: 1
text margin left: -.30 text margin left: -.30
...@@ -259,7 +259,7 @@ symbol: ...@@ -259,7 +259,7 @@ symbol:
image font size: 145 image font size: 145
symbol: symbol:
image: mana_nr.png image: mana_nr.png
code: ([XYZ0-9]+)/R code: ([XYZ0-9])/R
regex: yes regex: yes
draw text: 1 draw text: 1
text margin left: -.30 text margin left: -.30
...@@ -274,7 +274,7 @@ symbol: ...@@ -274,7 +274,7 @@ symbol:
image font size: 145 image font size: 145
symbol: symbol:
image: mana_ng.png image: mana_ng.png
code: ([XYZ0-9]+)/G code: ([XYZ0-9])/G
regex: yes regex: yes
draw text: 1 draw text: 1
text margin left: -.30 text margin left: -.30
...@@ -298,7 +298,7 @@ symbol: ...@@ -298,7 +298,7 @@ symbol:
image: mana_z.png image: mana_z.png
symbol: symbol:
image: mana_circle.png image: mana_circle.png
code: [0-9]+(?!/2)|. code: [0-9]+(?!/[WUBRGSTQ2])|.
regex: yes regex: yes
draw text: 0 draw text: 0
text margin left: .26 text margin left: .26
......
...@@ -489,27 +489,25 @@ init script: ...@@ -489,27 +489,25 @@ init script:
# Converted mana cost # Converted mana cost
is_half_mana := match@(match: "1/2|[|][WUBRGS]") is_half_mana := match@(match: "1/2|[|][WUBRGS]")
is_zero_slash := match@(match: "^0/")
is_colored_mana := match@(match: "[WUBRG]") is_colored_mana := match@(match: "[WUBRG]")
only_numbers := filter_text@(match: "^[0123456789]+") only_numbers := filter_text@(match: "^[0123456789]+")
cmc_split := break_text@(match: "(?ix) 1/2 | [|][WUBRG] | ([0-9]+(?!/2)|[WUBRGS])(/[WUBRGS])\{0,4} ") cmc_split := break_text@(match: "(?ix) 1/2 | [|][WUBRG] | [0-9]+(?!/[WUBRGSTQ2]) | [WUBRGS0-9](/[WUBRGS])\{0,4} ")
cmc := to_text + { cmc := {to_number(
for each sym in cmc_split() do ( for each sym in cmc_split() do (
numbers := only_numbers(sym) numbers := only_numbers(sym)
if is_half_mana(sym) then 0.5 if is_half_mana(sym) then 0.5
else if is_zero_slash(sym) then 1 # 0/C else if numbers != "" then max(1, to_int(numbers))
else if numbers != "" then to_int(numbers) else 1 # all other symbols are 1
else 1 # all other symbols are 1 ))
)
} }
colored_mana := to_text + { colored_mana := {to_number(
for each sym in cmc_split() do ( for each sym in cmc_split() do (
numbers := only_numbers(sym) numbers := only_numbers(sym)
if is_colored_mana(sym) then if is_colored_mana(sym) then
if is_half_mana(sym) then 0.5 else 1 if is_half_mana(sym) then 0.5 else 1
else 0 else 0
) ))
} }
primary_card_color := { primary_card_color := {
artifact := chosen(choice:"artifact") artifact := chosen(choice:"artifact")
......
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