mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 05:07:00 -04:00
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:
@@ -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—-]+
|
||||
|
||||
Reference in New Issue
Block a user