Commit 427e3b3c authored by twanvl's avatar twanvl

Some cleanup of the keywords;

Some experimenting with dependencies
parent 266d54bb
...@@ -485,6 +485,7 @@ error: ...@@ -485,6 +485,7 @@ error:
Error while parsing file: '%s' Error while parsing file: '%s'
%s %s
package not found: Package not found: '%s' package not found: Package not found: '%s'
package out of date: The package '%s' (version %s) is out of date, version %s is required.
unable to open output file: Error while saving, unable to open output file unable to open output file: Error while saving, unable to open output file
unable to store file: Error while saving, unable to store file unable to store file: Error while saving, unable to store file
......
...@@ -4,6 +4,14 @@ short name: Modern style ...@@ -4,6 +4,14 @@ short name: Modern style
full name: After 8th edition full name: After 8th edition
icon: card-sample.png icon: card-sample.png
version: 2007-05-05
depends on:
package: magic.mse-game
version: 2007-05-05
depends on:
package: magic-watermarks.mse-include
version: 2006-08-03
card width: 375 card width: 375
card height: 523 card height: 523
card dpi: 150 card dpi: 150
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
short name: Magic short name: Magic
full name: Magic the Gathering full name: Magic the Gathering
icon: card-back.png icon: card-back.png
version: 2007-05-05
############################################################## Functions & filters ############################################################## Functions & filters
...@@ -123,7 +124,7 @@ init script: ...@@ -123,7 +124,7 @@ init script:
is_multicolor := filter_rule(match: "^multicolor") + {input != ""}; is_multicolor := filter_rule(match: "^multicolor") + {input != ""};
is_hybrid := filter_rule(match: "^hybrid") + {input != ""}; is_hybrid := filter_rule(match: "^hybrid") + {input != ""};
is_colorless := filter_rule(match: "^colorless") + {input != ""}; is_colorless := filter_rule(match: "^colorless") + {input != ""};
is_artifact := filter_rule(match: "^artifact") + {input != ""}; is_artifact := filter_rule(match: "^artifact") + {input != ""};
sort_index := { sort_index := {
if card.card_color=="white" then "A" if card.card_color=="white" then "A"
else if card.card_color=="blue" then "B" else if card.card_color=="blue" then "B"
...@@ -139,23 +140,28 @@ init script: ...@@ -139,23 +140,28 @@ init script:
# The color of a card # The color of a card
is_artifact := filter_rule(match: "(?i)Artifact") + {input != ""}; is_artifact := filter_rule(match: "(?i)Artifact") + {input != ""};
is_land := filter_rule(match: "(?i)Land") + {input != ""}; is_land := filter_rule(match: "(?i)Land") + {input != ""};
card_color := { card_color := {
# usually the color of mana # usually the color of mana
mana_color := mana_to_color(casting_cost); mana_color := mana_to_color(casting_cost);
if mana_color == "colorless" and is_land(input: card.super_type) then land_to_color() if mana_color == "colorless" and is_land (input: card.super_type) then land_to_color()
else if mana_color == "colorless" and is_artifact(input: card.super_type) then "artifact" else if mana_color == "colorless" and is_artifact(input: card.super_type) then "artifact"
else mana_color else mana_color
}; };
# replaces — correctly # replaces — correctly
alternative_cost := replace_rule(match:"—|\\.", replace:"") + replace_rule(match:"[A-Z]", in_context:"<param-[a-z]*><match>", replace: { to_lower() }) alternative_cost := replace_rule(match:"—|\\.", replace:"") + replace_rule(match:"[A-Z]", in_context:"<param-[a-z]*><match>", replace: { to_lower() })
mana_cost := replace_rule(match:" ", in_context:"\\><match>", replace: "") mana_cost := replace_rule(match:"<param-cost> ", replace: "<param-cost>")
add := "" # default is nothing
format_cost := { format_cost := {
if substring(begin: 0, end: 13)=="<param-cost>—" then if substring(begin: 0, end: 13)=="<param-cost>—" then
alternative_cost(input:input) alternative_cost()
else add + "<sym>" + mana_cost(input:input) + "</sym>" else add + mana_cost()
}; };
format_cost_start := replace_rule(match:"^(<param-cost>)?[ ]?-", replace:"\\1—")
# Utilities for keywords
has_cc := { card.casting_cost != "" }
has_pt := { card.pt != "" }
# Filters for the text box # Filters for the text box
# context in which mana symbols are found # context in which mana symbols are found
...@@ -169,7 +175,7 @@ init script: ...@@ -169,7 +175,7 @@ init script:
|adds?|pay(ed)?[ ](with|using) |adds?|pay(ed)?[ ](with|using)
) )
([ ]either)? # pay either X or Y ([ ]either)? # pay either X or Y
([ ]<sym[^>]*>[XYZWUBRG0-9/|]+</sym[^>]*>[ ](and|or))* # pay X or Y ([ ]<sym[^>]*>[STXYZWUBRG0-9/|]+</sym[^>]*>[ ](and|or))* # pay X or Y
[ ]<match> [ ]<match>
([,.)]|$ # (end of word) ([,.)]|$ # (end of word)
|[ ][^ .,]*$ # still typing... |[ ][^ .,]*$ # still typing...
...@@ -218,8 +224,11 @@ init script: ...@@ -218,8 +224,11 @@ init script:
replace: {"<sym>" + mana_filter_t() + "</sym>"} ) + replace: {"<sym>" + mana_filter_t() + "</sym>"} ) +
# step 6 : longdash # step 6 : longdash
replace_rule( replace_rule(
match: "--| - ", match: "--",
replace: "—" ) + replace: "—") +
replace_rule(
match: " - ",
replace: " — ")
# step 6b : Æ replacement # step 6b : Æ replacement
replace_rule( replace_rule(
match: "AE", match: "AE",
...@@ -228,18 +237,6 @@ init script: ...@@ -228,18 +237,6 @@ init script:
replace_rule( replace_rule(
match: "s</param-name><s>" match: "s</param-name><s>"
replace: "" ) + replace: "" ) +
# step 6d : "." remover for keywords
replace_rule(
match: ".</param-name><.>"
replace: "" ) +
# step 6e : p/t detector, needed for suspend
tag_contents_rule(
tag: "<haspt>"
contents: { if card.pt == "" then "" else contents } ) +
# step 6f : casting cost detector, needed for suspend
tag_contents_rule(## <iscc> by somebloke
tag: "<hascc>"
contents: { if card.casting_cost == "" then "" else contents } ) +
# step 7 : italic reminder text # step 7 : italic reminder text
replace_rule( replace_rule(
match: "[(][^)\n]*[)]?", match: "[(][^)\n]*[)]?",
...@@ -312,8 +309,11 @@ init script: ...@@ -312,8 +309,11 @@ init script:
match: "AE", match: "AE",
replace: "Æ") + replace: "Æ") +
replace_rule( replace_rule(
match: "--| - ", match: "--",
replace: "—"); replace: "—") +
replace_rule(
match: " - ",
replace: " — ");
# Move the cursor past the separator in the p/t and type boxes # Move the cursor past the separator in the p/t and type boxes
type_over_pt := replace_rule(match:"/$", replace:"") type_over_pt := replace_rule(match:"/$", replace:"")
...@@ -1097,27 +1097,28 @@ keyword mode: ...@@ -1097,27 +1097,28 @@ keyword mode:
keyword parameter type: keyword parameter type:
name: mana name: mana
match: [XYZ0-9WUBRGS/]+ match: [STXYZ0-9WUBRG/|]+
# By pichoro and bunnierein # By pichoro and bunnierein
keyword parameter type: keyword parameter type:
name: cost name: cost
match: [:space:]?[^(\n]+ match: [ ][STXYZ0-9WUBRG/|]*|[-—][^(\n.]*
refer script: refer script:
name: normal name: normal
description: standard cost description: standard cost
script: \{{input}\} script: \{{input}\}
refer script: refer script:
name: add = nothing name: add nothing for - costs
description: parses dual costs without pay an additional description: When using - to specify a long cost, don't include the - in the reminder text
script: \{format_cost({input},add:"")\} script: \{format_cost({input})\}
refer script: refer script:
name: add = "pay an additional " name: add "pay an additional " for - costs
description: parses dual costs without pay an additional description: When using - to specify a long cost, words the reminder text as "pay an additional <cost>"
script: \{format_cost({input},add:"pay an additional ")\} script: \{format_cost(add:"pay an additional ",{input})\}
refer script: refer script:
name: add = "pay " name: add "pay " for - costs
description: parses dual costs without pay an additional description: When using - to specify a long cost, words the reminder text as "pay <cost>"
script: \{format_cost({input},add:"pay ")\} script: \{format_cost(add:"pay ",{input})\}
script: format_cost_start()
keyword parameter type: keyword parameter type:
name: number name: number
match: [XYZ0-9]+ match: [XYZ0-9]+
...@@ -1182,7 +1183,7 @@ keyword: ...@@ -1182,7 +1183,7 @@ keyword:
keyword: Cycling keyword: Cycling
match: Cycling<atom-param>cost</atom-param> match: Cycling<atom-param>cost</atom-param>
mode: core mode: core
reminder: {format_cost(param1,add:"")}, Discard this card: Draw a card. reminder: {format_cost(param1)}, Discard this card: Draw a card.
keyword: keyword:
keyword: Trample keyword: Trample
match: Trample match: Trample
...@@ -1217,7 +1218,7 @@ keyword: ...@@ -1217,7 +1218,7 @@ keyword:
keyword: Cumulative upkeep keyword: Cumulative upkeep
match: Cumulative upkeep<atom-param>cost</atom-param> match: Cumulative upkeep<atom-param>cost</atom-param>
mode: old mode: old
reminder: At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you {format_cost(param1,add:"pay ")} for each age counter on it. reminder: At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you {format_cost(add:"pay ",param1)} for each age counter on it.
keyword: keyword:
keyword: Horsemanship keyword: Horsemanship
match: Horsemanship match: Horsemanship
...@@ -1242,7 +1243,7 @@ keyword: ...@@ -1242,7 +1243,7 @@ keyword:
keyword: Buyback keyword: Buyback
match: Buyback<atom-param>cost</atom-param> match: Buyback<atom-param>cost</atom-param>
mode: expert mode: expert
reminder: You may pay {format_cost(param1,add:"pay ")} in addition to any other costs as you play this spell. If you do, put this card into your hand as it resolves. reminder: You may {format_cost(add:"pay ",param1)} in addition to any other costs as you play this spell. If you do, put this card into your hand as it resolves.
keyword: keyword:
keyword: Echo keyword: Echo
match: Echo<atom-param>cost</atom-param> match: Echo<atom-param>cost</atom-param>
...@@ -1252,7 +1253,7 @@ keyword: ...@@ -1252,7 +1253,7 @@ keyword:
keyword: Cardcycling keyword: Cardcycling
match: <atom-param>prefix</atom-param>cycling<atom-param>cost</atom-param> match: <atom-param>prefix</atom-param>cycling<atom-param>cost</atom-param>
mode: expert mode: expert
reminder: {format_cost(param2,add:"")}, Discard this card: Search your library for a {param1} card, reveal it, and put it into your hand. Then shuffle your library. reminder: {format_cost(param2)}, Discard this card: Search your library for a {param1} card, reveal it, and put it into your hand. Then shuffle your library.
keyword: keyword:
keyword: Fading keyword: Fading
match: Fading <atom-param>number</atom-param> match: Fading <atom-param>number</atom-param>
...@@ -1262,7 +1263,7 @@ keyword: ...@@ -1262,7 +1263,7 @@ keyword:
keyword: Kicker keyword: Kicker
match: Kicker<atom-param>cost</atom-param> match: Kicker<atom-param>cost</atom-param>
mode: expert mode: expert
reminder: You may {format_cost(param1,add:"pay an additional ")} as you play this spell. reminder: You may {format_cost(add:"pay an additional ",param1)} as you play this spell.
keyword: keyword:
keyword: Madness keyword: Madness
match: Madness<atom-param>cost</atom-param> match: Madness<atom-param>cost</atom-param>
...@@ -1312,7 +1313,7 @@ keyword: ...@@ -1312,7 +1313,7 @@ keyword:
keyword: Equip keyword: Equip
match: Equip<atom-param>cost</atom-param> match: Equip<atom-param>cost</atom-param>
mode: expert mode: expert
reminder: {format_cost(param1,add:"")}: Attach to target creature you control. Equip only as a sorcery. reminder: {format_cost(param1)}: Attach to target creature you control. Equip only as a sorcery.
keyword: keyword:
keyword: Imprint keyword: Imprint
match: Imprint—<atom-param>action</atom-param> match: Imprint—<atom-param>action</atom-param>
...@@ -1357,7 +1358,7 @@ keyword: ...@@ -1357,7 +1358,7 @@ keyword:
keyword: Ninjutsu keyword: Ninjutsu
match: Ninjutsu<atom-param>cost</atom-param> match: Ninjutsu<atom-param>cost</atom-param>
mode: expert mode: expert
reminder: {format_cost(param1,add:"")}, Return an unblocked attacker you control to hand: Put this card into play from your hand tapped and attacking. reminder: {format_cost(param1)}, Return an unblocked attacker you control to hand: Put this card into play from your hand tapped and attacking.
keyword: keyword:
keyword: Soulshift keyword: Soulshift
match: Soulshift <atom-param>number</atom-param> match: Soulshift <atom-param>number</atom-param>
...@@ -1377,7 +1378,7 @@ keyword: ...@@ -1377,7 +1378,7 @@ keyword:
keyword: Transmute keyword: Transmute
match: Transmute<atom-param>cost</atom-param> match: Transmute<atom-param>cost</atom-param>
mode: expert mode: expert
reminder: {format_cost(param1,add:"")}, Discard this card: Search your library for a card with the same converted mana cost as this card, reveal it, and put it into your hand. Then shuffle your library. Play only as a sorcery. reminder: {format_cost(param1)}, Discard this card: Search your library for a card with the same converted mana cost as this card, reveal it, and put it into your hand. Then shuffle your library. Play only as a sorcery.
keyword: keyword:
keyword: Haunt keyword: Haunt
match: Haunt match: Haunt
...@@ -1428,7 +1429,7 @@ keyword: ...@@ -1428,7 +1429,7 @@ keyword:
keyword: Recover keyword: Recover
match: Recover<atom-param>cost</atom-param> match: Recover<atom-param>cost</atom-param>
mode: expert mode: expert
reminder: When a creature is put into your graveyard from play, you may {format_cost(param1,add:"pay ")}. If you do, return this card from your graveyard to your hand. Otherwise, remove this card from the game. reminder: When a creature is put into your graveyard from play, you may {format_cost(add:"pay ",param1)}. If you do, return this card from your graveyard to your hand. Otherwise, remove this card from the game.
keyword: keyword:
keyword: Ripple keyword: Ripple
match: Ripple <atom-param>number</atom-param> match: Ripple <atom-param>number</atom-param>
...@@ -1448,7 +1449,7 @@ keyword: ...@@ -1448,7 +1449,7 @@ keyword:
keyword: Suspend keyword: Suspend
match: Suspend <atom-param>number</atom-param>—<atom-param>mana</atom-param> match: Suspend <atom-param>number</atom-param>—<atom-param>mana</atom-param>
mode: expert mode: expert
reminder: Rather than play this card from your hand,<hascc> you may</hascc> pay {param2} and remove it from the game with {english_number_a(param1)} time counter(s) on it. At the beginning of your upkeep, remove a time counter. When the last is removed, play it without paying its mana cost.<haspt> It has haste.</haspt> reminder: Rather than play this card from your hand,{if has_cc() then " you may"} pay {param2} and remove it from the game with {english_number_a(param1)} time counter(s) on it. At the beginning of your upkeep, remove a time counter. When the last is removed, play it without paying its mana cost.{if has_pt() then " It has haste."}
keyword: keyword:
keyword: Vanishing keyword: Vanishing
match: Vanishing <atom-param>number</atom-param> match: Vanishing <atom-param>number</atom-param>
...@@ -1488,12 +1489,12 @@ keyword: ...@@ -1488,12 +1489,12 @@ keyword:
keyword: Transfigure keyword: Transfigure
match: Transfigure<atom-param>cost</atom-param> match: Transfigure<atom-param>cost</atom-param>
mode: expert mode: expert
reminder: {format_cost(param1,add:"")}, Sacrifice this creature: Search your library for a creature card with the same converted mana cost as this creature and put that card into play. Then shuffle your library. Play only as a sorcery. reminder: {format_cost(param1)}, Sacrifice this creature: Search your library for a creature card with the same converted mana cost as this creature and put that card into play. Then shuffle your library. Play only as a sorcery.
keyword: keyword:
keyword: Aura swap keyword: Aura swap
match: Aura swap<atom-param>cost</atom-param> match: Aura swap<atom-param>cost</atom-param>
mode: expert mode: expert
reminder: {format_cost(param1,add:"")}: Exchange this Aura with an Aura card in your hand. reminder: {format_cost(param1)}: Exchange this Aura with an Aura card in your hand.
keyword: keyword:
keyword: Frenzy keyword: Frenzy
match: Frenzy <atom-param>number</atom-param> match: Frenzy <atom-param>number</atom-param>
...@@ -1518,4 +1519,4 @@ keyword: ...@@ -1518,4 +1519,4 @@ keyword:
keyword: Fortify keyword: Fortify
match: Fortify<atom-param>cost</atom-param> match: Fortify<atom-param>cost</atom-param>
mode: expert mode: expert
reminder: {format_cost(param1,add:"")}: Attach to target land you control. Fortify only as a sorcery. This card comes into play unattached and stays in play if the land leaves play. reminder: {format_cost(param1)}: Attach to target land you control. Fortify only as a sorcery. This card comes into play unattached and stays in play if the land leaves play.
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