Commit 47720b37 authored by twanvl's avatar twanvl

cmc now works correctly with keyword parameters

parent e2d4e8e8
...@@ -495,7 +495,7 @@ is_colored_mana := match@(match: "[WUBRG]") ...@@ -495,7 +495,7 @@ 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]+(?!/[WUBRGSTQ2]) | [WUBRGS0-9](/[WUBRGS])\{0,4} ") cmc_split := break_text@(match: "(?ix) 1/2 | [|][WUBRG] | [0-9]+(?!/[WUBRGSTQ2]) | [WUBRGS0-9](/[WUBRGS])\{0,4} ")
cmc := {to_number( cmc := {to_number(
for each sym in cmc_split() do ( for each sym in cmc_split(to_text()) 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 numbers != "" then to_int(numbers) else if numbers != "" then to_int(numbers)
...@@ -504,7 +504,7 @@ cmc := {to_number( ...@@ -504,7 +504,7 @@ cmc := {to_number(
} }
colored_mana := {to_number( colored_mana := {to_number(
for each sym in cmc_split() do ( for each sym in cmc_split(to_text()) 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
......
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