[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

@@ -1,10 +1,10 @@
mse version: 2.0.0
mse version: 2.5.0
short name: Lackey
full name: Lackey Exporter
position hint: 003
position hint: 900
icon: icon.png
version: 2014-01-20
installer group: magic/Export/lackeyccg
version: 2024-09-24
installer group: magic/Export/LackeyCCG
depends on:
package: magic.mse-game
@@ -30,13 +30,6 @@ option field:
type: text
name: set code
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:
type: boolean
name: unkeyworded clues
@@ -75,30 +68,47 @@ script:
or contains(card.level_3_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: "")+
replace@(match: "a?/[0-9b]+", replace: "")
corrected_card_number := { if card.custom_card_number != "" then trim_zeroes(card.custom_card_number) else card_number() }
####################### Image Exporting
is_backface := { contains(card.shape, match:"double faced") and contains(options.dfc_options, match:"Back faces") }
other_face := { contains(card.shape, match:"double faced") and not is_backface() }
image_export_width := { if contains(card.shape, match:"split") and options.export_size == "MSE Standard" then "523"
else if contains(options.dfc_options, match:"Standard") and contains(card.shape, match:"double faced") and options.export_size == "MSE Standard" then "752"
else if options.export_size == "MSE Standard" then "375"
else if contains(card.shape, match:"split") and options.export_size == "LackeyCCG Medium" then "285"
else if contains(options.dfc_options, match:"Standard") and contains(card.shape, match:"double faced") and options.export_size == "LackeyCCGMedium" then "572"
else if options.export_size == "LackeyCCG Medium" then "200"
else if contains(card.shape, match:"split") then "445"
else if contains(options.dfc_options, match:"Standard") and contains(card.shape, match:"double faced") then "626"
else "312"
}
image_export_height := { if contains(card.shape, match:"split") and options.export_size == "MSE Standard" then "375"
else if options.export_size == "MSE Standard" then "523"
else if contains(card.shape, match:"split") and options.export_size == "LackeyCCG Medium" then "200"
else if options.export_size == "LackeyCCG Medium" then "285"
else if contains(card.shape, match:"split") then "312"
else "445"
}
large_resizer := [
752: 626,
523: 445,
375: 312
]
medium_resizer := [
752: 402
523: 285
375: 200
]
image_export_width := {
base_width := if contains(card.shape, match:"split")
or contains(card.shape, match:"plane")
or contains(card.shape, match:"battle")
then 523
else if contains(card.shape, match:"double")
then 752
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
mse_to_lackeyccg_trim_duplicate_color := {to_text(if contains(input, match:"W") then "W")
+to_text(if contains(input, match:"U") then "U")
@@ -134,23 +144,23 @@ script:
####################### Used to name tokens
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"
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) = "blue" then "blue"
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) = "green" then "green"
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) = "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) = "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) = "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) = "white, red" then "red and white"
else if color_condense(card.card_color) = "blue, green" then "green and blue"
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) == "white" then "white"
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) == "red" then "red"
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) == "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) == "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, 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) == "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) == "blue, green" then "green and blue"
else ""
}
@@ -178,45 +188,45 @@ script:
####################### These check if a card uses simultaneous Lackey scrips to add commas and semicolons where needed
semi_search := {
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 = "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 = "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 = "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 = "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 = "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 = "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 = "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 = "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 ";"
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 == "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 == "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 == "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 == "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 == "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 == "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 == "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 == "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 ""
}
comma_search := {
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 = "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 = "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 = "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 = "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 = "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 = "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 = "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 = "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 ", "
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 == "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 == "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 == "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 == "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 == "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 == "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 == "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 == "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 ""
}
####################### 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 "" }
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 "" }
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_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 }
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_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")}
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" }
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_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 }
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_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")}
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" }
####################### MANIPULATION
####################### 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_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")
library_numbers:= { if input = "card" then "1"
else if input = "two cards" then "2"
else if input = "three cards" then "3"
else if input = "four cards" then "4"
else if input = "five cards" then "5"
else if input = "six cards" then "6"
else if input = "seven cards" then "7"
else if input = "eight cards" then "8"
else if input = "nine cards" then "9"
else if input = "ten cards" then "10"
else if input = "eleven cards" then "11"
else if input = "twelve cards" then "12"
else if input = "thirteen cards" then "13"
else if input = "fourteen cards" then "14"
else if input = "fifteen cards" then "15"
else if input = "sixteen cards" then "16"
else if input = "seventeen cards" then "17"
else if input = "eighteen cards" then "18"
else if input = "ninteen cards" then "19"
else if input = "twenty cards" then "20"
library_numbers:= { if input == "card" then "1"
else if input == "two cards" then "2"
else if input == "three cards" then "3"
else if input == "four cards" then "4"
else if input == "five cards" then "5"
else if input == "six cards" then "6"
else if input == "seven cards" then "7"
else if input == "eight cards" then "8"
else if input == "nine cards" then "9"
else if input == "ten cards" then "10"
else if input == "eleven cards" then "11"
else if input == "twelve cards" then "12"
else if input == "thirteen cards" then "13"
else if input == "fourteen cards" then "14"
else if input == "fifteen cards" then "15"
else if input == "sixteen cards" then "16"
else if input == "seventeen cards" then "17"
else if input == "eighteen cards" then "18"
else if input == "ninteen cards" then "19"
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_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 }
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_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)) }
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_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)) }
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 }
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_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)) }
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_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)) }
####################### COUNTERS
####################### Initial counter script scripts
@@ -348,6 +359,7 @@ script:
else if contains(input, match: "three") then "3"
else if contains(input, match: "two") then "2"
else if contains(input, match: "a") then "1"
else "1"
}
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) != "" }
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 = "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 = "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 = "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 = "eight" and loyalty_check(card.loyalty_cost_8) then card.loyalty_cost_8 + comma_search(check: "loyalty8", 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 == "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 == "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 == "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 "")
+ token_label_1(input) + comma_search(check: "token1", input)
+ token_label_2(input) + comma_search(check: "token2", input)
+ token_label_3(input) + comma_search(check: "token3", input)
@@ -378,14 +390,14 @@ script:
+ reveal_bot_label(input) + comma_search(check: "revealbot", input)
+ emblem_label(input)
+ "\</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 = "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 = "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 = "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 = "eight" and loyalty_check(card.loyalty_cost_8) then "/ccgreen" + card.loyalty_cost_8 + semi_search(check: "loyalty8", 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 == "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 == "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 == "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 "")
+ token_function_1(input) + semi_search(check: "token1", input)
+ token_function_2(input) + semi_search(check: "token2", input)
+ token_function_3(input) + semi_search(check: "token3", input)
@@ -401,8 +413,8 @@ script:
five_replace := replace@(match: "Spawn", "Spawn five")
x_replace := replace@(match: "/spawn ", "/spawnx5 ")
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 special_label() != "" then "\<s>\<l>" + special_label() + "\</l>\<f>" + special_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>" 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_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 "")
}
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 special_label() != "" then "\<s>\<l>" + special_label() + "\</l>\<f>" + special_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>" 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_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 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+" "
+corrected_card_number()+(if card.rarity == "special" then "s" else "")+" "
+(if contains(card.type, match:"Basic Land") then "0"
@@ -441,7 +453,7 @@ script:
+mse_to_lackeyccg_rules_filter(card.rule_text)
+"\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+" "
+corrected_card_number()+(if card.rarity == "special" then "s" else "")+" "
+(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)
+"\n"
}
write_flip := {card_name()+(if card.rarity = "special" then ".")+" "
write_flip := {card_name()+(if card.rarity == "special" then ".")+" "
+options.set_code+" "
+corrected_card_number()+(if card.rarity == "special" then "s" else "")+" "
+(if contains(card.type, match:"Land") then "L"
@@ -477,7 +489,7 @@ script:
+mse_to_lackeyccg_rules_filter(card.rule_text_2)
+"\n"
}
write_dfc := {card_name()+(if card.rarity = "special" then ".")+" "
write_dfc := {card_name()+(if card.rarity == "special" then ".")+" "
+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")+" "
+(if contains(card.type, match:"Land") then "L"
@@ -497,7 +509,7 @@ script:
+mse_to_lackeyccg_rules_filter(card.rule_text_2)
+"\n"
}
write_walker := {card_name()+(if card.rarity = "special" then ".")+" "
write_walker := {card_name()+(if card.rarity == "special" then ".")+" "
+options.set_code+" "
+corrected_card_number()+(if card.rarity == "special" then "s" else "")+" "
+(if contains(card.type, match:"Land") then "L"
@@ -522,7 +534,7 @@ script:
+mse_to_lackeyccg_rules_filter(paragraph_four())
+"\n"
}
write_sparker := {card_name()+(if card.rarity = "special" then ".")+" "
write_sparker := {card_name()+(if card.rarity == "special" then ".")+" "
+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")+" "
+(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)
+"\n"
}
write_dfc_walker := {card_name()+(if card.rarity = "special" then ".")+" "
write_dfc_walker := {card_name()+(if card.rarity == "special" then ".")+" "
+options.set_code+" "
+corrected_card_number()+(if card.rarity == "special" then "s" else "")+" "
+(if contains(card.type, match:"Land") then "L"
@@ -624,7 +636,7 @@ script:
+mse_to_lackeyccg_rules_filter(paragraph_eight())
+"\n"
}
write_leveler := {card_name()+(if card.rarity = "special" then ".")+" "
write_leveler := {card_name()+(if card.rarity == "special" then ".")+" "
+options.set_code+" "
+corrected_card_number()+(if card.rarity == "special" then "s" else "")+" "
+(if contains(card.type, match:"Land") then "L"
@@ -645,25 +657,44 @@ script:
+card.rule_text_2
+(if card.pt_3 !="" then " ("+card.pt_2+") ")
+"\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)+" "
+"tokens "
+options.set_code+corrected_card_number()+(if card.rarity == "special" then "s" else "")+" "
+(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 ".")+" "
}
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) + " " else "") + token_color_name()+ " "
) + card_name() + " " + options.set_code
)
+ " "
+ "tokens "
+ options.set_code + corrected_card_number() + (if card.rarity == "special" then "s" else "") + " "
+ (
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+" "
+corrected_card_number()+(if card.rarity == "special" then "s" else "")+" "
+(if contains(card.type, match:"Basic Land") then "0"
@@ -678,7 +709,7 @@ script:
+normal_scripts()+" "
+mse_to_lackeyccg_rules_filter(card.special_text)
+"\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()
else if contains(card.shape, match:"rulestip") then ""
else if contains(card.shape, match:"counter") then write_token()
@@ -692,7 +723,63 @@ script:
else if card.loyalty != "" then write_walker()
else if contains(card.shape, match:"leveler") then write_leveler()
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_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))