Finishing touches
fixed intending and extra linebreak on related changed name to Cockatrice v2
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
mse version: 0.3.8
|
mse version: 0.3.8
|
||||||
short name: Cockatrice
|
short name: Cockatrice
|
||||||
full name: CS/ECH 2.0
|
full name: Exporter v2.0
|
||||||
position hint: 007
|
position hint: 007
|
||||||
icon: icon.png
|
icon: icon.png
|
||||||
version: 2023-01-22
|
version: 2023-02-05
|
||||||
installer group: magic/Export/cockatrice
|
installer group: magic/Export/cockatrice
|
||||||
|
|
||||||
depends on:
|
depends on:
|
||||||
@@ -21,7 +21,7 @@ file type: *.xml|*.xml|*.*|*.*
|
|||||||
option field:
|
option field:
|
||||||
type: choice
|
type: choice
|
||||||
name: info
|
name: info
|
||||||
choice: CS/ECH 2.0, guide: https://tinyurl.com/ctexportv2
|
choice: Updated 2023/02, guide: https://tinyurl.com/ctexportv2
|
||||||
option field:
|
option field:
|
||||||
type: text
|
type: text
|
||||||
name: cockatrice Set Type
|
name: cockatrice Set Type
|
||||||
@@ -148,10 +148,10 @@ script:
|
|||||||
replace@(match:"!",replace: "") + #blank out the command ender
|
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 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) + add_persistent(entry) + ">" + xml_escape(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 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 the !token command field to <related> XML blocks
|
||||||
convert_token :=
|
convert_token :=
|
||||||
@@ -162,7 +162,7 @@ script:
|
|||||||
replace@(match:"!",replace: "") + #blank out the command ender
|
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 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 ("\<related" + add_related_count(entry) + add_attachment(entry) + add_persistent(entry) + ">" + xml_escape(strip_card_name(entry)) + "\</related>\n")}
|
{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_related := filter_text@(match:"!relate ?[^!]+!?")
|
||||||
@@ -258,7 +258,7 @@ script:
|
|||||||
+ CIPT()
|
+ CIPT()
|
||||||
# Rules Text
|
# Rules Text
|
||||||
+"\n "+"\<text>"+xml_escape(card_rules_text())+"\</text>"
|
+"\n "+"\<text>"+xml_escape(card_rules_text())+"\</text>"
|
||||||
+ (if filter_token(card.notes) != "" then remove_empty("\n " + convert_token(filter_token(card.notes))))
|
+ (if filter_token(card.notes) != "" then remove_empty(convert_token(filter_token(card.notes))))
|
||||||
+"\n "+"\</card>"
|
+"\n "+"\</card>"
|
||||||
}
|
}
|
||||||
write_token := {
|
write_token := {
|
||||||
@@ -293,7 +293,7 @@ script:
|
|||||||
+ "\n "+"\<token>1\</token>"
|
+ "\n "+"\<token>1\</token>"
|
||||||
# Reverse Related
|
# Reverse Related
|
||||||
#if there is a !related block in the cards notes, set up the reverse-related XML elements
|
#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>"
|
+"\n "+"\</card>"
|
||||||
}
|
}
|
||||||
write_flip := {
|
write_flip := {
|
||||||
@@ -365,7 +365,7 @@ script:
|
|||||||
+"\</tablerow>"
|
+"\</tablerow>"
|
||||||
# Rules Text
|
# Rules Text
|
||||||
+"\n "+"\<text>"+xml_escape(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("\n " + convert_token(filter_token(card.notes))))
|
+ (if filter_token(card.notes) != "" then remove_empty(convert_token(filter_token(card.notes))))
|
||||||
+"\n "+"\</card>"
|
+"\n "+"\</card>"
|
||||||
}
|
}
|
||||||
write_double := {
|
write_double := {
|
||||||
@@ -409,7 +409,7 @@ script:
|
|||||||
+"\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
|
# Name of the related card
|
||||||
+"\n "+"\<related attach=\"attach\">"+xml_escape(strip_card_name(card.name_2))+"\</related>"
|
+"\n "+"\<related attach=\"attach\">"+xml_escape(strip_card_name(card.name_2))+"\</related>"
|
||||||
+ (if filter_token(card.notes) != "" then remove_empty("\n " + convert_token(filter_token(card.notes))))
|
+ (if filter_token(card.notes) != "" then remove_empty(convert_token(filter_token(card.notes))))
|
||||||
+"\n "+"\</card>"
|
+"\n "+"\</card>"
|
||||||
+"\n "+"\<card>"
|
+"\n "+"\<card>"
|
||||||
# Name II
|
# Name II
|
||||||
@@ -449,7 +449,7 @@ script:
|
|||||||
# Rules Text II
|
# Rules Text II
|
||||||
+"\n "+"\<text>"+xml_escape(card_rules_text_2()
|
+"\n "+"\<text>"+xml_escape(card_rules_text_2()
|
||||||
+"\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("\n " + convert_token(filter_token(card.notes))))
|
+ (if filter_token(card.notes) != "" then remove_empty(convert_token(filter_token(card.notes))))
|
||||||
+"\n "+"\</card>"
|
+"\n "+"\</card>"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -507,7 +507,7 @@ script:
|
|||||||
+(if card.loyalty_cost_4 !="" then ": ")
|
+(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>"
|
+"\</text>"
|
||||||
+ (if filter_token(card.notes) != "" then remove_empty("\n " + convert_token(filter_token(card.notes))))
|
+ (if filter_token(card.notes) != "" then remove_empty(convert_token(filter_token(card.notes))))
|
||||||
+"\n "+"\</card>"
|
+"\n "+"\</card>"
|
||||||
}
|
}
|
||||||
write_double_walker := {
|
write_double_walker := {
|
||||||
@@ -566,7 +566,7 @@ script:
|
|||||||
+"\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
|
# Name of the related card
|
||||||
+"\n "+"\<related attach=\"attach\">"+xml_escape(strip_card_name(card.name_2))+"\</related>"
|
+"\n "+"\<related attach=\"attach\">"+xml_escape(strip_card_name(card.name_2))+"\</related>"
|
||||||
+ (if filter_token(card.notes) != "" then remove_empty("\n " + convert_token(filter_token(card.notes))))
|
+ (if filter_token(card.notes) != "" then remove_empty(convert_token(filter_token(card.notes))))
|
||||||
+"\n "+"\</card>"
|
+"\n "+"\</card>"
|
||||||
+"\n "+"\<card>"
|
+"\n "+"\<card>"
|
||||||
# Name II
|
# Name II
|
||||||
@@ -620,7 +620,7 @@ script:
|
|||||||
+(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 split_text(match:"\n", card.rule_text_2).2)
|
||||||
+(if contains(paragraph_count(card.rule_text_2), match:"•••") then "\n"))
|
+(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("\n " + convert_token(filter_token(card.notes))))
|
+ (if filter_token(card.notes) != "" then remove_empty(convert_token(filter_token(card.notes))))
|
||||||
+"\n "+"\</card>"
|
+"\n "+"\</card>"
|
||||||
}
|
}
|
||||||
write_sparker := {
|
write_sparker := {
|
||||||
@@ -664,7 +664,7 @@ script:
|
|||||||
+"\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
|
# Name of the related card
|
||||||
+"\n "+"\<related attach=\"attach\">"+xml_escape(strip_card_name(card.name_2))+"\</related>"
|
+"\n "+"\<related attach=\"attach\">"+xml_escape(strip_card_name(card.name_2))+"\</related>"
|
||||||
+ (if filter_token(card.notes) != "" then remove_empty("\n " + convert_token(filter_token(card.notes))))
|
+ (if filter_token(card.notes) != "" then remove_empty(convert_token(filter_token(card.notes))))
|
||||||
+"\n "+"\</card>"
|
+"\n "+"\</card>"
|
||||||
+"\n "+"\<card>"
|
+"\n "+"\<card>"
|
||||||
# Name II
|
# Name II
|
||||||
@@ -718,7 +718,7 @@ script:
|
|||||||
+(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 split_text(match:"\n", card.rule_text_2).2)
|
||||||
+(if contains(paragraph_count(card.rule_text_2), match:"•••") then "\n"))
|
+(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("\n " + convert_token(filter_token(card.notes))))
|
+ (if filter_token(card.notes) != "" then remove_empty(convert_token(filter_token(card.notes))))
|
||||||
+"\n "+"\</card>"
|
+"\n "+"\</card>"
|
||||||
}
|
}
|
||||||
write_sacrificer := {
|
write_sacrificer := {
|
||||||
@@ -777,7 +777,7 @@ script:
|
|||||||
+"\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
|
# Name of the related card
|
||||||
+"\n "+"\<related attach=\"attach\">"+xml_escape(strip_card_name(card.name_2))+"\</related>"
|
+"\n "+"\<related attach=\"attach\">"+xml_escape(strip_card_name(card.name_2))+"\</related>"
|
||||||
+ (if filter_token(card.notes) != "" then remove_empty("\n " + convert_token(filter_token(card.notes))))
|
+ (if filter_token(card.notes) != "" then remove_empty(convert_token(filter_token(card.notes))))
|
||||||
+"\n "+"\</card>"
|
+"\n "+"\</card>"
|
||||||
+"\n "+"\<card>"
|
+"\n "+"\<card>"
|
||||||
# Name II
|
# Name II
|
||||||
@@ -817,7 +817,7 @@ script:
|
|||||||
# Rules Text II
|
# Rules Text II
|
||||||
+"\n "+"\<text>"+xml_escape(card_rules_text_2()
|
+"\n "+"\<text>"+xml_escape(card_rules_text_2()
|
||||||
+"\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("\n " + convert_token(filter_token(card.notes))))
|
+ (if filter_token(card.notes) != "" then remove_empty(convert_token(filter_token(card.notes))))
|
||||||
+"\n "+"\</card>"
|
+"\n "+"\</card>"
|
||||||
}
|
}
|
||||||
write_leveler := {
|
write_leveler := {
|
||||||
@@ -869,7 +869,7 @@ script:
|
|||||||
+(if card.pt_3 != "" then "\n"+card.pt_3)
|
+(if card.pt_3 != "" then "\n"+card.pt_3)
|
||||||
+"\n"+card.rule_text_3)
|
+"\n"+card.rule_text_3)
|
||||||
+"\</text>"
|
+"\</text>"
|
||||||
+ (if filter_token(card.notes) != "" then remove_empty("\n " + convert_token(filter_token(card.notes))))
|
+ (if filter_token(card.notes) != "" then remove_empty(convert_token(filter_token(card.notes))))
|
||||||
+"\n "+"\</card>"
|
+"\n "+"\</card>"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
Reference in New Issue
Block a user