diff --git a/data/yugioh.mse-game/auto_replace b/data/yugioh.mse-game/auto_replace new file mode 100644 index 00000000..1057572f --- /dev/null +++ b/data/yugioh.mse-game/auto_replace @@ -0,0 +1,16 @@ + +############################################################## Auto replace + +auto replace: + match: (C) + replace: © +auto replace: + match: CR + replace: © +auto replace: + match: TM + replace: ™ + whole word: false +auto replace: + match: ~ + replace: CARDNAME \ No newline at end of file diff --git a/data/yugioh.mse-game/card_fields b/data/yugioh.mse-game/card_fields index 5d294945..1c707988 100644 --- a/data/yugioh.mse-game/card_fields +++ b/data/yugioh.mse-game/card_fields @@ -78,39 +78,60 @@ card field: name: image show statistics: false ############################# Card type +# Keep type1, type2, and separator fields for backwards compatibility until two or three versions after 0.3.8. card field: type: text name: type1 script: monster_type_filter(value) - default: " " + default: " " editable: false -card field: - type: text - name: separator - script: " / " show statistics: false - editable: false card field: type: text name: type2 script: card_class_filter(value) editable: false + show statistics: false +card field: + type: text + name: separator + script: " / " + editable: false + save value: false + show statistics: false +# These are the new type fields. +card field: + type: text + name: type 1 + script: monster_type_filter(value) + default: card.type1 # Remove when card.type1 is removed. +card field: + type: text + name: type 2 + script: card_class_filter(value) + default: split_text(match:" / ", card.type2).0 # Remove when card.type2 is removed. +card field: + type: text + name: type 3 + script: card_class_filter(value) + default: if contains(card.type2, match:" / ") then split_text(match:" / ", card.type2).1 else "" # Remove when card.type2 is removed. card field: type: text name: monster type script: # Either just monster, monster / type1 combined_editor( - field1: card.type1, - separator: card.separator, - field2: card.type2, + field1: card.type_1, + separator1: " / ", + field2: card.type_2, + separator2: " / ", + field3: card.type_3, soft_before_empty: true, - hide_when_empty: true, - type_over1: " /", - type_over2: "/" + hide_when_empty: true ) card list visible: true card list column: 3 + show statistics: false ############################# Edition and Card ID card field: type: text @@ -200,5 +221,4 @@ card field: type: text name: copyright default: set.copyright - script: copyright_filter(value) show statistics: false diff --git a/data/yugioh.mse-game/game b/data/yugioh.mse-game/game index 564157d2..4e9487f0 100644 --- a/data/yugioh.mse-game/game +++ b/data/yugioh.mse-game/game @@ -5,7 +5,7 @@ installer group: Yugioh/game files icon: card-back.png position hint: 4 -version: 2009-08-08 +version: 2009-08-09 ############################################################## The script @@ -17,5 +17,6 @@ include file: card_fields include file: set_fields include file: packs include file: word_lists +include file: auto_replace ############################################################## Other stuff \ No newline at end of file diff --git a/data/yugioh.mse-game/script b/data/yugioh.mse-game/script index 64f5d59a..c8cacf4a 100644 --- a/data/yugioh.mse-game/script +++ b/data/yugioh.mse-game/script @@ -13,7 +13,7 @@ tag_remove_rule(tag: "") + # step 2 : expand shortcut words ~ and CARDNAME replace_rule( - match: "~|~THIS~|CARDNAME", + match: "CARDNAME", in_context: "(^|[[:space:]]|\\()", # TODO: Allow any punctuation before replace: "" ) + @@ -44,15 +44,6 @@ replace_rule( match: "\\?", replace: "&" ); - copyright_filter := - # step 1 : trademark symbol - replace_rule( - match: "TM", - replace: "™") + - # step 2 : copyright symbol - replace_rule( - match: "CR|\\(C\\)", - replace: "©") # the flavor text filter flavor_text_filter := @@ -61,7 +52,7 @@ # step 2 : surround by tags { "" + input + "" }; - type_over_list := replace_rule(match:" ?-$", replace:"") + type_over_list := replace_rule(match:" ?/", replace:"") monster_type_filter := tag_remove_rule(tag: "Divine-Beast" then "obelisk" - else if card.type1 == "Legendary Dragon" then "legendary dragons" - else if contains(card.type2, match:"Fusion") then "fusion monster" - else if contains(card.type2, match:"Ritual") then "ritual monster" - else if contains(card.type2, match:"Dark Synchro") then "dark synchro monster" - else if contains(card.type2, match:"Dark Tuner") then "effect monster" - else if contains(card.type2, match:"Synchro") then "synchro monster" - else if contains(card.type2, match:"Effect") then "effect monster" - else if contains(card.type2, match:"Spirit") then "effect monster" - else if contains(card.type2, match:"Toon") then "effect monster" - else if contains(card.type2, match:"Tuner") then "effect monster" - else if contains(card.type2, match:"Union") then "effect monster" - else "normal monster" + else if card.type_1 == "Divine-Beast" then "obelisk" + else if card.type_1 == "Legendary Dragon" then "legendary dragons" + else if contains(card.monster_type, match:"Fusion") then "fusion monster" + else if contains(card.monster_type, match:"Ritual") then "ritual monster" + else if contains(card.monster_type, match:"Dark Synchro") then "dark synchro monster" + else if contains(card.monster_type, match:"Dark Tuner") then "effect monster" + else if contains(card.monster_type, match:"Synchro") then "synchro monster" + else if contains(card.monster_type, match:"Effect") then "effect monster" + else if contains(card.monster_type, match:"Spirit") then "effect monster" + else if contains(card.monster_type, match:"Toon") then "effect monster" + else if contains(card.monster_type, match:"Tuner") then "effect monster" + else if contains(card.monster_type, match:"Union") then "effect monster" + else "normal monster" } # Default 'attribute' of card attribute := {