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.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1041 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-08-03 19:02:07 +00:00
parent bca66f54b9
commit 063a2df8d7
6 changed files with 38 additions and 40 deletions
+8 -10
View File
@@ -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")