diff --git a/data/en.mse-locale/locale b/data/en.mse-locale/locale index 0af49a6c..8e66d273 100644 --- a/data/en.mse-locale/locale +++ b/data/en.mse-locale/locale @@ -485,6 +485,7 @@ error: Error while parsing file: '%s' %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 store file: Error while saving, unable to store file diff --git a/data/magic-new.mse-style/style b/data/magic-new.mse-style/style index afdf999c..460a0527 100644 --- a/data/magic-new.mse-style/style +++ b/data/magic-new.mse-style/style @@ -4,6 +4,14 @@ short name: Modern style full name: After 8th edition 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 height: 523 card dpi: 150 diff --git a/data/magic.mse-game/game b/data/magic.mse-game/game index d3910574..4249ddff 100644 --- a/data/magic.mse-game/game +++ b/data/magic.mse-game/game @@ -2,6 +2,7 @@ short name: Magic full name: Magic the Gathering icon: card-back.png +version: 2007-05-05 ############################################################## Functions & filters @@ -123,7 +124,7 @@ init script: is_multicolor := filter_rule(match: "^multicolor") + {input != ""}; is_hybrid := filter_rule(match: "^hybrid") + {input != ""}; is_colorless := filter_rule(match: "^colorless") + {input != ""}; - is_artifact := filter_rule(match: "^artifact") + {input != ""}; + is_artifact := filter_rule(match: "^artifact") + {input != ""}; sort_index := { if card.card_color=="white" then "A" else if card.card_color=="blue" then "B" @@ -139,23 +140,28 @@ init script: # The color of a card 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 := { # usually the color of mana mana_color := mana_to_color(casting_cost); - 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" + 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 mana_color }; # replaces — correctly alternative_cost := replace_rule(match:"—|\\.", replace:"") + replace_rule(match:"[A-Z]", in_context:"", replace: { to_lower() }) - mana_cost := replace_rule(match:" ", in_context:"\\>", replace: "") + mana_cost := replace_rule(match:" ", replace: "") + add := "" # default is nothing format_cost := { if substring(begin: 0, end: 13)=="—" then - alternative_cost(input:input) - else add + "" + mana_cost(input:input) + "" + alternative_cost() + else add + mana_cost() }; + format_cost_start := replace_rule(match:"^()?[ ]?-", replace:"\\1—") + # Utilities for keywords + has_cc := { card.casting_cost != "" } + has_pt := { card.pt != "" } # Filters for the text box # context in which mana symbols are found @@ -169,7 +175,7 @@ init script: |adds?|pay(ed)?[ ](with|using) ) ([ ]either)? # pay either X or Y - ([ ]]*>[XYZWUBRG0-9/|]+]*>[ ](and|or))* # pay X or Y + ([ ]]*>[STXYZWUBRG0-9/|]+]*>[ ](and|or))* # pay X or Y [ ] ([,.)]|$ # (end of word) |[ ][^ .,]*$ # still typing... @@ -218,8 +224,11 @@ init script: replace: {"" + mana_filter_t() + ""} ) + # step 6 : longdash replace_rule( - match: "--| - ", - replace: "—" ) + + match: "--", + replace: "—") + + replace_rule( + match: " - ", + replace: " — ") # step 6b : Æ replacement replace_rule( match: "AE", @@ -228,18 +237,6 @@ init script: replace_rule( match: "s" replace: "" ) + - # step 6d : "." remover for keywords - replace_rule( - match: ".<.>" - replace: "" ) + - # step 6e : p/t detector, needed for suspend - tag_contents_rule( - tag: "" - contents: { if card.pt == "" then "" else contents } ) + - # step 6f : casting cost detector, needed for suspend - tag_contents_rule(## by somebloke - tag: "" - contents: { if card.casting_cost == "" then "" else contents } ) + # step 7 : italic reminder text replace_rule( match: "[(][^)\n]*[)]?", @@ -312,8 +309,11 @@ init script: match: "AE", replace: "Æ") + replace_rule( - match: "--| - ", - replace: "—"); + match: "--", + replace: "—") + + replace_rule( + match: " - ", + replace: " — "); # Move the cursor past the separator in the p/t and type boxes type_over_pt := replace_rule(match:"/$", replace:"") @@ -1097,27 +1097,28 @@ keyword mode: keyword parameter type: name: mana - match: [XYZ0-9WUBRGS/]+ + match: [STXYZ0-9WUBRG/|]+ # By pichoro and bunnierein keyword parameter type: name: cost - match: [:space:]?[^(\n]+ + match: [ ][STXYZ0-9WUBRG/|]*|[-—][^(\n.]* refer script: name: normal description: standard cost script: \{{input}\} refer script: - name: add = nothing - description: parses dual costs without pay an additional - script: \{format_cost({input},add:"")\} + name: add nothing for - costs + description: When using - to specify a long cost, don't include the - in the reminder text + script: \{format_cost({input})\} refer script: - name: add = "pay an additional " - description: parses dual costs without pay an additional - script: \{format_cost({input},add:"pay an additional ")\} + name: add "pay an additional " for - costs + description: When using - to specify a long cost, words the reminder text as "pay an additional " + script: \{format_cost(add:"pay an additional ",{input})\} refer script: - name: add = "pay " - description: parses dual costs without pay an additional - script: \{format_cost({input},add:"pay ")\} + name: add "pay " for - costs + description: When using - to specify a long cost, words the reminder text as "pay " + script: \{format_cost(add:"pay ",{input})\} + script: format_cost_start() keyword parameter type: name: number match: [XYZ0-9]+ @@ -1182,7 +1183,7 @@ keyword: keyword: Cycling match: Cyclingcost 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: Trample match: Trample @@ -1217,7 +1218,7 @@ keyword: keyword: Cumulative upkeep match: Cumulative upkeepcost 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: Horsemanship match: Horsemanship @@ -1242,7 +1243,7 @@ keyword: keyword: Buyback match: Buybackcost 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: Echo match: Echocost @@ -1252,7 +1253,7 @@ keyword: keyword: Cardcycling match: prefixcyclingcost 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: Fading match: Fading number @@ -1262,7 +1263,7 @@ keyword: keyword: Kicker match: Kickercost 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: Madness match: Madnesscost @@ -1312,7 +1313,7 @@ keyword: keyword: Equip match: Equipcost 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: Imprint match: Imprint—action @@ -1357,7 +1358,7 @@ keyword: keyword: Ninjutsu match: Ninjutsucost 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: Soulshift match: Soulshift number @@ -1377,7 +1378,7 @@ keyword: keyword: Transmute match: Transmutecost 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: Haunt match: Haunt @@ -1428,7 +1429,7 @@ keyword: keyword: Recover match: Recovercost 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: Ripple match: Ripple number @@ -1448,7 +1449,7 @@ keyword: keyword: Suspend match: Suspend numbermana mode: expert - reminder: Rather than play this card from your hand, 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. It has haste. + 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: Vanishing match: Vanishing number @@ -1488,12 +1489,12 @@ keyword: keyword: Transfigure match: Transfigurecost 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: Aura swap match: Aura swapcost 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: Frenzy match: Frenzy number @@ -1518,4 +1519,4 @@ keyword: keyword: Fortify match: Fortifycost 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.