Merge branch 'pr/9'
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 25 KiB |
@@ -1,9 +1,9 @@
|
||||
mse version: 0.3.8
|
||||
short name: Cockatrice
|
||||
full name: CS/ECH 1.04
|
||||
full name: Exporter v2.0
|
||||
position hint: 007
|
||||
icon: icon.png
|
||||
version: 2018-09-29
|
||||
version: 2023-02-05
|
||||
installer group: magic/Export/cockatrice
|
||||
|
||||
depends on:
|
||||
@@ -15,32 +15,26 @@ create directory: true
|
||||
file type: *.xml|*.xml|*.*|*.*
|
||||
|
||||
# By K'yoril, edited by Advent, Updated by Reuben Covington, Updated by Cajun, Updated by Zeu
|
||||
# Updated to v4 xml by ebbit
|
||||
# Based on code by Pichoro, Idle Muse, Innuendo and Seeonee
|
||||
|
||||
option field:
|
||||
type: choice
|
||||
name: version
|
||||
choice: CS/ECH 1.04
|
||||
option field:
|
||||
type:choice
|
||||
name: Usage Guide
|
||||
choice: https://tinyurl.com/csexporter
|
||||
name: info
|
||||
choice: Updated 2023/02, guide: https://tinyurl.com/ctexportv2
|
||||
option field:
|
||||
type: text
|
||||
name: cockatrice Set Type
|
||||
description: The "set type" your set will appear as in Cockatrice. "Custom" should be the default.
|
||||
default: Custom
|
||||
option field:
|
||||
type: boolean
|
||||
name: export Images
|
||||
description: Whether or not to export images along with the XML. These images are recommended for Cockatrice use.
|
||||
initial: yes
|
||||
option field:
|
||||
type: choice
|
||||
name: images File Type
|
||||
description: Which file extension you want the images exported as. JPG is lower quality but lower file size.
|
||||
name: export Images
|
||||
description: Export images along with the XML? Recommended for Cockatrice use. JPG is lower quality but lower file size.
|
||||
choice: no
|
||||
choice: JPG
|
||||
choice: PNG
|
||||
initial: no
|
||||
option field:
|
||||
type: boolean
|
||||
name: tokens In Separate XML
|
||||
@@ -56,49 +50,40 @@ option field:
|
||||
name: append String To Names
|
||||
description: Appended to the front of all card names and image names.
|
||||
option field:
|
||||
type: boolean
|
||||
name: include Common
|
||||
description: Whether to include common cards or not.
|
||||
initial: yes
|
||||
option field:
|
||||
type: boolean
|
||||
name: include Uncommon
|
||||
description: Whether to include uncommon cards or not.
|
||||
initial: yes
|
||||
option field:
|
||||
type: boolean
|
||||
name: include Rare
|
||||
description: Whether to include rare cards or not.
|
||||
initial: yes
|
||||
option field:
|
||||
type: boolean
|
||||
name: include Mythic
|
||||
description: Whether to include mythic rare cards or not.
|
||||
initial: yes
|
||||
option field:
|
||||
type: boolean
|
||||
name: include Basic Land
|
||||
description: Whether to include basic land rarity cards or not.
|
||||
initial: yes
|
||||
option field:
|
||||
type: boolean
|
||||
name: include Tokens
|
||||
description: Whether to include tokens or not.
|
||||
initial: yes
|
||||
option field:
|
||||
type: boolean
|
||||
name: include Special
|
||||
description: Whether to include special rarity cards or not.
|
||||
initial: yes
|
||||
|
||||
type: multiple choice
|
||||
name: rarities to export
|
||||
choice: common
|
||||
choice: uncommon
|
||||
choice: rare
|
||||
choice: mythic rare
|
||||
choice: basic land
|
||||
choice: special
|
||||
choice: token
|
||||
choice: masterpiece
|
||||
initial: common, uncommon, rare, mythic rare, basic land, special, token, masterpiece
|
||||
option style:
|
||||
rarities to export:
|
||||
render style: checklist
|
||||
direction: vertical
|
||||
export Images:
|
||||
render style: both
|
||||
choice images:
|
||||
no: {built_in_image("bool_no")}
|
||||
JPG: {built_in_image("bool_yes")}
|
||||
PNG: {built_in_image("bool_yes")}
|
||||
script:
|
||||
splitter_name := {false} ## experimental future thing for splitting dfc images
|
||||
#determine if the card is a type that is a "token" i.e. it should be batched with tokens instead of with other cards
|
||||
is_token := {contains(card.shape, match:"token") or contains(card.shape, match:"emblem") or contains(card.shape, match:"rulestip") }
|
||||
is_double := {contains(card.shape, match:"double") }
|
||||
|
||||
file_type := {if options.export_Images == "PNG" then "png" else "jpg"}
|
||||
|
||||
#determine if the card is of a rarity that should be included
|
||||
included_rarity := {
|
||||
(is_token() and chosen(options.rarities_to_export, choice:"token")) or chosen(options.rarities_to_export, choice:card.rarity)
|
||||
}
|
||||
included_rarity2 := {
|
||||
(is_token() and options.include_Tokens)
|
||||
or (card.rarity == "basic land" and options.include_Basic_Land)
|
||||
or (card.rarity == "common" and options.include_Common)
|
||||
@@ -113,8 +98,18 @@ script:
|
||||
replace@(match: "’",replace:"'") + #replace bad apostrophe with good apostrophe
|
||||
replace@(match:":", replace:"")+ #remove colons
|
||||
replace@(match:";", replace:"")+ #remove semicolons
|
||||
replace@(match:"\n", replace:"")+ #remove linebreaks
|
||||
replace@(match:"\\.", replace:"") #remove periods
|
||||
|
||||
# escape special xml characters
|
||||
xml_escape := replace@(match:"&",replace:"&") #escape ampersands
|
||||
+ replace@(match:"\"",replace:"\\"") #escape double quote
|
||||
+ replace@(match:"\'",replace:"\\'") #escape single quote
|
||||
+ replace@(match:"\<",replace:"\\<") #escape less than sign
|
||||
#+ replace@(match:"\>",replace:"\\>") #escape greater than sign, for some reason this upsets mse and they are technically not needed to escape
|
||||
# escaped set code
|
||||
setcode := xml_escape(set.set_code)
|
||||
|
||||
#functions for the !exportname command
|
||||
exporter_name_filter := filter_text@(match:"!exporte?r?name [^\n\<]+")
|
||||
exporter_name_grabber := replace@(match:"!exporte?r?name ", replace:"")
|
||||
@@ -122,9 +117,12 @@ script:
|
||||
#determining what name should be used for the card
|
||||
card_name := { if exporter_name_grabber(exporter_name_filter(card.notes)) != "" then exporter_name_grabber(exporter_name_filter(card.notes)) else card.name }
|
||||
|
||||
#surround mana symbols in curly brackets
|
||||
format_mana := replace@(match:"(CHAOS|[1-9][0-9]+(?:\\/.)?|.\\/.\\/.|.\\/.|[+-]?[^.,: ])", replace:{"\{"+_1+"}"}, in_context:"<sym(-auto)?><match></sym")
|
||||
|
||||
#determining what rules text should be used for the card
|
||||
card_rules_text := { if card.special_text != "" then card.special_text else card.rule_text }
|
||||
card_rules_text_2 := { if card.special_text_2 != "" then card.special_text_2 else card.rule_text_2 }
|
||||
card_rules_text := { format_mana(if card.special_text != "" then card.special_text else card.rule_text) }
|
||||
card_rules_text_2 := { format_mana(if card.special_text_2 != "" then card.special_text_2 else card.rule_text_2) }
|
||||
|
||||
#helpers to find the correct count for this token relation, and generate the requisite XML
|
||||
token_count_regex := "<([0-9]+|x)>"
|
||||
@@ -135,8 +133,11 @@ script:
|
||||
#helpers to find if a auto-attachment is desired for this token relation, and generate the requisite XML
|
||||
add_attachment := {if filter_text(match: "<attach>", input) != "" then " attach=\"attach\"" else ""}
|
||||
|
||||
#helpers to find if persistent is desired for this token relation, and generate the requisite XML
|
||||
add_persistent := {if filter_text(match:"<(conjure|persistent)>", input) != "" then " persistent=\"persistent\"" else ""}
|
||||
|
||||
#helper functions for converted_related later
|
||||
related_entry_regex := "(.+?[^[:space:]]);"
|
||||
related_entry_regex := "(.+?[^[:space:]])(?:;|\n|$)"
|
||||
|
||||
#convert the !related command field to <reverse-related> XML blocks
|
||||
convert_related :=
|
||||
@@ -147,18 +148,53 @@ script:
|
||||
replace@(match:"!",replace: "") + #blank out the command ender
|
||||
|
||||
#for every other card name, surround it with reverse-related tags and put in relevant attributes
|
||||
{for each entry in (break_text(match:related_entry_regex, input)) do ("\<reverse-related" + add_related_count(entry) + add_attachment(entry) + ">" + strip_card_name(entry) + "\</reverse-related>\n")}
|
||||
{for each entry in (break_text(match:related_entry_regex, input)) do ("\n \<reverse-related" + add_related_count(entry) + add_attachment(entry) + add_persistent(entry) + ">" + xml_escape(strip_card_name(entry)) + "\</reverse-related>")}
|
||||
|
||||
#remove accidentily created empty <reverse-related> XML blocks
|
||||
remove_empty := replace@(match:"\<reverse-related>\</reverse-related>", replace:"")
|
||||
remove_empty := replace@(match:" \<(reverse-)?related>\</(reverse-)?related>", replace:"")
|
||||
|
||||
#convert the !token command field to <related> XML blocks
|
||||
convert_token :=
|
||||
replace@(match: "!tokens? ?\n?", replace:"")+ #blank out the related command itself
|
||||
replace@(match: "\<",replace:"<") + #replace junk Start of Header characters with proper "less than sign"s
|
||||
replace@(match: "’",replace:"'") + #replace bad apostrophe with good apostrophe
|
||||
replace@(match: "<X>",replace:"<x>") + #replace accidentily capital X with lowercase X
|
||||
replace@(match:"!",replace: "") + #blank out the command ender
|
||||
|
||||
#for every other card name, surround it with reverse-related tags and put in relevant attributes
|
||||
{for each entry in (break_text(match:related_entry_regex, input)) do ("\n \<related" + add_related_count(entry) + add_attachment(entry) + add_persistent(entry) + ">" + xml_escape(strip_card_name(entry)) + "\</related>")}
|
||||
|
||||
|
||||
filter_related := filter_text@(match:"!relate ?[^!]+!?")
|
||||
filter_token := filter_text@(match:"!tokens? ?[^!]+!?")
|
||||
|
||||
#functions for the !tapped command
|
||||
contains_tapped := contains@(match:"!tapped")
|
||||
|
||||
CIPT := {if contains_tapped(card.notes) then "\n "+"\<cipt>" + "1" + "\</cipt>" else ""}
|
||||
|
||||
# maintype, used in cockatrice's card type sorting,
|
||||
# no longer automatically determined in v4 xml,
|
||||
# first use the same heuristic used in "oracle" else do the same thing v3 xml did
|
||||
# !maintype [type]! in the card notes overwrites this
|
||||
filter_maintype := filter_text@(match:"!maintype ?[^!]+!?")
|
||||
maintype :=
|
||||
{
|
||||
"\n "+"\<maintype>"
|
||||
+(
|
||||
if filter_maintype(card.notes) != "" then xml_escape(replace(match:"!$", replace:"", replace(match:"^!maintype ?", replace:"", filter_maintype(card.notes))))
|
||||
else if contains(card.type, match:"Planeswalker") then "Planeswalker"
|
||||
else if contains(card.type, match:"Creature") then "Creature"
|
||||
else if contains(card.type, match:"Land") then "Land"
|
||||
else if contains(card.type, match:"Sorcery") then "Sorcery"
|
||||
else if contains(card.type, match:"Instant") then "Instant"
|
||||
else if contains(card.type, match:"Artifact") then "Artifact"
|
||||
else if contains(card.type, match:"Enchantment") then "Enchantment"
|
||||
else xml_escape(replace(match:"^.* ", replace:"", replace(match:"(<sep-soft>)? —.*$", replace:"", card.type)))
|
||||
)
|
||||
+"\</maintype>"
|
||||
}
|
||||
|
||||
card_color :=
|
||||
{
|
||||
if contains(card.type, match:"land") or contains(card.rule_text, match:"Devoid") then "" else
|
||||
@@ -187,7 +223,7 @@ script:
|
||||
write_normal := {
|
||||
"\n "+"\<card>"
|
||||
# Name
|
||||
+"\n "+"\<name>"+options.append_String_To_Names+strip_card_name(card_name())+"\</name>"
|
||||
+"\n "+"\<name>"+xml_escape(options.append_String_To_Names+strip_card_name(card_name()))+"\</name>"
|
||||
# Set
|
||||
+"\n "+"\<set rarity="
|
||||
+(if contains(card.rarity,match:"uncommon") then "\"uncommon\""
|
||||
@@ -195,7 +231,8 @@ script:
|
||||
else if contains(card.rarity,match:"mythic") then "\"mythic\""
|
||||
else if contains(card.rarity,match:"rare") then "\"rare\""
|
||||
else "\"\"")
|
||||
+ ">"+set.set_code+"\</set>"
|
||||
+ ">"+setcode+"\</set>"
|
||||
+"\n "+"\<prop>"
|
||||
# Color
|
||||
+"\n "+"\<color>"
|
||||
+ card_color()
|
||||
@@ -205,12 +242,11 @@ script:
|
||||
# Converted Mana Cost
|
||||
+"\n "+"\<cmc>"+card.cmc+"\</cmc>"
|
||||
# Type
|
||||
+"\n "+"\<type>"+replace(card.type, match:"—", replace:"-")+"\</type>"
|
||||
+"\n "+"\<type>"+xml_escape(replace(card.type, match:"—", replace:"-"))+"\</type>"
|
||||
+maintype()
|
||||
# P/T
|
||||
+(if contains(card.type, match:"Creature") then "\n ")
|
||||
+(if contains(card.type, match:"Creature") then "\<pt>")
|
||||
+(if contains(card.type, match:"Creature") then card.pt)
|
||||
+(if contains(card.type, match:"Creature") then "\</pt>")
|
||||
+(if contains(card.type, match:"Creature") then "\n "+"\<pt>"+xml_escape(card.pt)+"\</pt>")
|
||||
+"\n "+"\</prop>"
|
||||
# Tablerow
|
||||
+"\n "+"\<tablerow>"
|
||||
+(if contains(card.type, match:"Instant") or contains(card.type, match:"Sorcery") then "3"
|
||||
@@ -221,26 +257,27 @@ script:
|
||||
#CIPT
|
||||
+ CIPT()
|
||||
# Rules Text
|
||||
+"\n "+"\<text>"+card_rules_text()+"\</text>"
|
||||
+"\n "+"\<text>"+xml_escape(card_rules_text())+"\</text>"
|
||||
+ (if filter_token(card.notes) != "" then remove_empty(convert_token(filter_token(card.notes))))
|
||||
+"\n "+"\</card>"
|
||||
}
|
||||
write_token := {
|
||||
"\n "+"\<card>"
|
||||
# Name
|
||||
+"\n "+"\<name>"+strip_card_name(card_name())+(if options.append_Set_Code_To_Tokens then " " + set.set_code else "")+"\</name>"
|
||||
+"\n "+"\<name>"+xml_escape(strip_card_name(card_name())+(if options.append_Set_Code_To_Tokens then " " + setcode else ""))+"\</name>"
|
||||
# Set
|
||||
+"\n "+"\<set>"+set.set_code+"\</set>"
|
||||
+"\n "+"\<set>"+setcode+"\</set>"
|
||||
+"\n "+"\<prop>"
|
||||
# Color
|
||||
+"\n "+"\<color>"
|
||||
+ card_color()
|
||||
+"\</color>"
|
||||
# Type
|
||||
+"\n "+"\<type>"+replace(card.type, match:"—", replace:"-")+"\</type>"
|
||||
+"\n "+"\<type>"+xml_escape(replace(card.type, match:"—", replace:"-"))+"\</type>"
|
||||
+maintype()
|
||||
# P/T
|
||||
+(if contains(card.type, match:"Creature") then "\n ")
|
||||
+(if contains(card.type, match:"Creature") then "\<pt>")
|
||||
+(if contains(card.type, match:"Creature") then card.pt)
|
||||
+(if contains(card.type, match:"Creature") then "\</pt>")
|
||||
+(if contains(card.type, match:"Creature") then "\n "+"\<pt>"+xml_escape(card.pt)+"\</pt>")
|
||||
+"\n "+"\</prop>"
|
||||
# Tablerow
|
||||
+"\n "+"\<tablerow>"
|
||||
+(if contains(card.type, match:"Instant") or contains(card.type, match:"Sorcery") then "3"
|
||||
@@ -251,18 +288,18 @@ script:
|
||||
#CIPT
|
||||
+ CIPT()
|
||||
# Rules Text
|
||||
+"\n "+"\<text>"+card_rules_text()+"\</text>"
|
||||
+"\n "+"\<text>"+xml_escape(card_rules_text())+"\</text>"
|
||||
# Token
|
||||
+ "\n \<token>1\</token>"
|
||||
+ "\n "+"\<token>1\</token>"
|
||||
# Reverse Related
|
||||
#if there is a !related block in the cards notes, set up the reverse-related XML elements
|
||||
+ (if filter_related(card.notes) != "" then remove_empty("\n" + convert_related(filter_related(card.notes))))
|
||||
+ (if filter_related(card.notes) != "" then remove_empty(convert_related(filter_related(card.notes))))
|
||||
+"\n "+"\</card>"
|
||||
}
|
||||
write_flip := {
|
||||
"\n "+"\<card>"
|
||||
# Name
|
||||
+"\n "+"\<name>"+options.append_String_To_Names+strip_card_name(card_name())
|
||||
+"\n "+"\<name>"+xml_escape(options.append_String_To_Names+strip_card_name(card_name()))
|
||||
#+" // "+strip_card_name(card.name_2)
|
||||
+"\</name>"
|
||||
# Set
|
||||
@@ -272,7 +309,8 @@ script:
|
||||
else if contains(card.rarity,match:"mythic") then "\"mythic\""
|
||||
else if contains(card.rarity,match:"rare") then "\"rare\""
|
||||
else "\"\"")
|
||||
+ ">"+set.set_code+"\</set>"
|
||||
+ ">"+setcode+"\</set>"
|
||||
+"\n "+"\<prop>"
|
||||
# Color
|
||||
+"\n "+"\<color>"
|
||||
+(if contains(card.shape, match:"flip") then
|
||||
@@ -308,14 +346,16 @@ script:
|
||||
# Converted Mana Cost
|
||||
+"\n "+"\<cmc>"+card.cmc+"\</cmc>"
|
||||
# Type
|
||||
+"\n "+"\<type>"+replace(card.type, match:"—", replace:"-")+" // "+replace(card.type_2, match:"—", replace:"-")+"\</type>"
|
||||
+"\n "+"\<type>"+xml_escape(replace(card.type, match:"—", replace:"-")+" // "+replace(card.type_2, match:"—", replace:"-"))+"\</type>"
|
||||
+maintype()
|
||||
# P/T
|
||||
+(if contains(card.type, match:"Creature") or contains(card.type_2, match:"Creature") then "\n ")
|
||||
+(if contains(card.type, match:"Creature") or contains(card.type_2, match:"Creature") then "\<pt>")
|
||||
+(if contains(card.type, match:"Creature") then card.pt)
|
||||
+(if contains(card.type, match:"Creature") then xml_escape(card.pt))
|
||||
+(if contains(card.type, match:"Creature") and contains(card.type_2, match:"Creature") then " // ")
|
||||
+(if contains(card.type_2, match:"Creature") then card.pt_2)
|
||||
+(if contains(card.type_2, match:"Creature") then xml_escape(card.pt_2))
|
||||
+(if contains(card.type, match:"Creature") or contains(card.type_2, match:"Creature") then "\</pt>")
|
||||
+"\n "+"\</prop>"
|
||||
# Tablerow
|
||||
+"\n "+"\<tablerow>"
|
||||
+(if contains(card.type, match:"Instant") or contains(card.type, match:"Sorcery") or contains(card.type_2, match:"Instant") or contains(card.type_2, match:"Sorcery") then "3"
|
||||
@@ -324,13 +364,14 @@ script:
|
||||
else "1")
|
||||
+"\</tablerow>"
|
||||
# Rules Text
|
||||
+"\n "+"\<text>"+card_rules_text()+"\n--- \n"+card_rules_text_2()+"\</text>"
|
||||
+"\n "+"\<text>"+xml_escape(card_rules_text()+"\n--- \n"+card_rules_text_2())+"\</text>"
|
||||
+ (if filter_token(card.notes) != "" then remove_empty(convert_token(filter_token(card.notes))))
|
||||
+"\n "+"\</card>"
|
||||
}
|
||||
write_double := {
|
||||
"\n "+"\<card>"
|
||||
# Name
|
||||
+"\n "+"\<name>"+options.append_String_To_Names+strip_card_name(card_name())
|
||||
+"\n "+"\<name>"+xml_escape(options.append_String_To_Names+strip_card_name(card_name()))
|
||||
#+" | ("+strip_card_name(card.name_2)+")"
|
||||
+"\</name>"
|
||||
# Set
|
||||
@@ -340,24 +381,22 @@ script:
|
||||
else if contains(card.rarity,match:"mythic") then "\"mythic\""
|
||||
else if contains(card.rarity,match:"rare") then "\"rare\""
|
||||
else "\"\"")
|
||||
+ " splitterPath=\""+"/"+options.append_String_To_Names+strip_card_name(card_name())+".full." + to_lower(options.images_File_Type) + "\" >"+set.set_code+"\</set>"
|
||||
+ " splitterPath=\""+"/"+options.append_String_To_Names+strip_card_name(card_name())+"." + file_type() + "\" >"+setcode+"\</set>"
|
||||
+"\n "+"\<prop>"
|
||||
# Color
|
||||
+"\n "+"\<color>"
|
||||
+ card_color()
|
||||
+"\</color>"
|
||||
# Name of the related card
|
||||
+"\n "+"\<related attach=\"attach\">"+strip_card_name(card.name_2)+"\</related>"
|
||||
# Mana Cost
|
||||
+"\n "+"\<manacost>"+card.casting_cost+"\</manacost>"
|
||||
# Converted Mana Cost
|
||||
+"\n "+"\<cmc>"+card.cmc+"\</cmc>"
|
||||
# Type
|
||||
+"\n "+"\<type>"+replace(card.type, match:"—", replace:"-")+"\</type>"
|
||||
+"\n "+"\<type>"+xml_escape(replace(card.type, match:"—", replace:"-"))+"\</type>"
|
||||
+maintype()
|
||||
# P/T
|
||||
+(if contains(card.type, match:"Creature") then "\n ")
|
||||
+(if contains(card.type, match:"Creature") then "\<pt>")
|
||||
+(if contains(card.type, match:"Creature") then card.pt)
|
||||
+(if contains(card.type, match:"Creature") then "\</pt>")
|
||||
+(if contains(card.type, match:"Creature") then "\n "+"\<pt>"+xml_escape(card.pt)+"\</pt>")
|
||||
+"\n "+"\</prop>"
|
||||
# Tablerow
|
||||
+"\n "+"\<tablerow>"
|
||||
+(if contains(card.type, match:"Instant") or contains(card.type, match:"Sorcery") then "3"
|
||||
@@ -366,14 +405,17 @@ script:
|
||||
else "1")
|
||||
+"\</tablerow>"
|
||||
# Rules Text
|
||||
+"\n "+"\<text>"+card_rules_text()
|
||||
+"\n---\n(Back): "+strip_card_name(card.name_2)+"\</text>"
|
||||
+"\n "+"\<text>"+xml_escape(card_rules_text()
|
||||
+"\n---\n(Back): "+strip_card_name(card.name_2))+"\</text>"
|
||||
# Name of the related card
|
||||
+"\n "+"\<related attach=\"attach\">"+xml_escape(strip_card_name(card.name_2))+"\</related>"
|
||||
+ (if filter_token(card.notes) != "" then remove_empty(convert_token(filter_token(card.notes))))
|
||||
+"\n "+"\</card>"
|
||||
+"\n "+"\<card>"
|
||||
# Name II
|
||||
+"\n "+"\<name>"
|
||||
#+"("+strip_card_name(card_name())+") | "
|
||||
+strip_card_name(card.name_2)
|
||||
+xml_escape(strip_card_name(card.name_2))
|
||||
+"\</name>"
|
||||
# Set II
|
||||
+"\n "+"\<set rarity="
|
||||
@@ -382,7 +424,8 @@ script:
|
||||
else if contains(card.rarity,match:"mythic") then "\"mythic\""
|
||||
else if contains(card.rarity,match:"rare") then "\"rare\""
|
||||
else "\"\"")
|
||||
+ " splitterPath=\""+"/"+strip_card_name(card.name_2)+".full." + to_lower(options.images_File_Type) + "\" >"+set.set_code+"\</set>"
|
||||
+ " splitterPath=\""+"/"+strip_card_name(card.name_2)+"." + file_type() + "\" >"+setcode+"\</set>"
|
||||
+"\n "+"\<prop>"
|
||||
# Color II
|
||||
+"\n "+"\<color>"
|
||||
+ card_color_2()
|
||||
@@ -392,12 +435,10 @@ script:
|
||||
# Converted Mana Cost II
|
||||
+"\n "+"\<cmc>"+card.cmc+"\</cmc>"
|
||||
# Type II
|
||||
+"\n "+"\<type>"+replace(card.type_2, match:"—", replace:"-")+"\</type>"
|
||||
+"\n "+"\<type>"+xml_escape(replace(card.type_2, match:"—", replace:"-"))+"\</type>"
|
||||
# P/T II
|
||||
+(if contains(card.type_2, match:"Creature") then "\n ")
|
||||
+(if contains(card.type_2, match:"Creature") then "\<pt>")
|
||||
+(if contains(card.type_2, match:"Creature") then card.pt_2)
|
||||
+(if contains(card.type_2, match:"Creature") then "\</pt>")
|
||||
+(if contains(card.type_2, match:"Creature") then "\n "+"\<pt>"+xml_escape(card.pt_2)+"\</pt>")
|
||||
+"\n "+"\</prop>"
|
||||
# Tablerow II
|
||||
+"\n "+"\<tablerow>"
|
||||
+(if contains(card.type_2, match:"Instant") or contains(card.type_2, match:"Sorcery") then "3"
|
||||
@@ -406,8 +447,9 @@ script:
|
||||
else "1")
|
||||
+"\</tablerow>"
|
||||
# Rules Text II
|
||||
+"\n "+"\<text>"+card_rules_text_2()
|
||||
+"\n---\n(Front): "+strip_card_name(card_name())+"\</text>"
|
||||
+"\n "+"\<text>"+xml_escape(card_rules_text_2()
|
||||
+"\n---\n(Front): "+strip_card_name(card_name()))+"\</text>"
|
||||
+ (if filter_token(card.notes) != "" then remove_empty(convert_token(filter_token(card.notes))))
|
||||
+"\n "+"\</card>"
|
||||
}
|
||||
|
||||
@@ -418,7 +460,7 @@ script:
|
||||
write_walker := {
|
||||
"\n "+"\<card>"
|
||||
# Name
|
||||
+"\n "+"\<name>"+options.append_String_To_Names+strip_card_name(card_name())+"\</name>"
|
||||
+"\n "+"\<name>"+xml_escape(options.append_String_To_Names+strip_card_name(card_name()))+"\</name>"
|
||||
# Set
|
||||
+"\n "+"\<set rarity="
|
||||
+(if contains(card.rarity,match:"uncommon") then "\"uncommon\""
|
||||
@@ -426,7 +468,8 @@ script:
|
||||
else if contains(card.rarity,match:"mythic") then "\"mythic\""
|
||||
else if contains(card.rarity,match:"rare") then "\"rare\""
|
||||
else "\"\"")
|
||||
+ ">"+set.set_code+"\</set>"
|
||||
+ ">"+setcode+"\</set>"
|
||||
+"\n "+"\<prop>"
|
||||
# Color
|
||||
+"\n "+"\<color>"
|
||||
+ card_color()
|
||||
@@ -436,16 +479,18 @@ script:
|
||||
# Converted Mana Cost
|
||||
+"\n "+"\<cmc>"+card.cmc+"\</cmc>"
|
||||
# Type
|
||||
+"\n "+"\<type>"+replace(card.type, match:"—", replace:"-")+"\</type>"
|
||||
+"\n "+"\<type>"+xml_escape(replace(card.type, match:"—", replace:"-"))+"\</type>"
|
||||
+maintype()
|
||||
# Loyalty
|
||||
+"\n "+"\<loyalty>"+card.loyalty+"\</loyalty>"
|
||||
+"\n "+"\</prop>"
|
||||
# Tablerow
|
||||
+"\n "+"\<tablerow>"+"1"+"\</tablerow>"
|
||||
#CIPT
|
||||
+ CIPT()
|
||||
# Rules Text
|
||||
+"\n "+"\<text>"
|
||||
+(if card.special_text or else "" != "" then card.special_text else
|
||||
+xml_escape((if card.special_text or else "" != "" then card.special_text else
|
||||
card.loyalty_cost_1
|
||||
+(if card.loyalty_cost_1 !="" then ": ")
|
||||
+split_text(match:"\n", card.rule_text).0
|
||||
@@ -460,14 +505,15 @@ script:
|
||||
+(if contains(paragraph_count(card.rule_text), match:"•••") then "\n")
|
||||
+card.loyalty_cost_4
|
||||
+(if card.loyalty_cost_4 !="" then ": ")
|
||||
+(if contains(paragraph_count(card.rule_text), match:"•••") then split_text(match:"\n", card.rule_text).3))
|
||||
+(if contains(paragraph_count(card.rule_text), match:"•••") then split_text(match:"\n", card.rule_text).3)))
|
||||
+"\</text>"
|
||||
+ (if filter_token(card.notes) != "" then remove_empty(convert_token(filter_token(card.notes))))
|
||||
+"\n "+"\</card>"
|
||||
}
|
||||
write_double_walker := {
|
||||
"\n "+"\<card>"
|
||||
# Name
|
||||
+"\n "+"\<name>"+options.append_String_To_Names+strip_card_name(card_name())
|
||||
+"\n "+"\<name>"+xml_escape(options.append_String_To_Names+strip_card_name(card_name()))
|
||||
#+" | ("+strip_card_name(card.name_2)+")"
|
||||
+"\</name>"
|
||||
# Set
|
||||
@@ -477,23 +523,24 @@ script:
|
||||
else if contains(card.rarity,match:"mythic") then "\"mythic\""
|
||||
else if contains(card.rarity,match:"rare") then "\"rare\""
|
||||
else "\"\"")
|
||||
+ " splitterPath=\""+"/"+options.append_String_To_Names+strip_card_name(card_name())+".full." + to_lower(options.images_File_Type) + "\" >"+set.set_code+"\</set>"
|
||||
+ " splitterPath=\""+"/"+options.append_String_To_Names+strip_card_name(card_name())+"." + file_type() + "\" >"+setcode+"\</set>"
|
||||
+"\n "+"\<prop>"
|
||||
# Color
|
||||
+"\n "+"\<color>"
|
||||
+ card_color()
|
||||
+"\</color>"
|
||||
# Name of the related card
|
||||
+"\n "+"\<related attach=\"attach\">"+strip_card_name(card.name_2)+"\</related>"
|
||||
# Mana Cost
|
||||
+"\n "+"\<manacost>"+card.casting_cost+"\</manacost>"
|
||||
# Converted Mana Cost
|
||||
+"\n "+"\<cmc>"+card.cmc+"\</cmc>"
|
||||
# Type
|
||||
+"\n "+"\<type>"+replace(card.type, match:"—", replace:"-")+"\</type>"
|
||||
+"\n "+"\<type>"+xml_escape(replace(card.type, match:"—", replace:"-"))+"\</type>"
|
||||
+maintype()
|
||||
# Loyalty
|
||||
+(if contains(card.type, match:"Planeswalker") then "\n "+"\<loyalty>"+card.loyalty+"\</loyalty>")
|
||||
# P/T
|
||||
+(if contains(card.type, match:"Creature") then "\n "+"\<pt>"+card.pt+"\</pt>")
|
||||
+(if contains(card.type, match:"Creature") then "\n "+"\<pt>"+xml_escape(card.pt)+"\</pt>")
|
||||
+"\n "+"\</prop>"
|
||||
# Tablerow
|
||||
+"\n "+"\<tablerow>"
|
||||
+(if contains(card.type_2, match:"Instant") or contains(card.type_2, match:"Sorcery") then "3"
|
||||
@@ -503,7 +550,7 @@ script:
|
||||
+"\</tablerow>"
|
||||
# Rules Text
|
||||
+"\n "+"\<text>"
|
||||
+(if card.special_text or else "" != "" then card.special_text else
|
||||
+xml_escape((if card.special_text or else "" != "" then card.special_text else
|
||||
card.loyalty_cost_1
|
||||
+(if card.loyalty_cost_1 !="" then ": ")
|
||||
+split_text(match:"\n", card.rule_text).0
|
||||
@@ -516,13 +563,16 @@ script:
|
||||
+(if card.loyalty_cost_3 !="" then ": ")
|
||||
+(if contains(paragraph_count(card.rule_text), match:"••") then split_text(match:"\n", card.rule_text).2)
|
||||
+(if contains(paragraph_count(card.rule_text), match:"•••") then "\n"))
|
||||
+"\n---\n(Back): "+strip_card_name(card.name_2)+"\</text>"
|
||||
+"\n---\n(Back): "+strip_card_name(card.name_2))+"\</text>"
|
||||
# Name of the related card
|
||||
+"\n "+"\<related attach=\"attach\">"+xml_escape(strip_card_name(card.name_2))+"\</related>"
|
||||
+ (if filter_token(card.notes) != "" then remove_empty(convert_token(filter_token(card.notes))))
|
||||
+"\n "+"\</card>"
|
||||
+"\n "+"\<card>"
|
||||
# Name II
|
||||
+"\n "+"\<name>"
|
||||
#+strip_card_name(card_name())+") | "
|
||||
+strip_card_name(card.name_2)+"\</name>"
|
||||
+xml_escape(strip_card_name(card.name_2))+"\</name>"
|
||||
# Set II
|
||||
+"\n "+"\<set rarity="
|
||||
+(if contains(card.rarity,match:"uncommon") then "\"uncommon\""
|
||||
@@ -530,7 +580,8 @@ script:
|
||||
else if contains(card.rarity,match:"mythic") then "\"mythic\""
|
||||
else if contains(card.rarity,match:"rare") then "\"rare\""
|
||||
else "\"\"")
|
||||
+ " splitterPath=\""+"/"+strip_card_name(card.name_2)+".full." + to_lower(options.images_File_Type) + "\" >"+set.set_code+"\</set>"
|
||||
+ " splitterPath=\""+"/"+strip_card_name(card.name_2)+"." + file_type() + "\" >"+setcode+"\</set>"
|
||||
+"\n "+"\<prop>"
|
||||
# Color II
|
||||
+"\n "+"\<color>"
|
||||
+ card_color_2()
|
||||
@@ -540,11 +591,12 @@ script:
|
||||
# Converted Mana Cost II
|
||||
+"\n "+"\<cmc>"+card.cmc+"\</cmc>"
|
||||
# Type II
|
||||
+"\n "+"\<type>"+replace(card.type_2, match:"—", replace:"-")+"\</type>"
|
||||
+"\n "+"\<type>"+xml_escape(replace(card.type_2, match:"—", replace:"-"))+"\</type>"
|
||||
# Loyalty II
|
||||
+(if contains(card.type_2, match:"Planeswalker") then "\n "+"\<loyalty>"+card.loyalty_2+"\</loyalty>")
|
||||
# P/T II
|
||||
+(if contains(card.type_2, match:"Creature") then "\n "+"\<pt>"+card.pt_2+"\</pt>")
|
||||
+(if contains(card.type_2, match:"Creature") then "\n "+"\<pt>"+xml_escape(card.pt_2)+"\</pt>")
|
||||
+"\n "+"\</prop>"
|
||||
# Tablerow II
|
||||
+"\n "+"\<tablerow>"
|
||||
+(if contains(card.type_2, match:"Instant") or contains(card.type_2, match:"Sorcery") then "3"
|
||||
@@ -554,7 +606,7 @@ script:
|
||||
+"\</tablerow>"
|
||||
# Rules Text II
|
||||
+"\n "+"\<text>"
|
||||
+(if card.special_text_2 or else "" != "" then card.special_text_2 else
|
||||
+xml_escape((if card.special_text_2 or else "" != "" then card.special_text_2 else
|
||||
card.loyalty_cost_4
|
||||
+(if card.loyalty_cost_4 !="" then ": ")
|
||||
+split_text(match:"\n", card.rule_text_2).0
|
||||
@@ -567,13 +619,14 @@ script:
|
||||
+(if card.loyalty_cost_6 !="" then ": ")
|
||||
+(if contains(paragraph_count(card.rule_text_2), match:"••") then split_text(match:"\n", card.rule_text_2).2)
|
||||
+(if contains(paragraph_count(card.rule_text_2), match:"•••") then "\n"))
|
||||
+"\n---\n(Front): "+strip_card_name(card_name())+"\</text>"
|
||||
+"\n---\n(Front): "+strip_card_name(card_name()))+"\</text>"
|
||||
+ (if filter_token(card.notes) != "" then remove_empty(convert_token(filter_token(card.notes))))
|
||||
+"\n "+"\</card>"
|
||||
}
|
||||
write_sparker := {
|
||||
"\n "+"\<card>"
|
||||
# Name
|
||||
+"\n "+"\<name>"+options.append_String_To_Names+strip_card_name(card_name())
|
||||
+"\n "+"\<name>"+xml_escape(options.append_String_To_Names+strip_card_name(card_name()))
|
||||
#+" | ("+strip_card_name(card.name_2)+")"
|
||||
+"\</name>"
|
||||
# Set
|
||||
@@ -583,24 +636,22 @@ script:
|
||||
else if contains(card.rarity,match:"mythic") then "\"mythic\""
|
||||
else if contains(card.rarity,match:"rare") then "\"rare\""
|
||||
else "\"\"")
|
||||
+ " splitterPath=\""+"/"+options.append_String_To_Names+strip_card_name(card_name())+".full." + to_lower(options.images_File_Type) + "\" >"+set.set_code+"\</set>"
|
||||
+ " splitterPath=\""+"/"+options.append_String_To_Names+strip_card_name(card_name())+"." + file_type() + "\" >"+setcode+"\</set>"
|
||||
+"\n "+"\<prop>"
|
||||
# Color
|
||||
+"\n "+"\<color>"
|
||||
+ card_color()
|
||||
+"\</color>"
|
||||
# Name of the related card
|
||||
+"\n "+"\<related attach=\"attach\">"+strip_card_name(card.name_2)+"\</related>"
|
||||
# Mana Cost
|
||||
+"\n "+"\<manacost>"+card.casting_cost+"\</manacost>"
|
||||
# Converted Mana Cost
|
||||
+"\n "+"\<cmc>"+card.cmc+"\</cmc>"
|
||||
# Type
|
||||
+"\n "+"\<type>"+replace(card.type, match:"—", replace:"-")+"\</type>"
|
||||
+"\n "+"\<type>"+xml_escape(replace(card.type, match:"—", replace:"-"))+"\</type>"
|
||||
+maintype()
|
||||
# P/T
|
||||
+(if contains(card.type, match:"Creature") then "\n ")
|
||||
+(if contains(card.type, match:"Creature") then "\<pt>")
|
||||
+(if contains(card.type, match:"Creature") then card.pt)
|
||||
+(if contains(card.type, match:"Creature") then "\</pt>")
|
||||
+(if contains(card.type, match:"Creature") then "\n "+"\<pt>"+xml_escape(card.pt)+"\</pt>")
|
||||
+"\n "+"\</prop>"
|
||||
# Tablerow
|
||||
+"\n "+"\<tablerow>"
|
||||
+(if contains(card.type, match:"Instant") or contains(card.type, match:"Sorcery") then "3"
|
||||
@@ -609,14 +660,17 @@ script:
|
||||
else "1")
|
||||
+"\</tablerow>"
|
||||
# Rules Text
|
||||
+"\n "+"\<text>"+card_rules_text()
|
||||
+"\n---\n(Back): "+strip_card_name(card.name_2)+"\</text>"
|
||||
+"\n "+"\<text>"+xml_escape(card_rules_text()
|
||||
+"\n---\n(Back): "+strip_card_name(card.name_2))+"\</text>"
|
||||
# Name of the related card
|
||||
+"\n "+"\<related attach=\"attach\">"+xml_escape(strip_card_name(card.name_2))+"\</related>"
|
||||
+ (if filter_token(card.notes) != "" then remove_empty(convert_token(filter_token(card.notes))))
|
||||
+"\n "+"\</card>"
|
||||
+"\n "+"\<card>"
|
||||
# Name II
|
||||
+"\n "+"\<name>"
|
||||
#+strip_card_name(card_name())+") | "
|
||||
+strip_card_name(card.name_2)+"\</name>"
|
||||
+xml_escape(strip_card_name(card.name_2))+"\</name>"
|
||||
# Set II
|
||||
+"\n "+"\<set rarity="
|
||||
+(if contains(card.rarity,match:"uncommon") then "\"uncommon\""
|
||||
@@ -624,7 +678,8 @@ script:
|
||||
else if contains(card.rarity,match:"mythic") then "\"mythic\""
|
||||
else if contains(card.rarity,match:"rare") then "\"rare\""
|
||||
else "\"\"")
|
||||
+ " splitterPath=\""+"/"+strip_card_name(card.name_2)+".full." + to_lower(options.images_File_Type) + "\" >"+set.set_code+"\</set>"
|
||||
+ " splitterPath=\""+"/"+strip_card_name(card.name_2)+"." + file_type() + "\" >"+setcode+"\</set>"
|
||||
+"\n "+"\<prop>"
|
||||
# Color II
|
||||
+"\n "+"\<color>"
|
||||
+ card_color_2()
|
||||
@@ -634,11 +689,12 @@ script:
|
||||
# Converted Mana Cost II
|
||||
+"\n "+"\<cmc>"+card.cmc+"\</cmc>"
|
||||
# Type II
|
||||
+"\n "+"\<type>"+replace(card.type_2, match:"—", replace:"-")+"\</type>"
|
||||
+"\n "+"\<type>"+xml_escape(replace(card.type_2, match:"—", replace:"-"))+"\</type>"
|
||||
# Loyalty II
|
||||
+(if contains(card.type_2, match:"Planeswalker") then "\n "+"\<loyalty>"+card.loyalty_2+"\</loyalty>")
|
||||
# P/T II
|
||||
+(if contains(card.type_2, match:"Creature") then "\n "+"\<pt>"+card.pt_2+"\</pt>")
|
||||
+(if contains(card.type_2, match:"Creature") then "\n "+"\<pt>"+xml_escape(card.pt_2)+"\</pt>")
|
||||
+"\n "+"\</prop>"
|
||||
# Tablerow II
|
||||
+"\n "+"\<tablerow>"
|
||||
+(if contains(card.type_2, match:"Instant") or contains(card.type_2, match:"Sorcery") then "3"
|
||||
@@ -648,7 +704,7 @@ script:
|
||||
+"\</tablerow>"
|
||||
# Rules Text II
|
||||
+"\n "+"\<text>"
|
||||
+(if card.special_text_2 or else "" != "" then card.special_text_2 else
|
||||
+xml_escape((if card.special_text_2 or else "" != "" then card.special_text_2 else
|
||||
card.loyalty_cost_4
|
||||
+(if card.loyalty_cost_4 !="" then ": ")
|
||||
+split_text(match:"\n", card.rule_text_2).0
|
||||
@@ -661,13 +717,14 @@ script:
|
||||
+(if card.loyalty_cost_6 !="" then ": ")
|
||||
+(if contains(paragraph_count(card.rule_text_2), match:"••") then split_text(match:"\n", card.rule_text_2).2)
|
||||
+(if contains(paragraph_count(card.rule_text_2), match:"•••") then "\n"))
|
||||
+"\n---\n(Front): "+strip_card_name(card_name())+"\</text>"
|
||||
+"\n---\n(Front): "+strip_card_name(card_name()))+"\</text>"
|
||||
+ (if filter_token(card.notes) != "" then remove_empty(convert_token(filter_token(card.notes))))
|
||||
+"\n "+"\</card>"
|
||||
}
|
||||
write_sacrificer := {
|
||||
"\n "+"\<card>"
|
||||
# Name
|
||||
+"\n "+"\<name>"+options.append_String_To_Names+strip_card_name(card_name())
|
||||
+"\n "+"\<name>"+xml_escape(options.append_String_To_Names+strip_card_name(card_name()))
|
||||
#+" | ("+strip_card_name(card.name_2)+")"
|
||||
+"\</name>"
|
||||
# Set
|
||||
@@ -677,23 +734,24 @@ script:
|
||||
else if contains(card.rarity,match:"mythic") then "\"mythic\""
|
||||
else if contains(card.rarity,match:"rare") then "\"rare\""
|
||||
else "\"\"")
|
||||
+ " splitterPath=\""+"/"+options.append_String_To_Names+strip_card_name(card_name())+".full." + to_lower(options.images_File_Type) + "\" >"+set.set_code+"\</set>"
|
||||
+ " splitterPath=\""+"/"+options.append_String_To_Names+strip_card_name(card_name())+"." + file_type() + "\" >"+setcode+"\</set>"
|
||||
+"\n "+"\<prop>"
|
||||
# Color
|
||||
+"\n "+"\<color>"
|
||||
+ card_color()
|
||||
+"\</color>"
|
||||
# Name of the related card
|
||||
+"\n "+"\<related attach=\"attach\">"+strip_card_name(card.name_2)+"\</related>"
|
||||
# Mana Cost
|
||||
+"\n "+"\<manacost>"+card.casting_cost+"\</manacost>"
|
||||
# Converted Mana Cost
|
||||
+"\n "+"\<cmc>"+card.cmc+"\</cmc>"
|
||||
# Type
|
||||
+"\n "+"\<type>"+replace(card.type, match:"—", replace:"-")+"\</type>"
|
||||
+"\n "+"\<type>"+xml_escape(replace(card.type, match:"—", replace:"-"))+"\</type>"
|
||||
+maintype()
|
||||
# Loyalty
|
||||
+(if contains(card.type, match:"Planeswalker") then "\n "+"\<loyalty>"+card.loyalty+"\</loyalty>")
|
||||
# P/T
|
||||
+(if contains(card.type, match:"Creature") then "\n "+"\<pt>"+card.pt+"\</pt>")
|
||||
+(if contains(card.type, match:"Creature") then "\n "+"\<pt>"+xml_escape(card.pt)+"\</pt>")
|
||||
+"\n "+"\</prop>"
|
||||
# Tablerow
|
||||
+"\n "+"\<tablerow>"
|
||||
+(if contains(card.type_2, match:"Instant") or contains(card.type_2, match:"Sorcery") then "3"
|
||||
@@ -703,7 +761,7 @@ script:
|
||||
+"\</tablerow>"
|
||||
# Rules Text
|
||||
+"\n "+"\<text>"
|
||||
+(if card.special_text or else "" != "" then card.special_text else
|
||||
+xml_escape((if card.special_text or else "" != "" then card.special_text else
|
||||
card.loyalty_cost_1
|
||||
+(if card.loyalty_cost_1 !="" then ": ")
|
||||
+split_text(match:"\n", card.rule_text).0
|
||||
@@ -716,13 +774,16 @@ script:
|
||||
+(if card.loyalty_cost_3 !="" then ": ")
|
||||
+(if contains(paragraph_count(card.rule_text), match:"••") then split_text(match:"\n", card.rule_text).2)
|
||||
+(if contains(paragraph_count(card.rule_text), match:"•••") then "\n"))
|
||||
+"\n---\n(Back): "+strip_card_name(card.name_2)+"\</text>"
|
||||
+"\n---\n(Back): "+strip_card_name(card.name_2))+"\</text>"
|
||||
# Name of the related card
|
||||
+"\n "+"\<related attach=\"attach\">"+xml_escape(strip_card_name(card.name_2))+"\</related>"
|
||||
+ (if filter_token(card.notes) != "" then remove_empty(convert_token(filter_token(card.notes))))
|
||||
+"\n "+"\</card>"
|
||||
+"\n "+"\<card>"
|
||||
# Name II
|
||||
+"\n "+"\<name>"
|
||||
#+"("+strip_card_name(card_name())+") | "
|
||||
+strip_card_name(card.name_2)
|
||||
+xml_escape(strip_card_name(card.name_2))
|
||||
+"\</name>"
|
||||
# Set II
|
||||
+"\n "+"\<set rarity="
|
||||
@@ -731,7 +792,8 @@ script:
|
||||
else if contains(card.rarity,match:"mythic") then "\"mythic\""
|
||||
else if contains(card.rarity,match:"rare") then "\"rare\""
|
||||
else "\"\"")
|
||||
+ " splitterPath=\""+"/"+strip_card_name(card.name_2)+".full." + to_lower(options.images_File_Type) + "\" >"+set.set_code+"\</set>"
|
||||
+ " splitterPath=\""+"/"+strip_card_name(card.name_2)+"." + file_type() + "\" >"+setcode+"\</set>"
|
||||
+"\n "+"\<prop>"
|
||||
# Color II
|
||||
+"\n "+"\<color>"
|
||||
+ card_color_2()
|
||||
@@ -741,12 +803,10 @@ script:
|
||||
# Converted Mana Cost II
|
||||
+"\n "+"\<cmc>"+card.cmc+"\</cmc>"
|
||||
# Type II
|
||||
+"\n "+"\<type>"+replace(card.type_2, match:"—", replace:"-")+"\</type>"
|
||||
+"\n "+"\<type>"+xml_escape(replace(card.type_2, match:"—", replace:"-"))+"\</type>"
|
||||
# P/T II
|
||||
+(if contains(card.type_2, match:"Creature") then "\n ")
|
||||
+(if contains(card.type_2, match:"Creature") then "\<pt>")
|
||||
+(if contains(card.type_2, match:"Creature") then card.pt_2)
|
||||
+(if contains(card.type_2, match:"Creature") then "\</pt>")
|
||||
+(if contains(card.type_2, match:"Creature") then "\n "+"\<pt>"+xml_escape(card.pt_2)+"\</pt>")
|
||||
+"\n "+"\</prop>"
|
||||
# Tablerow II
|
||||
+"\n "+"\<tablerow>"
|
||||
+(if contains(card.type_2, match:"Instant") or contains(card.type_2, match:"Sorcery") then "3"
|
||||
@@ -755,14 +815,15 @@ script:
|
||||
else "1")
|
||||
+"\</tablerow>"
|
||||
# Rules Text II
|
||||
+"\n "+"\<text>"+card_rules_text_2()
|
||||
+"\n---\n(Front): "+strip_card_name(card_name())+"\</text>"
|
||||
+"\n "+"\<text>"+xml_escape(card_rules_text_2()
|
||||
+"\n---\n(Front): "+strip_card_name(card_name()))+"\</text>"
|
||||
+ (if filter_token(card.notes) != "" then remove_empty(convert_token(filter_token(card.notes))))
|
||||
+"\n "+"\</card>"
|
||||
}
|
||||
write_leveler := {
|
||||
"\n "+"\<card>"
|
||||
# Name
|
||||
+"\n "+"\<name>"+options.append_String_To_Names+strip_card_name(card_name())+"\</name>"
|
||||
+"\n "+"\<name>"+xml_escape(options.append_String_To_Names+strip_card_name(card_name()))+"\</name>"
|
||||
# Set
|
||||
+"\n "+"\<set rarity="
|
||||
+(if contains(card.rarity,match:"uncommon") then "\"uncommon\""
|
||||
@@ -770,7 +831,8 @@ script:
|
||||
else if contains(card.rarity,match:"mythic") then "\"mythic\""
|
||||
else if contains(card.rarity,match:"rare") then "\"rare\""
|
||||
else "\"\"")
|
||||
+ ">"+set.set_code+"\</set>"
|
||||
+ ">"+setcode+"\</set>"
|
||||
+"\n "+"\<prop>"
|
||||
# Color
|
||||
+"\n "+"\<color>"
|
||||
+ card_color()
|
||||
@@ -779,15 +841,12 @@ script:
|
||||
+"\n "+"\<manacost>"+card.casting_cost+"\</manacost>"
|
||||
# Converted Mana Cost
|
||||
+"\n "+"\<cmc>"+card.cmc+"\</cmc>"
|
||||
# Converted Mana Cost II
|
||||
+"\n "+"\<cmc>"+card.cmc+"\</cmc>"
|
||||
# Type
|
||||
+"\n "+"\<type>"+replace(card.type, match:"—", replace:"-")+"\</type>"
|
||||
+"\n "+"\<type>"+xml_escape(replace(card.type, match:"—", replace:"-"))+"\</type>"
|
||||
+maintype()
|
||||
# P/T
|
||||
+(if contains(card.type, match:"Creature") then "\n ")
|
||||
+(if contains(card.type, match:"Creature") then "\<pt>")
|
||||
+(if contains(card.type, match:"Creature") then card.pt)
|
||||
+(if contains(card.type, match:"Creature") then "\</pt>")
|
||||
+(if contains(card.type, match:"Creature") then "\n "+"\<pt>"+xml_escape(card.pt)+"\</pt>")
|
||||
+"\n "+"\</prop>"
|
||||
#CIPT
|
||||
+ CIPT()
|
||||
# Tablerow
|
||||
@@ -800,7 +859,7 @@ script:
|
||||
# Rules Text
|
||||
+"\n "+"\<text>"
|
||||
#Level I
|
||||
+card_rules_text()
|
||||
+xml_escape(card_rules_text()
|
||||
# Level II
|
||||
+"\nLEVEL " + card.level_1
|
||||
+(if card.pt_2 != "" then "\n"+card.pt_2)
|
||||
@@ -808,8 +867,9 @@ script:
|
||||
# Level III
|
||||
+"\nLEVEL " + card.level_2
|
||||
+(if card.pt_3 != "" then "\n"+card.pt_3)
|
||||
+"\n"+card.rule_text_3
|
||||
+"\n"+card.rule_text_3)
|
||||
+"\</text>"
|
||||
+ (if filter_token(card.notes) != "" then remove_empty(convert_token(filter_token(card.notes))))
|
||||
+"\n "+"\</card>"
|
||||
}
|
||||
|
||||
@@ -833,15 +893,15 @@ script:
|
||||
{
|
||||
write_image_file(
|
||||
card,
|
||||
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 "_" + card.name_2}.full." + to_lower(options.images_File_Type),
|
||||
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(),
|
||||
width: (if contains(card.shape, match:"split") or contains(card.shape, match:"double") then 752 else 375),
|
||||
height: 523
|
||||
)
|
||||
}
|
||||
|
||||
#if images are set to be rendered, render all images of rarities that have been selected
|
||||
write_images := if options.export_Images then for each card in filter_list(cards,filter:{included_rarity(card:input)}) do write_image() else ""
|
||||
write_images := if options.export_Images != "no" then for each card in filter_list(cards,filter:{included_rarity(card:input)}) do write_image() else ""
|
||||
|
||||
write_cards := to_text(for each card in cards do write_card())
|
||||
write_all_tokens := to_text(for each card in cards do write_token_if_token())
|
||||
@@ -849,7 +909,7 @@ script:
|
||||
#Main export script
|
||||
|
||||
#tokens in Separate XML
|
||||
if (options.include_Tokens and options.tokens_In_Separate_XML) then write_text_file(file:set.set_code + " Tokens" + ".xml", to_string("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<cockatrice_carddatabase version=\"3\">\n<cards>\n"+write_all_tokens+"\n\n</cards>\n</cockatrice_carddatabase>"))
|
||||
if (chosen(options.rarities_to_export, choice:"token") and options.tokens_In_Separate_XML) then write_text_file(file:set.set_code + " Tokens" + ".xml", to_string("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<cockatrice_carddatabase version=\"4\">\n <cards>\n"+write_all_tokens+"\n\n </cards>\n</cockatrice_carddatabase>"))
|
||||
|
||||
#other cards
|
||||
to_string("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<cockatrice_carddatabase version=\"3\">\n<sets>\n<set>\n<name>"+set.set_code+"</name>\n<longname>"+set.title+"</longname>\n<settype>"+options.cockatrice_Set_Type+"</settype>\n</set>\n</sets>\n<cards>\n"+write_cards+if (options.include_Tokens and not(options.tokens_In_Separate_XML)) then ("\n\n<!-->Tokens</-->\n"+write_all_tokens)+"\n\n</cards>\n</cockatrice_carddatabase>")
|
||||
to_string("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<cockatrice_carddatabase version=\"4\">\n <sets>\n <set>\n <name>"+setcode+"</name>\n <longname>"+xml_escape(set.title)+"</longname>\n <settype>"+xml_escape(options.cockatrice_Set_Type)+"</settype>\n </set>\n </sets>\n <cards>\n"+write_cards+if (chosen(options.rarities_to_export, choice:"token") and not(options.tokens_In_Separate_XML)) then ("\n\n <!-->Tokens</-->\n"+write_all_tokens)+"\n\n </cards>\n</cockatrice_carddatabase>")
|
||||
BIN
data/magic-cockatrice-v2.mse-export-template/icon.png
Normal file
BIN
data/magic-cockatrice-v2.mse-export-template/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.3 KiB |
Reference in New Issue
Block a user