Commit fdb6ff58 authored by pichoro's avatar pichoro

Update to Yugioh

- Better typeline system.
- Moved text replacements out of scripts and into auto_replace file.
parent f9375415

############################################################## 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
...@@ -78,39 +78,60 @@ card field: ...@@ -78,39 +78,60 @@ card field:
name: image name: image
show statistics: false show statistics: false
############################# Card type ############################# Card type
# Keep type1, type2, and separator fields for backwards compatibility until two or three versions after 0.3.8.
card field: card field:
type: text type: text
name: type1 name: type1
script: monster_type_filter(value) script: monster_type_filter(value)
default: " " default: " "
editable: false editable: false
show statistics: false
card field:
type: text
name: type2
script: card_class_filter(value)
editable: false
show statistics: false
card field: card field:
type: text type: text
name: separator name: separator
script: " / " script: " / "
show statistics: false
editable: false editable: false
save value: false
show statistics: false
# These are the new type fields.
card field: card field:
type: text type: text
name: type2 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) script: card_class_filter(value)
editable: false 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: card field:
type: text type: text
name: monster type name: monster type
script: script:
# Either just monster, monster / type1 # Either just monster, monster / type1
combined_editor( combined_editor(
field1: card.type1, field1: card.type_1,
separator: card.separator, separator1: " / ",
field2: card.type2, field2: card.type_2,
separator2: " / ",
field3: card.type_3,
soft_before_empty: true, soft_before_empty: true,
hide_when_empty: true, hide_when_empty: true
type_over1: " /",
type_over2: "/"
) )
card list visible: true card list visible: true
card list column: 3 card list column: 3
show statistics: false
############################# Edition and Card ID ############################# Edition and Card ID
card field: card field:
type: text type: text
...@@ -200,5 +221,4 @@ card field: ...@@ -200,5 +221,4 @@ card field:
type: text type: text
name: copyright name: copyright
default: set.copyright default: set.copyright
script: copyright_filter(value)
show statistics: false show statistics: false
...@@ -5,7 +5,7 @@ installer group: Yugioh/game files ...@@ -5,7 +5,7 @@ installer group: Yugioh/game files
icon: card-back.png icon: card-back.png
position hint: 4 position hint: 4
version: 2009-08-08 version: 2009-08-09
############################################################## The script ############################################################## The script
...@@ -17,5 +17,6 @@ include file: card_fields ...@@ -17,5 +17,6 @@ include file: card_fields
include file: set_fields include file: set_fields
include file: packs include file: packs
include file: word_lists include file: word_lists
include file: auto_replace
############################################################## Other stuff ############################################################## Other stuff
\ No newline at end of file
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
tag_remove_rule(tag: "<sym-auto>") + tag_remove_rule(tag: "<sym-auto>") +
# step 2 : expand shortcut words ~ and CARDNAME # step 2 : expand shortcut words ~ and CARDNAME
replace_rule( replace_rule(
match: "~|~THIS~|CARDNAME", match: "CARDNAME",
in_context: "(^|[[:space:]]|\\()<match>", # TODO: Allow any punctuation before in_context: "(^|[[:space:]]|\\()<match>", # TODO: Allow any punctuation before
replace: "<atom-cardname></atom-cardname>" replace: "<atom-cardname></atom-cardname>"
) + ) +
...@@ -44,15 +44,6 @@ ...@@ -44,15 +44,6 @@
replace_rule( replace_rule(
match: "\\?", match: "\\?",
replace: "<sym-auto>&</sym-auto>" ); replace: "<sym-auto>&</sym-auto>" );
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 # the flavor text filter
flavor_text_filter := flavor_text_filter :=
...@@ -61,7 +52,7 @@ ...@@ -61,7 +52,7 @@
# step 2 : surround by <i> tags # step 2 : surround by <i> tags
{ "<i-flavor>" + input + "</i-flavor>" }; { "<i-flavor>" + input + "</i-flavor>" };
type_over_list := replace_rule(match:" ?-$", replace:"") type_over_list := replace_rule(match:" ?/", replace:"")
monster_type_filter := monster_type_filter :=
tag_remove_rule(tag: "<word-list-") + tag_remove_rule(tag: "<word-list-") +
...@@ -82,18 +73,18 @@ ...@@ -82,18 +73,18 @@
else if contains(card.level, match:"Spell Card") then "spell card" else if contains(card.level, match:"Spell Card") then "spell card"
else if card.attribute == "trap" then "trap card" else if card.attribute == "trap" then "trap card"
else if contains(card.level, match:"Trap Card") then "trap card" else if contains(card.level, match:"Trap Card") then "trap card"
else if card.type1 == "<word-list-monster>Divine-Beast</word-list-monster>" then "obelisk" else if card.type_1 == "<word-list-monster>Divine-Beast</word-list-monster>" then "obelisk"
else if card.type1 == "<word-list-monster>Legendary Dragon</word-list-monster>" then "legendary dragons" else if card.type_1 == "<word-list-monster>Legendary Dragon</word-list-monster>" then "legendary dragons"
else if contains(card.type2, match:"Fusion") then "fusion monster" else if contains(card.monster_type, match:"Fusion") then "fusion monster"
else if contains(card.type2, match:"Ritual") then "ritual monster" else if contains(card.monster_type, match:"Ritual") then "ritual monster"
else if contains(card.type2, match:"Dark Synchro") then "dark synchro monster" else if contains(card.monster_type, match:"Dark Synchro") then "dark synchro monster"
else if contains(card.type2, match:"Dark Tuner") then "effect monster" else if contains(card.monster_type, match:"Dark Tuner") then "effect monster"
else if contains(card.type2, match:"Synchro") then "synchro monster" else if contains(card.monster_type, match:"Synchro") then "synchro monster"
else if contains(card.type2, match:"Effect") then "effect monster" else if contains(card.monster_type, match:"Effect") then "effect monster"
else if contains(card.type2, match:"Spirit") then "effect monster" else if contains(card.monster_type, match:"Spirit") then "effect monster"
else if contains(card.type2, match:"Toon") then "effect monster" else if contains(card.monster_type, match:"Toon") then "effect monster"
else if contains(card.type2, match:"Tuner") then "effect monster" else if contains(card.monster_type, match:"Tuner") then "effect monster"
else if contains(card.type2, match:"Union") then "effect monster" else if contains(card.monster_type, match:"Union") then "effect monster"
else "normal monster" else "normal monster"
} }
# Default 'attribute' of card # Default 'attribute' of card
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment