diff --git a/data/magic-new.mse-style/style b/data/magic-new.mse-style/style index 3a0f4085..3841c2df 100644 --- a/data/magic-new.mse-style/style +++ b/data/magic-new.mse-style/style @@ -212,12 +212,12 @@ card style: top : 328 width: 311 height: 142 - #font: - # name: MPlantin - # italic name: MPlantin-Italic - # size: 14 - # scale down to: 6 - # color: rgb(0,0,0) + font: + name: MPlantin + italic name: MPlantin-Italic + size: 14 + scale down to: 6 + color: rgb(0,0,0) symbol font: name: script: diff --git a/data/magic.mse-game/game b/data/magic.mse-game/game index 04707f8b..549ae0f4 100644 --- a/data/magic.mse-game/game +++ b/data/magic.mse-game/game @@ -1,4 +1,4 @@ -mse version: 0.3.1 +mse version: 0.3.1 short name: Magic full name: Magic the Gathering icon: card-back.png @@ -23,7 +23,7 @@ init script: replace: "™") + # step 4 : copyright symbol replace_rule( - match: "(C)", + match: "CR", replace: "©") #character filter for title line @@ -68,7 +68,7 @@ init script: else if input = "R" then "red" else if input = "G" then "green" else "" - } + } # color based on mana cost, input = a mana cost color_filter := sort_rule(order: "") + sort_rule(order: "(WUBRG)") color_filterH := sort_rule(order: "") @@ -154,6 +154,15 @@ init script: 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: "") + format_cost := { + if substring(begin: 0, end: 13)=="—" then + alternative_cost(input:input) + else add + "" + mana_cost(input:input) + "" + }; + # Filters for the text box # context in which mana symbols are found mana_context := @@ -173,8 +182,8 @@ init script: |[ ]( or | and | in | less | more | to ) # or next word is ... ) ) - | # keyword argument that is declared as mana - | # keyword argument that is declared as cost + | # keyword argument that is declared as mana + | [ ]* # keyword argument that is declared as cost | , # keyword argument that is declared as cost "; # the rule text filter @@ -225,15 +234,16 @@ init script: replace_rule( match: "s" replace: "" ) + - # step 6d : period remover for action param keywords - replace_rule( - match: ".<.>" - replace: "" ) + # step 7 : italic reminder text replace_rule( match: "[(][^)\n]*[)]?", in_context: "(^|[[:space:]])|&") + replace: "&") + + # step 8 : post ( capitalization + replace_rule( + match: "[a-z]", + in_context: "[(]()?", + replace: { to_upper() }) # the flavor text filter # - makes all text italic @@ -961,10 +971,18 @@ keyword mode: keyword parameter type: name: mana match: [XYZ0-9WUBRGS/]+ -# By jimrandomh +# By pichoro and bunnierein keyword parameter type: name: cost - match: [^(\n]+ + match: [:space:]?[^(\n]+ + refer script: + name: normal + description: standard cost + script: \{{input}\} + refer script: + name: dual parameters + description: parses dual costs without pay an additional + script: \{format_cost({input},add:"")\} keyword parameter type: name: number match: [XYZ0-9]+ @@ -1027,14 +1045,9 @@ keyword: reminder: Target a {param1} as you play this. This card comes into play attached to that {param1}. keyword: keyword: Cycling - match: Cycling mana + match: Cyclingcost mode: core - reminder: {param1}, Discard this card: Draw a card. -keyword: - keyword: Cycling - match: Cycling—action - mode: core - reminder: {param1}<.>, Discard this card: Draw a card. + reminder: {format_cost(param1,add:"")}, Discard this card: Draw a card. keyword: keyword: Trample match: Trample @@ -1067,14 +1080,9 @@ keyword: reminder: This creature can’t attack. keyword: keyword: Cumulative upkeep - match: Cumulative upkeep mana + match: Cumulative upkeepcost mode: old - reminder: At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay {param1} for each age counter on it. -keyword: - keyword: Cumulative upkeep - match: Cumulative upkeep—action - mode: old - reminder: At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you {to_lower(param1)}<.> 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(param1,add:"pay an additional ")} for each age counter on it. keyword: keyword: Horsemanship match: Horsemanship @@ -1097,34 +1105,24 @@ keyword: reminder: This creature can block or be blocked only by creatures with shadow. keyword: keyword: Buyback - match: Buyback mana + match: Buybackcost mode: expert - reminder: You may 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: Buyback - match: Buyback—action - mode: expert - reminder: You may {to_lower(param1)}<.> 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 pay {format_cost(param1,add:"pay an additional ")} 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: Echo mana - mode: expert - reminder: At the beginning of your upkeep, if this came under your control since the beginning of your last upkeep, sacrifice it unless you pay its echo cost. -keyword: - keyword: Echo - match: Echo—action + match: Echocost mode: expert reminder: At the beginning of your upkeep, if this came under your control since the beginning of your last upkeep, sacrifice it unless you pay its echo cost. keyword: keyword: Cardcycling - match: namecycling mana + match: namecyclingcost mode: expert - reminder: {param2}, 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(param1,add:"")}, Discard this card: Search your library for a {param1} card, reveal it, and put it into your hand. Then shuffle your library. keyword: keyword: Cardcycling match: namecycling—action mode: expert - reminder: {param2}<.>, Discard this card: Search your library for a {param1} card, reveal it, and put it into your hand. Then shuffle your library. + reminder: {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 @@ -1132,42 +1130,22 @@ keyword: reminder: This comes into play with {english_number_a(param1)} fade counter(s) on it. At the beginning of your upkeep, remove a fade counter from it. If you can’t, sacrifice it. keyword: keyword: Kicker - match: Kicker mana + match: Kickercost mode: expert - reminder: You may pay an additional {param1} as you play this spell. -keyword: - keyword: Kicker - match: Kicker—action - mode: expert - reminder: You may {to_lower(param1)}<.> as you play this spell. + reminder: You may pay an additional {format_cost(param1,add:"pay an additional ")} as you play this spell. keyword: keyword: Madness - match: Madness mana - mode: expert - reminder: You may play this card for its madness cost at the time you discard it. -keyword: - keyword: Madness - match: Madness—action + match: Madnesscost mode: expert reminder: You may play this card for its madness cost at the time you discard it. keyword: keyword: Flashback - match: Flashback mana - mode: expert - reminder: You may play this card from your graveyard for its flashback cost. Then remove it from the game. -keyword: - keyword: Flashback - match: Flashback—action + match: Flashbackcost mode: expert reminder: You may play this card from your graveyard for its flashback cost. Then remove it from the game. keyword: keyword: Morph - match: Morph mana - mode: expert - reminder: You may play this face down as a 2/2 creature for 3. Turn it face up any time for its morph cost. -keyword: - keyword: Morph - match: Morph—action + match: Morphcost mode: expert reminder: You may play this face down as a 2/2 creature for 3. Turn it face up any time for its morph cost. keyword: @@ -1197,24 +1175,14 @@ keyword: reminder: This spell costs 1 less to play for each {param1} you control. keyword: keyword: Entwine - match: Entwine mana - mode: expert - reminder: Choose both if you pay the entwine cost. -keyword: - keyword: Entwine - match: Entwine—action + match: Entwinecost mode: expert reminder: Choose both if you pay the entwine cost. keyword: keyword: Equip - match: Equip mana + match: Equipcost mode: expert - reminder: {param1}: Attach to target creature you control. Equip only as a sorcery. -keyword: - keyword: Equip - match: Equip—action - mode: expert - reminder: {param1}<.>: Attach to target creature you control. Equip only as a sorcery. + reminder: {format_cost(param1,add:"")}: Attach to target creature you control. Equip only as a sorcery. keyword: keyword: Imprint match: Imprint—action @@ -1237,14 +1205,9 @@ keyword: reminder: This comes into play with a +1/+1 counter on it for each color of mana used to pay its cost. If it is not a creature, use charge counters instead. keyword: keyword: Splice - match: Splice onto name mana + match: Splice onto namecost mode: expert reminder: As you play a {param1} spell, you may reveal this card from your hand and pay its splice cost. If you do, add this card’s effects to that spell. -keyword: - keyword: Splice - match: Splice onto nameaction - mode: expert - reminder: As you play a {param1} spell, you may reveal this card from your hand and pay its splice cost. If you do, add this card's effects to that spell. keyword: keyword: Offering match: name offering @@ -1257,14 +1220,9 @@ keyword: reminder: When this blocks or becomes blocked, it gets +{param1}/+{param1} until end of turn. keyword: keyword: Ninjutsu - match: Ninjutsu mana + match: Ninjutsucost mode: expert - reminder: {param1}, Return an unblocked attacker you control to hand: Put this card into play from your hand tapped and attacking. -keyword: - keyword: Ninjutsu - match: Ninjutsu—action - mode: expert - reminder: {param1}<.>, Return an unblocked attacker you control to hand: Put this card into play from your hand tapped and attacking. + reminder: {format_cost(param1,add:"")}, 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 @@ -1282,14 +1240,9 @@ keyword: reminder: Each creature you tap while playing this spell reduces its cost by 1 or by one mana of that creature’s color. keyword: keyword: Transmute - match: Transmute mana + match: Transmutecost mode: expert - reminder: {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: Transmute - match: Transmute—action - mode: expert - reminder: {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. + 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. keyword: keyword: Haunt match: Haunt @@ -1302,12 +1255,7 @@ keyword: reminder: If an opponent was dealt damage this turn, this creature comes into play with {english_number_a(param1)} +1/+1 counter(s) on it. keyword: keyword: Replicate - match: Replicate mana - mode: expert - reminder: When you play this spell, copy it for each time you paid its replicate cost. You may choose new targets for the copies. -keyword: - keyword: Replicate - match: Replicate—action + match: Replicatecost mode: expert reminder: When you play this spell, copy it for each time you paid its replicate cost. You may choose new targets for the copies. #Denimwalk was a casualty of my fixing landwalk to work right @@ -1343,14 +1291,9 @@ keyword: reminder: Play this ability only during your upkeep and only once each turn. keyword: keyword: Recover - match: Recover mana + match: Recovercost mode: expert - reminder: When a creature is put into your graveyard from play, you may pay an additional {param1}. If you do, return this card from your graveyard to your hand. Otherwise, remove this card from the game. -keyword: - keyword: Recover - match: Recover—action - mode: expert - reminder: When a creature is put into your graveyard from play, you may {to_lower(param1)}<.>. 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 pay an additional {format_cost(param1,add:"pay an additional ")}. 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 @@ -1408,24 +1351,14 @@ keyword: reminder: Look at the top {english_number_multiple(param1)} card(s) of an opponent's library, then put any number of them on the bottom of that player's library and the rest on top in any order. keyword: keyword: Transfigure - match: Transfigure mana + match: Transfigurecost mode: expert - reminder: {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: Transfigure - match: Transfigure—action - mode: expert - reminder: {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. + 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. keyword: keyword: Aura swap - match: Aura swamp mana + match: Aura swampcost mode: expert - reminder: {param1}: Exchange this Aura with an Aura card in your hand. -keyword: - keyword: Aura swap - match: Aura swap—action - mode: expert - reminder: {param1}<.>: Exchange this Aura with an Aura card in your hand. + reminder: {format_cost(param1,add:"")}: Exchange this Aura with an Aura card in your hand. keyword: keyword: Frenzy match: Frenzy number @@ -1448,11 +1381,6 @@ keyword: reminder: This permanent can't be the target of spells or abilities. keyword: keyword: Fortify - match: Fortify mana + match: Fortifycost mode: expert - reminder: {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. -keyword: - keyword: Fortify - match: Fortify—action - mode: expert - reminder: {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. + 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.