dfc watermarks, saga fix

This commit is contained in:
CajunAvenger
2021-11-06 22:56:12 -05:00
parent 427188118d
commit 5f058821f1
2 changed files with 88 additions and 82 deletions

View File

@@ -23,41 +23,46 @@
trim_colors :=
replace@(match:"(, )?(multicolor|hybrid|artifact|land|horizontal|vertical|radial)", replace:"")
watermark_colors := {
if trim_colors(card.card_color) == "white" then "ww"
else if trim_colors(card.card_color) == "blue" then "uu"
else if trim_colors(card.card_color) == "black" then "bb"
else if trim_colors(card.card_color) == "red" then "rr"
else if trim_colors(card.card_color) == "green" then "gg"
else if contains(card.card_color, match:"multi") or
contains(card.card_color, match:"hybrid") or
contains(card.card_color, match:", land") then hybrid_color()
else if contains(card.card_color, match:"artifact") then "aa"
else "cc"
}
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 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 := {
if trim_colors(card.card_color) == "white, blue" then "wu"
else if trim_colors(card.card_color) == "white, black" then "wb"
else if trim_colors(card.card_color) == "white, red" then "rw"
else if trim_colors(card.card_color) == "white, green" then "gw"
else if trim_colors(card.card_color) == "blue, black" then "ub"
else if trim_colors(card.card_color) == "blue, red" then "ur"
else if trim_colors(card.card_color) == "blue, green" then "gu"
else if trim_colors(card.card_color) == "black, red" then "br"
else if trim_colors(card.card_color) == "black, green" then "bg"
else if trim_colors(card.card_color) == "red, green" then "rg"
else if trim_colors(card.card_color) == "white, blue, reversed" then "uw"
else if trim_colors(card.card_color) == "white, black, reversed" then "bw"
else if trim_colors(card.card_color) == "white, red, reversed" then "wr"
else if trim_colors(card.card_color) == "white, green, reversed" then "wg"
else if trim_colors(card.card_color) == "blue, black, reversed" then "bu"
else if trim_colors(card.card_color) == "blue, red, reversed" then "ru"
else if trim_colors(card.card_color) == "blue, green, reversed" then "ug"
else if trim_colors(card.card_color) == "black, red, reversed" then "rb"
else if trim_colors(card.card_color) == "black, green, reversed" then "bg"
else if trim_colors(card.card_color) == "red, green, reversed" then "gr"
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 == "blue, black" then "ub"
else if trimmed == "blue, red" then "ur"
else if trimmed == "blue, green" then "gu"
else if trimmed == "black, red" then "br"
else if trimmed == "black, green" then "bg"
else if trimmed == "red, green" then "rg"
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 == "blue, black, reversed" then "bu"
else if trimmed == "blue, red, reversed" then "ru"
else if trimmed == "blue, green, reversed" then "ug"
else if trimmed == "black, red, reversed" then "rb"
else if trimmed == "black, green, reversed" then "bg"
else if trimmed == "red, green, reversed" then "gr"
else "mm"
}
}@(face:"")
########################################################################
# Combining multiple colors (hybrids)
########################################################################
@@ -865,71 +870,72 @@ color_background := {
color_combination := {
# The base hybrid, without the outer frame blended over it
base := base_hybrid[shape][color_count]()
light:= base
# Put a frame around it?
if land and not colored_lands then
masked_blend(
dark: land_template("c"),
mask "multicolor_blend_{type}.png",
mask: "multicolor_blend_{type}.png",
dark: land_template("c"),
light: base,
)
else if land and multi and mask_multi_land_with_color() then
masked_blend(
dark: land_template("m"),
mask: "hybrid_blend_{type}.png",
mask: "hybrid_blend_{type}.png",
dark: base,
light: land_template("m"),
)
else if multi and artifact then
masked_blend(
light: masked_blend(
light: base
dark: template("m"),
mask: "multicolor_blend_{type}.png",
mask: "artifact_blend_{type}.png",
dark: template("a"),
light: masked_blend(
mask: "multicolor_blend_{type}.png",
dark: template("m"),
light: base
)
dark: template("a"),
mask: "artifact_blend_{type}.png",
)
else if multi then
masked_blend(
dark: template("m"),
mask: "multicolor_blend_{type}.png",
)
mask: "multicolor_blend_{type}.png",
dark: template("m"),
light: base,
)
else if artifact and color_count > 1 and mask_hybrid_with_land() then
masked_blend(
light: masked_blend(
light: base
dark: template("c"),
mask: "multicolor_blend_{type}.png",
mask: "artifact_blend_{type}.png",
dark: template("a"),
light: masked_blend(
mask: "multicolor_blend_{type}.png",
dark: template("c"),
light: base
)
dark: template("a"),
mask: "artifact_blend_{type}.png",
)
else if artifact and color_count > 1 and mask_hybrid_with_gold() then
masked_blend(
light: masked_blend(
light: base
dark: template("m"),
mask: "multicolor_blend_{type}.png",
)dark: template("a"),
mask: "artifact_blend_{type}.png",
mask: "artifact_blend_{type}.png",
dark: template("a"),
light: masked_blend(
mask: "multicolor_blend_{type}.png",
dark: template("m"),
light: base
)
)
else if artifact then
masked_blend(
dark: template("a"),
mask: "artifact_blend_{type}.png",
mask: "artifact_blend_{type}.png",
dark: template("a"),
light: base,
)
else if color_count > 1 and mask_hybrid_with_land() then
masked_blend(
dark: land_template("c"),
mask: "hybrid_blend_{type}.png",
mask: "hybrid_blend_{type}.png",
dark: land_template("c"),
light: base,
)
else if color_count > 1 and mask_hybrid_with_gold() then
masked_blend(
dark: land_template("m"),
mask: "hybrid_blend_{type}.png",
mask: "hybrid_blend_{type}.png",
dark: land_template("m"),
light: base,
)
else base
}

View File

@@ -475,16 +475,16 @@ init script:
8: {[card_style.level_8_text.top, card_style.level_8_text.bottom-card_style.level_8_text.top]}
]
auto_snap := {
snap_array := split_text(replace(styling.snap_chapter_to_box, match:",[^,]+$", replace:","), match:",")
abil := to_number(pull_comma_array(styling.snap_chapter_to_box, cell:input-1, end:true)) ###textbox to snap to
if abil == 0 then 600 else snap_calc(input, snap_array:snap_array, abil:abil)
}
snap_array := split_text(replace(line, match:",[^,]+$", replace:","), match:",")
abil := to_number(pull_comma_array(line, cell:input-1, end:true)) ###textbox to snap to
if abil == 0 then 600 else snap_calc(input, snap_array:snap_array, abil:abil, bump:bump)
}@(bump:0)
snap_calc := {
out := 0
abil_array := saga_lore_count(snap_array) ###chapters in each box
ch_count := abil_array[abil-1] ###chapters in this box
self_index := saga_ch_placement(snap_array)[input-1] ###input's index
box_deets := coords_map[abil]() ###[top, height]
box_deets := coords_map[abil+bump]() ###[top, height]
remain := box_deets[1] - 30*ch_count ###remaining space after chapter hexes
excess := remain - 10*(ch_count-1) ###remaining after 10px gaps
if excess >= 0 then out := box_deets[0] + excess/2 + 40*(self_index-1) ###top + buffer*index + hex*index-1
@@ -502,12 +502,12 @@ init script:
out
}
chapter0 := { if styling.reminder_coordinate != "" then max(60,min(to_number(styling.reminder_coordinate),438)) else 155}
chapter1 := { if length(comma_count(styling.snap_chapter_to_box)) > 0 then auto_snap(1) else to_number(pull_comma_array(styling.move_loyalty_costs, cell:0, end:true, default:(if two_boxes() then 183 else 185))) }
chapter2 := { if length(comma_count(styling.snap_chapter_to_box)) > 1 then auto_snap(2) else to_number(pull_comma_array(styling.move_loyalty_costs, cell:1, end:true, default:(if two_boxes() then 223 else 279))) }
chapter3 := { if length(comma_count(styling.snap_chapter_to_box)) > 2 then auto_snap(3) else to_number(pull_comma_array(styling.move_loyalty_costs, cell:2, end:true, default:(if two_boxes() then 329 else 373))) }
chapter4 := { if length(comma_count(styling.snap_chapter_to_box)) > 3 then auto_snap(4) else to_number(pull_comma_array(styling.move_loyalty_costs, cell:3, end:true, default:600)) }
chapter5 := { if length(comma_count(styling.snap_chapter_to_box)) > 4 then auto_snap(5) else to_number(pull_comma_array(styling.move_loyalty_costs, cell:4, end:true, default:600)) }
chapter6 := { if length(comma_count(styling.snap_chapter_to_box)) > 5 then auto_snap(6) else to_number(pull_comma_array(styling.move_loyalty_costs, cell:5, end:true, default:600)) }
chapter1 := { if length(comma_count(styling.snap_chapter_to_box)) > 0 then auto_snap(1, line:styling.snap_chapter_to_box) else to_number(pull_comma_array(styling.move_loyalty_costs, cell:0, end:true, default:(if two_boxes() then 183 else 185))) }
chapter2 := { if length(comma_count(styling.snap_chapter_to_box)) > 1 then auto_snap(2, line:styling.snap_chapter_to_box) else to_number(pull_comma_array(styling.move_loyalty_costs, cell:1, end:true, default:(if two_boxes() then 223 else 279))) }
chapter3 := { if length(comma_count(styling.snap_chapter_to_box)) > 2 then auto_snap(3, line:styling.snap_chapter_to_box) else to_number(pull_comma_array(styling.move_loyalty_costs, cell:2, end:true, default:(if two_boxes() then 329 else 373))) }
chapter4 := { if length(comma_count(styling.snap_chapter_to_box)) > 3 then auto_snap(4, line:styling.snap_chapter_to_box) else to_number(pull_comma_array(styling.move_loyalty_costs, cell:3, end:true, default:600)) }
chapter5 := { if length(comma_count(styling.snap_chapter_to_box)) > 4 then auto_snap(5, line:styling.snap_chapter_to_box) else to_number(pull_comma_array(styling.move_loyalty_costs, cell:4, end:true, default:600)) }
chapter6 := { if length(comma_count(styling.snap_chapter_to_box)) > 5 then auto_snap(6, line:styling.snap_chapter_to_box) else to_number(pull_comma_array(styling.move_loyalty_costs, cell:5, end:true, default:600)) }
chapter1b := { if to_number(pull_comma_array(styling.snap_chapter_to_back_box, cell:0, end:true)) > 0 then auto_snap(1, line:styling.snap_chapter_to_back_box, bump:4) else to_number(pull_comma_array(styling.move_back_loyalty_costs, cell:0, end:true, default:(if back_two_boxes() then 183 else 185))) }
chapter2b := { if to_number(pull_comma_array(styling.snap_chapter_to_back_box, cell:1, end:true)) > 0 then auto_snap(2, line:styling.snap_chapter_to_back_box, bump:4) else to_number(pull_comma_array(styling.move_back_loyalty_costs, cell:1, end:true, default:(if back_two_boxes() then 223 else 279))) }
@@ -4182,7 +4182,7 @@ extra card style:
width: 30
height: 34
render style: image
z index: 3
z index: 5
image: {alt_chapters("1")}
visible: {back_saga()}
chapter 2b: