Fix various template warnings (#32)

- Missing :
- Deprecated =
- Not valid color name
- Must always return statement
This commit is contained in:
GenevensiS
2024-02-11 04:37:08 +01:00
committed by GitHub
parent 1ca8a98b3e
commit b7fb27fbb5
26 changed files with 141 additions and 143 deletions

View File

@@ -1052,16 +1052,16 @@ init script:
# Names of colors
color_name := {
if input = "W" then "white"
else if input = "U" then "blue"
else if input = "B" then "black"
else if input = "R" then "red"
else if input = "G" then "green"
else if input = "L" then "yellow"
else if input = "P" then "purple"
else if input = "O" then "orange"
else if input = "E" then "brown"
else if input = "K" then "pink"
if input == "W" then "white"
else if input == "U" then "blue"
else if input == "B" then "black"
else if input == "R" then "red"
else if input == "G" then "green"
else if input == "L" then "yellow"
else if input == "P" then "purple"
else if input == "O" then "orange"
else if input == "E" then "brown"
else if input == "K" then "pink"
else ""
}
color_names_6 := { color_name(colors.0) + ", " + color_name(colors.1) + ", " + color_name(colors.2) + ", " + color_name(colors.3) + ", " + color_name(colors.4) + ", " + color_name(colors.5) }
@@ -1071,7 +1071,7 @@ init script:
color_filterS := sort_text@(order: "<S>")
mana_to_color := {
count := number_of_items(in: colors)
if hybrid == "" and snow = "" and contains(type, match:"Artifact") then
if hybrid == "" and snow == "" and contains(type, match:"Artifact") then
# not a hybrid, not snow costed, but artifact
if count == 0 then "colorless"
else if count == 1 then color_names_1() + ", artifact"
@@ -1172,7 +1172,7 @@ init script:
if text != "" then (
if contains(text, match: "all colors") then (
colors := "WUBRGLPOEK"
if land = "land" then land_multicolor()
if land == "land" then land_multicolor()
else mana_to_color(hybrid: "")
) else (
colors := ""
@@ -1186,11 +1186,13 @@ init script:
if contains(text, match: "orange") then colors := colors + "O"
if contains(text, match: "brown") then colors := colors + "E"
if contains(text, match: "pink") then colors := colors + "K"
if land = "land" then land_multicolor()
if land == "land" then land_multicolor()
else mana_to_color(hybrid: "")
)
)
else ""
)
else ""
}
card_color := {
@@ -1232,53 +1234,53 @@ init script:
hybrid_color_pair_sort := {
colors := sort_text(casting_cost, order: "<WUBRGLPOEK>")
if not set.sort_hybrid_in_pairs then "HK"
else if colors = "WU" then "HA"
else if colors = "UB" then "HB"
else if colors = "BR" then "HC"
else if colors = "RG" then "HD"
else if colors = "WG" then "HE"
else if colors = "WB" then "HF"
else if colors = "UR" then "HG"
else if colors = "BG" then "HH"
else if colors = "WR" then "HI"
else if colors = "UG" then "HJ"
else if colors = "WP" then "HJA"
else if colors = "UP" then "HJB"
else if colors = "BP" then "HJC"
else if colors = "RP" then "HJD"
else if colors = "GP" then "HJE"
else if colors = "WO" then "HJF"
else if colors = "UO" then "HJG"
else if colors = "BO" then "HJH"
else if colors = "RO" then "HJI"
else if colors = "GO" then "HJM"
else if colors = "PO" then "HJN"
else if colors == "WU" then "HA"
else if colors == "UB" then "HB"
else if colors == "BR" then "HC"
else if colors == "RG" then "HD"
else if colors == "WG" then "HE"
else if colors == "WB" then "HF"
else if colors == "UR" then "HG"
else if colors == "BG" then "HH"
else if colors == "WR" then "HI"
else if colors == "UG" then "HJ"
else if colors == "WP" then "HJA"
else if colors == "UP" then "HJB"
else if colors == "BP" then "HJC"
else if colors == "RP" then "HJD"
else if colors == "GP" then "HJE"
else if colors == "WO" then "HJF"
else if colors == "UO" then "HJG"
else if colors == "BO" then "HJH"
else if colors == "RO" then "HJI"
else if colors == "GO" then "HJM"
else if colors == "PO" then "HJN"
else "HK"
}
multi_color_pair_sort := {
colors := sort_text(casting_cost, order: "<WUBRGLPOEK>")
if not set.sort_multicolor_in_pairs then "GK"
else if colors = "WU" then "GA"
else if colors = "UB" then "GB"
else if colors = "BR" then "GC"
else if colors = "RG" then "GD"
else if colors = "WG" then "GE"
else if colors = "WB" then "GF"
else if colors = "UR" then "GG"
else if colors = "BG" then "GH"
else if colors = "WR" then "GI"
else if colors = "UG" then "GJ"
else if colors = "WP" then "GJA"
else if colors = "UP" then "GJB"
else if colors = "BP" then "GJC"
else if colors = "RP" then "GJD"
else if colors = "GP" then "GJE"
else if colors = "WO" then "GJF"
else if colors = "UO" then "GJG"
else if colors = "BO" then "GJH"
else if colors = "RO" then "GJI"
else if colors = "GO" then "GJM"
else if colors = "PO" then "GJN"
else if colors == "WU" then "GA"
else if colors == "UB" then "GB"
else if colors == "BR" then "GC"
else if colors == "RG" then "GD"
else if colors == "WG" then "GE"
else if colors == "WB" then "GF"
else if colors == "UR" then "GG"
else if colors == "BG" then "GH"
else if colors == "WR" then "GI"
else if colors == "UG" then "GJ"
else if colors == "WP" then "GJA"
else if colors == "UP" then "GJB"
else if colors == "BP" then "GJC"
else if colors == "RP" then "GJD"
else if colors == "GP" then "GJE"
else if colors == "WO" then "GJF"
else if colors == "UO" then "GJG"
else if colors == "BO" then "GJH"
else if colors == "RO" then "GJI"
else if colors == "GO" then "GJM"
else if colors == "PO" then "GJN"
else if contains(card.casting_cost, match:"/") then "GL"
else "GK"
}