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