[wip] updating exporters for 2.5 (#75)

* Add Card Regions to DFCs
* Add Hashes
* Add crop_multi_image to help crop with card regions
* bugfix exporters and organize the list
* add dfc splitter support for Cockatrice and Lackey exporters
* fix sizing bugs on Planesculptors exporter
* update icons on exporters missing them
* update namecheck exporter and improve near checking

---------

Co-authored-by: cajun <12363371+CajunAvenger@users.noreply.github.com>
This commit is contained in:
cajun
2024-09-24 09:52:17 -05:00
committed by GitHub
parent 9668a1de6f
commit 9a7b7949e8
37 changed files with 1460 additions and 668 deletions

View File

@@ -133,6 +133,7 @@ OTHER UPDATES
• Added an option to Unstable Basics to remove the colored name banner. • Added an option to Unstable Basics to remove the colored name banner.
• Added eighth level support to M15 Dungeons. • Added eighth level support to M15 Dungeons.
• Added omni and polyamory flags to Pride Pinlines. • Added omni and polyamory flags to Pride Pinlines.
• The name checker exporter has been updated, and now does more filtering for Near Name Matches (for example, Dreameater will now be caught due to Dream Eater).
BUG FIXES BUG FIXES
• Fixed a bug where the 8th Edition Tokens name spacing would go beserk. • Fixed a bug where the 8th Edition Tokens name spacing would go beserk.

View File

@@ -1,9 +1,9 @@
mse version: 0.3.8 mse version: 2.5.0
short name: Cockatrice short name: Cockatrice
full name: Exporter v2.0 full name: Exporter v2.0
position hint: 007 position hint: 100
icon: icon.png icon: icon.png
version: 2023-02-05 version: 2024-09-23
installer group: magic/Export/cockatrice installer group: magic/Export/cockatrice
depends on: depends on:
@@ -899,13 +899,42 @@ script:
#render image file #render image file
write_image := write_image :=
{ {
if length(card.stylesheet.card_regions) > 0 then write_multi_image()
else write_single_image()
}
format_file_name := {
options.append_String_To_Names
+ input
+ (if is_token() and options.append_Set_Code_To_Tokens then " " + set.set_code else "")
+ "." + file_type()
}
write_single_image := {
write_image_file( write_image_file(
card, card,
directory: set.set_code, directory: set.set_code,
file: (options.append_String_To_Names+strip_card_name(card_name())+(if is_token() and options.append_Set_Code_To_Tokens then " " + set.set_code else "")+if splitter_name() and is_double() then "_" + strip_card_name(card.name_2)) + "." + file_type(), file: format_file_name(strip_card_name(card_name())),
width: (if contains(card.shape, match:"split") or contains(card.shape, match:"double") then 752 else 375), width: (if contains(card.shape, match:"split") then 752 else 375),
height: 523 height: 523
)
}
write_multi_image := {
crop_data := crop_multi_image(card:card)
for i from 0 to length(crop_data.keys)-1 do (
region_name := crop_data.keys[i][0]
region_image := crop_data.values[i][0]
face_name := if region_name == "front" or region_name == "minifront"
then strip_card_name(card_name())
else if region_name == "back" or region_name == "meldpair"
then strip_card_name(card.name_2)
else if region_name == "meld" or region_name == "meldback" or region_name == "thirdcard"
then strip_card_name(card.name_3)
else strip_card_name(card_name()) + "_" + region_name
write_image_file(
region_image,
directory: set.set_code,
file: format_file_name(face_name)
) )
)
} }
#if images are set to be rendered, render all images of rarities that have been selected #if images are set to be rendered, render all images of rarities that have been selected

View File

@@ -1,7 +1,7 @@
mse version: 2.0.0 mse version: 2.0.0
short name: Forum Booster short name: Forum Booster
full name: Booster Spoiler Exporter full name: Booster Spoiler Exporter
position hint: 006 position hint: 510
icon: icon.png icon: icon.png
version: 2014-01-20 version: 2014-01-20
installer group: magic/Export/forum installer group: magic/Export/forum
@@ -80,8 +80,8 @@ script:
replace@(match:"0", replace:":0mana:") replace@(match:"0", replace:":0mana:")
# Determine which style of colored rarities to use. # Determine which style of colored rarities to use.
rarity_color := { rarity_color := {
if options.forum == "mse" then rarity_color_mse() if options.forum == "mtgsalvation" then rarity_color_mtgs()
else if options.forum == "mtgsalvation" then rarity_color_mtgs() else rarity_color_mse()
} }
# Colored rarity markers for MTGS forum. # Colored rarity markers for MTGS forum.
rarity_color_mtgs := { rarity_color_mtgs := {
@@ -250,10 +250,10 @@ script:
else "6" else "6"
} }
forum_size_tag_start := { forum_size_tag_start := {
if options.forum == "mse" then "[size=12]" if options.forum == "mse" then "[size=12]" else ""
} }
forum_size_tag_end := { forum_size_tag_end := {
if options.forum == "mse" then "[/size]" if options.forum == "mse" then "[/size]" else ""
} }
write_normal := { write_normal := {
# The Name and Casting Cost # The Name and Casting Cost

View File

@@ -1,7 +1,7 @@
mse version: 2.0.0 mse version: 2.0.0
short name: Forum short name: Forum
full name: Spoiler Exporter full name: Spoiler Exporter
position hint: 006 position hint: 500
icon: icon.png icon: icon.png
version: 2014-01-19 version: 2014-01-19
installer group: magic/Export/forum installer group: magic/Export/forum
@@ -89,8 +89,8 @@ script:
replace@(match:"0", replace:":0mana:") replace@(match:"0", replace:":0mana:")
# Determine which style of colored rarities to use. # Determine which style of colored rarities to use.
rarity_color := { rarity_color := {
if options.forum == "mse" then rarity_color_mse() if options.forum == "mtgsalvation" then rarity_color_mtgs()
else if options.forum == "mtgsalvation" then rarity_color_mtgs() else rarity_color_mse()
} }
# Colored rarity markers for MTGS forum. # Colored rarity markers for MTGS forum.
rarity_color_mtgs := { rarity_color_mtgs := {

View File

@@ -1,10 +1,10 @@
mse version: 2.0.0 mse version: 2.5.0
short name: LackeyBot short name: LackeyBot
full name: LackeyBot Exporter full name: LackeyBot Exporter
position hint: 003 position hint: 200
icon: icon.png icon: icon.png
version: 2024-01-28 version: 2024-09-23
installer group: magic/Export/lackeybot installer group: magic/Export/LackeyBot
depends on: depends on:
package: magic.mse-game package: magic.mse-game
@@ -30,7 +30,6 @@ option field:
name: image name name: image name
choice: name choice: name
choice: card number choice: card number
choice: dfc name
option field: option field:
type: text type: text
name: default designer name: default designer
@@ -43,327 +42,9 @@ option field:
type: text type: text
name: v mana replacement name: v mana replacement
description: exports V mana as a replacement text string description: exports V mana as a replacement text string
option field:
type: choice
name: special usage
choice: promo
choice: bonus
script: script:
public := true include file: script
export_me := {
if options.update or else false then contains(card.notes, match:"!update") else true
}
fix_tm := replace@(match:"™", replace:"TM")
fixed_set_code := {fix_tm(options.set_code)}
dfc_splitter_name := {
name := card_name()
second := if contains(card.shape, match:"double faced") then remove_tags(card.name_2) else ""
if options.image_name == "dfc name" and second != "" then name + "_" + second else name
}
pull_designer_1 := {
design_command := designer_name_grabber(designer_name_filter(card.notes))
design_credit := card.card_code_text != "" and not match(card.card_code_text, match:"^(Story Spotlight|FT(:| ?[-—]| by| from| written))")
if design_command != ""
then design_command
else if options.check_designers and design_credit
then card.card_code_text
else if public
then options.default_designer
else options.default_designer
}
pull_designer := {
trim(pull_designer_1())
}
a_lackey_image_export_width := { if contains(card.shape, match:"split") then "445"
else if contains(card.shape, match:"double faced") then "626"
else "312"
}
a_lackey_image_export_height := { if contains(card.shape, match:"split") then "312"
else "445"
}
image_export_width := {
if options.export_images == "lackey size" then
if contains(card.shape, match:"split") then "445"
else if contains(card.shape, match:"double faced") then "626"
else "312"
else if contains(card.shape, match:"split") then 523
else if contains(card.shape, match:"double faced") then 752
else 375
}
image_export_height := {
if options.export_images == "lackey size" then
if contains(card.shape, match:"split") then "312"
else "445"
else if contains(card.shape, match:"split") then 375
else 523
}
remove_commas := replace@(match:":", replace:"")+
replace@(match:"<(/|\\\\)?i>", replace:"")+
replace@(match:"[\<>:\\\\/\"\\*\\?\\|]", replace:"")
token_export := {contains(card.shape, match:"token") or contains(card.shape, match:"emblem") or contains(card.shape, match:"rulestip")}
v_rep := {
if input != "V"
then input
else if options.v_mana_replacement == ""
then input
else
options.v_mana_replacement
}
exporter_name_filter := filter_text@(match:"!exporte?r?name [^\n!]+")
exporter_name_grabber := replace@(match:"!exporte?r?name ", replace:"")
hidden_name_filter := filter_text@(match:"!hiddenname [^\n!]+")
hidden_name_grabber := replace@(match:"!hiddenname ", replace:"")
hidden_tag_filter := filter_text@(match:"!hidetag [^\n!]+")
hidden_tag_grabber := replace@(match:"!hidetag ", replace:"")
hidden_name := {
name := hidden_name_grabber(hidden_name_filter(card.notes))
tag := hidden_tag_grabber(hidden_tag_filter(card.notes))
if tag != "" then name := card.name + " " + tag
name
}
patch_note_filter := filter_text@(match:"!update [^\n!]+")
patch_note_grabber := replace@(match:"!update ", replace:"")
patch_note := {patch_note_grabber(patch_note_filter(card.notes))}
card_name := { if exporter_name_grabber(exporter_name_filter(card.notes)) != "" then exporter_name_grabber(exporter_name_filter(card.notes)) else remove_tags(card.name) }
notes_filter := filter_text@(match:"!notes? [^\n!]+")
notes_grabber := replace@(match:"!notes? ", replace:"")
+replace@(match:"([^,]+)", replace:{"\"" + _1 + "\""})
+replace@(match:"italics", replace:"italic")
card_note_array := { "[" + (if notes_grabber(notes_filter(card.notes)) != "" then notes_grabber(notes_filter(card.notes)) else "") + "]" }
exporter_num_filter := filter_text@(match:"!num [^\n!]+")
exporter_num_grabber := replace@(match:"!num ", replace:"")
lackey_script_filter := filter_text@(match:"!script [^\n]+")
lackey_script_grabber := replace@(match:"!script ", replace:"")
designer_name_filter := filter_text@(match:"!designe?r? [^\n]+")
designer_name_grabber := replace@(match:"!designe?r? ", replace:"")
link_filter := filter_text@(match:"!link [^\n]+")
link_grabber := replace@(match:"!link ", replace:"")
link_name := { if link_grabber(link_filter(card.notes)) != "" then link_grabber(link_filter(card.notes)) else "" }
is_revived := { if contains(card.notes, match:"!revivetoken") then "Revived " else ""}
database_name := { if exporter_name_grabber(exporter_name_filter(card.notes)) != "" then exporter_name_grabber(exporter_name_filter(card.notes)) else if contains(card.shape, match: "split") or contains(card.shape, match:"double") or contains(card.shape, match:"adventure") then remove_tags(card.name) + "//" + remove_tags(card.name_2) else is_revived() + remove_tags(card.name) }
forced_script := { if lackey_script_grabber(lackey_script_filter(card.notes)) != "" then "[" + lackey_script_grabber(lackey_script_filter(card.notes)) + "]" else "\"\""}
type_trim := replace@(match:"Basic ", replace:"")+
replace@(match:"Legendary", replace:"")+
replace@(match:"Snow ", replace:"")+
replace@(match:"World ", replace:"")+
replace@(match:"Token ", replace:"")
####### Script that converts the card's mana cost
lackey_bot_rule_filter := replace@(match:"", replace:"'")+
replace@(match:"\n", replace:"\\\\n")+
replace@(match:"[(]", replace:"*(")+
replace@(match:"[)]", replace: ")*")+
replace@(match:"\"", replace:"”")
quote_replace := replace@(match:"\"", replace:"\\\\\"")
break_cleaner := replace@(match:"\n", replace:"")
mana_script := replace@(match:"(2|H|W|U|B|R|G|S|C)/(W|U|B|R|G|S|C)", replace:{"\{"+_1+"/"+_2+"\}"})+
replace@(match:"(X|Y|Z|W|U|B|R|G|S|C)", in_context:"(?<!\{)(?<!/)<match>", replace:{"\{"+_1+"\}"})+
replace@(match:"([1-9][0-9])", in_context:"(?<!\{)(?<!\\/)<match>", replace:{"\{"+_1+"\}"})+
replace@(match:"([0-9])", in_context:"(?<!\{)(?<!\\/)<match>(?!})", replace:{"\{"+_1+"\}"})+
replace@(match:"V", replace:{"\{"+v_rep("V")+"\}"})
lackey_bot_mana_filter := replace@(match:"<sym(-auto)?>([0-9WUBRGCSHEQTXYZEDV/]+)</sym(-auto)?>", replace:{"\{"+_2+"}"})+
replace@(match:"([0-9HSCWUBRGXYZEDV/])", in_context:"\{[0-9HSCWUBRGXYZEDV/]*<match>[0-9HSCWUBRGXYZEDV/]*}", replace:{"\{"+v_rep(_1)+"}"})+
replace@(match:"}\{/}\{", replace:"/")+
replace@(match:"\{([0-9])}\{([0-9])}", replace:{"\{"+_1+_2+"}"})+
replace@(match:"\{\{", replace:"\{")+
replace@(match:"}}", replace:"}")
color_condense := replace@(match:"(, )?(artifact|multicolor|land|hybrid|horizontal|vertical|radial|overlay)", replace: "") write_images := if options.export_images == "no" then "" else for each card in cards do if not export_me() then "" else write_card_images(card)
indicator_color_name := {
cond := color_condense(input)
if cond == "white" then "\{White\} "
else if cond == "blue" then "\{Blue\} "
else if cond == "black" then "\{Black\} "
else if cond == "red" then "\{Red\} "
else if cond == "green" then "\{Green\} "
else if cond == "white, blue" then "\{White/Blue\} "
else if cond == "blue, black" then "\{Blue/Black\} "
else if cond == "black, red" then "\{Black/Red\} "
else if cond == "red, green" then "\{Red/Green\} "
else if cond == "white, green" then "\{Green/White\} "
else if cond == "white, black" then "\{White/Black\} "
else if cond == "blue, red" then "\{Blue/Red\} "
else if cond == "black, green" then "\{Black/Green\} "
else if cond == "white, red" then "\{Red/White\} "
else if cond == "blue, green" then "\{Green/Blue\} "
else if cond == "white, black, red" then "\{White/Black/Red\} "
else if cond == "blue, red, green" then "\{Blue/Red/Green\} "
else if cond == "white, black, green" then "\{Black/Green/White\} "
else if cond == "white, blue, red" then "\{Red/White/Blue\} "
else if cond == "blue, black, green" then "\{Green/Blue/Black\} "
else if cond == "white, blue, black" then "\{White/Blue/Black\} "
else if cond == "blue, black, red" then "\{Blue/Black/Red\} "
else if cond == "black, red, green" then "\{Black/Red/Green\} "
else if cond == "white, red, green" then "\{Red/Green/White\} "
else if cond == "white, blue, green" then "\{Green/White/Blue\} "
else ""
}
trim_zeroes := replace@(match: "^00?", replace: "")+
replace@(match: "a?/[0-9b]+", replace: "")
corrected_card_number := { if exporter_num_grabber(exporter_num_filter(card.notes)) != "" then exporter_num_grabber(exporter_num_filter(card.notes)) else if card.custom_card_number != "" then trim_zeroes(card.custom_card_number) else card_number() }
lackey_bot_flavor := {"*" + input + "*" }
apos_filter := replace@(match:"", replace:"'")
paragraph_count := replace@(match:"\n", replace:"~")+
filter_text@(match:"~")
text_script := {
replace(
remove_tags(input) + (if card.rule_text_3 != "" then "\\n" + card.rule_text_3 else ""),
match:"[ ][ ]+•",
replace: "\\n•"
)
}
leveler_text := {
card.rule_text + "\\n" +
"[PROGRESS " + card.level_1 + "] " + card.rule_text_2 + "\\n" +
"[PROGRESS " + card.level_2 + "] " + card.rule_text_3 + "\\n"
}
flavor_script := { if input == "<i-flavor></i-flavor>" then ""
else replace(italic_filter(input), match:"\n", replace:"\\\\n") + "\\n"
}
italic_filter := replace@(match:"<i-flavor>", replace:"*")+
replace@(match:" *</i-flavor>", replace:"*")+
replace@(match:" </i>", replace:"* ")+
replace@(match:" </i>", replace:"* ")+
replace@(match:" </i>", replace:"* ")+
replace@(match:"</i>", replace:"*")+
replace@(match:"</i>", replace:"*")+
replace@(match:"</i>", replace:"*")+
replace@(match:"<i> ", replace:" *")+
replace@(match:"<i> ", replace:" *")+
replace@(match:"<i> ", replace:" *")+
replace@(match:"<i>", replace:"*")+
replace@(match:"<i>", replace:"*")+
replace@(match:"<i>", replace:"*")+
replace@(match:"\\*\\*+", replace:"")
walker_text := { lackey_bot_mana_filter(lackey_bot_rule_filter((if card.loyalty_cost_1 != "" then "[" + card.loyalty_cost_1 + "]: ") +(if card.level_1_text != "" then card.level_1_text else split_text(match:"\n", card.rule_text).0)+"\\n"
+ "[" + card.loyalty_cost_2 + "]" +(if card.loyalty_cost_2 !="" then ": ") +(if card.level_2_text != "" then card.level_2_text+"\\n" else if contains(paragraph_count(card.rule_text), match:"~") then split_text(match:"\n", card.rule_text).1+"\\n")
+ "[" + card.loyalty_cost_3 + "]" +(if card.loyalty_cost_3 !="" then ": ") +(if card.level_3_text != "" then card.level_3_text+"\\n" else if contains(paragraph_count(card.rule_text), match:"~~") then split_text(match:"\n", card.rule_text).2+"\\n")
+ ( if card.loyalty_cost_4 != "" then "[" + card.loyalty_cost_4 + "]" +": ") +(if card.level_4_text != "" then card.level_4_text+"\\n" else if contains(paragraph_count(card.rule_text), match:"~~~") then split_text(match:"\n", card.rule_text).3+"\\n")))
}
walker_text_2 := { lackey_bot_mana_filter(lackey_bot_rule_filter((if card.loyalty_cost_5 != "" then "[" + card.loyalty_cost_5 + "]: ") +(if card.loyalty_cost_5 !="" then ": ") +(if card.level_5_text != "" then card.level_5_text+"\\n" else split_text(match:"\n", card.rule_text_2).0)+"\\n"
+ "[" + card.loyalty_cost_6 + "]" +(if card.loyalty_cost_6 !="" then ": ") +(if card.level_6_text != "" then card.level_6_text+"\\n" else if contains(paragraph_count(card.rule_text_2), match:"~") then split_text(match:"\n", card.rule_text_2).1+"\\n")
+ "[" + card.loyalty_cost_7 + "]" +(if card.loyalty_cost_7 !="" then ": ") +(if card.level_7_text != "" then card.level_7_text+"\\n" else if contains(paragraph_count(card.rule_text_2), match:"~~") then split_text(match:"\n", card.rule_text_2).2+"\\n")
+ ( if card.loyalty_cost_8 != "" then "[" + card.loyalty_cost_8 + "]" +": ") +(if card.level_8_text != "" then card.level_8_text+"\\n" else if contains(paragraph_count(card.rule_text_2), match:"~~~") then split_text(match:"\n", card.rule_text_2).3+"\\n")))
}
apos_fix := replace@(match:"", replace:"'")
use_token := { contains(card.shape, match:"token") or contains(card.shape, match:"emblem") }
search_code := { (if card.rarity == "masterpiece" then "MPS_" else if card.rarity == "special" and not use_bonus() then "PRO_" else if use_token() then "TKN_" else "") + fixed_set_code() }
use_bonus := {card.rarity == "special" and options.special_usage == "bonus" }
rarity_name := { if contains(fixed_set_code(), match:"MPS") or card.rarity == "masterpiece" then "Masterpiece" else if use_bonus() then "Bonus" else if card.rarity == "special" then "Promo" else if use_token() then "Token" else if card.rarity == "mythic rare" then "M" else if card.rarity == "rare" then "R" else if card.rarity == "uncommon" then "U" else if card.rarity == "common" then "C" else "L" }
lb_rarity_code := {
if use_token() or fixed_set_code() != "MPS_MSE" then
"*" + fixed_set_code() + " " + rarity_name() + "*"
else
"*MSEM Champion*"
}
add_token_filter := filter_text@(match:"!addtoken [^\n!]+")
add_token_grabber := replace@(match:"!addtoken ", replace:"")
replace_token_filter := filter_text@(match:"!replacetoken [^\n!]+")
replace_token_grabber := replace@(match:"!replacetoken ", replace:"")
token_tag_filter := filter_text@(match:"!tokentag [^\n!]+")
token_tag_grabber := replace@(match:"!tokentag ", replace:"")
token_scripts := {
add_token_argument := add_token_grabber(add_token_filter(card.notes))
replace_token_argument := replace_token_grabber(replace_token_filter(card.notes))
token_tag_argument := token_tag_grabber(token_tag_filter(card.notes))
output := ""
if add_token_argument != "" then output := output + "\"aa\": \"" + add_token_argument + "\"" + (if replace_token_argument != "" or token_tag_argument != "" then ", " else "")
if replace_token_argument != "" then output := output + "\"rr\": \"" + replace_token_argument + "\"" + (if token_tag_argument != "" then ", " else "")
if token_tag_argument != "" then output := output + "\"t\": \"" + token_tag_argument + "\""
if output != "" then output := "\"tokenscripts\": \{" + output + "\}, "
output
}
write_normal:= {" \"" + (if hidden_name() != "" then hidden_name() else break_cleaner(apos_fix(database_name()))) + "_" + search_code() + "\": \{"
+ "\"fullName\": \"" + break_cleaner(apos_fix(database_name())) + "\", "
+ (
if card.alias != "" then
"\"cardName\": \"" + break_cleaner(card.alias) + "\", "
+ "\"alias\": \"" + break_cleaner(remove_tags(card.name)) + "\", "
else "\"cardName\": \"" + break_cleaner(remove_tags(card.name)) + "\", "
)
+ "\"manaCost\": \"" + mana_script(card.casting_cost) + "\", "
+ "\"typeLine\": \"" + break_cleaner(card.type) + "\", "
+ "\"rarityLine\": \"" + lb_rarity_code() + "\", "
+ "\"rulesText\": \"" + (if card.special_text != "" then lackey_bot_rule_filter(text_script(lackey_bot_mana_filter(card.special_text))) else if card.shape == "leveler" then lackey_bot_mana_filter(lackey_bot_rule_filter(leveler_text())) else if card.loyalty != "" then walker_text() else lackey_bot_rule_filter(text_script(lackey_bot_mana_filter(card.rule_text)))) + "\", "
+ "\"flavorText\": \"" + flavor_script(card.flavor_text) + "\", "
+ "\"power\": " + (if card.power == "*" then "\"★\"" else if card.power == "" then "\"\"" else if (to_number(card.power) or else false != card.power) then "\"" + card.power + "\"" else card.power) + ", "
+ "\"toughness\": " + (if card.toughness == "*" then "\"★\"" else if card.toughness == "" then "\"\"" else if (to_number(card.toughness) or else false != card.toughness) then "\"" + card.toughness + "\"" else card.toughness) + ", "
+ "\"loyalty\": " + (if (to_number(card.loyalty) or else false != card.loyalty) then "\"" + card.loyalty + "\"" else card.loyalty) + ", "
+ "\"color\": \"" + (if contains(card.super_type, match:"Land") then "" else indicator_color_name(card.card_color)) + "\", "
+ "\"cmc\": " + cmc(card.casting_cost) + ", "
+ "\"cardType\": \"" + type_trim(card.super_type) + "\", "
+ (if contains(card.shape, match: "split") or contains(card.shape, match:"double") or contains(card.shape, match:"adventure") or contains(card.shape, match:"aftermath") then secondCard())
+ "\"rarity\": \"" + (if rarity_name() == "Token" then "token" else if rarity_name() == "Bonus" then "bonus" else if rarity_name() == "Masterpiece" then "masterpiece" else card.rarity) + "\", "
+ "\"shape\": \"" + (if contains(card.shape, match: "adventure") then "adventure" else if contains(card.shape, match: "aftermath") or contains(card.shape, match: "split") then "split" else if contains(card.shape, match:"double") then "doubleface" else "normal") + "\", "
+ "\"setID\": \"" + (if use_token() then "tokens" else fixed_set_code()) + "\", "
+ "\"cardID\": \"" + (if use_token() then fixed_set_code() else "") + corrected_card_number() + "\", "
+ "\"designer\": \"" + pull_designer() + "\", "
+ "\"script\": " + forced_script() + ", "
+ "\"notes\": " + card_note_array() + ", "
+ token_scripts()
+ (if hidden_name() != "" then "\"hidden\": \"" + hidden_name() + "\"," else "")
+ (if link_name() != "" then "\"link\": \"" + link_name() + "\"," else "")
+ (if patch_note() != "" then "\"patchNote\": \"" + patch_note() + "\"," else "")
+ "\"artist\": \"" + break_cleaner(quote_replace(card.illustrator))
+ (if contains(card.shape, match: "split") or contains(card.shape, match:"double") and card.illustrator != card.illustrator_2 and card.illustrator_2 != "" then
"\", \"artist2\": \"" + quote_replace(break_cleaner(card.illustrator_2)))
+ "\"\},\n"
}
write_command:= {" \"" + apos_fix(database_name()) + "_" + search_code() + "\": \{"
+ "\"fullName\": \"" + apos_fix(database_name()) + "\", "
+ "\"cardName\": \"" + remove_tags(card.name) + "\", "
+ "\"manaCost\": \"\", "
+ "\"typeLine\": \"\", "
+ "\"rarityLine\": \"\", "
+ "\"rulesText\": \"" + (if card.loyalty != "" then walker_text() else lackey_bot_rule_filter(text_script(lackey_bot_mana_filter(card.rule_text)))) + "\", "
+ "\"flavorText\": \"\", "
+ "\"power\": \"\", "
+ "\"toughness\": \"\", "
+ "\"loyalty\": \"\", "
+ "\"color\": \"\", "
+ "\"cmc\": \"\", "
+ "\"cardType\": \"\", "
+ "\"rarity\": \"\", "
+ "\"shape\": \"normal\", "
+ "\"setID\": \"BOT\", "
+ "\"cardID\": \"\"\},\n"
}
secondCard := {
(
if card.alias_2 != "" then
"\"cardName2\": \"" + break_cleaner(card.alias_2) + "\", "
+ "\"alias2\": \"" + break_cleaner(remove_tags(card.name_2)) + "\", "
else "\"cardName2\": \"" + break_cleaner(remove_tags(card.name_2)) + "\", "
)
+ "\"manaCost2\": \"" + mana_script(card.casting_cost_2) + "\", "
+ "\"typeLine2\": \"" + break_cleaner(card.type_2) + "\", "
+ "\"rarityLine2\": \"" + lb_rarity_code() + "\", "
+ "\"rulesText2\": \"" + (if card.special_text_2 != "" then lackey_bot_rule_filter(text_script(lackey_bot_mana_filter(card.special_text_2))) else if card.loyalty_2 != "" then walker_text_2() else lackey_bot_rule_filter(text_script(lackey_bot_mana_filter(card.rule_text_2)))) + "\", "
+ "\"flavorText2\": \"" + flavor_script(card.flavor_text_2) + "\", "
+ "\"power2\": " + (if card.power_2 == "*" then "\"★\"" else if card.power_2 == "" then "\"\"" else if (to_number(card.power_2) or else false != card.power_2) then "\"" + card.power_2 + "\"" else card.power_2) + ", "
+ "\"toughness2\": " + (if card.toughness_2 == "*" then "\"★\"" else if card.toughness_2 == "" then "\"\"" else if (to_number(card.toughness_2) or else false != card.toughness_2) then "\"" + card.toughness_2 + "\"" else card.toughness_2) + ", "
+ "\"loyalty2\": " + (if (to_number(card.loyalty_2) or else false != card.loyalty_2) then "\"" + card.loyalty_2 + "\"" else card.loyalty_2) + ", "
+ "\"color2\": \"" + (if contains(card.super_type, match:"Land") then "" else indicator_color_name(card.card_color_2)) + "\", "
+ "\"cmc2\": " + cmc(card.casting_cost_2) + ", "
+ "\"cardType2\": \"" + type_trim(card.super_type_2) + "\", "
}
write_update := { if not export_me() then "" else write_normal() }
####################################write_update := { if options.update and not contains(card.notes, match:"!alter") then "" else write_normal() }
write_cards := to_text(for each card in cards do write_update())
clean_cards := replace@(match:",\n$", replace: "\n")
+replace@(match:"", replace:"'")
####################################to_string("\{\n"+clean_cards(write_cards+"THATSALLF0LKS") +"}")
file_name := {
if options.image_name == "card number" then
(if token_export() or fixed_set_code() == "MSEMAR" or card_name() == "Glory Counter" or card_name() == "Idol" or card_name() == "Morph" or card_name() == "Manifest" or card_name() == "Shimmer" or card_name() == "Submerge"
then fixed_set_code()+corrected_card_number()
else corrected_card_number()
)
+".jpg"
else
dfc_splitter_name()+".jpg"
}
write_images := if options.export_images == "no" then "" else for each card in cards do if not export_me() then "" else write_image_file(card, directory: "{fixed_set_code()}", file:file_name(), width: image_export_width(), height: image_export_height())
to_string("\{\n"+clean_cards(write_cards) +"}") to_string("\{\n"+clean_cards(write_cards) +"}")

View File

@@ -0,0 +1,712 @@
public := true
designer_map := {
[
"101": "Pipsqueak",
"DOA": "Pipsqueak",
"LVS": "Pipsqueak",
"Storytime": "Pipsqueak",
"Discoveries of Akieva": "Pipsqueak",
"Love Song": "Pipsqueak",
"AVX": "Pipsqueak",
"Animus Vox": "Pipsqueak",
"AKD": "Parasign",
"Arkadai": "Parasign",
"ALK": "Zangy",
"Alkabah": "Zangy",
"ALR": "Mako",
"Alara": "Mako",
"TTR": "Mako",
"Theros Triumphant": "Mako",
"ATB": "CanterburyEgg",
"GNJ": "CanterburyEgg",
"GHQ": "CanterburyEgg",
"SUR": "CanterburyEgg",
"KOD": "CanterburyEgg",
"DSS": "CanterburyEgg",
"NJB": "CanterburyEgg",
"Al Tabaq": "CanterburyEgg",
"Goliaths of Nangjiao": "CanterburyEgg",
"Glacia": "CanterburyEgg",
"Glacia: Hail to the Queen": "CanterburyEgg",
"Glacia Hail to the Queen": "CanterburyEgg",
"Glacia, Hail to the Queen": "CanterburyEgg",
"Surging Tide": "CanterburyEgg",
"Surging Tides": "CanterburyEgg",
"Kahembo Olde Dawn": "CanterburyEgg",
"Kahembo: Olde Dawn": "CanterburyEgg",
"Kahembo": "CanterburyEgg",
"Dark Seas of Shiryen": "CanterburyEgg",
"Nangjiao In Bloom": "CanterburyEgg",
"AFM": "Korakhos",
"K15": "Korakhos",
"KZD": "Korakhos",
"TOW": "Korakhos",
"Aftermath": "Korakhos",
"K15 Core Set": "Korakhos",
"Khaliz-Dorahn": "Korakhos",
"Tides of War": "Korakhos",
"Tide of War": "Korakhos",
"ACA": "HerziQuerzi",
"BYK": "HerziQuerzi",
"CAC": "HerziQuerzi",
"MAC": "HerziQuerzi",
"HVF": "HerziQuerzi",
"PFP": "HerziQuerzi",
"TWR": "HerziQuerzi",
"Arcanum Academia": "HerziQuerzi",
"Beyond Our Ken": "HerziQuerzi",
"Beyond our Ken": "HerziQuerzi",
"Carpe Arcanum": "HerziQuerzi",
"Memorium Arcanum": "HerziQuerzi",
"Harvest Festival": "HerziQuerzi",
"Plagues of Fretport": "HerziQuerzi",
"A Tourney at Whiterun": "HerziQuerzi",
"Tourney at Whiterun": "HerziQuerzi",
"DHL": "FifthDragon",
"Descent from the Highlands": "FifthDragon",
"Descent": "FifthDragon",
"EAU": "Simon Williamson",
"Eralou": "Simon Williamson",
"EIA": "Dodger",
"ONO": "Dodger",
"Elmare: Into the Abyss": "Dodger",
"Elmare Into the Abyss": "Dodger",
"Elmare": "Dodger",
"Adventurers of Onora": "Dodger",
"Adventures of Onora": "Dodger",
"EOW": "Purplemurasaki",
"End of Wollensie": "Purplemurasaki",
"HI12": "Cajun",
"KXP": "Cajun",
"NVA": "Cajun",
"OPH": "Cajun",
"ORP": "Cajun",
"MPS_OPO": "Cajun",
"MPS_HI12": "Cajun",
"VTM": "Cajun",
"MON": "Cajun",
"SPK": "Cajun",
"High Noon": "Cajun",
"Karina's Explorations": "Cajun",
"Novea": "Cajun",
"Ophorio": "Cajun",
"Oirohpo": "Cajun",
"Ophorio Sagas": "Cajun",
"Daisite Outlaws": "Cajun",
"Villains: the Musical": "Cajun",
"Villains: The Musical": "Cajun",
"Villains The Musical": "Cajun",
"Villains the Musical": "Cajun",
"Monsters of Chikyu": "Cajun",
"Monsters of Chikyuu": "Cajun",
"Sparks": "Cajun",
"Sparks of a Multiverse": "Cajun",
"FNV": "TEST",
"Feanav": "TEST",
"Feanav: The Apothecary's Progress": "TEST",
"Feanav: the Apothecary's Progress": "TEST",
"IMP": "Timespiraled",
"PSA": "Timespiraled",
"TOJ": "Timespiraled",
"WAY": "Timespiraled",
"SWR": "Timespiraled",
"TMI": "Timespiraled",
"Imperial Legacies": "Timespiraled",
"Path of Shadows": "Timespiraled",
"Tales of Old Jidai": "Timespiraled",
"Worlds Away": "Timespiraled",
"Seasons of War": "Timespiraled",
"Toll Midnight": "Timespiraled",
"KLC": "fluffyDeathbringer",
"LAW": "fluffyDeathbringer",
"MIS": "fluffyDeathbringer",
"Kaleidoscope": "fluffyDeathbringer",
"Lovi Awoken": "fluffyDeathbringer",
"Lovi": "fluffyDeathbringer",
"Mious": "fluffyDeathbringer",
"POA": "Daij_Djan",
"Pyramids of Atuum": "Daij_Djan",
"RVO": "Emily",
"Riddles of Revio": "Emily",
"RWR": "CyberChronometer",
"Rail War": "CyberChronometer",
"SOR": "WindyDelcarlo",
"Spark of the Revolution": "WindyDelcarlo",
"Spark of a Revolution": "WindyDelcarlo",
"Spark of Revolution": "WindyDelcarlo",
"SOU": "Matt",
"QRB": "Matt",
"Scriptures of Urshad": "Matt",
"Quest for the Roseblade": "Matt",
"OTH": "Matt & DrChillbrain",
"Over the Horizon": "Matt & DrChillbrain",
"STN": "Wrenn",
"Survive the Night": "Wrenn",
"UNR": "water the weeds",
"The Unraveling": "water the weeds",
"Unraveling": "water the weeds",
"RCM": "gynoidpoet",
"Road to Caru Mapu": "gynoidpoet",
"PAX": "Scribbl",
"Panxiou": "Scribbl",
"VHS": "Avery",
"Video Horror System": "Avery",
"ACT": "Zangy & Fleur",
"The Stage Presents": "Zangy & Fleur",
"The Neverending Act": "Zangy & Fleur",
"The Stage Presents: The Neverending Act": "Zangy & Fleur",
"ZER": "Umisa",
"Zero": "Umisa",
"VST": "Reuben",
"Vastuum": "Reuben",
"SRC": "Zangy",
"Secrets of the River City": "Zangy",
"KUT": "Matt",
"Kuutalya": "Matt",
"GQC": "CanterburyEgg",
"Ghariv, the Quaking City": "CanterburyEgg",
"SVG": "Occo",
"Svergard": "Occo",
"VRD": "DrChillbrain",
"Viridian's Last Mission": "DrChillbrain",
"KRS": "zarepath",
"Karsus": "zarepath",
"KSV": "Bergland",
"Karslav": "Bergland",
"BLR": "Pipsqueak",
"Blood Like Rivers": "Pipsqueak",
"DOV": "Matt",
"Duelists of Vereaux": "Matt",
"POP": "dr platypeople",
"Hyperpop": "dr platypeople",
"TRX": "Zangy",
"Theros: Age of Trax": "Zangy",
"OLD": "Dodger",
"Awakening in Oldun": "Dodger",
"Cybaros": "Splitmoon",
"CYB": "Splitmoon",
"Cliques of Nylin": "Stasis",
"CNY": "Stasis",
"nil": nil
]
}
code_map := [
"Imperial Legacies": "IMP",
"Path of Shadows": "PSA",
"Shrine": "SHRINE",
"Mana Pool": "L2",
"Land Bundle": "L"
]
export_me := {
if contains(card.notes, match:"!noexport")
then false
#else if contains(card.text+card.text_2+card.notes, match:"enter") or contains(card.super_type, match:"Enchantment")
# then true
else if options.update or else false
then contains(card.notes, match:"!update")
else true
}
fix_tm := replace@(match:"™", replace:"TM")
fixed_set_code := {
base := trim(fix_tm(if options.set_code != "" then options.set_code else set.set_code))
if base == "MSEM Champions" then "MPS_MSE" else if code_map[base] or else "" != "" then code_map[base] else base
}
dfc_splitter_name := {
name := card_name()
second := if contains(card.shape, match:"double faced") then remove_tags(card.name_2) else ""
if options.image_name == "dfc name" and second != "" then name + "_" + second else name
}
pull_designer_1 := {
design_command := designer_name_grabber(designer_name_filter(card.notes))
design_credit := card.card_code_text != "" and not match(card.card_code_text, match:"^(Story Spotlight|([|] ?)?FT(:| ?[-—]| by| from| written))")
possible_designer := replace(replace(card.card_code_text, match:"[*✉]", replace:""), match:"^ +", replace:"")
## !design XXX
## if public, basic check
## if public, default designers
## check credit vs fixer map
## check credit exists
## check set code vs cached map
## default designer
if design_command != ""
then design_command
else if public and options.check_designers and design_credit
then possible_designer
else if public or not options.check_designers
then options.default_designer
else if designer_map()[possible_designer] or else "" != ""
then designer_map()[possible_designer]
else if design_credit and possible_designer != ""
then possible_designer
else if designer_map()[fixed_set_code()] or else "" != ""
then designer_map()[fixed_set_code()]
else options.default_designer
}
pull_designer := {
base := trim(pull_designer_1())
if public then base else designer_map()[base] or else base
}
a_lackey_image_export_width := { if contains(card.shape, match:"split") then "445"
else if contains(card.shape, match:"double faced") then "626"
else "312"
}
a_lackey_image_export_height := { if contains(card.shape, match:"split") then "312"
else "445"
}
image_export_width := {
if options.export_images == "lackey size" then
if contains(card.shape, match:"split") then "445"
else if contains(card.shape, match:"double faced") then "626"
else "312"
else if contains(card.shape, match:"split") then 523
else if contains(card.shape, match:"double faced") then 752
else 375
}
image_export_height := {
if options.export_images == "lackey size" then
if contains(card.shape, match:"split") then "312"
else "445"
else if contains(card.shape, match:"split") then 375
else 523
}
remove_commas := replace@(match:":", replace:"")+
replace@(match:"<(/|\\\\)?i>", replace:"")+
replace@(match:"[\<>:\\\\/\"\\*\\?\\|]", replace:"")
token_export := {use_token() or contains(card.shape, match:"rulestip")}
v_rep := {
if input != "V"
then input
else if options.v_mana_replacement == ""
then input
else
options.v_mana_replacement
}
escape_quotes := replace@(match:"\"", replace:"\\\\\"")
exporter_name_filter := filter_text@(match:"(^|[^!])!exporte?r?name [^\n!]+")
exporter_name_grabber := replace@(match:".*!exporte?r?name ", replace:"")
has_export_tag := match@(match:"!export\\b")
hidden_name_filter := filter_text@(match:"!hiddenname [^\n!]+")
hidden_name_grabber := replace@(match:"!hiddenname ", replace:"")
hidden_tag_filter := filter_text@(match:"!hidetag [^\n!]+")
hidden_tag_grabber := replace@(match:"!hidetag ", replace:"")
hidden_name := {
given := hidden_name_grabber(hidden_name_filter(remove_tags(card.notes)))
if given != "" and db
then given := replace(given, match:"//", replace:"__")
tag := hidden_tag_grabber(hidden_tag_filter(remove_tags(card.notes)))
tag := if tag != "" then " " + tag else ""
name := if given == "" then remove_tags(card.name) else given
shape := if contains(card.notes, match:"!notes secretface")
then "secretface"
else lackey_shape()
breaker := if card.name_2 == ""
then ""
else if db
then "//"
else if shape == "doubleface" or shape == "secretface"
then "__"
else "//"
name2 := if card.name_2 == "" then "" else remove_tags(card.name_2)
tag2 := if shape == "secretface"
then replace(tag, match:"[)]", replace:"b)")
else if name2 != ""
then tag
else ""
partial_name := if given == "" and tag == ""
then "" ## no hidden name
else if given != ""
then given ## hiddenname
else if shape == "secretface"
then name + tag + breaker + name2 + tag2 ## secretface
else if shape == "doubleface" and db
then name + breaker + name2 + tag ## double database
else if shape == "doubleface"
then name + tag + breaker + name2 + tag2 ## double hidden
else if db or shape == "split"
then name + breaker + name2 + tag ## split / normal db / adv db
else
name + tag ## adventure hidden / normal hidden
replace(partial_name, match:"(\n|^ +| +$)", replace:"")
}@(db:false)
patch_note_filter := filter_text@(match:"!update [^\n!]+")
patch_note_grabber := replace@(match:"!update ", replace:"")
patch_note := {escape_quotes(patch_note_grabber(patch_note_filter(card.notes)))}
card_name := { replace(if exporter_name_grabber(exporter_name_filter(card.notes)) != "" then exporter_name_grabber(exporter_name_filter(card.notes)) else remove_tags(card.name), match:"(\n| +$|^ +)", replace:"") }
notes_filter := filter_text@(match:"!notes? [^\n!]+")
notes_grabber := replace@(match:"!notes? ", replace:"")
+replace@(match:"([^,]+)", replace:{"\"" + _1 + "\""})
+replace@(match:"italics", replace:"italic")
card_note_array := { "[" + (if notes_grabber(notes_filter(card.notes)) != "" then notes_grabber(notes_filter(card.notes)) else "") + "]" }
exporter_num_filter := filter_text@(match:"!num [^\n!]+")
exporter_num_grabber := replace@(match:"!num ", replace:"")
lackey_script_filter := filter_text@(match:"!script [^\n]+")
lackey_script_grabber := replace@(match:"!script ", replace:"")
designer_name_filter := filter_text@(match:"!designe?r? [^\n]+")
designer_name_grabber := replace@(match:"!designe?r? ", replace:"")
link_filter := filter_text@(match:"!link [^\n]+")
link_grabber := replace@(match:"!link ", replace:"")
link_name := { if link_grabber(link_filter(card.notes)) != "" then link_grabber(link_filter(card.notes)) else "" }
is_revived := { if contains(card.notes, match:"!revivetoken") then "Revived " else ""}
database_name := {
if exporter_name_grabber(exporter_name_filter(card.notes)) != ""
then exporter_name_grabber(exporter_name_filter(card.notes))
else if contains(card.shape, match: "split") or contains(card.shape, match:"double") or contains(card.shape, match:"adventure")
then remove_tags(card.name) + "//" + remove_tags(card.name_2)
else is_revived() + remove_tags(card.name)
}
forced_script := { if lackey_script_grabber(lackey_script_filter(card.notes)) != "" then "[" + lackey_script_grabber(lackey_script_filter(card.notes)) + "]" else "\"\""}
type_trim := replace@(match:"Basic ", replace:"")+
replace@(match:"Legendary", replace:"")+
replace@(match:"Snow ", replace:"")+
replace@(match:"World ", replace:"")+
replace@(match:"Token ", replace:"")
####### Script that converts the card's mana cost
lackey_bot_rule_filter := replace@(match:"", replace:"'")+
replace@(match:"\n", replace:"\\\\n")+
replace@(match:";;", replace:"\\\\n\\\\n")+
replace@(match:"[(]", replace:"*(")+
replace@(match:"[)]", replace: ")*")+
replace@(match:"\"", replace:"”")+
replace@(match:" ”", replace:" “")
break_cleaner := replace@(match:"\n", replace:"")
+ replace@(match:"\"", replace:"\\\\\"")
mana_script := replace@(match:"(2|H|W|U|B|R|G|S|C)/(W|U|B|R|G|S|C)", replace:{"\{"+_1+"/"+_2+"\}"})+
replace@(match:"(X|Y|Z|W|U|B|R|G|S|C)", in_context:"(?<!\{)(?<!/)<match>", replace:{"\{"+_1+"\}"})+
replace@(match:"([1-9][0-9])", in_context:"(?<!\{)(?<!\\/)<match>", replace:{"\{"+_1+"\}"})+
replace@(match:"([0-9])", in_context:"(?<!\{)(?<!\\/)<match>(?!})", replace:{"\{"+_1+"\}"})+
replace@(match:"V", replace:{"\{"+v_rep("V")+"\}"})
lackey_bot_mana_filter := replace@(match:"<sym(-auto)?>([0-9WUBRGCSHEQTXYZEDV/]+)</sym(-auto)?>", replace:{"\{"+_2+"}"})+
replace@(match:"([0-9HSCWUBRGXYZEDV/])", in_context:"\{[0-9HSCWUBRGXYZEDV/]*<match>[0-9HSCWUBRGXYZEDV/]*}", replace:{"\{"+v_rep(_1)+"}"})+
replace@(match:"}\{/}\{", replace:"/")+
replace@(match:"\{([0-9])}\{([0-9])}", replace:{"\{"+_1+_2+"}"})+
replace@(match:"\{\{", replace:"\{")+
replace@(match:"}}", replace:"}")
color_condense := replace@(match:"(, )?(artifact|multicolor|land|hybrid|horizontal|vertical|radial|overlay)", replace: "")
indicator_color_name := {
cond := color_condense(input)
if cond == "white" then "\{White\} "
else if cond == "blue" then "\{Blue\} "
else if cond == "black" then "\{Black\} "
else if cond == "red" then "\{Red\} "
else if cond == "green" then "\{Green\} "
else if cond == "white, blue" then "\{White/Blue\} "
else if cond == "blue, black" then "\{Blue/Black\} "
else if cond == "black, red" then "\{Black/Red\} "
else if cond == "red, green" then "\{Red/Green\} "
else if cond == "white, green" then "\{Green/White\} "
else if cond == "white, black" then "\{White/Black\} "
else if cond == "blue, red" then "\{Blue/Red\} "
else if cond == "black, green" then "\{Black/Green\} "
else if cond == "white, red" then "\{Red/White\} "
else if cond == "blue, green" then "\{Green/Blue\} "
else if cond == "white, black, red" then "\{White/Black/Red\} "
else if cond == "blue, red, green" then "\{Blue/Red/Green\} "
else if cond == "white, black, green" then "\{Black/Green/White\} "
else if cond == "white, blue, red" then "\{Red/White/Blue\} "
else if cond == "blue, black, green" then "\{Green/Blue/Black\} "
else if cond == "white, blue, black" then "\{White/Blue/Black\} "
else if cond == "blue, black, red" then "\{Blue/Black/Red\} "
else if cond == "black, red, green" then "\{Black/Red/Green\} "
else if cond == "white, red, green" then "\{Red/Green/White\} "
else if cond == "white, blue, green" then "\{Green/White/Blue\} "
else ""
}
trim_zeroes := replace@(match: "^00?", replace: "")+
replace@(match: "a?/[0-9b]+", replace: "")
corrected_card_number := { if exporter_num_grabber(exporter_num_filter(card.notes)) != "" then exporter_num_grabber(exporter_num_filter(card.notes)) else if card.custom_card_number != "" then trim_zeroes(card.custom_card_number) else card_number() }
lackey_bot_flavor := {"*" + input + "*" }
apos_filter := replace@(match:"", replace:"'")
paragraph_count := replace@(match:"\n", replace:"~")+
filter_text@(match:"~")
text_script := {
replace(
remove_tags(input) + (if card.rule_text_3 != "" then "\\n" + card.rule_text_3 else ""),
match:"[ ][ ]+•",
replace: "\\n•"
)
}
leveler_text := {
card.rule_text + "\\n" +
"[PROGRESS " + card.level_1 + "] " + card.rule_text_2 + "\\n" +
"[PROGRESS " + card.level_2 + "] " + card.rule_text_3 + "\\n"
}
flavor_script := { if input == "<i-flavor></i-flavor>" then ""
else replace(italic_filter(input), match:"\n", replace:"\\\\n") + "\\n"
}
italic_filter := replace@(match:"<i-flavor>", replace:"*")+
replace@(match:" *</i-flavor>", replace:"*")+
replace@(match:" </i>", replace:"* ")+
replace@(match:" </i>", replace:"* ")+
replace@(match:" </i>", replace:"* ")+
replace@(match:"</i>", replace:"*")+
replace@(match:"</i>", replace:"*")+
replace@(match:"</i>", replace:"*")+
replace@(match:"<i> ", replace:" *")+
replace@(match:"<i> ", replace:" *")+
replace@(match:"<i> ", replace:" *")+
replace@(match:"<i>", replace:"*")+
replace@(match:"<i>", replace:"*")+
replace@(match:"<i>", replace:"*")+
replace@(match:"\\*\\*+", replace:"")
walker_text := { lackey_bot_mana_filter(lackey_bot_rule_filter((if card.loyalty_cost_1 != "" then "[" + card.loyalty_cost_1 + "]: ") +(if card.level_1_text != "" then card.level_1_text else split_text(match:"\n", card.rule_text).0)+"\\n"
+ "[" + card.loyalty_cost_2 + "]" +(if card.loyalty_cost_2 !="" then ": ") +(if card.level_2_text != "" then card.level_2_text+"\\n" else if contains(paragraph_count(card.rule_text), match:"~") then split_text(match:"\n", card.rule_text).1+"\\n")
+ "[" + card.loyalty_cost_3 + "]" +(if card.loyalty_cost_3 !="" then ": ") +(if card.level_3_text != "" then card.level_3_text+"\\n" else if contains(paragraph_count(card.rule_text), match:"~~") then split_text(match:"\n", card.rule_text).2+"\\n")
+ ( if card.loyalty_cost_4 != "" then "[" + card.loyalty_cost_4 + "]" +": ") +(if card.level_4_text != "" then card.level_4_text+"\\n" else if contains(paragraph_count(card.rule_text), match:"~~~") then split_text(match:"\n", card.rule_text).3+"\\n")))
}
walker_text_2 := { lackey_bot_mana_filter(lackey_bot_rule_filter((if card.loyalty_cost_5 != "" then "[" + card.loyalty_cost_5 + "]: ") +(if card.loyalty_cost_5 !="" then ": ") +(if card.level_5_text != "" then card.level_5_text+"\\n" else split_text(match:"\n", card.rule_text_2).0)+"\\n"
+ "[" + card.loyalty_cost_6 + "]" +(if card.loyalty_cost_6 !="" then ": ") +(if card.level_6_text != "" then card.level_6_text+"\\n" else if contains(paragraph_count(card.rule_text_2), match:"~") then split_text(match:"\n", card.rule_text_2).1+"\\n")
+ "[" + card.loyalty_cost_7 + "]" +(if card.loyalty_cost_7 !="" then ": ") +(if card.level_7_text != "" then card.level_7_text+"\\n" else if contains(paragraph_count(card.rule_text_2), match:"~~") then split_text(match:"\n", card.rule_text_2).2+"\\n")
+ ( if card.loyalty_cost_8 != "" then "[" + card.loyalty_cost_8 + "]" +": ") +(if card.level_8_text != "" then card.level_8_text+"\\n" else if contains(paragraph_count(card.rule_text_2), match:"~~~") then split_text(match:"\n", card.rule_text_2).3+"\\n")))
}
apos_fix := replace@(match:"", replace:"'")
use_token := { contains(card.shape, match:"token") or contains(card.shape, match:"emblem") or contains(card.super_type, match:"Token") or contains(card.super_type, match:"Emblem") }
search_code := { (if card.rarity == "masterpiece" then "MPS_" else if card.rarity == "special" and not use_bonus() then "PRO_" else if use_token() then "TKN_" else "") + fixed_set_code() }
use_promo := match@(match:"!promo\\b")
use_bonus := { card.rarity == "special" and not use_promo(card.notes) }
lackey_shape := {
if contains(card.shape, match: "adventure")
then "adventure"
else if contains(card.shape, match: "aftermath") or contains(card.shape, match: "split")
then "split"
else if contains(card.shape, match:"double")
then "doubleface"
else "normal"
}
rarity_name := { if use_token() then "Token" else if contains(fixed_set_code(), match:"MPS") or card.rarity == "masterpiece" then "Masterpiece" else if use_bonus() then "Bonus" else if card.rarity == "special" then "Promo" else if card.rarity == "mythic rare" then "M" else if card.rarity == "rare" then "R" else if card.rarity == "uncommon" then "U" else if card.rarity == "common" then "C" else "L" }
lb_rarity_code := {
if use_token() or fixed_set_code() != "MPS_MSE" then
"*" + fixed_set_code() + " " + rarity_name() + "*"
else
"*MSEM Champion*"
}
check_champion := {
sc := fixed_set_code()
checker := ""
if sc == "MPS_MSE" or sc == "CHAMPIONS" or sc == "REV" then
checker := if card.custom_card_number != "" then card.custom_card_number else card.card_code_text
else if sc == "LAIR" and match(card.copyright, match:"Top Xs|League Leaders") then
checker := card.copyright
split_text(checker, match:"— ?").1 or else ""
}
rename_filter := filter_text@(match:"!renameof [^\n!]+")
rename_grabber := replace@(match:"!renameof ", replace:"")
check_rename := {
rn := rename_grabber(rename_filter(card.notes))
if rn == "" then rn else rn + "_" + search_code()
}
add_token_filter := filter_text@(match:"!addtoken [^\n!]+")
add_token_grabber := replace@(match:"!addtoken ", replace:"")
replace_token_filter := filter_text@(match:"!replacetoken [^\n!]+")
replace_token_grabber := replace@(match:"!replacetoken ", replace:"")
token_tag_filter := filter_text@(match:"!tokentag [^\n!]+")
token_tag_grabber := replace@(match:"!tokentag ", replace:"")
has_subtitle := { card.alias != "" and contains(card.notes, match:"!subtitle")}
token_scripts := {
add_token_argument := add_token_grabber(add_token_filter(card.notes))
replace_token_argument := replace_token_grabber(replace_token_filter(card.notes))
token_tag_argument := token_tag_grabber(token_tag_filter(card.notes))
output := ""
if add_token_argument != "" then output := output + "\"aa\": \"" + add_token_argument + "\"" + (if replace_token_argument != "" or token_tag_argument != "" then ", " else "")
if replace_token_argument != "" then output := output + "\"rr\": \"" + replace_token_argument + "\"" + (if token_tag_argument != "" then ", " else "")
if token_tag_argument != "" then output := output + "\"t\": \"" + token_tag_argument + "\""
if output != "" then output := "\"tokenscripts\": \{" + output + "\}, "
output
}
text_processing1 := {text_processing(input, box:"")}
text_processing2 := {text_processing(input, box:"2")}
textpends := "!(append|prepend|inpend|exitpend)"
text_processing := {
blocks := split_text(card.notes, match:textpends+box+" ")
cmds := break_text(card.notes, match:textpends+box+" ")
if length(cmds) > 0 then (
shift := if not contains(card.notes, match:cmds[0]+blocks[0]) then 1 else 0
for x from 0 to length(cmds)-1 do (
cmd := replace(to_lower(cmds[x]), match:"2? $", replace:"");
inf := replace(blocks[x+shift], match:"\n\n\n.*", replace:"");
input := command_processing[cmd](input, info:inf);
""
)
)
replace(input, match:"\\\\n$", replace:"")
}
command_processing := [
"!append": {
input + lackey_bot_rule_filter(info)
},
"!prepend": {
replace(lackey_bot_rule_filter(info), match:"\\\\n$", replace:"") + input
},
"!exitpend": {
input
},
"!inpend": {
swaps := split_text(info, match:"/replace/")
apps := split_text(info, match:"/add/")
if length(swaps) > 1 then
replace(input, match:swaps.0, replace:lackey_bot_rule_filter(swaps.1))
else if length(apps) > 1 then
replace(input, match:"(.*)({apps.0})(.*)", replace:"\\1\\2{lackey_bot_rule_filter(apps.1)}\\3")
else input
}
]
write_normal := {
" \"" + (if hidden_name() != "" then hidden_name(db:true) else break_cleaner(apos_fix(database_name()))) + "_" + search_code() + "\": \{"
+ "\"fullName\": \"" + break_cleaner(apos_fix(database_name())) + "\", "
+ (
if has_subtitle() then
"\"cardName\": \"" + break_cleaner(remove_tags(card.name)) + "\", "
+ "\"alias\": \"" + break_cleaner(card.alias) + "\", "
if card.alias != "" then
"\"cardName\": \"" + break_cleaner(card.alias) + "\", "
+ "\"alias\": \"" + break_cleaner(remove_tags(card.name)) + "\", "
else "\"cardName\": \"" + break_cleaner(remove_tags(card.name)) + "\", "
)
+ "\"manaCost\": \"" + mana_script(card.casting_cost) + "\", "
+ "\"typeLine\": \"" + break_cleaner(card.type) + "\", "
+ "\"rarityLine\": \"" + lb_rarity_code() + "\", "
+ "\"rulesText\": \"" + text_processing1(if card.special_text != "" then lackey_bot_rule_filter(text_script(lackey_bot_mana_filter(card.special_text))) else if card.shape == "leveler" then lackey_bot_mana_filter(lackey_bot_rule_filter(leveler_text())) else if card.loyalty != "" then walker_text() else lackey_bot_rule_filter(text_script(lackey_bot_mana_filter(card.rule_text))),) + "\", "
+ "\"flavorText\": \"" + flavor_script(if contains(card.chapter_text, match:"<i>") then card.chapter_text else card.flavor_text) + "\", "
+ "\"power\": " + (if card.power == "*" then "\"★\"" else if card.power == "" then "\"\"" else if (to_number(card.power) or else false != card.power) then "\"" + card.power + "\"" else card.power) + ", "
+ "\"toughness\": " + (if card.toughness == "*" then "\"★\"" else if card.toughness == "" then "\"\"" else if (to_number(card.toughness) or else false != card.toughness) then "\"" + card.toughness + "\"" else card.toughness) + ", "
+ "\"loyalty\": " + (if (to_number(card.loyalty) or else false != card.loyalty) then "\"" + card.loyalty + "\"" else card.loyalty) + ", "
+ "\"color\": \"" + (if contains(card.super_type, match:"Land") then "" else indicator_color_name(card.card_color)) + "\", "
+ "\"cmc\": " + cmc(card.casting_cost) + ", "
+ "\"cardType\": \"" + type_trim(card.super_type) + "\", "
+ (if contains(card.shape, match: "split") or contains(card.shape, match:"double") or contains(card.shape, match:"adventure") or contains(card.shape, match:"aftermath") then secondCard())
+ "\"rarity\": \"" + (if rarity_name() == "Token" then "token" else if rarity_name() == "Bonus" then "bonus" else if rarity_name() == "Masterpiece" then "masterpiece" else card.rarity) + "\", "
+ "\"shape\": \"" + lackey_shape() + "\", "
+ "\"setID\": \"" + (if use_token() then "tokens" else fixed_set_code()) + "\", "
+ (if use_token() then "\"parentSet\": \"" + fixed_set_code() + "\", " else "")
+ "\"cardID\": \"" + (if use_token() then fixed_set_code() else "") + corrected_card_number() + "\", "
+ "\"designer\": \"" + pull_designer() + "\", "
+ "\"script\": " + forced_script() + ", "
+ (if has_export_tag(card.notes) then "\"tagged\": true, " else "")
+ "\"notes\": " + card_note_array() + ", "
+ token_scripts()
+ (if check_champion() != "" then "\"champion\": \"" + check_champion() + "\"," else "")
+ (if check_rename() != "" then "\"rename\": \"" + check_rename() + "\"," else "")
+ (if hidden_name() != "" then "\"hidden\": \"" + hidden_name() + "\"," else "")
+ (if link_name() != "" then "\"link\": \"" + link_name() + "\"," else "")
+ (if patch_note() != "" then "\"patchNote\": \"" + patch_note() + "\"," else "")
+ "\"artist\": \"" + break_cleaner(card.illustrator)
+ (if contains(card.shape, match: "split") or contains(card.shape, match:"double") and card.illustrator != card.illustrator_2 and card.illustrator_2 != "" then
"\", \"artist2\": \"" + break_cleaner(card.illustrator_2))
+ "\"\},\n"
}
write_command:= {" \"" + apos_fix(database_name()) + "_" + search_code() + "\": \{"
+ "\"fullName\": \"" + apos_fix(database_name()) + "\", "
+ "\"cardName\": \"" + remove_tags(card.name) + "\", "
+ "\"manaCost\": \"\", "
+ "\"typeLine\": \"\", "
+ "\"rarityLine\": \"\", "
+ "\"rulesText\": \"" + (if card.loyalty != "" then walker_text() else lackey_bot_rule_filter(text_script(lackey_bot_mana_filter(card.rule_text)))) + "\", "
+ "\"flavorText\": \"\", "
+ "\"power\": \"\", "
+ "\"toughness\": \"\", "
+ "\"loyalty\": \"\", "
+ "\"color\": \"\", "
+ "\"cmc\": \"\", "
+ "\"cardType\": \"\", "
+ "\"rarity\": \"\", "
+ "\"shape\": \"normal\", "
+ "\"setID\": \"BOT\", "
+ "\"cardID\": \"\"\},\n"
}
secondCard := {
(
if card.alias_2 != "" then
"\"cardName2\": \"" + break_cleaner(card.alias_2) + "\", "
+ "\"alias2\": \"" + break_cleaner(remove_tags(card.name_2)) + "\", "
else "\"cardName2\": \"" + break_cleaner(remove_tags(card.name_2)) + "\", "
)
+ "\"manaCost2\": \"" + mana_script(card.casting_cost_2) + "\", "
+ "\"typeLine2\": \"" + break_cleaner(card.type_2) + "\", "
+ "\"rarityLine2\": \"" + lb_rarity_code() + "\", "
+ "\"rulesText2\": \"" + text_processing2(if card.special_text_2 != "" then lackey_bot_rule_filter(text_script(lackey_bot_mana_filter(card.special_text_2))) else if card.loyalty_2 != "" then walker_text_2() else lackey_bot_rule_filter(text_script(lackey_bot_mana_filter(card.rule_text_2)))) + "\", "
+ "\"flavorText2\": \"" + flavor_script(card.flavor_text_2) + "\", "
+ "\"power2\": " + (if card.power_2 == "*" then "\"★\"" else if card.power_2 == "" then "\"\"" else if (to_number(card.power_2) or else false != card.power_2) then "\"" + card.power_2 + "\"" else card.power_2) + ", "
+ "\"toughness2\": " + (if card.toughness_2 == "*" then "\"★\"" else if card.toughness_2 == "" then "\"\"" else if (to_number(card.toughness_2) or else false != card.toughness_2) then "\"" + card.toughness_2 + "\"" else card.toughness_2) + ", "
+ "\"loyalty2\": " + (if (to_number(card.loyalty_2) or else false != card.loyalty_2) then "\"" + card.loyalty_2 + "\"" else card.loyalty_2) + ", "
+ "\"color2\": \"" + (if contains(card.super_type, match:"Land") then "" else indicator_color_name(card.card_color_2)) + "\", "
+ "\"cmc2\": " + cmc(card.casting_cost_2) + ", "
+ "\"cardType2\": \"" + type_trim(card.super_type_2) + "\", "
}
write_update := { if not export_me() then "" else write_normal() }
####################################write_update := { if options.update and not contains(card.notes, match:"!alter") then "" else write_normal() }
write_cards := to_text(for each card in cards do write_update())
clean_cards := replace@(match:",\n$", replace: "\n")
+replace@(match:"", replace:"'")
+replace@(match:"\\\\n[ \t]+", replace:"\\\\n")
####################################to_string("\{\n"+clean_cards(write_cards+"THATSALLF0LKS") +"}")
file_name := {
if options.image_name == "card number" then
(
if token_export() or (not public and (fixed_set_code() == "MSEMAR" or card_name() == "Glory Counter" or card_name() == "Idol" or card_name() == "Morph" or card_name() == "Manifest" or card_name() == "Shimmer" or card_name() == "Submerge"))
then fixed_set_code()+corrected_card_number()
else corrected_card_number()
)
+ fillin
+ ".jpg"
else if fillin == "b"
then remove_tags(card.name_2) +".jpg"
else card_name() + ".jpg"
}@(fillin:"")
lackey_sizer := [
375: 312,
523: 445
]
write_card_images := {
## base card
write_image_file(
card,
directory: fixed_set_code(),
file: file_name(),
width: image_export_width(),
height: image_export_height()
)
len := length(card.stylesheet.card_regions)
if len > 0 then (
card_image := to_card_image(card)
for i from 0 to len-1 do (
region_info := card.stylesheet.card_regions[i]
region := crop(
card_image,
width: region_info.width,
height: region_info.height,
offset_x: region_info.x,
offset_y: region_info.y
)
fillin := if region_info.name == "front" or region_info.name == "minifront"
then "a"
else if region_info.name == "back" or region_info.name == "meldpair"
then "b"
else if region_info.name == "meld" or region_info.name == "thirdcard"
then "c"
else region_info.name
fn := file_name(fillin:fillin)
w := region_info.width
h := region_info.height
if options.export_images == "lackey size" then (
w := lackey_sizer[w] or else w
h := lackey_sizer[h] or else h
)
write_image_file(
region,
directory: fixed_set_code(),
file: fn,
width: w,
height: h
)
)
)
""
}

View File

@@ -1,10 +1,10 @@
mse version: 2.0.0 mse version: 2.5.0
short name: Lackey short name: Lackey
full name: Lackey Exporter full name: Lackey Exporter
position hint: 003 position hint: 900
icon: icon.png icon: icon.png
version: 2014-01-20 version: 2024-09-24
installer group: magic/Export/lackeyccg installer group: magic/Export/LackeyCCG
depends on: depends on:
package: magic.mse-game package: magic.mse-game
@@ -30,13 +30,6 @@ option field:
type: text type: text
name: set code name: set code
description: The three letter extension of your set name. description: The three letter extension of your set name.
option field:
type: choice
name: dfc options
description: Options for exporting DFCs.
choice: Back faces (DFC-Exporter)
choice: Front faces (DFC-Exporter)
choice: Both faces (Standard)
option field: option field:
type: boolean type: boolean
name: unkeyworded clues name: unkeyworded clues
@@ -75,30 +68,47 @@ script:
or contains(card.level_3_text, match:"Create X") or contains(card.level_3_text, match:"Create X")
or contains(card.level_4_text, match:"Create X") or contains(card.level_4_text, match:"Create X")
} }
token_pt_fix := { (if card.power = "*" then "X" else card.power) + (if card.power != "" and card.toughness != "" then "/") + (if card.toughness == "*" then "X" else card.toughness) } token_pt_fix := { (if card.power == "*" then "X" else card.power) + (if card.power != "" and card.toughness != "" then "/") + (if card.toughness == "*" then "X" else card.toughness) }
trim_zeroes := replace@(match: "^[0]+", replace: "")+ trim_zeroes := replace@(match: "^[0]+", replace: "")+
replace@(match: "a?/[0-9b]+", replace: "") replace@(match: "a?/[0-9b]+", replace: "")
corrected_card_number := { if card.custom_card_number != "" then trim_zeroes(card.custom_card_number) else card_number() } corrected_card_number := { if card.custom_card_number != "" then trim_zeroes(card.custom_card_number) else card_number() }
####################### Image Exporting ####################### Image Exporting
is_backface := { contains(card.shape, match:"double faced") and contains(options.dfc_options, match:"Back faces") } large_resizer := [
other_face := { contains(card.shape, match:"double faced") and not is_backface() } 752: 626,
image_export_width := { if contains(card.shape, match:"split") and options.export_size == "MSE Standard" then "523" 523: 445,
else if contains(options.dfc_options, match:"Standard") and contains(card.shape, match:"double faced") and options.export_size == "MSE Standard" then "752" 375: 312
else if options.export_size == "MSE Standard" then "375" ]
else if contains(card.shape, match:"split") and options.export_size == "LackeyCCG Medium" then "285" medium_resizer := [
else if contains(options.dfc_options, match:"Standard") and contains(card.shape, match:"double faced") and options.export_size == "LackeyCCGMedium" then "572" 752: 402
else if options.export_size == "LackeyCCG Medium" then "200" 523: 285
else if contains(card.shape, match:"split") then "445" 375: 200
else if contains(options.dfc_options, match:"Standard") and contains(card.shape, match:"double faced") then "626" ]
else "312" image_export_width := {
} base_width := if contains(card.shape, match:"split")
image_export_height := { if contains(card.shape, match:"split") and options.export_size == "MSE Standard" then "375" or contains(card.shape, match:"plane")
else if options.export_size == "MSE Standard" then "523" or contains(card.shape, match:"battle")
else if contains(card.shape, match:"split") and options.export_size == "LackeyCCG Medium" then "200" then 523
else if options.export_size == "LackeyCCG Medium" then "285" else if contains(card.shape, match:"double")
else if contains(card.shape, match:"split") then "312" then 752
else "445" else 375
} convert_size(base_width)
}
image_export_height := {
base_height := if contains(card.shape, match:"split")
or contains(card.shape, match:"plane")
or contains(card.shape, match:"battle")
then 375
else 523
convert_size(base_height)
}
convert_size := {
if options.export_size == "LackeyCCG Medium"
then medium_resizer[input] or else input
else if options.export_size == "LackeyCCG Large"
then large_resizer[input] or else input
else input
}
####################### Lackey Columns ####################### Lackey Columns
mse_to_lackeyccg_trim_duplicate_color := {to_text(if contains(input, match:"W") then "W") mse_to_lackeyccg_trim_duplicate_color := {to_text(if contains(input, match:"W") then "W")
+to_text(if contains(input, match:"U") then "U") +to_text(if contains(input, match:"U") then "U")
@@ -134,23 +144,23 @@ script:
####################### Used to name tokens ####################### Used to name tokens
color_condense := replace@(match:"(, )?(artifact|multicolor|land|hybrid|horizontal|vertical|radial|overlay)", replace: "") color_condense := replace@(match:"(, )?(artifact|multicolor|land|hybrid|horizontal|vertical|radial|overlay)", replace: "")
token_color_name := { if color_condense(card.card_color) = "colorless" then "colorless" token_color_name := { if color_condense(card.card_color) == "colorless" then "colorless"
else if color_condense(card.card_color) = "" and contains(card.type, match:"Artifact") or contains(card.type, match:"Land") then "colorless" else if color_condense(card.card_color) == "" and contains(card.type, match:"Artifact") or contains(card.type, match:"Land") then "colorless"
else if color_condense(card.card_color) = "white" then "white" else if color_condense(card.card_color) == "white" then "white"
else if color_condense(card.card_color) = "blue" then "blue" else if color_condense(card.card_color) == "blue" then "blue"
else if color_condense(card.card_color) = "black" then "black" else if color_condense(card.card_color) == "black" then "black"
else if color_condense(card.card_color) = "red" then "red" else if color_condense(card.card_color) == "red" then "red"
else if color_condense(card.card_color) = "green" then "green" else if color_condense(card.card_color) == "green" then "green"
else if color_condense(card.card_color) = "white, blue" then "white and blue" else if color_condense(card.card_color) == "white, blue" then "white and blue"
else if color_condense(card.card_color) = "blue, black" then "blue and black" else if color_condense(card.card_color) == "blue, black" then "blue and black"
else if color_condense(card.card_color) = "black, red" then "black and red" else if color_condense(card.card_color) == "black, red" then "black and red"
else if color_condense(card.card_color) = "red, green" then "red and green" else if color_condense(card.card_color) == "red, green" then "red and green"
else if color_condense(card.card_color) = "white, green" then "green and white" else if color_condense(card.card_color) == "white, green" then "green and white"
else if color_condense(card.card_color) = "white, black" then "white and black" else if color_condense(card.card_color) == "white, black" then "white and black"
else if color_condense(card.card_color) = "blue, red" then "blue and red" else if color_condense(card.card_color) == "blue, red" then "blue and red"
else if color_condense(card.card_color) = "black, green" then "black and green" else if color_condense(card.card_color) == "black, green" then "black and green"
else if color_condense(card.card_color) = "white, red" then "red and white" else if color_condense(card.card_color) == "white, red" then "red and white"
else if color_condense(card.card_color) = "blue, green" then "green and blue" else if color_condense(card.card_color) == "blue, green" then "green and blue"
else "" else ""
} }
@@ -178,45 +188,45 @@ script:
####################### These check if a card uses simultaneous Lackey scrips to add commas and semicolons where needed ####################### These check if a card uses simultaneous Lackey scrips to add commas and semicolons where needed
semi_search := { semi_search := {
if check = "init" and etbt_function() != "" and counter_function() != "" then ";" if check == "init" and etbt_function() != "" and counter_function() != "" then ";"
else if check = "loyalty1" and card.loyalty_cost_1 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";" else if check == "loyalty1" and card.loyalty_cost_1 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";"
else if check = "loyalty2" and card.loyalty_cost_2 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";" else if check == "loyalty2" and card.loyalty_cost_2 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";"
else if check = "loyalty3" and card.loyalty_cost_3 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";" else if check == "loyalty3" and card.loyalty_cost_3 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";"
else if check = "loyalty4" and card.loyalty_cost_4 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";" else if check == "loyalty4" and card.loyalty_cost_4 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";"
else if check = "loyalty5" and card.loyalty_cost_5 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";" else if check == "loyalty5" and card.loyalty_cost_5 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";"
else if check = "loyalty6" and card.loyalty_cost_6 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";" else if check == "loyalty6" and card.loyalty_cost_6 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";"
else if check = "loyalty7" and card.loyalty_cost_7 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";" else if check == "loyalty7" and card.loyalty_cost_7 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";"
else if check = "loyalty8" and card.loyalty_cost_8 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";" else if check == "loyalty8" and card.loyalty_cost_8 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";"
else if check = "special" and special_function() != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";" else if check == "special" and special_function() != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";"
else if check = "token1" and token_function_1(input) != "" and (token_function_2(input) != "" or token_function_3(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";" else if check == "token1" and token_function_1(input) != "" and (token_function_2(input) != "" or token_function_3(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";"
else if check = "token2" and token_function_2(input) != "" and (token_function_3(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";" else if check == "token2" and token_function_2(input) != "" and (token_function_3(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";"
else if check = "token3" and token_function_3(input) != "" and (scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";" else if check == "token3" and token_function_3(input) != "" and (scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";"
else if check = "scry" and scry_function(input) != "" and (look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";" else if check == "scry" and scry_function(input) != "" and (look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";"
else if check = "looktop" and look_top_function(input) != "" and (reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";" else if check == "looktop" and look_top_function(input) != "" and (reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";"
else if check = "revealtop" and reveal_top_function(input) != "" and (look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";" else if check == "revealtop" and reveal_top_function(input) != "" and (look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ";"
else if check = "lookbot" and look_bot_function(input) != "" and (reveal_bot_function(input) != "" or emblem_function(input) != "") then ";" else if check == "lookbot" and look_bot_function(input) != "" and (reveal_bot_function(input) != "" or emblem_function(input) != "") then ";"
else if check = "revealbot" and reveal_bot_function(input) != "" and (emblem_function(input) != "") then ";" else if check == "revealbot" and reveal_bot_function(input) != "" and (emblem_function(input) != "") then ";"
else "" else ""
} }
comma_search := { comma_search := {
if check = "init" and etbt_function() != "" and counter_function() != "" then ";" if check == "init" and etbt_function() != "" and counter_function() != "" then ";"
else if check = "loyalty1" and card.loyalty_cost_1 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", " else if check == "loyalty1" and card.loyalty_cost_1 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", "
else if check = "loyalty2" and card.loyalty_cost_2 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", " else if check == "loyalty2" and card.loyalty_cost_2 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", "
else if check = "loyalty3" and card.loyalty_cost_3 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", " else if check == "loyalty3" and card.loyalty_cost_3 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", "
else if check = "loyalty4" and card.loyalty_cost_4 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", " else if check == "loyalty4" and card.loyalty_cost_4 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", "
else if check = "loyalty5" and card.loyalty_cost_5 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", " else if check == "loyalty5" and card.loyalty_cost_5 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", "
else if check = "loyalty6" and card.loyalty_cost_6 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", " else if check == "loyalty6" and card.loyalty_cost_6 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", "
else if check = "loyalty7" and card.loyalty_cost_7 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", " else if check == "loyalty7" and card.loyalty_cost_7 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", "
else if check = "loyalty8" and card.loyalty_cost_8 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", " else if check == "loyalty8" and card.loyalty_cost_8 != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", "
else if check = "special" and special_function() != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", " else if check == "special" and special_function() != "" and (token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", "
else if check = "token1" and token_function_1(input) != "" and (token_function_2(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", " else if check == "token1" and token_function_1(input) != "" and (token_function_2(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", "
else if check = "token2" and token_function_2(input) != "" and (token_function_3(input) != "" or add_function(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", " else if check == "token2" and token_function_2(input) != "" and (token_function_3(input) != "" or add_function(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", "
else if check = "token3" and token_function_3(input) != "" and (scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", " else if check == "token3" and token_function_3(input) != "" and (scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", "
else if check = "scry" and scry_function(input) != "" and (look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", " else if check == "scry" and scry_function(input) != "" and (look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", "
else if check = "looktop" and look_top_function(input) != "" and (reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", " else if check == "looktop" and look_top_function(input) != "" and (reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", "
else if check = "revealtop" and reveal_top_function(input) != "" and (look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", " else if check == "revealtop" and reveal_top_function(input) != "" and (look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "") then ", "
else if check = "lookbot" and look_bot_function(input) != "" and (reveal_bot_function(input) != "" or emblem_function(input) != "") then ", " else if check == "lookbot" and look_bot_function(input) != "" and (reveal_bot_function(input) != "" or emblem_function(input) != "") then ", "
else if check = "revealbot" and reveal_bot_function(input) != "" and (emblem_function(input) != "") then ", " else if check == "revealbot" and reveal_bot_function(input) != "" and (emblem_function(input) != "") then ", "
else "" else ""
} }
####################### SCRIPTS ####################### SCRIPTS
@@ -280,16 +290,16 @@ script:
first_token := { if contains(multi_filter(filter_tokens(input)), match: "token") then split_text(match: "tokens?( with)?", filter_tokens(input)).0 + "token" else "" } first_token := { if contains(multi_filter(filter_tokens(input)), match: "token") then split_text(match: "tokens?( with)?", filter_tokens(input)).0 + "token" else "" }
second_token := { if contains(multi_filter(filter_tokens(input)), match: "tokentoken") then split_text(match: "tokens?( with)?", filter_tokens(input)).1 + "token" else "" } second_token := { if contains(multi_filter(filter_tokens(input)), match: "tokentoken") then split_text(match: "tokens?( with)?", filter_tokens(input)).1 + "token" else "" }
third_token := { if contains(multi_filter(filter_tokens(input)), match: "tokentokentoken") then split_text(match: "tokens?( with)?", filter_tokens(input)).2 + "token" else "" } third_token := { if contains(multi_filter(filter_tokens(input)), match: "tokentokentoken") then split_text(match: "tokens?( with)?", filter_tokens(input)).2 + "token" else "" }
token_function_1 := { if first_token(input) = "" then "" else if filter_name(first_token(input)) = "colorless Clue" and not no_investigate() then "" else "/spawn" + convert_digit_1(input) + (if filter_legend(first_token(input)) != "" then filter_legend(first_token(input)) else filter_name(first_token(input))) + " " + options.set_code } token_function_1 := { if first_token(input) == "" then "" else if filter_name(first_token(input)) == "colorless Clue" and not no_investigate() then "" else "/spawn" + convert_digit_1(input) + (if filter_legend(first_token(input)) != "" then filter_legend(first_token(input)) else filter_name(first_token(input))) + " " + options.set_code }
token_function_2 := { if second_token(input) = "" then "" else if filter_name(second_token(input)) = "colorless Clue" and not no_investigate() then "" else "/spawn" + convert_digit_2(input) + (if filter_legend(second_token(input)) != "" then filter_legend(second_token(input)) else filter_name(second_token(input))) + " " + options.set_code } token_function_2 := { if second_token(input) == "" then "" else if filter_name(second_token(input)) == "colorless Clue" and not no_investigate() then "" else "/spawn" + convert_digit_2(input) + (if filter_legend(second_token(input)) != "" then filter_legend(second_token(input)) else filter_name(second_token(input))) + " " + options.set_code }
token_function_3 := { if third_token(input) = "" then "" else if filter_name(third_token(input)) = "colorless Clue" and not no_investigate() then "" else "/spawn" + convert_digit_3(input) + (if filter_legend(third_token(input)) != "" then filter_legend(third_token(input)) else filter_name(third_token(input))) + " " + options.set_code } token_function_3 := { if third_token(input) == "" then "" else if filter_name(third_token(input)) == "colorless Clue" and not no_investigate() then "" else "/spawn" + convert_digit_3(input) + (if filter_legend(third_token(input)) != "" then filter_legend(third_token(input)) else filter_name(third_token(input))) + " " + options.set_code }
add_function := { if filter_adds(card.rule_text) = "" then "" else "/spawn" + convert_adds(input) + (if filter_legend(first_token(input)) != "" then filter_legend(first_token(input)) else filter_name(first_token(input))) + " " + options.set_code } add_function := { if filter_adds(card.rule_text) == "" then "" else "/spawn" + convert_adds(input) + (if filter_legend(first_token(input)) != "" then filter_legend(first_token(input)) else filter_name(first_token(input))) + " " + options.set_code }
token_label_1 := { if first_token(input) = "" then "" else (if contains(filter_type(first_token(input)), match: "Kraken") then "Release the " else "Spawn ") + (if filter_legend(first_token(input)) != "" then filter_legend(first_token(input)) else filter_type(first_token(input))) + (if convert_digit_1(input) != " " then " tokens")} token_label_1 := { if first_token(input) == "" then "" else (if contains(filter_type(first_token(input)), match: "Kraken") then "Release the " else "Spawn ") + (if filter_legend(first_token(input)) != "" then filter_legend(first_token(input)) else filter_type(first_token(input))) + (if convert_digit_1(input) != " " then " tokens")}
token_label_2 := { if second_token(input) = "" then "" else "Spawn " + (if filter_legend(second_token(input)) != "" then filter_legend(second_token(input)) else filter_type(second_token(input))) + (if convert_digit_2(input) != " " then " tokens")} token_label_2 := { if second_token(input) == "" then "" else "Spawn " + (if filter_legend(second_token(input)) != "" then filter_legend(second_token(input)) else filter_type(second_token(input))) + (if convert_digit_2(input) != " " then " tokens")}
token_label_3 := { if third_token(input) = "" then "" else "Spawn " + (if filter_legend(third_token(input)) != "" then filter_legend(third_token(input)) else filter_type(third_token(input))) + (if convert_digit_3(input) != " " then " tokens")} token_label_3 := { if third_token(input) == "" then "" else "Spawn " + (if filter_legend(third_token(input)) != "" then filter_legend(third_token(input)) else filter_type(third_token(input))) + (if convert_digit_3(input) != " " then " tokens")}
add_label := { if filter_adds(card.rule_text) = "" then "" else "Spawn many " + (if filter_legend(first_token(input)) != "" then filter_legend(first_token(input)) else filter_type(first_token(input))) + (if convert_adds() != " " then " tokens")} add_label := { if filter_adds(card.rule_text) == "" then "" else "Spawn many " + (if filter_legend(first_token(input)) != "" then filter_legend(first_token(input)) else filter_type(first_token(input))) + (if convert_adds() != " " then " tokens")}
emblem_function := { if filter_emblem(input) = "" then "" else "/spawn " + (if contains(card.type_2, match:"Planeswalker") then card.sub_type_2 else card.sub_type) + "Emblem " + options.set_code } emblem_function := { if filter_emblem(input) == "" then "" else "/spawn " + (if contains(card.type_2, match:"Planeswalker") then card.sub_type_2 else card.sub_type) + "Emblem " + options.set_code }
emblem_label := { if filter_emblem(input) = "" then "" else "Emblem Get" } emblem_label := { if filter_emblem(input) == "" then "" else "Emblem Get" }
####################### MANIPULATION ####################### MANIPULATION
####################### Filters for library manipulation scripts ####################### Filters for library manipulation scripts
@@ -298,39 +308,40 @@ script:
filter_reveal := filter_text@(match: "(card|two cards|three cards|four cards|five cards|six cards|seven cards|eight cards|nine cards|ten cards|eleven cards|twelve cards|thirteen cards|fourteen cards|fifteen cards|sixteen cards|seventeen cards|eighteen cards|nineteen cards|twenty cards)", in_context: "([Rr]eveals?|[Ee]xiles?) the top <match> of") filter_reveal := filter_text@(match: "(card|two cards|three cards|four cards|five cards|six cards|seven cards|eight cards|nine cards|ten cards|eleven cards|twelve cards|thirteen cards|fourteen cards|fifteen cards|sixteen cards|seventeen cards|eighteen cards|nineteen cards|twenty cards)", in_context: "([Rr]eveals?|[Ee]xiles?) the top <match> of")
filter_bottom := filter_text@(match: "(card|two cards|three cards|four cards|five cards|six cards|seven cards|eight cards|nine cards|ten cards|eleven cards|twelve cards|thirteen cards|fourteen cards|fifteen cards|sixteen cards|seventeen cards|eighteen cards|nineteen cards|twenty cards)", in_context: "([Ll]ooks? at|[Pp]uts?) the bottom <match> of") filter_bottom := filter_text@(match: "(card|two cards|three cards|four cards|five cards|six cards|seven cards|eight cards|nine cards|ten cards|eleven cards|twelve cards|thirteen cards|fourteen cards|fifteen cards|sixteen cards|seventeen cards|eighteen cards|nineteen cards|twenty cards)", in_context: "([Ll]ooks? at|[Pp]uts?) the bottom <match> of")
filter_reveal_bottom := filter_text@(match: "(card|two cards|three cards|four cards|five cards|six cards|seven cards|eight cards|nine cards|ten cards|eleven cards|twelve cards|thirteen cards|fourteen cards|fifteen cards|sixteen cards|seventeen cards|eighteen cards|nineteen cards|twenty cards)", in_context: "([Rr]eveals?|[Ee]xile)s? the bottom <match> of") filter_reveal_bottom := filter_text@(match: "(card|two cards|three cards|four cards|five cards|six cards|seven cards|eight cards|nine cards|ten cards|eleven cards|twelve cards|thirteen cards|fourteen cards|fifteen cards|sixteen cards|seventeen cards|eighteen cards|nineteen cards|twenty cards)", in_context: "([Rr]eveals?|[Ee]xile)s? the bottom <match> of")
library_numbers:= { if input = "card" then "1" library_numbers:= { if input == "card" then "1"
else if input = "two cards" then "2" else if input == "two cards" then "2"
else if input = "three cards" then "3" else if input == "three cards" then "3"
else if input = "four cards" then "4" else if input == "four cards" then "4"
else if input = "five cards" then "5" else if input == "five cards" then "5"
else if input = "six cards" then "6" else if input == "six cards" then "6"
else if input = "seven cards" then "7" else if input == "seven cards" then "7"
else if input = "eight cards" then "8" else if input == "eight cards" then "8"
else if input = "nine cards" then "9" else if input == "nine cards" then "9"
else if input = "ten cards" then "10" else if input == "ten cards" then "10"
else if input = "eleven cards" then "11" else if input == "eleven cards" then "11"
else if input = "twelve cards" then "12" else if input == "twelve cards" then "12"
else if input = "thirteen cards" then "13" else if input == "thirteen cards" then "13"
else if input = "fourteen cards" then "14" else if input == "fourteen cards" then "14"
else if input = "fifteen cards" then "15" else if input == "fifteen cards" then "15"
else if input = "sixteen cards" then "16" else if input == "sixteen cards" then "16"
else if input = "seventeen cards" then "17" else if input == "seventeen cards" then "17"
else if input = "eighteen cards" then "18" else if input == "eighteen cards" then "18"
else if input = "ninteen cards" then "19" else if input == "ninteen cards" then "19"
else if input = "twenty cards" then "20" else if input == "twenty cards" then "20"
else "1"
} }
####################### Scry often has reminder text, so we only take the first digit of the scry filter ####################### Scry often has reminder text, so we only take the first digit of the scry filter
scry_label := { if filter_scry(scry_replacement(input)) = "" then "" else "Scry " + filter_scry(scry_replacement(input)).0 } scry_label := { if filter_scry(scry_replacement(input)) == "" then "" else "Scry " + filter_scry(scry_replacement(input)).0 }
scry_function := { if filter_scry(scry_replacement(input)) = "" then "" else "/vp1pt" + filter_scry(scry_replacement(input)).0 } scry_function := { if filter_scry(scry_replacement(input)) == "" then "" else "/vp1pt" + filter_scry(scry_replacement(input)).0 }
look_top_label := { if filter_look(input) = "" then "" else if filter_scry(input) != "" then "" else "Look at top " + library_numbers(filter_look(input)) } look_top_label := { if filter_look(input) == "" then "" else if filter_scry(input) != "" then "" else "Look at top " + library_numbers(filter_look(input)) }
look_top_function := { if look_top_label(input) = "" then "" else "/vp1pt" + library_numbers(filter_look(input)) } look_top_function := { if look_top_label(input) == "" then "" else "/vp1pt" + library_numbers(filter_look(input)) }
look_bot_label := { if filter_bottom(input) = "" then "" else "Look at bottom " + library_numbers(filter_bottom(input)) } look_bot_label := { if filter_bottom(input) == "" then "" else "Look at bottom " + library_numbers(filter_bottom(input)) }
look_bot_function := { if filter_bottom(input) = "" then "" else "/vp1pb" + library_numbers(filter_bottom(input)) } look_bot_function := { if filter_bottom(input) == "" then "" else "/vp1pb" + library_numbers(filter_bottom(input)) }
reveal_top_label := { if filter_reveal(input) = "" then "" else "Reveal top " + library_numbers(filter_reveal(input)) } reveal_top_label := { if filter_reveal(input) == "" then "" else "Reveal top " + library_numbers(filter_reveal(input)) }
reveal_top_function := { if filter_reveal(input) = "" then "" else "/vp1at" + library_numbers(filter_reveal(input)) } reveal_top_function := { if filter_reveal(input) == "" then "" else "/vp1at" + library_numbers(filter_reveal(input)) }
reveal_bot_label := { if filter_reveal_bottom(input) = "" then "" else "Reveal bottom " + library_numbers(filter_reveal_bottom(input)) } reveal_bot_label := { if filter_reveal_bottom(input) == "" then "" else "Reveal bottom " + library_numbers(filter_reveal_bottom(input)) }
reveal_bot_function := { if filter_reveal_bottom(input) = "" then "" else "/vp1ab" + library_numbers(filter_reveal_bottom(input)) } reveal_bot_function := { if filter_reveal_bottom(input) == "" then "" else "/vp1ab" + library_numbers(filter_reveal_bottom(input)) }
####################### COUNTERS ####################### COUNTERS
####################### Initial counter script scripts ####################### Initial counter script scripts
@@ -348,6 +359,7 @@ script:
else if contains(input, match: "three") then "3" else if contains(input, match: "three") then "3"
else if contains(input, match: "two") then "2" else if contains(input, match: "two") then "2"
else if contains(input, match: "a") then "1" else if contains(input, match: "a") then "1"
else "1"
} }
loyalty_check := { contains(input, match:"+") or contains(input, match:"-") } loyalty_check := { contains(input, match:"+") or contains(input, match:"-") }
@@ -360,14 +372,14 @@ script:
} }
use_scripts := { token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "" } use_scripts := { token_function_1(input) != "" or scry_function(input) != "" or look_top_function(input) != "" or reveal_top_function(input) != "" or look_bot_function(input) != "" or reveal_bot_function(input) != "" or emblem_function(input) != "" }
normal_script := { "\<s>\<l>" normal_script := { "\<s>\<l>"
+ (if walker = "one" and loyalty_check(card.loyalty_cost_1) then card.loyalty_cost_1 + comma_search(check: "loyalty1", input) else "") + (if walker == "one" and loyalty_check(card.loyalty_cost_1) then card.loyalty_cost_1 + comma_search(check: "loyalty1", input) else "")
+ (if walker = "two" and loyalty_check(card.loyalty_cost_2) then card.loyalty_cost_2 + comma_search(check: "loyalty2", input) else "") + (if walker == "two" and loyalty_check(card.loyalty_cost_2) then card.loyalty_cost_2 + comma_search(check: "loyalty2", input) else "")
+ (if walker = "three" and loyalty_check(card.loyalty_cost_3) then card.loyalty_cost_3 + comma_search(check: "loyalty3", input) else "") + (if walker == "three" and loyalty_check(card.loyalty_cost_3) then card.loyalty_cost_3 + comma_search(check: "loyalty3", input) else "")
+ (if walker = "four" and loyalty_check(card.loyalty_cost_4) then card.loyalty_cost_4 + comma_search(check: "loyalty4", input) else "") + (if walker == "four" and loyalty_check(card.loyalty_cost_4) then card.loyalty_cost_4 + comma_search(check: "loyalty4", input) else "")
+ (if walker = "five" and loyalty_check(card.loyalty_cost_5) then card.loyalty_cost_5 + comma_search(check: "loyalty5", input) else "") + (if walker == "five" and loyalty_check(card.loyalty_cost_5) then card.loyalty_cost_5 + comma_search(check: "loyalty5", input) else "")
+ (if walker = "six" and loyalty_check(card.loyalty_cost_6) then card.loyalty_cost_6 + comma_search(check: "loyalty6", input) else "") + (if walker == "six" and loyalty_check(card.loyalty_cost_6) then card.loyalty_cost_6 + comma_search(check: "loyalty6", input) else "")
+ (if walker = "seven" and loyalty_check(card.loyalty_cost_7) then card.loyalty_cost_7 + comma_search(check: "loyalty7", input) else "") + (if walker == "seven" and loyalty_check(card.loyalty_cost_7) then card.loyalty_cost_7 + comma_search(check: "loyalty7", input) else "")
+ (if walker = "eight" and loyalty_check(card.loyalty_cost_8) then card.loyalty_cost_8 + comma_search(check: "loyalty8", input) else "") + (if walker == "eight" and loyalty_check(card.loyalty_cost_8) then card.loyalty_cost_8 + comma_search(check: "loyalty8", input) else "")
+ token_label_1(input) + comma_search(check: "token1", input) + token_label_1(input) + comma_search(check: "token1", input)
+ token_label_2(input) + comma_search(check: "token2", input) + token_label_2(input) + comma_search(check: "token2", input)
+ token_label_3(input) + comma_search(check: "token3", input) + token_label_3(input) + comma_search(check: "token3", input)
@@ -378,14 +390,14 @@ script:
+ reveal_bot_label(input) + comma_search(check: "revealbot", input) + reveal_bot_label(input) + comma_search(check: "revealbot", input)
+ emblem_label(input) + emblem_label(input)
+ "\</l>\<f>" + "\</l>\<f>"
+ (if walker = "one" and loyalty_check(card.loyalty_cost_1) then "/ccgreen" + card.loyalty_cost_1 + semi_search(check: "loyalty1", input) else "") + (if walker == "one" and loyalty_check(card.loyalty_cost_1) then "/ccgreen" + card.loyalty_cost_1 + semi_search(check: "loyalty1", input) else "")
+ (if walker = "two" and loyalty_check(card.loyalty_cost_2) then "/ccgreen" + card.loyalty_cost_2 + semi_search(check: "loyalty2", input) else "") + (if walker == "two" and loyalty_check(card.loyalty_cost_2) then "/ccgreen" + card.loyalty_cost_2 + semi_search(check: "loyalty2", input) else "")
+ (if walker = "three" and loyalty_check(card.loyalty_cost_3) then "/ccgreen" + card.loyalty_cost_3 + semi_search(check: "loyalty3", input) else "") + (if walker == "three" and loyalty_check(card.loyalty_cost_3) then "/ccgreen" + card.loyalty_cost_3 + semi_search(check: "loyalty3", input) else "")
+ (if walker = "four" and loyalty_check(card.loyalty_cost_4) then "/ccgreen" + card.loyalty_cost_4 + semi_search(check: "loyalty4", input) else "") + (if walker == "four" and loyalty_check(card.loyalty_cost_4) then "/ccgreen" + card.loyalty_cost_4 + semi_search(check: "loyalty4", input) else "")
+ (if walker = "five" and loyalty_check(card.loyalty_cost_5) then "/ccgreen" + card.loyalty_cost_5 + semi_search(check: "loyalty5", input) else "") + (if walker == "five" and loyalty_check(card.loyalty_cost_5) then "/ccgreen" + card.loyalty_cost_5 + semi_search(check: "loyalty5", input) else "")
+ (if walker = "six" and loyalty_check(card.loyalty_cost_6) then "/ccgreen" + card.loyalty_cost_6 + semi_search(check: "loyalty6", input) else "") + (if walker == "six" and loyalty_check(card.loyalty_cost_6) then "/ccgreen" + card.loyalty_cost_6 + semi_search(check: "loyalty6", input) else "")
+ (if walker = "seven" and loyalty_check(card.loyalty_cost_7) then "/ccgreen" + card.loyalty_cost_7 + semi_search(check: "loyalty7", input) else "") + (if walker == "seven" and loyalty_check(card.loyalty_cost_7) then "/ccgreen" + card.loyalty_cost_7 + semi_search(check: "loyalty7", input) else "")
+ (if walker = "eight" and loyalty_check(card.loyalty_cost_8) then "/ccgreen" + card.loyalty_cost_8 + semi_search(check: "loyalty8", input) else "") + (if walker == "eight" and loyalty_check(card.loyalty_cost_8) then "/ccgreen" + card.loyalty_cost_8 + semi_search(check: "loyalty8", input) else "")
+ token_function_1(input) + semi_search(check: "token1", input) + token_function_1(input) + semi_search(check: "token1", input)
+ token_function_2(input) + semi_search(check: "token2", input) + token_function_2(input) + semi_search(check: "token2", input)
+ token_function_3(input) + semi_search(check: "token3", input) + token_function_3(input) + semi_search(check: "token3", input)
@@ -401,8 +413,8 @@ script:
five_replace := replace@(match: "Spawn", "Spawn five") five_replace := replace@(match: "Spawn", "Spawn five")
x_replace := replace@(match: "/spawn ", "/spawnx5 ") x_replace := replace@(match: "/spawn ", "/spawnx5 ")
walker_scripts := { walker_scripts := {
(if etbt_function() != "" or counter_function() != "" then "\<s>\<a>y\</a>\<l>Initialize\</l>\<f>" + etbt_function() + semi_search(check: "init", card.rule_text) + counter_function() + "\</f>\</s>") (if etbt_function() != "" or counter_function() != "" then "\<s>\<a>y\</a>\<l>Initialize\</l>\<f>" + etbt_function() + semi_search(check: "init", card.rule_text) + counter_function() + "\</f>\</s>" else "")
+(if special_label() != "" then "\<s>\<l>" + special_label() + "\</l>\<f>" + special_function() + "\</f>\</s>") +(if special_label() != "" then "\<s>\<l>" + special_label() + "\</l>\<f>" + special_function() + "\</f>\</s>" else "")
+(if loyalty_check(card.loyalty_cost_1) or use_scripts(paragraph_one()) then normal_script(walker: "one", paragraph_one()) else "") +(if loyalty_check(card.loyalty_cost_1) or use_scripts(paragraph_one()) then normal_script(walker: "one", paragraph_one()) else "")
+(if loyalty_check(card.loyalty_cost_2) or use_scripts(paragraph_two()) then normal_script(walker: "two", paragraph_two()) else "") +(if loyalty_check(card.loyalty_cost_2) or use_scripts(paragraph_two()) then normal_script(walker: "two", paragraph_two()) else "")
+(if loyalty_check(card.loyalty_cost_3) or use_scripts(paragraph_three()) then normal_script(walker: "three", paragraph_three()) else "") +(if loyalty_check(card.loyalty_cost_3) or use_scripts(paragraph_three()) then normal_script(walker: "three", paragraph_three()) else "")
@@ -413,8 +425,8 @@ script:
+(if loyalty_check(card.loyalty_cost_8) or use_scripts(paragraph_eight()) then normal_script(walker: "eight", paragraph_eight()) else "") +(if loyalty_check(card.loyalty_cost_8) or use_scripts(paragraph_eight()) then normal_script(walker: "eight", paragraph_eight()) else "")
} }
normal_scripts := { normal_scripts := {
(if etbt_function() != "" or counter_function() != "" then "\<s>\<a>y\</a>\<l>Initialize\</l>\<f>" + etbt_function() + semi_search(check: "init", card.rule_text) + counter_function() + "\</f>\</s>") (if etbt_function() != "" or counter_function() != "" then "\<s>\<a>y\</a>\<l>Initialize\</l>\<f>" + etbt_function() + semi_search(check: "init", card.rule_text) + counter_function() + "\</f>\</s>" else "")
+(if special_label() != "" then "\<s>\<l>" + special_label() + "\</l>\<f>" + special_function() + "\</f>\</s>") +(if special_label() != "" then "\<s>\<l>" + special_label() + "\</l>\<f>" + special_function() + "\</f>\</s>" else "")
+(if use_scripts(paragraph_one()) then normal_script(walker: "no", paragraph_one()) else "") +(if use_scripts(paragraph_one()) then normal_script(walker: "no", paragraph_one()) else "")
+(if use_scripts(paragraph_two()) then normal_script(walker: "no", paragraph_two()) else "") +(if use_scripts(paragraph_two()) then normal_script(walker: "no", paragraph_two()) else "")
+(if use_scripts(paragraph_three()) then normal_script(walker: "no", paragraph_three()) else "") +(if use_scripts(paragraph_three()) then normal_script(walker: "no", paragraph_three()) else "")
@@ -425,7 +437,7 @@ script:
+(if use_scripts(paragraph_eight()) then normal_script(walker: "no", paragraph_eight()) else "") +(if use_scripts(paragraph_eight()) then normal_script(walker: "no", paragraph_eight()) else "")
+(if add_label(card.rule_text) != "" then "\<s>\<l>" + add_label(card.rule_text) + "\</l>\<f>" + add_function(card.rule_text) + "\</f>\</s>" ) +(if add_label(card.rule_text) != "" then "\<s>\<l>" + add_label(card.rule_text) + "\</l>\<f>" + add_function(card.rule_text) + "\</f>\</s>" )
} }
write_normal := {card_name()+(if card.rarity = "special" then ".")+" " write_normal := {card_name()+(if card.rarity == "special" then ".")+" "
+options.set_code+" " +options.set_code+" "
+corrected_card_number()+(if card.rarity == "special" then "s" else "")+" " +corrected_card_number()+(if card.rarity == "special" then "s" else "")+" "
+(if contains(card.type, match:"Basic Land") then "0" +(if contains(card.type, match:"Basic Land") then "0"
@@ -441,7 +453,7 @@ script:
+mse_to_lackeyccg_rules_filter(card.rule_text) +mse_to_lackeyccg_rules_filter(card.rule_text)
+"\n" +"\n"
} }
write_split := {card_name()+" // "+card.name_2+(if card.rarity = "special" then ".")+" " write_split := {card_name()+" // "+card.name_2+(if card.rarity == "special" then ".")+" "
+options.set_code+" " +options.set_code+" "
+corrected_card_number()+(if card.rarity == "special" then "s" else "")+" " +corrected_card_number()+(if card.rarity == "special" then "s" else "")+" "
+(if contains(card.type, match:"Land") then "L" +(if contains(card.type, match:"Land") then "L"
@@ -457,7 +469,7 @@ script:
+mse_to_lackeyccg_rules_filter(card.rule_text)+" // "+mse_to_lackeyccg_rules_filter(card.rule_text_2) +mse_to_lackeyccg_rules_filter(card.rule_text)+" // "+mse_to_lackeyccg_rules_filter(card.rule_text_2)
+"\n" +"\n"
} }
write_flip := {card_name()+(if card.rarity = "special" then ".")+" " write_flip := {card_name()+(if card.rarity == "special" then ".")+" "
+options.set_code+" " +options.set_code+" "
+corrected_card_number()+(if card.rarity == "special" then "s" else "")+" " +corrected_card_number()+(if card.rarity == "special" then "s" else "")+" "
+(if contains(card.type, match:"Land") then "L" +(if contains(card.type, match:"Land") then "L"
@@ -477,7 +489,7 @@ script:
+mse_to_lackeyccg_rules_filter(card.rule_text_2) +mse_to_lackeyccg_rules_filter(card.rule_text_2)
+"\n" +"\n"
} }
write_dfc := {card_name()+(if card.rarity = "special" then ".")+" " write_dfc := {card_name()+(if card.rarity == "special" then ".")+" "
+options.set_code+" " +options.set_code+" "
+corrected_card_number()+(if card.rarity == "special" then "as" else "a")+","+corrected_card_number()+(if card.rarity == "special" then "bs" else "b")+" " +corrected_card_number()+(if card.rarity == "special" then "as" else "a")+","+corrected_card_number()+(if card.rarity == "special" then "bs" else "b")+" "
+(if contains(card.type, match:"Land") then "L" +(if contains(card.type, match:"Land") then "L"
@@ -497,7 +509,7 @@ script:
+mse_to_lackeyccg_rules_filter(card.rule_text_2) +mse_to_lackeyccg_rules_filter(card.rule_text_2)
+"\n" +"\n"
} }
write_walker := {card_name()+(if card.rarity = "special" then ".")+" " write_walker := {card_name()+(if card.rarity == "special" then ".")+" "
+options.set_code+" " +options.set_code+" "
+corrected_card_number()+(if card.rarity == "special" then "s" else "")+" " +corrected_card_number()+(if card.rarity == "special" then "s" else "")+" "
+(if contains(card.type, match:"Land") then "L" +(if contains(card.type, match:"Land") then "L"
@@ -522,7 +534,7 @@ script:
+mse_to_lackeyccg_rules_filter(paragraph_four()) +mse_to_lackeyccg_rules_filter(paragraph_four())
+"\n" +"\n"
} }
write_sparker := {card_name()+(if card.rarity = "special" then ".")+" " write_sparker := {card_name()+(if card.rarity == "special" then ".")+" "
+options.set_code+" " +options.set_code+" "
+corrected_card_number()+(if card.rarity == "special" then "as" else "a")+","+corrected_card_number()+(if card.rarity == "special" then "bs" else "b")+" " +corrected_card_number()+(if card.rarity == "special" then "as" else "a")+","+corrected_card_number()+(if card.rarity == "special" then "bs" else "b")+" "
+(if contains(card.type, match:"Land") then "L" else mse_to_lackeyccg_trim_duplicate_color(mse_to_lackeyccg_color_filter(card.card_color)))+" " +(if contains(card.type, match:"Land") then "L" else mse_to_lackeyccg_trim_duplicate_color(mse_to_lackeyccg_color_filter(card.card_color)))+" "
@@ -583,7 +595,7 @@ script:
+mse_to_lackeyccg_rules_filter(card.rule_text_2) +mse_to_lackeyccg_rules_filter(card.rule_text_2)
+"\n" +"\n"
} }
write_dfc_walker := {card_name()+(if card.rarity = "special" then ".")+" " write_dfc_walker := {card_name()+(if card.rarity == "special" then ".")+" "
+options.set_code+" " +options.set_code+" "
+corrected_card_number()+(if card.rarity == "special" then "s" else "")+" " +corrected_card_number()+(if card.rarity == "special" then "s" else "")+" "
+(if contains(card.type, match:"Land") then "L" +(if contains(card.type, match:"Land") then "L"
@@ -624,7 +636,7 @@ script:
+mse_to_lackeyccg_rules_filter(paragraph_eight()) +mse_to_lackeyccg_rules_filter(paragraph_eight())
+"\n" +"\n"
} }
write_leveler := {card_name()+(if card.rarity = "special" then ".")+" " write_leveler := {card_name()+(if card.rarity == "special" then ".")+" "
+options.set_code+" " +options.set_code+" "
+corrected_card_number()+(if card.rarity == "special" then "s" else "")+" " +corrected_card_number()+(if card.rarity == "special" then "s" else "")+" "
+(if contains(card.type, match:"Land") then "L" +(if contains(card.type, match:"Land") then "L"
@@ -645,25 +657,44 @@ script:
+card.rule_text_2 +card.rule_text_2
+(if card.pt_3 !="" then " ("+card.pt_2+") ") +(if card.pt_3 !="" then " ("+card.pt_2+") ")
+"\n" +"\n"
} }
write_token := { (if contains(card.type, match:"Legendary") then card_name() + " " + options.set_code else if card_name() == "Clue" or card_name() == "Gold" then "colorless " + card_name() + " " + options.set_code else if card_name() == "Morph" or card_name() == "Manifest" then card_name() else (if contains(card.type, match:"Emblem") then card.sub_type else (if card.pt != "" then token_pt_fix(card.pt) + " ") + token_color_name()+ " ")+card_name()+" "+options.set_code)+" " write_token := {
+"tokens " (
+options.set_code+corrected_card_number()+(if card.rarity == "special" then "s" else "")+" " if contains(card.type, match:"Legendary")
+(if contains(card.type, match:"Basic Land") then "0" then card_name() + " " + options.set_code
else if contains(card.type, match:"Land") then "L" else if card_name() == "Clue" or card_name() == "Gold"
else mse_to_lackeyccg_trim_duplicate_color(mse_to_lackeyccg_color_filter(card.card_color)))+" " then "colorless " + card_name() + " " + options.set_code
+card.casting_cost+" " else if card_name() == "Morph" or card_name() == "Manifest"
+cmc(card.casting_cost)+" " then card_name()
+"Token " else (
+card.power+" " if contains(card.type, match:"Emblem")
+card.toughness+" " then card.sub_type
+"T " else (if card.pt != "" then token_pt_fix(card.pt) + " " else "") + token_color_name()+ " "
+" " ) + card_name() + " " + options.set_code
+normal_scripts()+" " )
+mse_to_lackeyccg_rules_filter(card.rule_text) + " "
+"\n" + "tokens "
} + options.set_code + corrected_card_number() + (if card.rarity == "special" then "s" else "") + " "
write_saga := {card_name()+(if card.rarity = "special" then ".")+" " + (
if contains(card.type, match:"Basic Land")
then "0"
else if contains(card.type, match:"Land")
then "L"
else mse_to_lackeyccg_trim_duplicate_color(mse_to_lackeyccg_color_filter(card.card_color))
)
+ " "
+ card.casting_cost + " "
+ cmc(card.casting_cost) + " "
+ "Token "
+ card.power + " "
+ card.toughness + " "
+ "T "
+ " "
+ normal_scripts() + " "
+ mse_to_lackeyccg_rules_filter(card.rule_text)
+ "\n"
}
write_saga := {card_name()+(if card.rarity == "special" then ".")+" "
+options.set_code+" " +options.set_code+" "
+corrected_card_number()+(if card.rarity == "special" then "s" else "")+" " +corrected_card_number()+(if card.rarity == "special" then "s" else "")+" "
+(if contains(card.type, match:"Basic Land") then "0" +(if contains(card.type, match:"Basic Land") then "0"
@@ -678,7 +709,7 @@ script:
+normal_scripts()+" " +normal_scripts()+" "
+mse_to_lackeyccg_rules_filter(card.special_text) +mse_to_lackeyccg_rules_filter(card.special_text)
+"\n" +"\n"
} }
write_card := { if contains(card.shape, match:"token") or contains(card.shape, match:"emblem") or contains(card.super_type, match:"Token") or contains(card.super_type, match:"Emblem") or contains(card.type, match:"Reminder") then write_token() write_card := { if contains(card.shape, match:"token") or contains(card.shape, match:"emblem") or contains(card.super_type, match:"Token") or contains(card.super_type, match:"Emblem") or contains(card.type, match:"Reminder") then write_token()
else if contains(card.shape, match:"rulestip") then "" else if contains(card.shape, match:"rulestip") then ""
else if contains(card.shape, match:"counter") then write_token() else if contains(card.shape, match:"counter") then write_token()
@@ -692,7 +723,63 @@ script:
else if card.loyalty != "" then write_walker() else if card.loyalty != "" then write_walker()
else if contains(card.shape, match:"leveler") then write_leveler() else if contains(card.shape, match:"leveler") then write_leveler()
else write_normal() else write_normal()
} }
image_file_name := {
(
if contains(card.super_type, match:"Token")
or contains(card.super_type, match:"Emblem")
or contains(card.shape, match:"token")
or contains(card.shape, match:"emblem")
or card_name() == "Morph"
or card_name() == "Manifest"
then options.set_code
else ""
)
+ corrected_card_number()
+ fillin
+ (if card.rarity == "special" then "s" else "")
+ ".jpg"
}@(fillin:"")
write_card_image := {
if length(card.stylesheet.card_regions) > 0
then write_multi_images();
write_image_file(
card,
directory: to_lower(options.set_code),
file: image_file_name(),
width: image_export_width(),
height: image_export_height()
)
}
write_multi_images := {
card_image := to_card_image(card)
for i from 0 to length(card.stylesheet.card_regions)-1 do (
region_info := card.stylesheet.card_regions[i]
region_name := region_info.name
fillin := if region_name == "front" or region_name == "minifront" or region_name == "meldpair"
then "a"
else if region_name == "back" or region_name == "meldback" or region_name == "meld"
then "b"
else if region_name == "thirdcard"
then "c"
else region_name
region := crop(
card_image,
height: region_info.height,
width: region_info.width,
offset_x: region_info.x,
offset_y: region_info.y
)
write_image_file(
region,
directory: to_lower(options.set_code),
file: image_file_name(fillin:fillin),
width: convert_size(region_info.width),
height: convert_size(region_info.height)
)
)
}
write_cards := to_text(for each card in cards do write_card()) write_cards := to_text(for each card in cards do write_card())
write_images := if options.export_images then for each card in sort_list(cards, order_by: {card.card_number}) do write_image_file(card, directory: "{to_lower(options.set_code)}", file:"{if contains(card.super_type, match:"Token") or contains(card.super_type, match:"Emblem") or contains(card.shape, match:"token") or contains(card.shape, match:"emblem") or card_name() == "Morph" or card_name() == "Manifest" then options.set_code+corrected_card_number() else corrected_card_number()}{if other_face() and not contains(options.dfc_options, match:"Both faces") then "a" else if is_backface() then "b" else ""}{if card.rarity == "special" then "s" else ""}.jpg", width: image_export_width(), height: image_export_height()) write_images := if options.export_images then (for each card in sort_list(cards, order_by: {card.card_number}) do write_card_image()) else ""
to_string("Name Set ImageFile Color Cost ConvertedCost Type Power Toughness Rarity Script Text\n"+last_replace(write_cards)) to_string("Name Set ImageFile Color Cost ConvertedCost Type Power Toughness Rarity Script Text\n"+last_replace(write_cards))

View File

@@ -32,6 +32,19 @@ depends on:
card width: 752 card width: 752
card height: 523 card height: 523
card dpi: 150 card dpi: 150
card region:
name: front
x: 0
y: 0
height: 523
width: 375
card region:
name: back
x: 377
y: 0
height: 523
width: 375
############################################################## Extra scripts ############################################################## Extra scripts
init script: init script:
####### Shape things ####### Shape things

View File

@@ -93,7 +93,7 @@ init script:
masked_blend(dark:invert_image(double_mask), light:cropped, mask:double_mask) masked_blend(dark:invert_image(double_mask), light:cropped, mask:double_mask)
} }
card_shape := { "plane card" } card_shape := { "mini plane card" }
margin_left := { margin_left := {
if input == "text2" then 310 else 0 if input == "text2" then 310 else 0

View File

@@ -1,7 +1,7 @@
mse version: 2.0.0 mse version: 2.0.0
game: magic game: magic
short name: EMN Meld (3-in-1) short name: EMN Meld (3-in-1)
full name: M15 Style Meld cards (3-in-1) full name: M15 Style Meld cards (3-in-1)
icon: card-sample.png icon: card-sample.png
position hint: 066 position hint: 066
installer group: magic/m15 style/double faced installer group: magic/m15 style/double faced
@@ -26,6 +26,36 @@ depends on:
card width: 568 card width: 568
card height: 523 card height: 523
card dpi: 150 card dpi: 150
card region:
name: minifront
x: 0
y: 0
height: 261
width: 188
card region:
name: meldpair
x: 0
y: 263
height: 261
width: 188
card region:
name: meld
x: 193
y: 0
width: 375
height: 523
card region:
name: front
x: 0
y: 0
width: 375
height: 523
card region:
name: meldback
x: 193
y: 0
width: 375
height: 523
############################################################## Extra scripts ############################################################## Extra scripts
init script: init script:
# Load scripts for image box # Load scripts for image box

View File

@@ -29,6 +29,18 @@ depends on:
card width: 752 card width: 752
card height: 523 card height: 523
card dpi: 150 card dpi: 150
card region:
name: front
x: 0
y: 0
height: 523
width: 375
card region:
name: back
x: 377
y: 0
height: 523
width: 375
####### images from digiman ####### images from digiman
############################################################## Extra scripts ############################################################## Extra scripts
init script: init script:

View File

@@ -1,7 +1,7 @@
mse version: 2.0.0 mse version: 2.0.0
short name: MWS short name: MWS
full name: Plugin Exporter full name: Plugin Exporter
position hint: 005 position hint: 900
icon: icon.png icon: icon.png
version: 2014-01-20 version: 2014-01-20
#Remember to update version at bottom of file. #Remember to update version at bottom of file.
@@ -370,8 +370,8 @@ script:
else if contains(card.shape, match:"leveler") then write_leveler() else if contains(card.shape, match:"leveler") then write_leveler()
else write_normal() else write_normal()
} }
write_cards := to_text(for each card in sort_list(cards, order_by: {card.card_number}) do write_card()) write_cards := to_text(for each card in sort_list(set, order_by: {card.card_number}) do write_card())
write_images := if options.export_images then (for each card in cards do write_image_file((if options.image_type =="full" then card else card.image), file:"{card.name}{if options.image_type == "full" then ".full" else ""}.jpg")) write_images := if options.export_images then (for each card in cards do write_image_file((if options.image_type =="full" then card else card.image), file:"{card.name}{if options.image_type == "full" then ".full" else ""}.jpg")) else ""
to_string(set.title+" Spoiler List\n" to_string(set.title+" Spoiler List\n"
+set.description+"\n" +set.description+"\n"
+"Spoiler List created on "+options.date_created+"\n" +"Spoiler List created on "+options.date_created+"\n"

View File

@@ -1,7 +1,7 @@
mse version: 2.0.0 mse version: 2.0.0
short name: Name Check short name: Name Check
full name: Name Check Exporter full name: Name Check Exporter
position hint: 009 position hint: 300
icon: icon.png icon: icon.png
version: 2018-01-11 version: 2018-01-11
installer group: magic/Export/Name Check installer group: magic/Export/Name Check
@@ -38,26 +38,46 @@ script:
quote_filter := replace@(match:"”", replace:"")+ quote_filter := replace@(match:"”", replace:"")+
replace@(match:"“", replace:"")+ replace@(match:"“", replace:"")+
replace@(match:"[[.quotation-mark.]]", replace:"") replace@(match:"[[.quotation-mark.]]", replace:"")
near_filter := replace@(match:"(and|or|in|into|to|upon|the|of|from|at|through|with) ", replace:"")
+ replace@(match:" ", replace:"")
match_name := match@(match: "(?i)^{name_list()}$")
match_near := match@(match: "(?i)^{near_name_list()}")
write_cards := {
# exact := ""
# near := ""
# Spacer because long blocks of code with lots of card names are long. art := ""
# for each card in set do (
# matches_name := match_name(quote_filter(card.name));
# if matches_name
then exact := exact + "\n" + card.name
matches_name := { to_string(quote_filter(card.name)) } + match@(match: "^{name_list()}$") else (
matches_name_2 := { to_string(quote_filter(card.name_2)) } + match@(match: "^{name_list()}$") matches_near := match_near(near_filter(quote_filter(card.name)))
if matches_near
art_check := { options.check_for_artists and (card.illustrator == "" or card.illustrator == "([ ]+|[Uu]nknown|[?]+)")} then near := near + "\n" + card.name
art_check_2 := { card.name_2 != "" and options.check_for_artists and (card.illustrator_2 == "" or card.illustrator_2 == "([ ]+|[Uu]nknown|[?]+)")} )
if options.check_for_artists and (card.illustrator == "" or card.illustrator == "([ ]+|[Uu]nknown|[?]+)")
write_card := {(if matches_name() then card.name + "\n" else "") then art := art + "\n" + card.name
+ (if matches_name_2() then card.name_2 + "\n" else "") if card.name_2 != "" then (
matches_name_2 := match_name(quote_filter(card.name_2))
if matches_name_2
then exact := exact + "\n" + card.name_2
else (
matches_near_2 := match_near(near_filter(quote_filter(card.name_2)))
if matches_near_2
then near := near + "\n" + card.name_2
)
if contains(card.shape, match:"double") and options.check_for_artists and (card.illustrator_2 == "" or card.illustrator_2 == "([ ]+|[Uu]nknown|[?]+)")
then art := art + "\n" + card.name_2
)
"dummy return"
);
str := ""
+ (if exact != "" then "----- Exact Matches -----" + exact + "\n\n")
+ (if near != "" then "----- Near Matches -----" + near + "\n\n")
+ (if art != "" then "----- No Artists -----" + art + "\n\n")
str
} }
write_card_2 := { (if art_check() then card.name + "\n" else "") to_string(write_cards())
+ (if art_check_2() then card.name_2 + "\n" else "")
}
write_cards := "----- Exact Matches -----\n\n" + to_text(for each card in cards do write_card()) + (if options.check_for_artists then "\n\n-----No Illustrators-----\n\n" + to_text(for each card in cards do write_card_2()))
to_string(write_cards)

File diff suppressed because one or more lines are too long

View File

@@ -29,6 +29,18 @@ depends on:
card width: 752 card width: 752
card height: 523 card height: 523
card dpi: 150 card dpi: 150
card region:
name: front
x: 0
y: 0
height: 523
width: 375
card region:
name: back
x: 377
y: 0
height: 523
width: 375
############################################################## Extra scripts ############################################################## Extra scripts
init script: init script:
# Load scripts for image box # Load scripts for image box

View File

@@ -29,6 +29,18 @@ depends on:
card width: 752 card width: 752
card height: 523 card height: 523
card dpi: 150 card dpi: 150
card region:
name: front
x: 0
y: 0
height: 523
width: 375
card region:
name: back
x: 377
y: 0
height: 523
width: 375
############################################################## Extra scripts ############################################################## Extra scripts
init script: init script:
# Load scripts for image box # Load scripts for image box

View File

@@ -26,6 +26,18 @@ depends on:
card width: 752 card width: 752
card height: 523 card height: 523
card dpi: 150 card dpi: 150
card region:
name: front
x: 0
y: 0
height: 523
width: 375
card region:
name: back
x: 377
y: 0
height: 523
width: 375
############################################################## Extra scripts ############################################################## Extra scripts
init script: init script:
# Load scripts for image box # Load scripts for image box

View File

@@ -26,6 +26,18 @@ depends on:
card width: 752 card width: 752
card height: 523 card height: 523
card dpi: 150 card dpi: 150
card region:
name: front
x: 0
y: 0
height: 523
width: 375
card region:
name: back
x: 377
y: 0
height: 523
width: 375
############################################################## Extra scripts ############################################################## Extra scripts
init script: init script:
# Load scripts for image box # Load scripts for image box

View File

@@ -26,6 +26,18 @@ depends on:
card width: 752 card width: 752
card height: 523 card height: 523
card dpi: 150 card dpi: 150
card region:
name: front
x: 0
y: 0
height: 523
width: 375
card region:
name: back
x: 377
y: 0
height: 523
width: 375
#Code by Pichoro #Code by Pichoro
############################################################## Extra scripts ############################################################## Extra scripts
init script: init script:

View File

@@ -1,7 +1,7 @@
mse version: 0.3.8 mse version: 0.3.8
short name: PlaneSculptors short name: PlaneSculptors
full name: PlaneSculptors Export 1.4 full name: PS Export 1.5
position hint: 006 position hint: 110
version: 2023-02-04 version: 2023-02-04
installer group: magic/Export/planesculptors installer group: magic/Export/planesculptors
create directory: true create directory: true
@@ -36,8 +36,10 @@ script:
compare_card_name := { if exporter_name_grabber(exporter_name_filter(input.notes)) != "" then exporter_name_grabber(exporter_name_filter(input.notes)) else input.name } compare_card_name := { if exporter_name_grabber(exporter_name_filter(input.notes)) != "" then exporter_name_grabber(exporter_name_filter(input.notes)) else input.name }
determine_shape := { determine_shape := {
if (contains(card.shape, match:"normal") or contains(card.shape, match:"planeswalker") or card.loyalty_2 != "") and card.name_2 != "" then "double" if (contains(card.shape, match:"normal") or contains(card.shape, match:"planeswalker") or card.loyalty_2 != "") and card.name_2 != "" then "double"
else if contains(card.shape, match:"double") then "double" else if contains(card.shape, match:"double") then "split"
else if contains(card.shape, match:"mini plane card") then "split"
else if contains(card.shape, match:"plane card") then "plane" else if contains(card.shape, match:"plane card") then "plane"
else if contains(card.shape, match:"battle") then "split"
else if contains(card.shape, match:"leveler") then "normal" else if contains(card.shape, match:"leveler") then "normal"
else if contains(card.shape, match:"saga") then "normal" else if contains(card.shape, match:"saga") then "normal"
else if contains(card.shape, match:"adventure") then "vsplit" else if contains(card.shape, match:"adventure") then "vsplit"
@@ -46,6 +48,15 @@ script:
else if contains(card.shape, match:"shifted") then "normal" else if contains(card.shape, match:"shifted") then "normal"
else replace(card.shape, match:" faced", replace:"") else replace(card.shape, match:" faced", replace:"")
} }
resized_image := {
sh := determine_shape()
write_image_file(
card,
file:card_name()+options.export_images,
width: if sh == "double" then 752 else if sh == "split" then 523 else if sh == "plane" then 800 else 375,
height: if sh == "split" then 375 else if sh == "plane" then 559 else 523
)
}
paragraph_count := replace@(match:"\n", replace:"<22>")+ paragraph_count := replace@(match:"\n", replace:"<22>")+
filter_text@(match:"<22>") filter_text@(match:"<22>")
@@ -189,7 +200,7 @@ script:
for x from 0 to length(input)-1 do if compare_card_name(input[x]) == name then count := count + 1 for x from 0 to length(input)-1 do if compare_card_name(input[x]) == name then count := count + 1
count count
} }
write_images := if options.export_images == "no" then "" else for each card in cards do write_image_file(card, file:card_name()+options.export_images) write_images := if options.export_images == "no" then "" else for each card in cards do resized_image()
for each card in cards do if check_unique(cards, name:card_name()) > 1 then trace("Warning: Repeated name: " + card.name) for each card in cards do if check_unique(cards, name:card_name()) > 1 then trace("Warning: Repeated name: " + card.name)
write_cards := for each card in cards do write_card() write_cards := for each card in cards do write_card()
wordshtml := to_string( wordshtml := to_string(

View File

@@ -1,10 +1,10 @@
mse version: 2.0.0 mse version: 2.0.0
short name: Simple Exporter short name: Simple Exporter
full name: Simple full name: Simple
position hint: 009 position hint: 410
icon: icon.png icon: icon.png
version: 2018-01-11 version: 2018-01-11
installer group: magic/Export/Name Check installer group: magic/Export/text
depends on: depends on:
package: magic.mse-game package: magic.mse-game

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -1,10 +1,10 @@
mse version: 2.0.0 mse version: 2.0.0
short name: Skeleton short name: Skeleton
full name: Skeleton Extractor full name: Skeleton Extractor
position hint: 003 position hint: 420
##icon: icon.png ##icon: icon.png
version: 2018-02-09 version: 2018-02-09
installer group: magic/Export/Misc installer group: magic/Export/text
depends on: depends on:
package: magic.mse-game package: magic.mse-game

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -1,10 +1,10 @@
mse version: 2.0.0 mse version: 2.0.0
short name: Symbol Printer short name: Symbol Printer
full name: Data Collection full name: Symbol Printer
position hint: 009 position hint: 350
icon: icon.png icon: icon.png
version: 2018-01-11 version: 2018-01-11
installer group: magic/Export/Name Check installer group: magic/Export/Symbols
depends on: depends on:
package: magic.mse-game package: magic.mse-game

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -1,7 +1,7 @@
mse version: 0.3.8 mse version: 0.3.8
short name: Text short name: Text
full name: Raw list data full name: Raw list data
position hint: 002 position hint: 400
icon: icon.png icon: icon.png
version: 2009-06-29 version: 2009-06-29
installer group: magic/Export/text installer group: magic/Export/text

View File

@@ -1,7 +1,7 @@
mse version: 0.3.8 mse version: 0.3.8
short name: TOExp short name: TOExp
full name: TappedOut Exporter full name: TappedOut Exporter
position hint: 001 position hint: 600
icon: icon.png icon: icon.png
version: 2012-11-23 version: 2012-11-23
installer group: magic/Export/TOExp installer group: magic/Export/TOExp

View File

@@ -1,7 +1,7 @@
mse version: 0.3.8 mse version: 0.3.8
short name: Wagic short name: Wagic
full name: Plugin Exporter full name: Plugin Exporter
position hint: 007 position hint: 900
icon: icon.png icon: icon.png
version: 2009-11-14 version: 2009-11-14
#Remember to update version at bottom of file. #Remember to update version at bottom of file.
@@ -225,81 +225,81 @@ script:
#Filter out the "keyword" abilities recognized by Wagic from the rules text. #Filter out the "keyword" abilities recognized by Wagic from the rules text.
#Todo: Try to make more precise so you don't catch things like "Enchanted creature has flying." #Todo: Try to make more precise so you don't catch things like "Enchanted creature has flying."
wagic_abilities := { wagic_abilities := {
(if contains(card.rule_text, match:"Flying") then "flying,") (if contains(card.rule_text, match:"Flying") then "flying," else "")
+(if contains(card.rule_text, match:"flying") then "flying,") +(if contains(card.rule_text, match:"flying") then "flying," else "")
+(if contains(card.rule_text, match:"Trample") then "trample,") +(if contains(card.rule_text, match:"Trample") then "trample," else "")
+(if contains(card.rule_text, match:"trample") then "trample,") +(if contains(card.rule_text, match:"trample") then "trample," else "")
+(if contains(card.rule_text, match:"Plainswalk") then "plainwalk,") +(if contains(card.rule_text, match:"Plainswalk") then "plainwalk," else "")
+(if contains(card.rule_text, match:"Plainswalk") then "plainwalk,") +(if contains(card.rule_text, match:"Plainswalk") then "plainwalk," else "")
+(if contains(card.rule_text, match:"Islandwalk") then "islandwalk,") +(if contains(card.rule_text, match:"Islandwalk") then "islandwalk," else "")
+(if contains(card.rule_text, match:"Islandwalk") then "islandwalk,") +(if contains(card.rule_text, match:"Islandwalk") then "islandwalk," else "")
+(if contains(card.rule_text, match:"Swampwalk") then "swampwalk,") +(if contains(card.rule_text, match:"Swampwalk") then "swampwalk," else "")
+(if contains(card.rule_text, match:"Swampwalk") then "swampwalk,") +(if contains(card.rule_text, match:"Swampwalk") then "swampwalk," else "")
+(if contains(card.rule_text, match:"Mountainwalk") then "mountainwalk,") +(if contains(card.rule_text, match:"Mountainwalk") then "mountainwalk," else "")
+(if contains(card.rule_text, match:"Mountainwalk") then "mountainwalk,") +(if contains(card.rule_text, match:"Mountainwalk") then "mountainwalk," else "")
+(if contains(card.rule_text, match:"Forestwalk") then "forestwalk,") +(if contains(card.rule_text, match:"Forestwalk") then "forestwalk," else "")
+(if contains(card.rule_text, match:"Forestwalk") then "forestwalk,") +(if contains(card.rule_text, match:"Forestwalk") then "forestwalk," else "")
+(if contains(card.rule_text, match:"First strike") then "first strike,") +(if contains(card.rule_text, match:"First strike") then "first strike," else "")
+(if contains(card.rule_text, match:"first strike") then "first strike,") +(if contains(card.rule_text, match:"first strike") then "first strike," else "")
+(if contains(card.rule_text, match:"Double strike") then "double strike,") +(if contains(card.rule_text, match:"Double strike") then "double strike," else "")
+(if contains(card.rule_text, match:"double strike") then "double strike,") +(if contains(card.rule_text, match:"double strike") then "double strike," else "")
+(if contains(card.rule_text, match:"Fear") then "fear,") +(if contains(card.rule_text, match:"Fear") then "fear," else "")
+(if contains(card.rule_text, match:"fear") then "fear,") +(if contains(card.rule_text, match:"fear") then "fear," else "")
+(if contains(card.rule_text, match:"Flash") then "flash,") +(if contains(card.rule_text, match:"Flash") then "flash," else "")
+(if contains(card.rule_text, match:"flash") then "flash,") +(if contains(card.rule_text, match:"flash") then "flash," else "")
+(if contains(card.rule_text, match:"Haste") then "haste,") +(if contains(card.rule_text, match:"Haste") then "haste," else "")
+(if contains(card.rule_text, match:"haste") then "haste,") +(if contains(card.rule_text, match:"haste") then "haste," else "")
+(if contains(card.rule_text, match:"Lifelink") then "lifelink,") +(if contains(card.rule_text, match:"Lifelink") then "lifelink," else "")
+(if contains(card.rule_text, match:"lifelink") then "lifelink,") +(if contains(card.rule_text, match:"lifelink") then "lifelink," else "")
+(if contains(card.rule_text, match:"Reach") then "reach,") +(if contains(card.rule_text, match:"Reach") then "reach," else "")
+(if contains(card.rule_text, match:"reach") then "reach,") +(if contains(card.rule_text, match:"reach") then "reach," else "")
+(if contains(card.rule_text, match:"Shroud") then "shroud,") +(if contains(card.rule_text, match:"Shroud") then "shroud," else "")
+(if contains(card.rule_text, match:"shroud") then "shroud,") +(if contains(card.rule_text, match:"shroud") then "shroud," else "")
+(if contains(card.rule_text, match:"Vigilance") then "vigilance,") +(if contains(card.rule_text, match:"Vigilance") then "vigilance," else "")
+(if contains(card.rule_text, match:"vigilance") then "vigilance,") +(if contains(card.rule_text, match:"vigilance") then "vigilance," else "")
+(if contains(card.rule_text, match:"Defender") then "defender,") +(if contains(card.rule_text, match:"Defender") then "defender," else "")
+(if contains(card.rule_text, match:"defender") then "defender,") +(if contains(card.rule_text, match:"defender") then "defender," else "")
+(if contains(card.rule_text, match:"Banding") then "banding,") +(if contains(card.rule_text, match:"Banding") then "banding," else "")
+(if contains(card.rule_text, match:"banding") then "banding,") +(if contains(card.rule_text, match:"banding") then "banding," else "")
+(if contains(card.rule_text, match:"Protection from white") then "protection from white,") +(if contains(card.rule_text, match:"Protection from white") then "protection from white," else "")
+(if contains(card.rule_text, match:"protection from white") then "protection from white,") +(if contains(card.rule_text, match:"protection from white") then "protection from white," else "")
+(if contains(card.rule_text, match:"Protection from blue") then "protection from blue,") +(if contains(card.rule_text, match:"Protection from blue") then "protection from blue," else "")
+(if contains(card.rule_text, match:"protection from blue") then "protection from blue,") +(if contains(card.rule_text, match:"protection from blue") then "protection from blue," else "")
+(if contains(card.rule_text, match:"Protection from black") then "protection from black,") +(if contains(card.rule_text, match:"Protection from black") then "protection from black," else "")
+(if contains(card.rule_text, match:"protection from black") then "protection from black,") +(if contains(card.rule_text, match:"protection from black") then "protection from black," else "")
+(if contains(card.rule_text, match:"Protection from red") then "protection from red,") +(if contains(card.rule_text, match:"Protection from red") then "protection from red," else "")
+(if contains(card.rule_text, match:"protection from red") then "protection from red,") +(if contains(card.rule_text, match:"protection from red") then "protection from red," else "")
+(if contains(card.rule_text, match:"Protection from green") then "protection from green,") +(if contains(card.rule_text, match:"Protection from green") then "protection from green," else "")
+(if contains(card.rule_text, match:"protection from green") then "protection from green,") +(if contains(card.rule_text, match:"protection from green") then "protection from green," else "")
+(if contains(card.rule_text, match:" is unblockable.") then "unblockable,") +(if contains(card.rule_text, match:" is unblockable.") then "unblockable," else "")
+(if contains(card.rule_text, match:"Wither") then "wither,") +(if contains(card.rule_text, match:"Wither") then "wither," else "")
+(if contains(card.rule_text, match:"wither") then "wither,") +(if contains(card.rule_text, match:"wither") then "wither," else "")
+(if contains(card.rule_text, match:"Persist") then "persist,") +(if contains(card.rule_text, match:"Persist") then "persist," else "")
+(if contains(card.rule_text, match:"persist") then "persist,") +(if contains(card.rule_text, match:"persist") then "persist," else "")
+(if contains(card.rule_text, match:"Retrace") then "retrace,") +(if contains(card.rule_text, match:"Retrace") then "retrace," else "")
+(if contains(card.rule_text, match:"retrace") then "retrace,") +(if contains(card.rule_text, match:"retrace") then "retrace," else "")
+(if contains(card.rule_text, match:"Exalted") then "exalted,") +(if contains(card.rule_text, match:"Exalted") then "exalted," else "")
+(if contains(card.rule_text, match:"exalted") then "exalted,") +(if contains(card.rule_text, match:"exalted") then "exalted," else "")
+(if contains(card.super_type, match:"Legendary") then "legendary,") +(if contains(card.super_type, match:"Legendary") then "legendary," else "")
+(if contains(card.rule_text, match:"Shadow") then "shadow,") +(if contains(card.rule_text, match:"Shadow") then "shadow," else "")
+(if contains(card.rule_text, match:"shadow") then "shadow,") +(if contains(card.rule_text, match:"shadow") then "shadow," else "")
+(if contains(card.rule_text, match:" can block creatures with shadow as though they didn't have shadow.") then "reachshadow,") +(if contains(card.rule_text, match:" can block creatures with shadow as though they didn't have shadow.") then "reachshadow," else "")
+(if contains(card.rule_text, match:" cant attack unless defending player controls an Plains.") and contains(card.rule_text, match:"When you control no Plains, sacrifice ") then "plainshome,") +(if contains(card.rule_text, match:" cant attack unless defending player controls an Plains.") and contains(card.rule_text, match:"When you control no Plains, sacrifice ") then "plainshome," else "")
+(if contains(card.rule_text, match:" cant attack unless defending player controls an Island.") and contains(card.rule_text, match:"When you control no Islands, sacrifice ") then "islandhome,") +(if contains(card.rule_text, match:" cant attack unless defending player controls an Island.") and contains(card.rule_text, match:"When you control no Islands, sacrifice ") then "islandhome," else "")
+(if contains(card.rule_text, match:" cant attack unless defending player controls an Swamp.") and contains(card.rule_text, match:"When you control no Swamps, sacrifice ") then "swamphome,") +(if contains(card.rule_text, match:" cant attack unless defending player controls an Swamp.") and contains(card.rule_text, match:"When you control no Swamps, sacrifice ") then "swamphome," else "")
+(if contains(card.rule_text, match:" cant attack unless defending player controls an Mountain.") and contains(card.rule_text, match:"When you control no Mountains, sacrifice ") then "mountainhome,") +(if contains(card.rule_text, match:" cant attack unless defending player controls an Mountain.") and contains(card.rule_text, match:"When you control no Mountains, sacrifice ") then "mountainhome," else "")
+(if contains(card.rule_text, match:" cant attack unless defending player controls an Forest.") and contains(card.rule_text, match:"When you control no Forests, sacrifice ") then "foresthome,") +(if contains(card.rule_text, match:" cant attack unless defending player controls an Forest.") and contains(card.rule_text, match:"When you control no Forests, sacrifice ") then "foresthome," else "")
+(if contains(card.rule_text, match:"Flanking") then "flanking,") +(if contains(card.rule_text, match:"Flanking") then "flanking," else "")
+(if contains(card.rule_text, match:"flanking") then "flanking,") +(if contains(card.rule_text, match:"flanking") then "flanking," else "")
+(if contains(card.rule_text, match:"Rampage") then "rampage,") +(if contains(card.rule_text, match:"Rampage") then "rampage," else "")
+(if contains(card.rule_text, match:"rampage") then "rampage,") +(if contains(card.rule_text, match:"rampage") then "rampage," else "")
+(if contains(card.rule_text, match:" can block only creatures with flying.") then "cloud,") +(if contains(card.rule_text, match:" can block only creatures with flying.") then "cloud," else "")
+(if contains(card.rule_text, match:" attacks each turn if able.") then "mustattack,") +(if contains(card.rule_text, match:" attacks each turn if able.") then "mustattack," else "")
+(if contains(card.rule_text, match:" can't attack.") then "cantattack,") +(if contains(card.rule_text, match:" can't attack.") then "cantattack," else "")
+(if contains(card.rule_text, match:" can't block.") then "cantblock,") +(if contains(card.rule_text, match:" can't block.") then "cantblock," else "")
+(if contains(card.rule_text, match:" doesn't untap during your untap step.") then "doesnotuntap,") +(if contains(card.rule_text, match:" doesn't untap during your untap step.") then "doesnotuntap," else "")
+(if contains(card.rule_text, match:" can't be the targets of spells or abilities your opponents control.") then "opponentshroud,") +(if contains(card.rule_text, match:" can't be the targets of spells or abilities your opponents control.") then "opponentshroud," else "")
+(if contains(card.rule_text, match:" is indestructible.") then "indestructible,") +(if contains(card.rule_text, match:" is indestructible.") then "indestructible," else "")
} }
#Take the trailing comma off the end of the abilities line. #Take the trailing comma off the end of the abilities line.
wagic_remove_trailing_comma := replace@(match:",$", replace:"") wagic_remove_trailing_comma := replace@(match:",$", replace:"")
@@ -391,7 +391,7 @@ script:
else write_normal() else write_normal()
} }
#Write cards. #Write cards.
write_cards := to_text(for each card in sort_list(cards, order_by: {card.card_number}) do write_card()) write_cards := to_text(for each card in sort_list(set, order_by: {card.card_number}) do write_card())
#Render images. #Render images.
#write_images := for each card in cards do write_image_file(card, file:"{wagic_id_prefix()}{wagic_card_number()}{if card.shape == "token" then "t"}{if card.shape == "rulestip" then "tip"}.jpg") #write_images := for each card in cards do write_image_file(card, file:"{wagic_id_prefix()}{wagic_card_number()}{if card.shape == "token" then "t"}{if card.shape == "rulestip" then "tip"}.jpg")
#Write header, then write the cards. #Write header, then write the cards.

View File

@@ -1,2 +0,0 @@
[.ShellClassInfo]
LocalizedResourceName=@magic-webdrafter.mse-export-template,0

View File

@@ -1,30 +0,0 @@
mse version: 0.3.8
short name: WebDrafter
full name: WebDrafter Exporter
position hint: 006
version: 2015-02-14
installer group: magic/Export/webdrafter
depends on:
package: magic.mse-game
version: 2009-07-23
game: magic
file type: *.txt|*.txt|*.*|*.*
# By caeonosphere
# Written by modifying thequinn's IsochronDrafter exporter ()
script:
write_card := {
"\n"+card.name
+"\n"+card.rarity
+"\n"+card.card_color
+"\n"+card.type
+"\n"+cmc(card.casting_cost)
+"\n"
}
write_cards := to_text(for each card in sort_list(cards, order_by: {input.card_number}) do write_card())
to_string(
set.title+"\n"
+write_cards)

View File

@@ -1,7 +1,7 @@
mse version: 0.3.8 mse version: 0.3.8
short name: XML short name: XML
full name: Formatted data full name: Formatted data
position hint: 004 position hint: 430
icon: icon.png icon: icon.png
version: 2009-06-29 version: 2009-06-29
installer group: magic/Export/xml installer group: magic/Export/xml

View File

@@ -25,6 +25,7 @@
#### Card column sorting #### Card column sorting
#### Custom index #### Custom index
#### Skeleton generator #### Skeleton generator
#### Hashes
############################################################## Localization ############################################################## Localization
include file: language include file: language
@@ -380,6 +381,29 @@ trim_zeroes := replace@(match: "^00?", replace: "")+
replace@(match: "a?/[0-9b]+", replace: "") replace@(match: "a?/[0-9b]+", replace: "")
corrected_card_number := { if exporter_num_grabber(exporter_num_filter(card.notes)) != "" then exporter_num_grabber(exporter_num_filter(card.notes)) else if card.custom_card_number != "" then trim_zeroes(card.custom_card_number) else card_number() } corrected_card_number := { if exporter_num_grabber(exporter_num_filter(card.notes)) != "" then exporter_num_grabber(exporter_num_filter(card.notes)) else if card.custom_card_number != "" then trim_zeroes(card.custom_card_number) else card_number() }
crop_multi_image := {
image_map := hash_new()
m3in1 := card.stylesheet.full_name == "M15 Style Meld cards (3-in-1)"
three_cards := false
cs := get_card_styling(card)
if m3in1 and cs.three_cards or else false then three_cards := true
card_image := to_card_image(card)
len := length(card.stylesheet.card_regions)
for i from 0 to len-1 do (
region_info := card.stylesheet.card_regions[i]
if m3in1 and three_cards and (region_info.name == "front" or region_info.name == "meldback")
then ""
else if m3in1 and (not three_cards) and (region_info.name != "front" and region_info.name != "meldback")
then ""
else (
region := crop(card_image, height:region_info.height, width:region_info.width, offset_x:region_info.x, offset_y:region_info.y)
image_map := hash_create(image_map, key:region_info.name, value:region);
"dummy return"
)
)
image_map
}
############################################################## 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_text@(order: "\\?XYZI[0123456789]VLHSFCAIE(WUBRG)") mana_sort := sort_text@(order: "\\?XYZI[0123456789]VLHSFCAIE(WUBRG)")
@@ -5138,3 +5162,147 @@ skeleton_info := {
+"skeleton_wedge_uncommons: " + skeleton_wedge_uncommons + "\n" +"skeleton_wedge_uncommons: " + skeleton_wedge_uncommons + "\n"
+"skeleton_wedge_rares: " + skeleton_wedge_rares) +"skeleton_wedge_rares: " + skeleton_wedge_rares)
} }
############################################################## Hashes
#### return a new Hash
hash_new := {
len := min(length(keys), length(values)) - 1
if keys != [] and len >= 0
then keys := for x from 0 to len do [[keys[x]]]
else keys := []
if values != [] and len >= 0
then values := for x from 0 to len do [[values[x]]]
else values := []
[
keys: keys,
values: values
]
}@(keys:[], values:[])
#### check if hash already has this key
hash_includes := {
if value != nil then
key := value;
if keys != [] and key != nil then keys := keys + [key]
if input == nil
then false
else if keys != []
then hash_nest(input, key_chain:keys, func:hash_includes, update:false, value:key)
else if position(of:[key] in:input.keys) < 0
then false
else true
}@(key:nil, keys:[], value:nil)
#### add key:value to hash unless key exists
hash_create := {
if input == [] then input := hash_new()
if keys != [] and key != nil then keys := keys + [key]
if keys != []
then hash_nest(input, key_chain:keys, func:hash_create, value:value)
else if hash_includes(input, key:key)
then input
else hash_push(input, key:key, value:value)
}@(input:[], keys:[], key:nil)
#### add a key:value even if the key exists
hash_push := {
if keys != [] and key != nil then keys := keys + [key]
if input == nil
then []
else if keys != []
then hash_nest(input, key_chain:keys, func:hash_push, value:value)
else [
keys: input.keys + [[key]],
values: input.values + [[value]]
]
}@(keys:[], key:nil)
#### read value from a key
hash_read := {
if value != nil then
key := value;
if keys != [] and key != nil then keys := keys + [key]
if input == nil
then []
else if keys != []
then hash_nest(input, key_chain:keys, func:hash_read, value:value, update:false)
else (
posi := position(of:[key] in:input.keys)
if posi < 0
then nil
else input.values[posi][0]
)
}@(keys:[], value:nil, key:nil)
#### add key:value to hash. if key already exists, overwrite
hash_update := {
if keys != [] and key != nil then keys := keys + [key]
if input == nil
then []
else if keys != []
then hash_nest(input, key_chain:keys, func:hash_update, value:value)
else (
posi := position(of:[key] in:input.keys)
if posi < 0 then hash_create(input, key:key, value:value)
else [
keys: (for k from 0 to length(input.keys)-1 do if k == posi then [[key]] else [input.keys[k]]),
values: (for v from 0 to length(input.values)-1 do if v == posi then [[value]] else [input.values[v]])
]
)
}@(keys:[], key:nil)
#### remove a key:value from the hash
hash_delete := {
if keys != [] and key != nil then keys := keys + [key]
if input == nil
then []
else if keys != []
then hash_nest(input, key_chain:keys, func:hash_delete, value:value)
else (
posi := position(of:[key] in:input.keys)
if posi < 0 then input
else [
keys: (for k from 0 to length(input.keys)-1 do if k == posi then [] else [input.keys[k]]),
values: (for v from 0 to length(input.values)-1 do if v == posi then [] else [input.values[v]])
]
)
}@(keys:[], key:nil)
#### get keys of the hash, optionally only those with a particular value
hash_keys := {
if keys != [] and key != nil then keys := keys + [key]
if value != nil then
of := value;
if input == nil
then []
else if keys != []
then hash_nest(input, key_chain:keys, func:hash_keys, value:value, update:false)
else (
res := for i from 0 to length(input.keys)-1 do if of == nil or input.values[i] == [of] then input.keys[i] else nil
if res == nil then [] else res
)
}@(of:nil, keys:[], key:nil, value:nil)
hash_increment := {
if keys != [] and key != nil then keys := keys + [key]
if input == nil
then []
else if keys != []
then hash_nest(input, key_chain:keys, func:hash_increment, value:value)
else (
initial := hash_read(input, key:key)
if initial == nil then initial := 0
hash_update(input, key:key, value:initial+value)
)
}@(value:1, keys:[], key:nil)
hash_decrement := {
hash_increment(input, key:key, keys:keys, value:(-1*value))
}@(value:1, keys:[], key:nil)
#### update a nested hash
hash_nest := {
hash_chain := [input]
for x from 0 to length(key_chain)-2 do (
hash_chain := hash_chain + [hash_read(hash_chain[x], key:key_chain[x])]
)
len := length(hash_chain)-1
value := func(hash_chain[length(hash_chain)-1], key:key_chain[length(key_chain)-1], value:value)
if update then (
len := len - 1
for x from 0 to len do (
ind := len - x
value := hash_update(hash_chain[ind], key:key_chain[ind])
)
)
value
}@(key_chain:[], func:hash_update, update:true)

View File

@@ -211,5 +211,5 @@ script:
+(if options.include_notes and card.notes !="" then "[/spoiler]") +(if options.include_notes and card.notes !="" then "[/spoiler]")
+"\n" +"\n"
} }
write_cards := to_text(for each card in sort_list(cards, order_by: {input.card_number}) do write_card()) write_cards := to_text(for each card in sort_list(set, order_by: {input.card_number}) do write_card())
to_string("Full Spoiler List for "+set.title+"\nSet by "+options.creator+"\n"+set.description+"\n"+write_cards) to_string("Full Spoiler List for "+set.title+"\nSet by "+options.creator+"\n"+set.description+"\n"+write_cards)

View File

@@ -193,7 +193,7 @@ script:
+"\nCard #: "+card.card_number +"\nCard #: "+card.card_number
+"\n" +"\n"
} }
write_cards := to_text(for each card in sort_list(cards, order_by: {card.card_number}) do write_card()) write_cards := to_text(for each card in sort_list(set, order_by: {card.card_number}) do write_card())
write_images := if options.export_images then (for each card in cards do write_image_file((if options.image_type =="full" then card else card.image), file:"{card.name}{if options.image_type == "full" then ".full" else ""}.jpg")) write_images := if options.export_images then (for each card in cards do write_image_file((if options.image_type =="full" then card else card.image), file:"{card.name}{if options.image_type == "full" then ".full" else ""}.jpg"))
to_string(set.title+" Spoiler List\n" to_string(set.title+" Spoiler List\n"
+set.description+"\n" +set.description+"\n"

View File

@@ -212,5 +212,5 @@ script:
+(if options.include_notes and card.notes !="" then "[/spoiler]") +(if options.include_notes and card.notes !="" then "[/spoiler]")
+"\n" +"\n"
} }
write_cards := to_text(for each card in sort_list(cards, order_by: {input.card_number}) do write_card()) write_cards := to_text(for each card in sort_list(set, order_by: {input.card_number}) do write_card())
to_string("Full Spoiler List for "+set.title+"\nSet by "+options.creator+"\n"+set.description+"\n"+write_cards) to_string("Full Spoiler List for "+set.title+"\nSet by "+options.creator+"\n"+set.description+"\n"+write_cards)

View File

@@ -192,7 +192,7 @@ script:
+"\nCard #: "+card.card_number +"\nCard #: "+card.card_number
+"\n" +"\n"
} }
write_cards := to_text(for each card in sort_list(cards, order_by: {card.card_number}) do write_card()) write_cards := to_text(for each card in sort_list(set, order_by: {card.card_number}) do write_card())
write_images := if options.export_images then (for each card in cards do write_image_file((if options.image_type =="full" then card else card.image), file:"{card.name}{if options.image_type == "full" then ".full" else ""}.jpg")) write_images := if options.export_images then (for each card in cards do write_image_file((if options.image_type =="full" then card else card.image), file:"{card.name}{if options.image_type == "full" then ".full" else ""}.jpg"))
to_string(set.title+" Spoiler List\n" to_string(set.title+" Spoiler List\n"
+set.description+"\n" +set.description+"\n"