# the rule text filter # - adds continuous symbols # - adds counter symbols # - adds equipment symbols # - adds field symbols # - adds quickplay symbols # - adds ritual symbols # - adds level symbols # - adds infinity symbols # - makes text in parentheses italic text_filter := # step 1 : remove all automatic tags tag_remove_rule(tag: "") + # step 2 : expand shortcut words ~ and CARDNAME replace_rule( match: "CARDNAME", in_context: "(^|[[:space:]]|\\()", # TODO: Allow any punctuation before replace: "" ) + # step 3 : fill in the cardname atom field tag_contents_rule( tag: "", contents: { if card.name=="" then "CARDNAME" else card.name } ) + # step 4 : symbols replace_rule( match: "[|@|*|?|]", replace: "&" ); level_filter := # step 1 : remove all automatic tags tag_remove_rule(tag: "") + # step 2 : symbols replace_rule( match: "[|%|!|+|&|$|#|*|^|]", replace: "&" ); a_and_d_filter := # step 1 : remove all automatic tags tag_remove_rule(tag: "") + # step 2 : infinity replace_rule( match: "@", replace: "&" ) + # step 3 : question mark replace_rule( match: "\\?", replace: "&" ); # the flavor text filter flavor_text_filter := # step 1 : remove italic tags tag_remove_rule(tag: "") + # step 2 : surround by tags { "" + input + "" }; type_over_list := replace_rule(match:" ?/", replace:"") monster_type_filter := tag_remove_rule(tag: "{input}" } space_to_wltags := replace_rule(match:"( +| )", replace:{"{_1}"}) card_class_filter := tag_remove_rule(tag: "{input}" } # Determine type of card card_type := { if card.attribute == "spell" then "spell card" else if contains(card.level, match:"Spell Card") then "spell card" else if card.attribute == "trap" then "trap card" else if contains(card.level, match:"Trap Card") then "trap card" 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 := { if is_spell_card() then "Spell" else if is_trap_card() then "Trap" else "none" } # Default foil for a card foil := { if card.rarity == "super rare" then "holo image" else if card.rarity == "ultra rare" then "holo image" else if card.rarity == "secret rare" then "secret holo image" else if card.rarity == "ultimate rare" then "holo image" else if card.rarity == "parallel rare" then "parallel holo image" else if card.rarity == "gold tech" then "gold tech holo image" else if card.rarity == "promo" then "secret holo image" else "none" } ############### Type of card nm_ext_querry := { if set.gods_have_effects == "no" then is_normal_monster_extended(value) else is_normal_monster(value) } is_nmonster := { card.card_type == "spell card" or card.card_type == "trap card" } is_monster := { card.card_type == "normal monster" or card.card_type == "effect monster" or card.card_type == "ritual monster" or card.card_type == "dark synchro monster" or card.card_type == "synchro monster" or card.card_type == "fusion monster" or card.card_type == "token monster" or card.card_type == "obelisk" or card.card_type == "slifer" or card.card_type == "ra" or card.card_type == "legendary dragons" } is_normal_monster_extended := { card.card_type == "normal monster" or card.card_type == "obelisk" or card.card_type == "slifer" or card.card_type == "ra" or card.card_type == "legendary dragons" } is_normal_monster := { card.card_type == "normal monster" } is_spell_card := { card.card_type == "spell card" or card.attribute == "spell" or card.level == "Spell" } is_trap_card := { card.card_type == "trap card" or card.attribute == "trap" or card.level == "Trap" } ############### Determine Card Position type_sort := { type := card.card_type if chosen(choice:"normal monster", type) then "A" else if chosen(choice:"ra", type) then "B" else if chosen(choice:"effect monster", type) then "C" else if chosen(choice:"slifer", type) then "D" else if chosen(choice:"ritual monster", type) then "E" else if chosen(choice:"obelisk", type) then "F" else if chosen(choice:"fusion monster", type) then "G" else if chosen(choice:"synchro monster", type) then "H" else if chosen(choice:"dark synchro monster", type) then "I" else if chosen(choice:"token monster", type) then "J" else if chosen(choice:"legendary dragons", type) then "K" else if chosen(choice:"spell card", type) then "L" else if chosen(choice:"trap card", type) then "M" else "N" } pos_of_card := { position( of: card in: set order_by: { type_sort() + card.monster_type + card.name + card.attribute }) + 1 }