mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 21:27:01 -04:00
Vanguard wanted an update to catch up to Magic.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1061 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+53
-45
@@ -1,11 +1,11 @@
|
|||||||
mse version: 0.3.6
|
mse version: 0.3.7
|
||||||
short name: Vanguard
|
short name: Vanguard
|
||||||
full name: Magic Vanguard
|
full name: Magic Vanguard
|
||||||
installer group: Magic Vanguard/game files
|
installer group: Magic Vanguard/game files
|
||||||
icon: card-sample.png
|
icon: card-sample.png
|
||||||
position hint: 02
|
position hint: 02
|
||||||
|
|
||||||
version: 2008-06-02
|
version: 2008-08-05
|
||||||
|
|
||||||
# Author : Wolfwood
|
# Author : Wolfwood
|
||||||
# Most stuff is copy/pasted from magic.mse-game
|
# Most stuff is copy/pasted from magic.mse-game
|
||||||
@@ -17,23 +17,23 @@ init script:
|
|||||||
############################################################## Sorting mana symbols
|
############################################################## Sorting mana symbols
|
||||||
|
|
||||||
# correctly sort a mana symbol (no guild mana)
|
# correctly sort a mana symbol (no guild mana)
|
||||||
mana_sort := sort_rule(order: "XYZI[0123456789]S(WUBRG)")
|
mana_sort := sort_text@(order: "XYZI[0123456789]S(WUBRG)")
|
||||||
# correctly sort guild mana
|
# correctly sort guild mana
|
||||||
mana_sort_guild := sort_rule(order: "[XYZI01234567890SWUBRG/]") +
|
mana_sort_guild := sort_text@(order: "[XYZI01234567890SWUBRG/|]") +
|
||||||
replace_rule(
|
replace@(
|
||||||
match: "./.|././.|./././.|.[|]",
|
match: "./.|././.|./././.|.[|]",
|
||||||
in_context: "(^|[^/])<match>($|[^/])",
|
in_context: "(^|[^/])<match>($|[^/])",
|
||||||
replace: {sort_text(order:"in_place((WUBRG)")}
|
replace: {sort_text(order:"in_place((WUBRG)")}
|
||||||
)
|
)
|
||||||
mana_has_guild := sort_rule(order: "</|>") # Is there guild or half mana in the input?
|
mana_has_guild := match@(match: "[/|]") # Is there guild or half mana in the input?
|
||||||
# A mana cost can contain both normal and guild mana
|
# A mana cost can contain both normal and guild mana
|
||||||
mana_filter := to_upper + {
|
mana_filter := to_upper + {
|
||||||
if mana_has_guild()!="" then mana_sort_guild()
|
if mana_has_guild() then mana_sort_guild()
|
||||||
else mana_sort()
|
else mana_sort()
|
||||||
}
|
}
|
||||||
# Like mana filter, only also allow tap symbols:
|
# Like mana filter, only also allow tap symbols:
|
||||||
tap_filter := sort_rule(order: "<TQ>")
|
tap_filter := sort_text@(order: "<TQ>")
|
||||||
mana_filter_t := replace_rule( # Remove [] used for forcing mana symbols
|
mana_filter_t := replace@( # Remove [] used for forcing mana symbols
|
||||||
match: "[\\[\\]]",
|
match: "[\\[\\]]",
|
||||||
replace: ""
|
replace: ""
|
||||||
) + { tap_filter() + mana_filter() }
|
) + { tap_filter() + mana_filter() }
|
||||||
@@ -53,39 +53,37 @@ init script:
|
|||||||
) else
|
) else
|
||||||
"{add}<param-mana>{input.param}</param-mana>"
|
"{add}<param-mana>{input.param}</param-mana>"
|
||||||
}
|
}
|
||||||
alternative_cost := replace_rule(match:"^[A-Z]", replace: { to_lower() })
|
alternative_cost := replace@(match:"^[A-Z]", replace: { to_lower() })
|
||||||
combined_cost := replace_rule(match:", [A-Z]", replace: { to_lower() })+
|
combined_cost := replace@(match:", [A-Z]", replace: { to_lower() })+
|
||||||
replace_rule(match:",", replace:" and")+
|
replace@(match:",", replace:" and")+
|
||||||
replace_rule(match:"^[STQXYZIWUBRG0-9/|]", in_context: "(^|[[:space:]])<match>", replace: "<sym-auto>&</sym-auto>")+
|
replace@(match:"^[STQXYZIWUBRG0-9/|]", in_context: "(^|[[:space:]])<match>", replace: "<sym-auto>&</sym-auto>")+
|
||||||
replace_rule(match:"^[A-Z]", replace: { to_lower() })
|
replace@(match:"^[A-Z]", replace: { to_lower() })
|
||||||
long_dash := replace_rule(match:"-", replace:"—")
|
long_dash := replace@(match:"-", replace:"—")
|
||||||
# Utilities for keywords
|
# Utilities for keywords
|
||||||
has_cc := { card.casting_cost != "" }
|
has_cc := { card.casting_cost != "" }
|
||||||
has_pt := { card.pt != "" }
|
has_pt := { card.pt != "" }
|
||||||
|
|
||||||
# Converted mana cost
|
# Converted mana cost
|
||||||
is_half_mana := match_rule(match: "1/2|[|][WUBRGS]")
|
is_half_mana := match@(match: "1/2|[|][WUBRGS]")
|
||||||
is_zero_slash := match_rule(match: "^0/")
|
is_colored_mana := match@(match: "[WUBRG]")
|
||||||
is_colored_mana := match_rule(match: "[WUBRG]")
|
only_numbers := filter_text@(match: "^[0123456789]+")
|
||||||
only_numbers := filter_rule(match: "^[0123456789]+")
|
cmc_split := break_text@(match: "(?ix) 1/2 | [|][WUBRG] | [0-9]+(?!/[WUBRGSTQ2]) | [WUBRGS0-9](/[WUBRGS])\{0,4} ")
|
||||||
cmc_split := break_rule(match: "(?ix) 1/2 | [|][WUBRG] | ([0-9]+(?!/2)|[WUBRGS])(/[WUBRGS])\{0,4} ")
|
cmc := {to_number(
|
||||||
cmc := to_text + { 0 +
|
|
||||||
for each sym in cmc_split() do (
|
for each sym in cmc_split() 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 is_zero_slash(sym) then 1 # 0/C
|
else if numbers != "" then max(1, to_int(numbers))
|
||||||
else if numbers != "" then 1 * numbers
|
else 1 # all other symbols are 1
|
||||||
else 1 # all other symbols are 1
|
))
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
colored_mana := to_text + { 0 +
|
colored_mana := {to_number(
|
||||||
for each sym in cmc_split() do (
|
for each sym in cmc_split() 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
|
||||||
else 0
|
else 0
|
||||||
)
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
############################################################## The text box
|
############################################################## The text box
|
||||||
@@ -118,59 +116,59 @@ init script:
|
|||||||
# - makes text in parentheses italic
|
# - makes text in parentheses italic
|
||||||
text_filter :=
|
text_filter :=
|
||||||
# step 1 : remove all automatic tags
|
# step 1 : remove all automatic tags
|
||||||
tag_remove_rule(tag: "<sym-auto>") +
|
remove_tag@(tag: "<sym-auto>") +
|
||||||
tag_remove_rule(tag: "<i-auto>") +
|
remove_tag@(tag: "<i-auto>") +
|
||||||
# step 2 : reminder text for keywords
|
# step 2 : reminder text for keywords
|
||||||
expand_keywords_rule(
|
expand_keywords@(
|
||||||
default_expand: { contains(match:mode, set.automatic_reminder_text) },
|
default_expand: { contains(match:mode, set.automatic_reminder_text) },
|
||||||
combine: {
|
combine: {
|
||||||
if mode == "pseudo" then "<i-auto>{keyword}</i-auto>"
|
if mode == "pseudo" then "<i-auto>{keyword}</i-auto>"
|
||||||
else "{keyword}<atom-reminder><i> ({process_english_hints(reminder)})</i></atom-reminder>" }
|
else "{keyword}<atom-reminder><i> ({process_english_hints(reminder)})</i></atom-reminder>" }
|
||||||
) +
|
) +
|
||||||
# step 2b : move inline keywords' reminder text to the end of the line
|
# step 2b : move inline keywords' reminder text to the end of the line
|
||||||
replace_rule(
|
replace@(
|
||||||
match: "(<atom-reminder-core>.*</atom-reminder-core></kw[^>]*>)([^\n(]+)",
|
match: "(<atom-reminder-core>.*</atom-reminder-core></kw[^>]*>)([^\n(]+)",
|
||||||
replace: "\\2\\1"
|
replace: "\\2\\1"
|
||||||
) +
|
) +
|
||||||
replace_rule(
|
replace@(
|
||||||
match: "(<atom-reminder-old>.*</atom-reminder-old></kw[^>]*>)([^\n(]+)",
|
match: "(<atom-reminder-old>.*</atom-reminder-old></kw[^>]*>)([^\n(]+)",
|
||||||
replace: "\\2\\1"
|
replace: "\\2\\1"
|
||||||
) +
|
) +
|
||||||
replace_rule(
|
replace@(
|
||||||
match: "(<atom-reminder-expert>.*</atom-reminder-expert></kw[^>]*>)([^\n(]+)",
|
match: "(<atom-reminder-expert>.*</atom-reminder-expert></kw[^>]*>)([^\n(]+)",
|
||||||
replace: "\\2\\1"
|
replace: "\\2\\1"
|
||||||
) +
|
) +
|
||||||
# step 3 : expand shortcut words ~ and CARDNAME
|
# step 3 : expand shortcut words ~ and CARDNAME
|
||||||
replace_rule(
|
replace@(
|
||||||
match: "~|~THIS~|CARDNAME",
|
match: "~|~THIS~|CARDNAME",
|
||||||
in_context: "(^|[[:space:]]|\\()<match>",
|
in_context: "(^|[[:space:]]|\\()<match>",
|
||||||
replace: "<atom-cardname></atom-cardname>"
|
replace: "<atom-cardname></atom-cardname>"
|
||||||
) +
|
) +
|
||||||
# step 4 : fill in atom fields
|
# step 4 : fill in atom fields
|
||||||
tag_contents_rule(
|
tag_contents@(
|
||||||
tag: "<atom-cardname>",
|
tag: "<atom-cardname>",
|
||||||
contents: { if card.name=="" then "CARDNAME" else card.name }
|
contents: { if card.name=="" then "CARDNAME" else card.name }
|
||||||
) +
|
) +
|
||||||
# step 4.5 : explict non mana symbols
|
# step 4.5 : explict non mana symbols
|
||||||
replace_rule(
|
replace@(
|
||||||
match: "\\][STQXYZIWUBRG0-9/|]+\\[",
|
match: "\\][STQXYZIWUBRG0-9/|]+\\[",
|
||||||
replace: {"<nosym>" + mana_filter_t() + "</nosym>"} ) +
|
replace: {"<nosym>" + mana_filter_t() + "</nosym>"} ) +
|
||||||
# step 5 : add mana & tap symbols
|
# step 5 : add mana & tap symbols
|
||||||
replace_rule(
|
replace@(
|
||||||
match: "[STQXYZIWUBRG0-9/|]+",
|
match: "[STQXYZIWUBRG0-9/|]+",
|
||||||
in_context: mana_context,
|
in_context: mana_context,
|
||||||
replace: {"<sym-auto>" + mana_filter_t() + "</sym-auto>"} ) +
|
replace: {"<sym-auto>" + mana_filter_t() + "</sym-auto>"} ) +
|
||||||
# step 5b : add explict mana symbols
|
# step 5b : add explict mana symbols
|
||||||
replace_rule(
|
replace@(
|
||||||
match: "\\[[STQXYZIWUBRG0-9/|]+\\]",
|
match: "\\[[STQXYZIWUBRG0-9/|]+\\]",
|
||||||
replace: {"<sym>" + mana_filter_t() + "</sym>"} ) +
|
replace: {"<sym>" + mana_filter_t() + "</sym>"} ) +
|
||||||
# step 7 : italic reminder text
|
# step 7 : italic reminder text
|
||||||
replace_rule(
|
replace@(
|
||||||
match: "[(][^)\n]*[)]?",
|
match: "[(][^)\n]*[)]?",
|
||||||
in_context: "(^|[[:space:]])<match>|<atom-keyword><match></>",
|
in_context: "(^|[[:space:]])<match>|<atom-keyword><match></>",
|
||||||
replace: "<i-auto>&</i-auto>") +
|
replace: "<i-auto>&</i-auto>") +
|
||||||
# step 8 : automatic capitalization
|
# step 8 : automatic capitalization
|
||||||
replace_rule(
|
replace@(
|
||||||
match: "[a-z]",
|
match: "[a-z]",
|
||||||
in_context: "[(](<param-[a-z]*>)?<match>|[ ]*: <param-cost><match>|—<match>| — <match>",
|
in_context: "[(](<param-[a-z]*>)?<match>|[ ]*: <param-cost><match>|—<match>| — <match>",
|
||||||
replace: { to_upper() })
|
replace: { to_upper() })
|
||||||
@@ -181,7 +179,7 @@ init script:
|
|||||||
# - makes all text italic
|
# - makes all text italic
|
||||||
flavor_text_filter :=
|
flavor_text_filter :=
|
||||||
# step 2 : remove italic tags
|
# step 2 : remove italic tags
|
||||||
tag_remove_rule(tag: "<i-flavor>") +
|
remove_tag@(tag: "<i-flavor>") +
|
||||||
# step 3 : surround by <i> tags
|
# step 3 : surround by <i> tags
|
||||||
{ "<i-flavor>" + input + "</i-flavor>" } +
|
{ "<i-flavor>" + input + "</i-flavor>" } +
|
||||||
# curly quotes
|
# curly quotes
|
||||||
@@ -995,4 +993,14 @@ keyword:
|
|||||||
keyword: Conspire
|
keyword: Conspire
|
||||||
match: conspire
|
match: conspire
|
||||||
mode: expert
|
mode: expert
|
||||||
reminder: As you play it, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose a new target for the copy.
|
reminder: As you play it, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose a new target for the copy.
|
||||||
|
keyword:
|
||||||
|
keyword: Retrace
|
||||||
|
match: Retrace
|
||||||
|
mode: expert
|
||||||
|
reminder: You may play this card from your graveyard by discarding a land card in addition to paying its other costs.
|
||||||
|
keyword:
|
||||||
|
keyword: Chroma
|
||||||
|
match: Chroma
|
||||||
|
mode: pseudo
|
||||||
|
rules: Chroma — [effect] based on the number of [color] mana symbols [in graveyard, under your control, in cards you discard].
|
||||||
|
|||||||
Reference in New Issue
Block a user