1292 lines
44 KiB
Plaintext
1292 lines
44 KiB
Plaintext
#For vertical alignment, set tab spacing to 8.
|
|
|
|
# Scripts for blending images
|
|
# Included by a style file in its init script
|
|
|
|
|
|
########################################################################
|
|
# Filenames and other defaults
|
|
########################################################################
|
|
include file: masks
|
|
|
|
mask_hybrid_with_land := { false }
|
|
mask_hybrid_with_gold := { false }
|
|
mask_multi_land_with_color := { false }
|
|
template := { input + "{type}.jpg" }
|
|
land_template := { ( if input == "a" then "c" else input) + "l{type}.jpg" }
|
|
offset := 0
|
|
# For what value should thumbnails of hybrids be made?
|
|
hybrid_previews := "hybrid"
|
|
|
|
# Are there templates for colored lands, land_template(...)?
|
|
colored_lands := true
|
|
trim_colors :=
|
|
replace@(match:"(, )?(multicolor|hybrid|artifact|land|horizontal|vertical|radial)", replace:"")
|
|
|
|
watermark_colors := {
|
|
check_colors := card.card_color
|
|
if face != "" then check_colors := face
|
|
if trim_colors(check_colors) == "white" then "ww"
|
|
else if trim_colors(check_colors) == "blue" then "uu"
|
|
else if trim_colors(check_colors) == "black" then "bb"
|
|
else if trim_colors(check_colors) == "red" then "rr"
|
|
else if trim_colors(check_colors) == "green" then "gg"
|
|
else if trim_colors(check_colors) == "orange" then "oo"
|
|
else if contains(check_colors, match:"multi") or
|
|
contains(check_colors, match:"hybrid") or
|
|
contains(check_colors, match:", land") then hybrid_color(face:face)
|
|
else if contains(check_colors, match:"artifact") then "aa"
|
|
else "cc"
|
|
}@(face:"")
|
|
hybrid_color := {
|
|
check_colors := card.card_color
|
|
if face != "" then check_colors := face
|
|
trimmed := trim_colors(check_colors)
|
|
if trimmed == "white, blue" then "wu"
|
|
else if trimmed == "white, black" then "wb"
|
|
else if trimmed == "white, red" then "rw"
|
|
else if trimmed == "white, green" then "gw"
|
|
else if trimmed == "white, orange" then "wo"
|
|
else if trimmed == "blue, black" then "ub"
|
|
else if trimmed == "blue, red" then "ur"
|
|
else if trimmed == "blue, green" then "gu"
|
|
else if trimmed == "blue, orange" then "uo"
|
|
else if trimmed == "black, red" then "br"
|
|
else if trimmed == "black, green" then "bg"
|
|
else if trimmed == "black, orange" then "bo"
|
|
else if trimmed == "red, green" then "rg"
|
|
else if trimmed == "red, orange" then "ro"
|
|
else if trimmed == "green, orange" then "go"
|
|
else if trimmed == "white, blue, reversed" then "uw"
|
|
else if trimmed == "white, black, reversed" then "bw"
|
|
else if trimmed == "white, red, reversed" then "wr"
|
|
else if trimmed == "white, green, reversed" then "wg"
|
|
else if trimmed == "white, orange, reversed" then "ow"
|
|
else if trimmed == "blue, black, reversed" then "bu"
|
|
else if trimmed == "blue, red, reversed" then "ru"
|
|
else if trimmed == "blue, green, reversed" then "ug"
|
|
else if trimmed == "blue, orange, reversed" then "ou"
|
|
else if trimmed == "black, red, reversed" then "rb"
|
|
else if trimmed == "black, green, reversed" then "gb"
|
|
else if trimmed == "black, orange, reversed" then "ob"
|
|
else if trimmed == "red, green, reversed" then "gr"
|
|
else if trimmed == "red, orange, reversed" then "or"
|
|
else if trimmed == "green, orange, reversed" then "og"
|
|
else "mm"
|
|
}@(face:"")
|
|
########################################################################
|
|
# Combining multiple colors (hybrids)
|
|
########################################################################
|
|
|
|
card_hybrid_2 := {linear_blend(
|
|
image1: template( colors[0] ),
|
|
image2: template( colors[1] ),
|
|
x1: 0.4, y1: 0
|
|
x2: 0.6, y2: 0
|
|
)
|
|
}
|
|
|
|
overlay_hybrid := [
|
|
1: { template( colors[0] ) }
|
|
2: {combine_blend(
|
|
image1: template( colors[0] ),
|
|
image2: template( colors[1] ),
|
|
combine: "symmetric overlay"
|
|
)}
|
|
]
|
|
|
|
|
|
# vertical version of a horizontal hybrid
|
|
vertical_card_hybrid := {
|
|
do_linear_blend := linear_blend
|
|
linear_blend := { do_linear_blend(x1: 0, x2: 0, y1: x1, y2: x2) }
|
|
card_hybrid.horizontal[color_count]()
|
|
}
|
|
|
|
horizontal_card_hybrid := [
|
|
1: { template( colors[0]) }
|
|
2: card_hybrid_2
|
|
|
|
3: {linear_blend(
|
|
image1: template( colors[(to_int(offset) + 0 ) mod 3] ),
|
|
x1: 0.22, y1: 0
|
|
x2: 0.4, y2: 0
|
|
image2: linear_blend(
|
|
image1: template( colors[(to_int(offset) + 1 ) mod 3] ),
|
|
image2: template( colors[(to_int(offset) + 2 ) mod 3] ),
|
|
x1: 0.6, y1: 0
|
|
x2: 0.78, y2: 0
|
|
)
|
|
)
|
|
}
|
|
4: {linear_blend(
|
|
image1: template( colors[(to_int(offset) + 0 ) mod 4] ),
|
|
x1: 0.15, y1: 0
|
|
x2: 0.31, y2: 0
|
|
image2: linear_blend(
|
|
image1: template( colors[(to_int(offset) + 1 ) mod 4] ),
|
|
x1: 0.42, y1: 0
|
|
x2: 0.58, y2: 0
|
|
image2: linear_blend(
|
|
image1: template( colors[(to_int(offset) + 2 ) mod 4] ),
|
|
image2: template( colors[(to_int(offset) + 3 ) mod 4] ),
|
|
x1: 0.69, y1: 0
|
|
x2: 0.85, y2: 0
|
|
)))}
|
|
|
|
5: {linear_blend(
|
|
image1: template( colors[(to_int(offset) + 0 ) mod 5] ),
|
|
x1: 2.0 / 15, y1: 0
|
|
x2: 4.0 / 15, y2: 0
|
|
image2: linear_blend(
|
|
image1: template( colors[(to_int(offset) + 1 ) mod 5] ),
|
|
x1: 5.0 / 15, y1: 0
|
|
x2: 7.0 / 15, y2: 0
|
|
image2: linear_blend(
|
|
image1: template( colors[(to_int(offset) + 2 ) mod 5] ),
|
|
x1: 8.0 / 15, y1: 0
|
|
x2: 10.0 / 15, y2: 0
|
|
image2: linear_blend(
|
|
image1: template( colors[(to_int(offset) + 3 ) mod 5] ),
|
|
image2: template( colors[(to_int(offset) + 4 ) mod 5] ),
|
|
x1: 11.0 / 15, y1: 0
|
|
x2: 13.0 / 15, y2: 0
|
|
))))}
|
|
|
|
6: {linear_blend(
|
|
image1: template( colors[(to_int(offset) + 0 ) mod 6] ),
|
|
x1: 1.5 / 15, y1: 0
|
|
x2: 3.1 / 15, y2: 0
|
|
image2: linear_blend(
|
|
image1: template( colors[(to_int(offset) + 1 ) mod 6] ),
|
|
x1: 4.1 / 15, y1: 0
|
|
x2: 5.7 / 15, y2: 0
|
|
image2: linear_blend(
|
|
image1: template( colors[(to_int(offset) + 2 ) mod 6] ),
|
|
x1: 6.7 / 15, y1: 0
|
|
x2: 8.3 / 15, y2: 0
|
|
image2: linear_blend(
|
|
image1: template( colors[(to_int(offset) + 3 ) mod 6] ),
|
|
x1: 9.3 / 15, y1: 0
|
|
x2: 10.9 / 15, y2: 0
|
|
image2: linear_blend(
|
|
image1: template( colors[(to_int(offset) + 4 ) mod 6] ),
|
|
image2: template( colors[(to_int(offset) + 5 ) mod 6] ),
|
|
x1: 11.9 / 15, y1: 0
|
|
x2: 13.5 / 15, y2: 0
|
|
)))))}
|
|
|
|
7: {linear_blend(
|
|
image1: template( colors[(to_int(offset) + 0 ) mod 7] ),
|
|
x1: 1.3 / 15, y1: 0
|
|
x2: 2.7 / 15, y2: 0
|
|
image2: linear_blend(
|
|
image1: template( colors[(to_int(offset) + 1 ) mod 7] ),
|
|
x1: 3.5 / 15, y1: 0
|
|
x2: 4.9 / 15, y2: 0
|
|
image2: linear_blend(
|
|
image1: template( colors[(to_int(offset) + 2 ) mod 7] ),
|
|
x1: 5.7 / 15, y1: 0
|
|
x2: 7.1 / 15, y2: 0
|
|
image2: linear_blend(
|
|
image1: template( colors[(to_int(offset) + 3 ) mod 7] ),
|
|
x1: 7.9 / 15, y1: 0
|
|
x2: 9.3 / 15, y2: 0
|
|
image2: linear_blend(
|
|
image1: template( colors[(to_int(offset) + 4 ) mod 7] ),
|
|
x1: 10.1 / 15, y1: 0
|
|
x2: 11.5 / 15, y2: 0
|
|
image2: linear_blend(
|
|
image1: template( colors[(to_int(offset) + 5 ) mod 7] ),
|
|
image2: template( colors[(to_int(offset) + 6 ) mod 7] ),
|
|
x1: 12.3 / 15, y1: 0
|
|
x2: 13.7 / 15, y2: 0
|
|
))))))}
|
|
]
|
|
|
|
|
|
card_hybrid := [
|
|
radial: [
|
|
0: { template( "c") }
|
|
1: { template( colors[0]) }
|
|
2: card_hybrid_2
|
|
|
|
3:{linear_blend(
|
|
image1: card_hybrid_2( colors: colors[(to_int(offset) + 0 ) mod 3] +
|
|
colors[(to_int(offset) + 1 ) mod 3] ),
|
|
image2: template( colors[(to_int(offset) + 2 ) mod 3] ),
|
|
x1: 0, y1: 0.55
|
|
x2: 0, y2: 0.77
|
|
)}
|
|
4:{linear_blend(
|
|
image1: card_hybrid_2( colors: colors[(to_int(offset) + 0 ) mod 4] +
|
|
colors[(to_int(offset) + 1 ) mod 4] ),
|
|
image2: card_hybrid_2( colors: colors[(to_int(offset) + 3 ) mod 4] +
|
|
colors[(to_int(offset) + 2 ) mod 4] ),
|
|
x1: 0, y1: 0.4
|
|
x2: 0, y2: 0.62
|
|
)}
|
|
|
|
5: {linear_blend(
|
|
image1: linear_blend(
|
|
image1: card_hybrid_2( colors: colors[(to_int(offset) + 0 ) mod 5] +
|
|
colors[(to_int(offset) + 1 ) mod 5] ),
|
|
image2: card_hybrid_2( colors: colors[(to_int(offset) + 4 ) mod 5] +
|
|
colors[(to_int(offset) + 2 ) mod 5] ),
|
|
x1: 0, y1: 0.19
|
|
x2: 0, y2: 0.35
|
|
),
|
|
image2: template( colors[(to_int(offset) + 3 ) mod 5] ),
|
|
x1: 0, y1: 0.777
|
|
x2: 0, y2: 0.937
|
|
)}
|
|
|
|
6: {linear_blend(
|
|
image1: linear_blend(
|
|
image1: card_hybrid_2( colors: colors[(to_int(offset) + 0 ) mod 6] +
|
|
colors[(to_int(offset) + 1 ) mod 6] ),
|
|
image2: card_hybrid_2( colors: colors[(to_int(offset) + 5 ) mod 6] +
|
|
colors[(to_int(offset) + 2 ) mod 6] ),
|
|
x1: 0, y1: 0.19
|
|
x2: 0, y2: 0.35
|
|
),
|
|
image2: card_hybrid_2( colors: colors[(to_int(offset) + 4 ) mod 6] +
|
|
colors[(to_int(offset) + 3 ) mod 6] ),
|
|
x1: 0, y1: 0.777
|
|
x2: 0, y2: 0.937
|
|
)}
|
|
|
|
7: {linear_blend(
|
|
image1: linear_blend(
|
|
image1: linear_blend(
|
|
image1: card_hybrid_2( colors: colors[(to_int(offset) + 0 ) mod 7] +
|
|
colors[(to_int(offset) + 1 ) mod 7] ),
|
|
image2: card_hybrid_2( colors: colors[(to_int(offset) + 6 ) mod 7] +
|
|
colors[(to_int(offset) + 2 ) mod 7] ),
|
|
x1: 0, y1: 0.34
|
|
x2: 0, y2: 0.50
|
|
),
|
|
image2: card_hybrid_2( colors: colors[(to_int(offset) + 5 ) mod 7] +
|
|
colors[(to_int(offset) + 3 ) mod 7] ),
|
|
x1: 0, y1: 0.877
|
|
x2: 0, y2: 0.937
|
|
),
|
|
image2: template( colors[(to_int(offset) + 4 ) mod 7] ),
|
|
x1: 0, y1: 1.140
|
|
x2: 0, y2: 1.300
|
|
)}
|
|
]
|
|
horizontal: horizontal_card_hybrid
|
|
vertical: [
|
|
1: { template( colors[0]) }
|
|
2: { linear_blend(
|
|
image1: template( colors[0] ),
|
|
image2: template( colors[1] ),
|
|
x1: 0, y1: 0.4
|
|
x2: 0, y2: 0.6
|
|
)}
|
|
3: vertical_card_hybrid
|
|
4: vertical_card_hybrid
|
|
5: vertical_card_hybrid
|
|
6: vertical_card_hybrid
|
|
7: vertical_card_hybrid
|
|
]
|
|
overlay: overlay_hybrid
|
|
]
|
|
|
|
|
|
|
|
########################################################################
|
|
# P/T box
|
|
########################################################################
|
|
# These are easier
|
|
|
|
horizontal_pt_hybrid := [
|
|
1: { template( colors[0]) }
|
|
2: { template( colors[1]) }
|
|
3: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 1 ) mod 3] ),
|
|
image2: template( colors[(to_int(offset) + 2 ) mod 3] ),
|
|
x1: -0.51, y1: 0
|
|
x2: 0.26, y2: 0
|
|
)}
|
|
4: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 2 ) mod 4] ),
|
|
image2: template( colors[(to_int(offset) + 3 ) mod 4] ),
|
|
x1: -0.1, y1: 0
|
|
x2: 0.6, y2: 0
|
|
)}
|
|
5: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 3 ) mod 5] ),
|
|
image2: template( colors[(to_int(offset) + 4 ) mod 5] ),
|
|
x1: 0.08, y1: 0
|
|
x2: 0.65, y2: 0
|
|
)}
|
|
6: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 4 ) mod 6] ),
|
|
image2: template( colors[(to_int(offset) + 5 ) mod 6] ),
|
|
x1: 0.07, y1: 0
|
|
x2: 0.7, y2: 0
|
|
)}
|
|
7: {linear_blend(
|
|
image1: linear_blend(
|
|
image1: template( colors[(to_int(offset) + 4 ) mod 7] ),
|
|
image2: template( colors[(to_int(offset) + 5 ) mod 7] ),
|
|
x1: -0.2, y1: 0
|
|
x2: 0.2, y2: 0
|
|
),
|
|
image2: template( colors[(to_int(offset) + 6 ) mod 7] ),
|
|
x1: 0.5, y1: 0
|
|
x2: 0.7, y2: 0
|
|
)}
|
|
]
|
|
|
|
|
|
pt_hybrid := [
|
|
radial: [
|
|
0: { template( "c") }
|
|
1: { template( colors[0]) }
|
|
2: { template( colors[1]) }
|
|
3: { template( colors[(to_int(offset) + 2 ) mod 3]) }
|
|
4: { template( colors[(to_int(offset) + 2 ) mod 4]) }
|
|
5: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 2 ) mod 5] ),
|
|
image2: template( colors[(to_int(offset) + 3 ) mod 5] ),
|
|
x1: 0, y1: -1.5
|
|
x2: 0, y2: 0.7
|
|
)}
|
|
6: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 2 ) mod 6] ),
|
|
image2: template( colors[(to_int(offset) + 3 ) mod 6] ),
|
|
x1: 0, y1: -1.5
|
|
x2: 0, y2: 0.7
|
|
)}
|
|
7: { template( colors[(to_int(offset) + 4 ) mod 7]) }
|
|
]
|
|
horizontal: horizontal_pt_hybrid
|
|
vertical: [
|
|
1: { template( colors[0]) }
|
|
2: { template( colors[1]) }
|
|
3: { template( colors[(to_int(offset) + 2 ) mod 7]) }
|
|
4: { template( colors[(to_int(offset) + 3 ) mod 7]) }
|
|
5: { template( colors[(to_int(offset) + 4 ) mod 7]) }
|
|
6: { template( colors[(to_int(offset) + 5 ) mod 7]) }
|
|
7: { template( colors[(to_int(offset) + 6 ) mod 7]) }
|
|
]
|
|
overlay: overlay_hybrid
|
|
]
|
|
|
|
|
|
########################################################################
|
|
# P/T boxes of flip cards
|
|
########################################################################
|
|
|
|
flip_pt_hybrid := [
|
|
radial: [
|
|
0: { template( "c") }
|
|
1: { template( colors[0]) }
|
|
2: { template( colors[1]) }
|
|
3: { template( colors[(to_int(offset) + 1 ) mod 3]) }
|
|
4: { template( colors[(to_int(offset) + 1 ) mod 4]) }
|
|
5: {linear_blend(
|
|
image1: template( colors[(to_int(offset) + 1 ) mod 5] ),
|
|
image2: template( colors[(to_int(offset) + 2 ) mod 5] ),
|
|
x1: 0, y1: -1
|
|
x2: 0, y2: 1.8
|
|
)}
|
|
6: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 1 ) mod 6] ),
|
|
image2: template( colors[(to_int(offset) + 2 ) mod 6] ),
|
|
x1: 0, y1: -1
|
|
x2: 0, y2: 1.8
|
|
)}
|
|
7: { template( colors[(to_int(offset) + 4 ) mod 7]) }
|
|
]
|
|
horizontal: horizontal_pt_hybrid
|
|
vertical: [
|
|
1: { template( colors[0]) }
|
|
2: { template( colors[0]) }
|
|
3: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 0 ) mod 3] ),
|
|
image2: template( colors[(to_int(offset) + 1 ) mod 3] ),
|
|
x1: 0, y1: 0
|
|
x2: 0, y2: 2
|
|
)}
|
|
4: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 0 ) mod 4] ),
|
|
image2: template( colors[(to_int(offset) + 1 ) mod 4] ),
|
|
x1: 0, y1: -1.5
|
|
x2: 0, y2: 1
|
|
)}
|
|
5: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 0 ) mod 5] ),
|
|
image2: template( colors[(to_int(offset) + 1 ) mod 5] ),
|
|
x1: 0, y1: -1.1
|
|
x2: 0, y2: 0.2
|
|
)}
|
|
6: { template( colors[(to_int(offset) + 1 ) mod 6] ) } # Probably not right
|
|
7: { template( colors[(to_int(offset) + 2 ) mod 7]) }
|
|
]
|
|
overlay: overlay_hybrid
|
|
]
|
|
|
|
flip_pt_hybrid2 := [
|
|
radial: [
|
|
0: { template( "c") }
|
|
1: { template( colors[0]) }
|
|
2: { template( colors[0]) }
|
|
3: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 0 ) mod 3] ),
|
|
image2: template( colors[(to_int(offset) + 2 ) mod 3] ),
|
|
x1: 0, y1: -1
|
|
x2: 0, y2: 1.1
|
|
)}
|
|
4: { template( colors[(to_int(offset) + 3 ) mod 4]) }
|
|
5: { template( colors[(to_int(offset) + 4 ) mod 5]) }
|
|
6: { template( colors[(to_int(offset) + 5 ) mod 6]) }
|
|
7: { template( colors[(to_int(offset) + 6 ) mod 7]) }
|
|
]
|
|
horizontal: [
|
|
1: { template( colors[0]) }
|
|
2: { template( colors[0]) }
|
|
3: { template( colors[(to_int(offset) + 0 ) mod 3]) }
|
|
4: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 0 ) mod 4] ),
|
|
image2: template( colors[(to_int(offset) + 1 ) mod 4] ),
|
|
x1: 0.4, y1: 0
|
|
x2: 1.5, y2: 0
|
|
)}
|
|
5: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 0 ) mod 5] ),
|
|
image2: template( colors[(to_int(offset) + 1 ) mod 5] ),
|
|
x1: 0.08, y1: 0
|
|
x2: 0.65, y2: 0
|
|
)}
|
|
6: { template( colors[(to_int(offset) + 5 ) mod 6] ) } #TODO
|
|
7: { template( colors[(to_int(offset) + 6 ) mod 7] ) } #TODO
|
|
]
|
|
vertical: [
|
|
1: { template( colors[0]) }
|
|
2: { template( colors[1]) }
|
|
3: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 1 ) mod 3] ),
|
|
image2: template( colors[(to_int(offset) + 2 ) mod 3] ),
|
|
x1: 0, y1: -1
|
|
x2: 0, y2: 1.5
|
|
)}
|
|
4: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 2 ) mod 4] ),
|
|
image2: template( colors[(to_int(offset) + 3 ) mod 4] ),
|
|
x1: 0, y1: 0.5
|
|
x2: 0, y2: 3
|
|
)}
|
|
5: { template( colors[(to_int(offset) + 3 ) mod 5]) }
|
|
6: { template( colors[(to_int(offset) + 5 ) mod 6] ) } # Probably not right
|
|
7: { template( colors[(to_int(offset) + 6 ) mod 7]) }
|
|
]
|
|
overlay: overlay_hybrid
|
|
]
|
|
########################################################################
|
|
# P/T boxes for leveler cards
|
|
########################################################################
|
|
|
|
leveler_pt_hybrid := [
|
|
radial: [
|
|
0: { template( "c") }
|
|
1: { template( colors[0]) }
|
|
2: { template( colors[1]) }
|
|
3: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 1 ) mod 3] ),
|
|
image2: template( colors[(to_int(offset) + 2 ) mod 3] ),
|
|
x1: 0, y1: 0
|
|
x2: 0, y2: 1
|
|
)}
|
|
4: { template( colors[(to_int(offset) + 2 ) mod 4]) }
|
|
5: { template( colors[(to_int(offset) + 2 ) mod 5]) }
|
|
6: { template( colors[(to_int(offset) + 2 ) mod 6]) }
|
|
7: { template( colors[(to_int(offset) + 4 ) mod 7]) }
|
|
]
|
|
horizontal: horizontal_pt_hybrid
|
|
vertical: [
|
|
1: { template( colors[0]) }
|
|
2: { template( colors[1]) }
|
|
3: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 1 ) mod 3] ),
|
|
image2: template( colors[(to_int(offset) + 2 ) mod 3] ),
|
|
x1: 0, y1: 0
|
|
x2: 0, y2: 1
|
|
)}
|
|
4: { template( colors[(to_int(offset) + 2 ) mod 4]) }
|
|
5: { template( colors[(to_int(offset) + 3 ) mod 5]) }
|
|
6: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 2 ) mod 6] ),
|
|
image2: template( colors[(to_int(offset) + 4 ) mod 6] ),
|
|
x1: 0, y1: 0
|
|
x2: 0, y2: 0.25
|
|
)}
|
|
7: { template( colors[(to_int(offset) + 5 ) mod 7]) }
|
|
]
|
|
overlay: overlay_hybrid
|
|
]
|
|
|
|
########################################################################
|
|
# P/T boxes for leveler cards
|
|
########################################################################
|
|
|
|
leveler_pt_hybrid := [
|
|
radial: [
|
|
0: { template( "c") }
|
|
1: { template( colors[0]) }
|
|
2: { template( colors[1]) }
|
|
3: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 1 ) mod 3] ),
|
|
image2: template( colors[(to_int(offset) + 2 ) mod 3] ),
|
|
x1: 0, y1: 0
|
|
x2: 0, y2: 1
|
|
)}
|
|
4: { template( colors[(to_int(offset) + 2 ) mod 4]) }
|
|
5: { template( colors[(to_int(offset) + 2 ) mod 5]) }
|
|
6: { template( colors[(to_int(offset) + 2 ) mod 6]) }
|
|
7: { template( colors[(to_int(offset) + 4 ) mod 7]) }
|
|
]
|
|
horizontal: horizontal_pt_hybrid
|
|
vertical: [
|
|
1: { template( colors[0]) }
|
|
2: { template( colors[1]) }
|
|
3: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 1 ) mod 3] ),
|
|
image2: template( colors[(to_int(offset) + 2 ) mod 3] ),
|
|
x1: 0, y1: 0
|
|
x2: 0, y2: 1
|
|
)}
|
|
4: { template( colors[(to_int(offset) + 2 ) mod 4]) }
|
|
5: { template( colors[(to_int(offset) + 3 ) mod 5]) }
|
|
6: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 3 ) mod 6] ),
|
|
image2: template( colors[(to_int(offset) + 4 ) mod 6] ),
|
|
x1: 0, y1: 0
|
|
x2: 0, y2: 0.25
|
|
)}
|
|
7: { template( colors[(to_int(offset) + 5 ) mod 7]) }
|
|
]
|
|
overlay: overlay_hybrid
|
|
]
|
|
|
|
leveler_pt_hybrid2 := [
|
|
radial: [
|
|
0: { template( "c") }
|
|
1: { template( colors[0]) }
|
|
2: { template( colors[1]) }
|
|
3: { template( colors[(to_int(offset) + 2 ) mod 3]) }
|
|
4: { template( colors[(to_int(offset) + 2 ) mod 4]) }
|
|
5: { template( colors[(to_int(offset) + 2 ) mod 5]) }
|
|
6: { template( colors[(to_int(offset) + 2 ) mod 6]) }
|
|
7: { template( colors[(to_int(offset) + 4 ) mod 7]) }
|
|
]
|
|
horizontal: horizontal_pt_hybrid
|
|
vertical: [
|
|
1: { template( colors[0]) }
|
|
2: { template( colors[1]) }
|
|
3: { template( colors[(to_int(offset) + 2 ) mod 3]) }
|
|
4: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 2 ) mod 4] ),
|
|
image2: template( colors[(to_int(offset) + 3 ) mod 4] ),
|
|
x1: 0, y1: 0
|
|
x2: 0, y2: 1
|
|
)}
|
|
5: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 3 ) mod 5] ),
|
|
image2: template( colors[(to_int(offset) + 4 ) mod 5] ),
|
|
x1: 0, y1: 0
|
|
x2: 0, y2: 0.75
|
|
)}
|
|
6: { template( colors[(to_int(offset) + 4 ) mod 6]) }
|
|
7: { template( colors[(to_int(offset) + 5 ) mod 7]) }
|
|
]
|
|
overlay: overlay_hybrid
|
|
]
|
|
|
|
leveler_pt_hybrid3 := [
|
|
radial: [
|
|
0: { template( "c") }
|
|
1: { template( colors[0]) }
|
|
2: { template( colors[1]) }
|
|
3: { template( colors[(to_int(offset) + 2 ) mod 3]) }
|
|
4: { template( colors[(to_int(offset) + 2 ) mod 4]) }
|
|
5: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 2 ) mod 5] ),
|
|
image2: template( colors[(to_int(offset) + 3 ) mod 5] ),
|
|
x1: 0, y1: 0
|
|
x2: 0, y2: 1
|
|
)}
|
|
6: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 2 ) mod 6] ),
|
|
image2: template( colors[(to_int(offset) + 3 ) mod 6] ),
|
|
x1: 0, y1: 0
|
|
x2: 0, y2: 1
|
|
)}
|
|
7: { template( colors[(to_int(offset) + 4 ) mod 7]) }
|
|
]
|
|
horizontal: horizontal_pt_hybrid
|
|
vertical: [
|
|
1: { template( colors[0]) }
|
|
2: { template( colors[1]) }
|
|
3: { template( colors[(to_int(offset) + 2 ) mod 3]) }
|
|
4: { template( colors[(to_int(offset) + 3 ) mod 4]) }
|
|
5: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 3 ) mod 5] ),
|
|
image2: template( colors[(to_int(offset) + 4 ) mod 5] ),
|
|
x1: 0, y1: 0
|
|
x2: 0, y2: 0.5
|
|
)}
|
|
6: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 4 ) mod 6] ),
|
|
image2: template( colors[(to_int(offset) + 5 ) mod 6] ),
|
|
x1: 0, y1: 0
|
|
x2: 0, y2: 0.5
|
|
)}
|
|
7: { template( colors[(to_int(offset) + 5 ) mod 7]) }
|
|
]
|
|
overlay: overlay_hybrid
|
|
]
|
|
|
|
|
|
########################################################################
|
|
# Textbox and typeline for FPM templates and Futureshifts
|
|
########################################################################
|
|
|
|
textbox_hybrid := [
|
|
radial: [
|
|
0: { template( "c") }
|
|
1: { template( colors[0]) }
|
|
2: card_hybrid_2
|
|
3: { template( colors[(to_int(offset) + 2 ) mod 3]) }
|
|
4: { card_hybrid_2( colors: colors[(to_int(offset) + 0 ) mod 4] +
|
|
colors[(to_int(offset) + 3 ) mod 4]) }
|
|
5: { template( colors[(to_int(offset) + 3 ) mod 5]) }
|
|
6: { card_hybrid_2( colors: colors[(to_int(offset) + 0 ) mod 6] +
|
|
colors[(to_int(offset) + 5 ) mod 6]) }
|
|
7: { template( colors[(to_int(offset) + 4 ) mod 7]) }
|
|
]
|
|
horizontal: horizontal_card_hybrid
|
|
vertical: [
|
|
0: { template( "c") }
|
|
1: { template( colors[0]) }
|
|
2: { template( colors[1]) }
|
|
3: { template( colors[(to_int(offset) + 2 ) mod 3] ) } # TODO
|
|
4: { template( colors[(to_int(offset) + 3 ) mod 4]) }
|
|
5: { template( colors[(to_int(offset) + 4 ) mod 5]) }
|
|
6: { template( colors[(to_int(offset) + 5 ) mod 6]) }
|
|
7: { template( colors[(to_int(offset) + 6 ) mod 7]) }
|
|
]
|
|
overlay: overlay_hybrid
|
|
]
|
|
|
|
typeline_hybrid := textbox_hybrid
|
|
|
|
########################################################################
|
|
# Color Identity Marking
|
|
########################################################################
|
|
|
|
identity_horizontal_hybrid := [
|
|
0: { template( "c") }
|
|
1: { template( colors[0]) }
|
|
2: {linear_blend(
|
|
image1: template( colors[0] ),
|
|
image2: template( colors[1] ),
|
|
x1: 0.49, y1: 0.49
|
|
x2: 0.5, y2: 0.5
|
|
)}
|
|
3: {masked_blend(
|
|
light: masked_blend(
|
|
light: template( colors[0] ),
|
|
dark: template( colors[2] ),
|
|
mask: id_mask[32]),
|
|
dark: template( colors[1] ),
|
|
mask: id_mask[33]
|
|
)}
|
|
4: {masked_blend(
|
|
light: masked_blend(
|
|
light: masked_blend(
|
|
light: template( colors[1] ),
|
|
dark: template( colors[0] ),
|
|
mask: id_mask[42] ),
|
|
dark: template( colors[2] ),
|
|
mask: id_mask[43] ),
|
|
dark: template( colors[3] ),
|
|
mask: id_mask[44]
|
|
)}
|
|
5: {masked_blend(
|
|
light: masked_blend(
|
|
light: masked_blend(
|
|
light: masked_blend(
|
|
light: template( colors[0] ),
|
|
dark: template( colors[4] ),
|
|
mask: id_mask[52]),
|
|
dark: template( colors[1] ),
|
|
mask: id_mask[53]),
|
|
dark: template( colors[2] ),
|
|
mask: id_mask[54]),
|
|
dark: template( colors[3] ),
|
|
mask: id_mask[55]
|
|
)}
|
|
6: { template( "m") }
|
|
|
|
]
|
|
identity_hybrid := [
|
|
radial: identity_horizontal_hybrid
|
|
vertical: identity_horizontal_hybrid
|
|
horizontal: identity_horizontal_hybrid
|
|
overlay: identity_horizontal_hybrid
|
|
]
|
|
########################################################################
|
|
# Promo Stamp
|
|
########################################################################
|
|
# These are easier
|
|
|
|
horizontal_stamp_hybrid := [
|
|
1: { template( colors[0]) }
|
|
2: { linear_blend(
|
|
image1: template( colors[0] ),
|
|
image2: template( colors[1] ),
|
|
x1: -0.3, y1: 0
|
|
x2: 1.3, y2: 0
|
|
)}
|
|
3: { template( colors[(to_int(offset) + 1 ) mod 3]) }
|
|
4: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 1 ) mod 4] ),
|
|
image2: template( colors[(to_int(offset) + 2 ) mod 4] ),
|
|
x1: -0.3, y1: 0
|
|
x2: 1.3, y2: 0
|
|
)}
|
|
5: {linear_blend(
|
|
image1: template( colors[(to_int(offset) + 1 ) mod 5] )
|
|
x1: -0.55, y1: 0
|
|
x2: 0.2, y2: 0
|
|
image2: linear_blend(
|
|
image1: template( colors[(to_int(offset) + 2 ) mod 5] ),
|
|
image2: template( colors[(to_int(offset) + 3 ) mod 5] ),
|
|
x1: 0.8, y1: 0
|
|
x2: 1.55, y2: 0
|
|
))}
|
|
6: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 2 ) mod 6] ),
|
|
image2: template( colors[(to_int(offset) + 3 ) mod 6] ),
|
|
x1: 0.1, y1: 0
|
|
x2: 0.9, y2: 0
|
|
)}
|
|
7: {linear_blend(
|
|
image1: template( colors[(to_int(offset) + 2 ) mod 7] ),
|
|
x1: -0.55, y1: 0
|
|
x2: 0.2, y2: 0
|
|
image2: linear_blend(
|
|
image1: template( colors[(to_int(offset) + 3 ) mod 7] ),
|
|
image2: template( colors[(to_int(offset) + 5 ) mod 7] ),
|
|
x1: 0.8, y1: 0
|
|
x2: 1.55, y2: 0
|
|
))}
|
|
]
|
|
|
|
stamp_hybrid := [
|
|
radial: [
|
|
0: { template( "c") }
|
|
1: { template( colors[0]) }
|
|
2: { linear_blend(
|
|
image1: template( colors[0] ),
|
|
image2: template( colors[1] ),
|
|
x1: -0.3, y1: 0
|
|
x2: 1.3, y2: 0
|
|
)}
|
|
3: { template( colors[(to_int(offset) + 2) mod 3]) }
|
|
4: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 3) mod 4] ),
|
|
image2: template( colors[(to_int(offset) + 2) mod 4] ),
|
|
x1: -0.3, y1: 0
|
|
x2: 1.3, y2: 0
|
|
)}
|
|
5: { template( colors[(to_int(offset) + 3) mod 5]) }
|
|
6: { linear_blend(
|
|
image1: template( colors[(to_int(offset) + 4) mod 6] ),
|
|
image2: template( colors[(to_int(offset) + 3) mod 6] ),
|
|
x1: -0.3, y1: 0
|
|
x2: 1.3, y2: 0
|
|
)}
|
|
7: { template( colors[(to_int(offset) + 4 ) mod 7]) }
|
|
]
|
|
horizontal: horizontal_stamp_hybrid
|
|
vertical: [
|
|
1: { template( colors[0]) }
|
|
2: { template( colors[1]) }
|
|
3: { template( colors[(to_int(offset) + 2 ) mod 3]) }
|
|
4: { template( colors[(to_int(offset) + 3 ) mod 4]) }
|
|
5: { template( colors[(to_int(offset) + 4 ) mod 5]) }
|
|
6: { template( colors[(to_int(offset) + 5 ) mod 6]) }
|
|
# 7: { template( colors[(to_int(offset) + 6 ) mod 7]) }
|
|
]
|
|
overlay: overlay_hybrid
|
|
]
|
|
########################################################################
|
|
# Putting it all together.
|
|
########################################################################
|
|
blend_colors := {
|
|
colors := sort_text( order: if card_is_wedge(input) then "(wbguro)" else "(wubrgo)"
|
|
, (if chosen(choice:"white" ) then "w")
|
|
+ (if chosen(choice:"blue" ) then "u")
|
|
+ (if chosen(choice:"black" ) then "b")
|
|
+ (if chosen(choice:"red" ) then "r")
|
|
+ (if chosen(choice:"green" ) then "g")
|
|
+ (if chosen(choice:"orange") then "o")
|
|
)
|
|
if multi and (hybrid or colors == "") then (
|
|
colors := colors + "m"
|
|
)
|
|
if artifact and (hybrid or colors == "") then (
|
|
colors := colors + "a"
|
|
)
|
|
if chosen(choice:"reversed") then colors := reverse(colors)
|
|
if colors == "" then colors := "c"
|
|
colors
|
|
}
|
|
# Determine the card background based on the card_color multiple choice options
|
|
color_background := {
|
|
|
|
# for thumbnails
|
|
if input == "hybrid" then
|
|
input := "white,blue,red,{hybrid_previews},horizontal"
|
|
else if input == "overlay" then
|
|
input := "blue,red,{hybrid_previews},overlay"
|
|
else if input == "radial" or input == "horizontal" or input == "vertical" then
|
|
input := "white,blue,red,{hybrid_previews}," + input
|
|
else if input == "reversed" then
|
|
input := "white,blue,red,{hybrid_previews},horizontal,reversed"
|
|
|
|
# What type of 'hybrid'?
|
|
land := chosen(choice:"land")
|
|
multi := chosen(choice:"multicolor")
|
|
hybrid := chosen(choice:"hybrid")
|
|
artifact := chosen(choice:"artifact")
|
|
if land and colored_lands then template := land_template # use land template instead?
|
|
|
|
# The selected colors
|
|
colors := blend_colors(input,land:land, multi:multi, hybrid:hybrid, artifact:artifact)
|
|
if contains(colors, match:"a") then artifact := false
|
|
if contains(colors, match:"m") then multi := false
|
|
color_count := if colors == "c" then 0 else number_of_items(in: colors)
|
|
|
|
# 'shape' / type of hybrid
|
|
shape := if chosen(choice:"horizontal" ) then "horizontal"
|
|
else if chosen(choice:"vertical" ) then "vertical"
|
|
else if chosen(choice:"overlay" ) then "overlay"
|
|
else "radial"
|
|
|
|
# Determine background (allows styles to hook something else here)
|
|
# This is implicitly passed the following parameters: type, shape, colors, color_count, base_hybrid, land, multi, hybrid, artifact, multicolor_blend, hybrid_blend, artifact_blend
|
|
color_combination(folder:folder, blend_type:blend_type)
|
|
}@(folder: "", blend_type: "", multicolor_blend: "mask", hybrid_blend: "mask", artifact_blend: "mask")
|
|
|
|
color_combination := {
|
|
# does this have an override blend_type?
|
|
if blend_type == "" then blend_type := type
|
|
|
|
# Basic gradient of the color frames
|
|
base := base_hybrid[shape][color_count]
|
|
|
|
# This next step adds additional blending from artifact, hybrid, and multicolor cards
|
|
# Usually, the basic gradient is used on the "light" parts of the mask
|
|
# And one of those three are used on the "dark" parts
|
|
# artifact mode is expected to add a trim effect, but leave the plates and pinlines alone
|
|
# hybrid mode is expected to add a plate effect, but leave the trim and pinline alone
|
|
# multicolor mode is expted to add a trim and plate effect, but leave the pinline alone
|
|
# when in conflict, artifact > multicolor > hybrid
|
|
# an artifact that costs (W)(W/U)(U) has artifact trim, gold plates, and WU gradient pinlines
|
|
# this finds the parameters needed for the script at the end
|
|
# but may need an intermediate blend step when modes are chained
|
|
mode := "" # by default we don't blend at all
|
|
light := base # our base gradient script
|
|
light_input := input # the color we've been given
|
|
dark := template # the template script for this type
|
|
dark_input := "c" # the color of the secondary blend image
|
|
|
|
if land and not colored_lands then (
|
|
## blend with land via multi mode
|
|
mode := "multicolor"
|
|
dark := land_template
|
|
)
|
|
else if land and multi then (
|
|
## blend with land via hybrid mode
|
|
## mask_hybrid decides the dark input
|
|
mode := "hybrid"
|
|
dark := land_template
|
|
if mask_hybrid_with_gold() then (
|
|
## Add mland internals to the gradient
|
|
dark_input := "m"
|
|
)
|
|
else if mask_multi_land_with_color() then (
|
|
## Use gradient's internals on mland
|
|
light := land_template
|
|
light_input := "m"
|
|
dark := base
|
|
dark_input := input
|
|
)
|
|
else (
|
|
## cland with gradient pinlines
|
|
mode := "multicolor"
|
|
)
|
|
)
|
|
else if artifact then (
|
|
## blend via artifact mode
|
|
## multi and hybrid need to chain blends
|
|
## otherwise just use artifact as dark input
|
|
mode := "artifact"
|
|
dark_input := "a"
|
|
if multi then (
|
|
## first blend multicolor internals onto the gradient
|
|
## then artifact will overwrite the outer portion
|
|
light := { conditional_masked_blend(
|
|
mode: "multicolor",
|
|
light: base,
|
|
light_input: input,
|
|
dark: template,
|
|
dark_input : "m"
|
|
)}
|
|
)
|
|
else if color_count <= 1 then (
|
|
## blend artifact outside
|
|
""
|
|
)
|
|
else if mask_hybrid_with_land() then (
|
|
## first blend cland internals, artifact happens later
|
|
light := { conditional_masked_blend(
|
|
mode: "multicolor",
|
|
light: base,
|
|
light_input: input,
|
|
dark: template,
|
|
dark_input : "c"
|
|
)}
|
|
)
|
|
else if mask_hybrid_with_gold() then (
|
|
## first blend mland internals, artifact happens later
|
|
light := { conditional_masked_blend(
|
|
mode: "multicolor",
|
|
light: base,
|
|
light_input: input,
|
|
dark: template,
|
|
dark_input : "m"
|
|
)}
|
|
)
|
|
else (
|
|
## shouldn't get here, but if we do, blend artifact outside
|
|
""
|
|
)
|
|
)
|
|
else if multi then (
|
|
## complex forms already handled
|
|
## just blend multicolor over the gradient
|
|
mode := "multicolor"
|
|
dark_input := "m"
|
|
)
|
|
else if color_count > 1 then (
|
|
## blend hybrid internals over the gradient
|
|
## settings change which template we blend with
|
|
mode := "hybrid"
|
|
dark := land_template
|
|
if mask_hybrid_with_gold() then (
|
|
dark_input := "m"
|
|
)
|
|
else if not mask_hybrid_with_land() then (
|
|
mode := ""
|
|
)
|
|
)
|
|
## if we have a mode, blend that, otherwise use our base gradient
|
|
if mode == "" then base() else conditional_masked_blend()
|
|
|
|
}@(folder: "", blend_type:"")
|
|
|
|
conditional_masked_blend :=
|
|
{
|
|
mask := "{folder}{mode}_blend_{blend_type}.png"
|
|
mode := if mode == "multicolor" then multicolor_blend
|
|
else if mode == "artifact" then artifact_blend
|
|
else hybrid_blend
|
|
if mode == "black" then dark(dark_input)
|
|
else if mode == "white" then light(light_input)
|
|
else masked_blend(
|
|
mask: mask,
|
|
dark: dark(dark_input),
|
|
light: light(light_input),
|
|
)
|
|
}
|
|
|
|
########################################################################
|
|
# Specific types
|
|
########################################################################
|
|
|
|
card_background := { color_background(type:"card", base_hybrid:card_hybrid) }@(offset:0 )
|
|
card_background2 := { color_background(type:"card2", base_hybrid:card_hybrid) }@(offset:0 )
|
|
card_ptbox := { color_background(type:"pt", base_hybrid:pt_hybrid) }@(offset:0 )
|
|
flip_ptbox := { color_background(type:"pt", base_hybrid:flip_pt_hybrid) }@(offset:0 )
|
|
flip_ptbox2 := { color_background(type:"pt2", base_hybrid:flip_pt_hybrid2) }@(offset:0 )
|
|
leveler_ptbox := { color_background(type:"pt", base_hybrid:leveler_pt_hybrid) }@(offset:0 )
|
|
leveler_ptbox2 := { color_background(type:"pt", base_hybrid:leveler_pt_hybrid2) }@(offset:0 )
|
|
leveler_ptbox3 := { color_background(type:"pt", base_hybrid:leveler_pt_hybrid3) }@(offset:0 )
|
|
card_textbox := { color_background(type:"textbox", base_hybrid:textbox_hybrid) }@(offset:0 )
|
|
card_typeline := { color_background(type:"typeline", base_hybrid:typeline_hybrid) }@(offset:0 )
|
|
card_identity := { color_background(type:"identity", base_hybrid:identity_hybrid) }@(offset:0 )
|
|
card_identity_2 := { color_background(type:"identity2", base_hybrid:identity_hybrid) }@(offset:0 )
|
|
card_stamp := { color_background(type:"stamp", base_hybrid:stamp_hybrid) }@(offset:0 )
|
|
card_stamp2 := { color_background(type:"stamp2", base_hybrid:stamp_hybrid) }@(offset:0 )
|
|
|
|
template_prefix := []
|
|
module_card := { color_background(type:"card", base_hybrid:card_hybrid, folder:template_prefix["card"]) }
|
|
module_card2 := { color_background(type:"card2", base_hybrid:card_hybrid, folder:template_prefix["card2"]) }
|
|
module_identity := { color_background(type:"identity", base_hybrid:identity_hybrid, folder:template_prefix["identity"]) }
|
|
module_stamp := { color_background(type:"stamp", base_hybrid:stamp_hybrid, folder:template_prefix["stamp"]) }
|
|
module_ubstamp := { color_background(type:"ubstamp", base_hybrid:stamp_hybrid, folder:template_prefix["ubstamp"], blend_type:"stamp") }
|
|
module_nyx := {
|
|
type := "nyx"
|
|
if has_png(set.alternate_nyx) and type_name(harder_script["alt_nyx" or else nil] or else nil) != type_name(nil)
|
|
then type := "alt_nyx"
|
|
else if set.alternate_nyx == "star" and type_name(harder_script["star" or else nil] or else template_prefix["star" or else nil] or else nil) != type_name(nil)
|
|
then type := "star"
|
|
color_background(
|
|
type: type,
|
|
blend_type: "nyx",
|
|
base_hybrid:card_hybrid,
|
|
folder:template_prefix["nyx"],
|
|
)
|
|
}
|
|
module_snow := { color_background(type:"snow", base_hybrid:card_hybrid, folder:template_prefix["snow"]) }
|
|
module_alias := {
|
|
template := alias_custom_template
|
|
land_template := alias_custom_land_template
|
|
color_background(
|
|
type: "alias",
|
|
base_hybrid: card_hybrid,
|
|
artifact_blend: "white",
|
|
hybrid_blend: "white",
|
|
multicolor_blend: "white"
|
|
)
|
|
}
|
|
module_ptbox := {
|
|
if vehicle then template_prefix["pt"] + "vpt.png"
|
|
else color_background(type:"pt", base_hybrid:pt_hybrid, folder:template_prefix["pt"])
|
|
}@(vehicle:false)
|
|
module_ptbox2 := {
|
|
if vehicle then template_prefix["pt"] + "vpt.png"
|
|
else color_background(type:"pt2", base_hybrid:pt_hybrid, folder:template_prefix["pt"], blend_type:"pt")
|
|
}@(vehicle:false)
|
|
module_levelpt := {
|
|
if vehicle then template_prefix["pt"] + "vpt.png"
|
|
else color_background(type:"pt", base_hybrid:leveler_pt_hybrid, folder:template_prefix["pt"])
|
|
}@(vehicle:false)
|
|
module_levelpt2 := {
|
|
if vehicle then template_prefix["pt"] + "vpt.png"
|
|
else color_background(type:"pt", base_hybrid:leveler_pt_hybrid2, folder:template_prefix["pt"])
|
|
}@(vehicle:false)
|
|
module_levelpt3 := {
|
|
if vehicle then template_prefix["pt"] + "vpt.png"
|
|
else color_background(type:"pt", base_hybrid:leveler_pt_hybrid3, folder:template_prefix["pt"])
|
|
}@(vehicle:false)
|
|
|
|
|
|
flip_background := {
|
|
linear_blend(
|
|
image1: card_background(top)
|
|
image2: card_background(bottom)
|
|
x1: 0, y1: 0.4
|
|
x2: 0, y2: 0.6
|
|
)
|
|
}
|
|
|
|
########################################################################
|
|
# Font colors
|
|
########################################################################
|
|
|
|
# For which colors is the font white?
|
|
font_colors_white := { input == "b" or input == "l" }
|
|
|
|
font_color_positions := [
|
|
radial: [0,0,0,2,3,3,4,4]
|
|
horizontal: [0,0,0,0,0,0,0,0]
|
|
vertical: [0,0,1,2,3,4,5,6]
|
|
overlay: [0,0,0,0,0,0,0,0]
|
|
]
|
|
|
|
# Determine whether light or dark fonts should be used
|
|
font_white := {
|
|
hybrid := chosen(choice:"hybrid" )
|
|
artifact := chosen(choice:"artifact" )
|
|
colors := sort_text( order: "(wubrgo)"
|
|
, (if chosen(choice:"white" ) then "w")
|
|
+ (if chosen(choice:"blue" ) then "u")
|
|
+ (if chosen(choice:"black" ) then "b")
|
|
+ (if chosen(choice:"red" ) then "r")
|
|
+ (if chosen(choice:"green" ) then "g")
|
|
+ (if chosen(choice:"orange" ) then "o")
|
|
) + (if artifact then "a")
|
|
font_colors_white(
|
|
if chosen(choice:"land") then "l"
|
|
else if input == "artifact, multicolor" then "a"
|
|
else if chosen(choice:"multicolor") then "m"
|
|
else if artifact and not hybrid then "a"
|
|
else if colors == "" then "c"
|
|
else colors[
|
|
font_color_positions[
|
|
if chosen(choice:"horizontal") then "horizontal"
|
|
else if chosen(choice:"vertical") then "vertical"
|
|
else if chosen(choice:"overlay") then "overlay"
|
|
else "radial"
|
|
][number_of_items(in: colors)]
|
|
]
|
|
)
|
|
}
|
|
|
|
font_color := { if font_white() then rgb(255,255,255) else rgb(0,0,0) }
|
|
|
|
#####Watermark Blending
|
|
#### Overwrite this in style files until we fully deprecate this
|
|
watermark_include := "/magic-watermarks.mse-include"
|
|
watermark_hybrid := {
|
|
linear_blend(
|
|
image1: colors[0] + input + ".png"
|
|
image2: colors[1] + input + ".png"
|
|
x1: 0.4, y1: 0
|
|
x2: 0.6, y2: 0
|
|
)
|
|
}
|
|
set_watermark_blend := {
|
|
set_alpha(
|
|
alpha: 0.75
|
|
input:
|
|
linear_blend(
|
|
image1:
|
|
masked_blend(
|
|
light: watermark_include + "/sets/" + input + ".png"
|
|
dark: watermark_include + "/sets/" + watermark_colors().0 + "mark.png"
|
|
mask: watermark_include + "/sets/" + input + ".png"
|
|
)
|
|
image2:
|
|
masked_blend(
|
|
light: watermark_include + "/sets/" + input + ".png"
|
|
dark: watermark_include + "/sets/" + watermark_colors().1 + "mark.png"
|
|
mask: watermark_include + "/sets/" + input + ".png"
|
|
)
|
|
x1: 0.4, y1: 0
|
|
x2: 0.6, y2: 0
|
|
)
|
|
)
|
|
}
|
|
spotlight_folder := { watermark_include + "/spotlight/" }
|
|
spotlight_watermark_blend := {
|
|
face := [1:card.card_color, 2:card.card_color_2, 3:card.card_color_3][face]
|
|
|
|
if l < 1 or h < 1 or l > 1024 or h > 1024 then (
|
|
input
|
|
) else (
|
|
wmc := watermark_colors(face:face)
|
|
c1 := wmc.0 + (if contains(face, match:"land") then "l") + "spotlight.png"
|
|
c2 := wmc.1 + (if contains(face, match:"land") then "l") + "spotlight.png"
|
|
wmdir := spotlight_folder()
|
|
c1 := crop(wmdir+c1, height:h, width:l, offset_x:0, offset_y:0)
|
|
c2 := crop(wmdir+c2, height:h, width:l, offset_x:0, offset_y:0)
|
|
|
|
mask := input
|
|
set_alpha(
|
|
alpha: alpha
|
|
input:
|
|
linear_blend(
|
|
image1:
|
|
masked_blend(
|
|
light: input
|
|
dark: c1
|
|
mask: mask
|
|
)
|
|
image2:
|
|
masked_blend(
|
|
light: input
|
|
dark: c2
|
|
mask: mask
|
|
)
|
|
x1: 0.4, y1: 0
|
|
x2: 0.6, y2: 0
|
|
)
|
|
)
|
|
)
|
|
}@(face:1,alpha:0.2,l:500,h:500)
|
|
|
|
shadow_watermark_blend := {
|
|
set_combine(
|
|
combine:"shadow",
|
|
set_alpha(
|
|
alpha: alpha,
|
|
drop_shadow(
|
|
offset_x: -0.01,
|
|
offset_y: 0.03,
|
|
blur_radius: 0.02,
|
|
alpha: 1,
|
|
color: rgb(0,0,0),
|
|
enlarge(
|
|
border_size: 0.03,
|
|
invert_image(input)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
}@(alpha:0.5)
|
|
|
|
glow_watermark_blend := {
|
|
set_combine(
|
|
combine:"glow",
|
|
set_alpha(
|
|
alpha: alpha,
|
|
drop_shadow(
|
|
offset_x: -0.01,
|
|
offset_y: 0.03,
|
|
blur_radius: 0.02,
|
|
alpha: 1,
|
|
color: rgb(0,0,0),
|
|
enlarge(
|
|
border_size: 0.03,
|
|
invert_image(input)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
}@(alpha:0.3)
|
|
|
|
watermark_blend :=
|
|
{
|
|
shadow_alpha := 0.5
|
|
glow_alpha := 0.3
|
|
backup := if custom then set.blend_with_colors else set.use_blended_watermarks
|
|
option := styling.watermark_render or else backup
|
|
dark_textbox := (face == 1 and invert_watermark_1())
|
|
or (face == 2 and invert_watermark_2())
|
|
or (face == 3 and invert_watermark_3())
|
|
if option == "inverted" then dark_textbox := not dark_textbox
|
|
invert_base_image := false
|
|
if custom then (
|
|
alpha := spotlight_alpha
|
|
)
|
|
if dark_textbox then
|
|
(
|
|
alpha := dark_alpha
|
|
spotlight_alpha := dark_spotlight_alpha
|
|
invert_base_image := true
|
|
)
|
|
user_alpha := styling.watermark_opacity_percentage or else ""
|
|
user_alpha := if user_alpha != "" then get_alpha_percentage(user_alpha, default: -1.0) else -1.0
|
|
if user_alpha >= 0.0 then
|
|
(
|
|
alpha := user_alpha
|
|
spotlight_alpha := user_alpha
|
|
shadow_alpha := user_alpha
|
|
glow_alpha := user_alpha
|
|
)
|
|
if colored then set_alpha(alpha: alpha, input)
|
|
else if option == "yes" or option == "blend with colors" then spotlight_watermark_blend(h:h, l:l, face:face, alpha: spotlight_alpha, input)
|
|
else if option == "shadow" then shadow_watermark_blend(input, alpha: shadow_alpha)
|
|
else if option == "glow" then glow_watermark_blend(input, alpha: glow_alpha)
|
|
else if invert_base_image then set_alpha(alpha: alpha, invert_image(input))
|
|
else set_alpha(alpha: alpha, input)
|
|
}@(h:500,l:500,colored:false,face:1,alpha:0.25,spotlight_alpha:0.75,dark_alpha:0.25,dark_spotlight_alpha:0.35,custom:false) |