Fixed spoiler export template

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@683 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-09-09 19:07:00 +00:00
parent a485807d90
commit 38b934ce90
4 changed files with 38 additions and 43 deletions
@@ -147,7 +147,7 @@ script:
}</ul>"
}
write_group := {
cards := filter_list(set.cards, filter: { contains(match:sort_index(card:input), code } )
cards := filter_list(set.cards, filter: { contains(color_of_card(card:input), match:code) } )
count := number_of_items(in:cards)
if count > 0 then
"<h2>{title} ({count} {if count == 1 then "card" else "cards"})</h2>" +
@@ -204,7 +204,7 @@ script:
write_group(title: "Multicolor split cards", code:"H") +
write_group(title: "Colorless", code:"I") +
write_group(title: "Non-basic lands", code:"K") +
write_group(title: "Basic lands", code:"LMNOPQ")
write_group(title: "Basic lands", code:"L")
else
write_cards(cards: set.cards)
}
+31 -38
View File
@@ -170,60 +170,53 @@ init script:
############################################################## Card number
# Index for sorting, white cards are first, so white->A, blue->B, .. ,
# multi->F, hybrid->G, diff color splits -> H, arti->I, land->K, basic land->L, plains->M, island->N, swamp->O, mountain->P, forest->Q
# The code consists of 4 parts:
# normal/token, color, shifted, split
sort_index := {
(if contains(card.shape, match:"token") then "T" else "N") + # Tokens come last
color_of_card() +
(if contains(card.shape, match:"shifted") then "1" else "0") + # planeshifted cards come after normal ones
(if contains(card.shape, match:"split") then "1" else "0") # split cards come after normal ones
}
is_multicolor := { chosen(choice: "multicolor") and input != "artifact, multicolor" }
is_null_cost := { input == "" or input == "0" }
basic_land_sort := {
if contains(card.name, match:"Plains") then "LB" # Plains
else if contains(card.name, match:"Island") then "LC" # Islands
else if contains(card.name, match:"Swamp") then "LD" # Swamps
else if contains(card.name, match:"Mountain") then "LE" # Mountains
else if contains(card.name, match:"Forest") then "LF" # Forests
else "LA" # other basic lands
}
norm_or_token := {
if contains(card.shape, match:"token") then "T"
else "N"
if contains(card.name, match:"Plains") then "LB" # Plains
else if contains(card.name, match:"Island") then "LC" # Islands
else if contains(card.name, match:"Swamp") then "LD" # Swamps
else if contains(card.name, match:"Mountain") then "LE" # Mountains
else if contains(card.name, match:"Forest") then "LF" # Forests
else "LA" # other basic lands
}
color_of_card := {
card_color := card.card_color
casting_cost := card.casting_cost
if card.shape == "split" and
casting_cost != card.casting_cost_2 then "H" # Diff Color Splits
casting_cost != card.casting_cost_2 then "H" # Diff Color Splits
else if chosen(choice: "land", card_color) then (
if card.rarity != "basic land" then "K" # Nonbasic Land
if card.rarity != "basic land" then "K" # Nonbasic Land
else basic_land_sort()
) else if is_null_cost(casting_cost) then (
if chosen(choice: "hybrid", card_color) then "G" # Hybrids
else if is_multicolor(card_color) then "F" # Multicolor
else if chosen(choice:"white", card_color) then "A" # White
else if chosen(choice:"blue", card_color) then "B" # Blue
else if chosen(choice:"black", card_color) then "C" # Black
else if chosen(choice:"red", card_color) then "D" # Red
else if chosen(choice:"green", card_color) then "E" # Green
else "I" # Colorless / Artifact
if chosen(choice: "hybrid", card_color) then "G" # Hybrids
else if is_multicolor(card_color) then "F" # Multicolor
else if chosen(choice:"white", card_color) then "A" # White
else if chosen(choice:"blue", card_color) then "B" # Blue
else if chosen(choice:"black", card_color) then "C" # Black
else if chosen(choice:"red", card_color) then "D" # Red
else if chosen(choice:"green", card_color) then "E" # Green
else "I" # Colorless / Artifact
) else (
# use the casting cost
colors := sort_text(casting_cost, order: "<WUBRG>")
if colors == "" then "I" # Colorless / Artifact
else if colors == "W" then "A" # White
else if colors == "U" then "B" # Blue
else if colors == "B" then "C" # Black
else if colors == "R" then "D" # Red
else if colors == "G" then "E" # Green
else "F" # Multicolor
if colors == "" then "I" # Colorless / Artifact
else if colors == "W" then "A" # White
else if colors == "U" then "B" # Blue
else if colors == "B" then "C" # Black
else if colors == "R" then "D" # Red
else if colors == "G" then "E" # Green
else "F" # Multicolor
)
}
is_shifted := {
if contains(card.shape, match:"shifted") then "1"
else "0"
}
is_split := {
if contains(card.shape, match:"split") then "1"
else "0"
}
sort_index := { norm_or_token() + color_of_card() + is_shifted() + is_split()
}
rarity_sort := {
if set.sort_special_rarity == "with the rest" or card.rarity != "special" then "A" else "Z"