Added "rules" to pseudo keywords, to serve as a guideline for use.

Added support to cost param for mixed costs, such as "Kicker-R, Sacrifice a Merfolk."

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@582 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
pichoro
2007-07-25 05:16:20 +00:00
parent 2f33292cfb
commit 5bfced7102
2 changed files with 31 additions and 10 deletions
+12 -5
View File
@@ -70,17 +70,22 @@ init script:
# replaces — correctly
add := "" # default is nothing
for_mana_costs := format_cost := {
if input.separator_before == "—" then
"<param-cost>{input.param}</param-cost>"
else
if input.separator_before == "—" then (
if not contains(input.param, match:",") then
"<param-cost>{input.param}</param-cost>"
else
"{add}<param-cost>{input.param}</param-cost>"
) else
"{add}<param-mana>{input.param}</param-mana>"
}
alternative_cost := replace_rule(match:"^[A-Z]", replace: { to_lower() })
combined_cost := replace_rule(match:", [A-Z]", replace: { to_lower() })+
replace_rule(match:",", replace:", and")
format_alt_cost := {
if input.separator_before == "—" then
if input.separator_before == "—" and not contains(input.param, match:",") then
alternative_cost(input.param)
else
input.param
combined_cost(input.param)
}
long_dash := replace_rule(match:"-", replace:"—")
# Utilities for keywords
@@ -465,6 +470,8 @@ keyword parameter type:
keyword parameter type:
name: action
match: [^(\n]+
separator after is: [.]
reminder script: alternative_cost()
keyword parameter type:
name: name
match: [^(.,\n—-]+