From 9ee0a387bd2ccf07623ee100786c04ba9710cb50 Mon Sep 17 00:00:00 2001 From: cajun <12363371+CajunAvenger@users.noreply.github.com> Date: Wed, 6 Mar 2024 19:56:49 -0600 Subject: [PATCH] Add support for 8 level dungeons Baldur's Gate Wilderness just had to be 8 levels --- data/magic-m15-dungeons.mse-style/style | 416 +++++++++++++++++++++++- data/magic.mse-game/card_fields | 21 ++ 2 files changed, 428 insertions(+), 9 deletions(-) diff --git a/data/magic-m15-dungeons.mse-style/style b/data/magic-m15-dungeons.mse-style/style index ea0f1c7f7..e4ebd0063 100644 --- a/data/magic-m15-dungeons.mse-style/style +++ b/data/magic-m15-dungeons.mse-style/style @@ -88,7 +88,7 @@ init script: min(max(1,to_int(pull_comma_array(styling.room_counts, cell:line-1, end:false))),3) } # max number of levels determined by room count - max_level := {min(7,max(3, length(filter_text(styling.room_counts, match:"[0-9]"))))} + max_level := {min(8,max(3, length(filter_text(styling.room_counts, match:"[0-9]"))))} # simplify our common crop script wall_crop := {crop(input, height:387, width:327, offset_x:x, offset_y:offset)}@(x:0) # line height for a level @@ -129,7 +129,7 @@ init script: if per2 > per then per := per2 rem := exc - per*ml - one_off - bump := for x from 1 to 8 do [per+(if x == ml then rem+back_off else if x == 1 then one_off else 0)] + bump := for x from 1 to 9 do [per+(if x == ml then rem+back_off else if x == 1 then one_off else 0)] bump ) } @@ -145,7 +145,7 @@ init script: array := default_w[lanes] # if widths are edited if not use_fast() and styling["level_"+input+"_custom_widths"] != "" then ( - shift := split_text(styling["level_"+input+"_custom_widths"]+",,,,", match:",") + shift := split_text(styling["level_"+input+"_custom_widths"]+",,,,,", match:",") # width of room 1 l1 := to_int(if shift[0] != "" then shift[0] else array[1]) # width of room 2 @@ -195,7 +195,7 @@ init script: }@(text:true) box_max_y := { multi := 1 - maxi := for n from y+1 to 7 do ( + maxi := for n from y+1 to 8 do ( if not long_box(x:x, y:n) then multi := 0; multi ) @@ -204,9 +204,9 @@ init script: box_h := { multi := 1 if long_box(x:x, y:y) then multi := 0 - h := for n from y to 7 do ( + h := for n from y to 8 do ( if n > y and not long_box(x:x, y:n) then multi := 0 - if multi == 0 then n := 7 + if multi == 0 then n := 8 multi*line_height(n) ) h @@ -338,6 +338,7 @@ init script: if ml >= 5 then lanes := add_level_lanes(img:lanes, line:5, s:s) if ml >= 6 then lanes := add_level_lanes(img:lanes, line:6, s:s) if ml >= 7 then lanes := add_level_lanes(img:lanes, line:7, s:s) + if ml >= 8 then lanes := add_level_lanes(img:lanes, line:8, s:s) lanes } add_level_lanes := { @@ -368,6 +369,10 @@ init script: if line > 0 and ml <= 6 and contains(styling["level_"+(line+1)+"_long_rooms"], match:"5") then img := add_long_room(img:img, x:5, y:line, e:walls[5], s:s) else img := add_door(img:img, x:5, y:line, c:0.5*(walls[4]+walls[5]), s:s, w:(walls[5]-walls[4])) + if len >= 7 and not contains(styling["level_"+line+"_dead_ends"], match:"6") then + if line > 0 and ml <= 7 and contains(styling["level_"+(line+1)+"_long_rooms"], match:"6") + then img := add_long_room(img:img, x:6, y:line, e:walls[6], s:s) + else img := add_door(img:img, x:6, y:line, c:0.5*(walls[5]+walls[6]), s:s, w:(walls[6]-walls[5])) img } add_long_room := { @@ -401,6 +406,7 @@ init script: if ml >= 5 then walls := add_level_walls(img:walls, line:5, s:s) if ml >= 6 then walls := add_level_walls(img:walls, line:6, s:s) if ml >= 7 then walls := add_level_walls(img:walls, line:7, s:s) + if ml >= 8 then walls := add_level_walls(img:walls, line:8, s:s) walls } add_level_walls := { @@ -454,6 +460,7 @@ init script: if ml >= 5 then lanes := lane_mask(folder, img:lanes, line:6) if ml >= 6 then lanes := lane_mask(folder, img:lanes, line:7) if ml >= 7 then lanes := lane_mask(folder, img:lanes, line:8) + if ml >= 8 then lanes := lane_mask(folder, img:lanes, line:9) if ml >= 1 then walls := wall_mask(folder, img:walls, line:1) if ml >= 2 then walls := wall_mask(folder, img:walls, line:2) if ml >= 3 then walls := wall_mask(folder, img:walls, line:3) @@ -461,6 +468,7 @@ init script: if ml >= 5 then walls := wall_mask(folder, img:walls, line:5) if ml >= 6 then walls := wall_mask(folder, img:walls, line:6) if ml >= 7 then walls := wall_mask(folder, img:walls, line:7) + if ml >= 8 then walls := wall_mask(folder, img:walls, line:8) if ml >= 1 then walls := door_mask(folder, img:walls, line:1) if ml >= 2 then walls := door_mask(folder, img:walls, line:2) if ml >= 3 then walls := door_mask(folder, img:walls, line:3) @@ -468,6 +476,7 @@ init script: if ml >= 5 then walls := door_mask(folder, img:walls, line:5) if ml >= 6 then walls := door_mask(folder, img:walls, line:6) if ml >= 7 then walls := door_mask(folder, img:walls, line:7) + if ml >= 8 then walls := door_mask(folder, img:walls, line:8) if ml >= 0 then lanes := dead_mask(folder, img:lanes, line:0) if ml >= 1 then lanes := dead_mask(folder, img:lanes, line:1) if ml >= 2 then lanes := dead_mask(folder, img:lanes, line:2) @@ -476,6 +485,7 @@ init script: if ml >= 5 then lanes := dead_mask(folder, img:lanes, line:5) if ml >= 6 then lanes := dead_mask(folder, img:lanes, line:6) if ml >= 7 then lanes := dead_mask(folder, img:lanes, line:7) + if ml >= 8 then lanes := dead_mask(folder, img:lanes, line:8) dungeon := masked_blend(dark:walls, light:white, mask:lanes) dungeon_img := black @@ -501,7 +511,7 @@ init script: next := line_lanes(line+1) base := lane_mask_base[lanes][next] rooms := sort_list(break_text(styling["level_"+line+"_dead_ends"], match:"[0-9]")) - longs := if line > 1 and line < 7 then break_text(styling["level_"+(line+1)+"_long_rooms"], match:"[0-9]") else ["no"] + longs := if line > 1 and line < 8 then break_text(styling["level_"+(line+1)+"_long_rooms"], match:"[0-9]") else ["no"] rooms := unique_elements(of:rooms, from:longs) tail := for x from 0 to length(rooms)-1 do ( if rooms[x] == "1" and ar_position(of:"1", in:longs) == -1 @@ -524,7 +534,7 @@ init script: next := line_lanes(line+1) base := lane_mask_base[lanes][next] file := input+"lane_masks/"+base - if line > 0 and line < 7 and lanes > 1 and lanes == next then file := file + long_map(long_lanes(line)) + if line > 0 and line < 8 and lanes > 1 and lanes == next then file := file + long_map(long_lanes(line)) mask_img := wall_crop(file+".png", offset:380-line_offset(line)) masked_blend(dark:img, light:"walls.png", mask:mask_img) } @@ -545,7 +555,7 @@ init script: } long_lanes := { - if input > 7 then 0 else ( + if input > 8 then 0 else ( line := to_int(input)+1 long := sort_list(break_text(styling["level_"+line+"_long_rooms"], match:"[123]"), remove_duplicates:true) len := length(long) @@ -671,6 +681,10 @@ styling field: type: text name: level 7 long rooms description: Make these rooms continue from the last level, like Oubliette. +styling field: + type: text + name: level 8 long rooms + description: Make these rooms continue from the last level, like Oubliette. styling field: type: info name: Dead Ends @@ -707,6 +721,10 @@ styling field: type: text name: level 7 dead ends description: List of doors out of this level to close, eg "12" +styling field: + type: text + name: level 8 dead ends + description: List of doors out of this level to close, eg "12" styling field: type: info name: Exits @@ -739,6 +757,10 @@ styling field: type: text name: level 7 exits description: Walls to put vertical doors on. +styling field: + type: text + name: level 8 exits + description: Walls to put vertical doors on. styling field: type: text name: arrow replacement folder @@ -802,6 +824,10 @@ styling field: type: text name: level 7 custom widths description: Make rooms a different number of blocks wide, for example "10,6," for a double sized room +styling field: + type: text + name: level 8 custom widths + description: Make rooms a different number of blocks wide, for example "10,6," for a double sized room styling field: type: info name: Door offsets @@ -834,6 +860,10 @@ styling field: type: text name: level 7 door offsets description: Move doors X pixels right (use negative for left). A block is 20px +styling field: + type: text + name: level 8 door offsets + description: Move doors X pixels right (use negative for left). A block is 20px styling field: type: boolean name: remove from autocount @@ -1463,6 +1493,86 @@ card style: line height hard max: 0.9 line height line max: 0.9 + level 20 text: + left: {box_x(x:1, y:8)} + top: {box_y(x:1, y:8)} + width: {box_w(x:1, y:8)} + height: {box_h(x:1, y:8)} + font: + name: MPlantin + italic name: MPlantin-Italic + size: {font_size()} + scale down to: 6 + color: {font_color()} + symbol font: + name: { styling.text_box_mana_symbols } + size: {font_size()} + scale down to: 6 + alignment: middle center + z index: 5 + padding top: 3 + padding bottom: 2 + padding left: 5 + padding right: 5 + line height hard: 0.9 + line height line: 0.9 + line height soft: 0.9 + line height hard max: 0.9 + line height line max: 0.9 + level 21 text: + left: {box_x(x:2, y:8)} + top: {box_y(x:2, y:8)} + width: {box_w(x:2, y:8)} + height: {box_h(x:2, y:8)} + font: + name: MPlantin + italic name: MPlantin-Italic + size: {font_size()} + scale down to: 6 + color: {font_color()} + symbol font: + name: { styling.text_box_mana_symbols } + size: {font_size()} + scale down to: 6 + alignment: middle center + z index: 5 + padding top: 3 + padding bottom: 2 + padding left: 5 + padding right: 5 + line height hard: 0.9 + line height line: 0.9 + line height soft: 0.9 + line height hard max: 0.9 + line height line max: 0.9 + + level 22 text: + left: {box_x(x:3, y:8)} + top: {box_y(x:3, y:8)} + width: {box_w(x:3, y:8)} + height: {box_h(x:3, y:8)} + font: + name: MPlantin + italic name: MPlantin-Italic + size: {font_size()} + scale down to: 6 + color: {font_color()} + symbol font: + name: { styling.text_box_mana_symbols } + size: {font_size()} + scale down to: 6 + alignment: middle center + z index: 5 + padding top: 3 + padding bottom: 2 + padding left: 5 + padding right: 5 + line height hard: 0.9 + line height line: 0.9 + line height soft: 0.9 + line height hard max: 0.9 + line height line max: 0.9 + ############################# Card sorting / numbering set code: left: 24 @@ -2260,6 +2370,76 @@ extra card field: choice: custom symbol 1 choice: custom symbol 2 default: arrow_direction(y:6, x:5) +extra card field: + type: choice + name: arrow 71 + editable: true + save value: true + choice: none + choice: up + choice: down + choice: updown + choice: lock + choice: key + choice: custom symbol 1 + choice: custom symbol 2 + default: arrow_direction(y:7, x:1) +extra card field: + type: choice + name: arrow 72 + editable: true + save value: true + choice: none + choice: up + choice: down + choice: updown + choice: lock + choice: key + choice: custom symbol 1 + choice: custom symbol 2 + default: arrow_direction(y:7, x:2) +extra card field: + type: choice + name: arrow 73 + editable: true + save value: true + choice: none + choice: up + choice: down + choice: updown + choice: lock + choice: key + choice: custom symbol 1 + choice: custom symbol 2 + default: arrow_direction(y:7, x:3) +extra card field: + type: choice + name: arrow 74 + editable: true + save value: true + choice: none + choice: up + choice: down + choice: updown + choice: lock + choice: key + choice: custom symbol 1 + choice: custom symbol 2 + default: arrow_direction(y:7, x:4) +extra card field: + type: choice + name: arrow 75 + editable: true + save value: true + choice: none + choice: up + choice: down + choice: updown + choice: lock + choice: key + choice: custom symbol 1 + choice: custom symbol 2 + default: arrow_direction(y:7, x:5) extra card field: type: choice name: wall arrow 61 @@ -2372,6 +2552,62 @@ extra card field: choice: custom symbol 1 choice: custom symbol 2 default: door_direction(y:7, x:4) +extra card field: + type: choice + name: wall arrow 81 + editable: true + save value: true + choice: none + choice: left + choice: right + choice: leftright + choice: lock + choice: key + choice: custom symbol 1 + choice: custom symbol 2 + default: door_direction(y:8, x:1) +extra card field: + type: choice + name: wall arrow 82 + editable: true + save value: true + choice: none + choice: left + choice: right + choice: leftright + choice: lock + choice: key + choice: custom symbol 1 + choice: custom symbol 2 + default: door_direction(y:8, x:2) +extra card field: + type: choice + name: wall arrow 83 + editable: true + save value: true + choice: none + choice: left + choice: right + choice: leftright + choice: lock + choice: key + choice: custom symbol 1 + choice: custom symbol 2 + default: door_direction(y:8, x:3) +extra card field: + type: choice + name: wall arrow 84 + editable: true + save value: true + choice: none + choice: left + choice: right + choice: leftright + choice: lock + choice: key + choice: custom symbol 1 + choice: custom symbol 2 + default: door_direction(y:8, x:4) extra card style: card code: left: 24 @@ -3433,6 +3669,96 @@ extra card style: key: {custom_sym("key.png")} custom_symbol_1: {custom_sym("1")} custom_symbol_2: {custom_sym("2")} + arrow 71: + left: {arrow_x(x:1, y:7)} + top: {arrow_y(x:1, y:7)} + width: {if arrow_x(x:1, y:7) == 0 then 0 else 20} + height: 20 + render style: image + z index: 6 + choice images: + up: {custom_sym("arrowU.png")} + down: {custom_sym("arrowD.png")} + updown: {custom_sym("arrowUD.png")} + left: {custom_sym("arrowL.png")} + right: {custom_sym("arrowR.png")} + leftright: {custom_sym("arrowLR.png")} + lock: {custom_sym("lock.png")} + key: {custom_sym("key.png")} + custom_symbol_1: {custom_sym("1")} + custom_symbol_2: {custom_sym("2")} + arrow 72: + left: {arrow_x(x:2, y:7)} + top: {arrow_y(x:2, y:7)} + width: {if arrow_x(x:2, y:7) == 0 then 0 else 20} + height: 20 + render style: image + z index: 6 + choice images: + up: {custom_sym("arrowU.png")} + down: {custom_sym("arrowD.png")} + updown: {custom_sym("arrowUD.png")} + left: {custom_sym("arrowL.png")} + right: {custom_sym("arrowR.png")} + leftright: {custom_sym("arrowLR.png")} + lock: {custom_sym("lock.png")} + key: {custom_sym("key.png")} + custom_symbol_1: {custom_sym("1")} + custom_symbol_2: {custom_sym("2")} + arrow 73: + left: {arrow_x(x:3, y:7)} + top: {arrow_y(x:3, y:7)} + width: {if arrow_x(x:3, y:7) == 0 then 0 else 20} + height: 20 + render style: image + z index: 6 + choice images: + up: {custom_sym("arrowU.png")} + down: {custom_sym("arrowD.png")} + updown: {custom_sym("arrowUD.png")} + left: {custom_sym("arrowL.png")} + right: {custom_sym("arrowR.png")} + leftright: {custom_sym("arrowLR.png")} + lock: {custom_sym("lock.png")} + key: {custom_sym("key.png")} + custom_symbol_1: {custom_sym("1")} + custom_symbol_2: {custom_sym("2")} + arrow 74: + left: {arrow_x(x:4, y:7)} + top: {arrow_y(x:4, y:7)} + width: {if arrow_x(x:4, y:7) == 0 then 0 else 20} + height: 20 + render style: image + z index: 6 + choice images: + up: {custom_sym("arrowU.png")} + down: {custom_sym("arrowD.png")} + updown: {custom_sym("arrowUD.png")} + left: {custom_sym("arrowL.png")} + right: {custom_sym("arrowR.png")} + leftright: {custom_sym("arrowLR.png")} + lock: {custom_sym("lock.png")} + key: {custom_sym("key.png")} + custom_symbol_1: {custom_sym("1")} + custom_symbol_2: {custom_sym("2")} + arrow 75: + left: {arrow_x(x:5, y:7)} + top: {arrow_y(x:5, y:7)} + width: {if arrow_x(x:5, y:7) == 0 then 0 else 20} + height: 20 + render style: image + z index: 6 + choice images: + up: {custom_sym("arrowU.png")} + down: {custom_sym("arrowD.png")} + updown: {custom_sym("arrowUD.png")} + left: {custom_sym("arrowL.png")} + right: {custom_sym("arrowR.png")} + leftright: {custom_sym("arrowLR.png")} + lock: {custom_sym("lock.png")} + key: {custom_sym("key.png")} + custom_symbol_1: {custom_sym("1")} + custom_symbol_2: {custom_sym("2")} wall arrow 71: left: {door_x(x:1, y:7)} top: {door_y(x:1, y:7)} @@ -3505,3 +3831,75 @@ extra card style: key: {custom_sym("key.png")} custom_symbol_1: {custom_sym("1")} custom_symbol_2: {custom_sym("2")} + wall arrow 81: + left: {door_x(x:1, y:8)} + top: {door_y(x:1, y:8)} + width: {if door_x(x:1, y:8) == 0 then 0 else 20} + height: 20 + render style: image + z index: 6 + choice images: + up: {custom_sym("arrowU.png")} + down: {custom_sym("arrowD.png")} + updown: {custom_sym("arrowUD.png")} + left: {custom_sym("arrowL.png")} + right: {custom_sym("arrowR.png")} + leftright: {custom_sym("arrowLR.png")} + lock: {custom_sym("lock.png")} + key: {custom_sym("key.png")} + custom_symbol_1: {custom_sym("1")} + custom_symbol_2: {custom_sym("2")} + wall arrow 82: + left: {door_x(x:2, y:8)} + top: {door_y(x:2, y:8)} + width: {if door_x(x:2, y:8) == 0 then 0 else 20} + height: 20 + render style: image + z index: 6 + choice images: + up: {custom_sym("arrowU.png")} + down: {custom_sym("arrowD.png")} + updown: {custom_sym("arrowUD.png")} + left: {custom_sym("arrowL.png")} + right: {custom_sym("arrowR.png")} + leftright: {custom_sym("arrowLR.png")} + lock: {custom_sym("lock.png")} + key: {custom_sym("key.png")} + custom_symbol_1: {custom_sym("1")} + custom_symbol_2: {custom_sym("2")} + wall arrow 83: + left: {door_x(x:3, y:8)} + top: {door_y(x:3, y:8)} + width: {if door_x(x:3, y:8) == 0 then 0 else 20} + height: 20 + render style: image + z index: 6 + choice images: + up: {custom_sym("arrowU.png")} + down: {custom_sym("arrowD.png")} + updown: {custom_sym("arrowUD.png")} + left: {custom_sym("arrowL.png")} + right: {custom_sym("arrowR.png")} + leftright: {custom_sym("arrowLR.png")} + lock: {custom_sym("lock.png")} + key: {custom_sym("key.png")} + custom_symbol_1: {custom_sym("1")} + custom_symbol_2: {custom_sym("2")} + wall arrow 84: + left: {door_x(x:4, y:8)} + top: {door_y(x:4, y:8)} + width: {if door_x(x:4, y:8) == 0 then 0 else 20} + height: 20 + render style: image + z index: 6 + choice images: + up: {custom_sym("arrowU.png")} + down: {custom_sym("arrowD.png")} + updown: {custom_sym("arrowUD.png")} + left: {custom_sym("arrowL.png")} + right: {custom_sym("arrowR.png")} + leftright: {custom_sym("arrowLR.png")} + lock: {custom_sym("lock.png")} + key: {custom_sym("key.png")} + custom_symbol_1: {custom_sym("1")} + custom_symbol_2: {custom_sym("2")} diff --git a/data/magic.mse-game/card_fields b/data/magic.mse-game/card_fields index e9f92d788..7e616fdee 100644 --- a/data/magic.mse-game/card_fields +++ b/data/magic.mse-game/card_fields @@ -1134,6 +1134,27 @@ card field: show statistics: false multi line: true description: The nineteenth level text for the card +card field: + type: text + name: level 20 text + script: text_filter(input: value, card_name: if set.alias_as_cardname and card.alias != "" then card.alias else card.name, margin_code:"lv20") + show statistics: false + multi line: true + description: The twentieth level text for the card +card field: + type: text + name: level 21 text + script: text_filter(input: value, card_name: if set.alias_as_cardname and card.alias != "" then card.alias else card.name, margin_code:"lv21") + show statistics: false + multi line: true + description: The twenty-first level text for the card +card field: + type: text + name: level 22 text + script: text_filter(input: value, card_name: if set.alias_as_cardname and card.alias != "" then card.alias else card.name, margin_code:"lv22") + show statistics: false + multi line: true + description: The twenty-second level text for the card card field: type: text name: level 5