From 3ea37bff83b523aa6d47c629355d08c18689530e Mon Sep 17 00:00:00 2001 From: Milopetilo <78963720+Milopetilo@users.noreply.github.com> Date: Sun, 8 Dec 2024 21:48:44 +0100 Subject: [PATCH] Make the grocery store use a palette (#78425) * Add the palette * Update s_grocery.json * Move ter_furn_transform --- data/json/mapgen/nested/aux_nested.json | 5 + data/json/mapgen/s_grocery.json | 347 +++++------------- .../json/mapgen_palettes/grocery_palette.json | 41 +++ 3 files changed, 144 insertions(+), 249 deletions(-) create mode 100644 data/json/mapgen_palettes/grocery_palette.json diff --git a/data/json/mapgen/nested/aux_nested.json b/data/json/mapgen/nested/aux_nested.json index bdf57a74d623d..4de1b9d869e33 100644 --- a/data/json/mapgen/nested/aux_nested.json +++ b/data/json/mapgen/nested/aux_nested.json @@ -173,6 +173,11 @@ } ] }, + { + "type": "ter_furn_transform", + "id": "glass_door_wall_2_floor", + "terrain": [ { "result": "t_floor", "valid_terrain": [ "t_wall_glass", "t_door_glass_c" ] } ] + }, { "type": "ter_furn_transform", "id": "destroyed_window", diff --git a/data/json/mapgen/s_grocery.json b/data/json/mapgen/s_grocery.json index 6298793de1bf5..97248f821ad98 100644 --- a/data/json/mapgen/s_grocery.json +++ b/data/json/mapgen/s_grocery.json @@ -31,41 +31,9 @@ "sssL***+**************#_", "sss####################_" ], - "palettes": [ "parametrized_linoleum_palette", "parametrized_carpets_palette", "parametrized_walls_palette" ], "fill_ter": { "param": "linoleum_color", "fallback": "t_linoleum_white" }, - "terrain": { - " ": { "param": "linoleum_color", "fallback": "t_linoleum_white" }, - "*": "t_thconc_floor", - "+": "t_door_c", - "g": "t_wall_glass", - "C": "t_thconc_floor", - "I": "t_door_locked_interior", - "L": "t_door_locked", - "S": { "param": "linoleum_color", "fallback": "t_linoleum_gray" }, - "T": { "param": "linoleum_color", "fallback": "t_linoleum_gray" }, - "W": "t_chainfence", - "[": "t_door_glass_c", - "]": "t_thconc_floor", - "_": "t_region_groundcover_urban", - "l": { "param": "linoleum_color", "fallback": "t_linoleum_gray" }, - "s": "t_concrete", - "w": "t_chainfence", - "4": "t_gutter_downspout" - }, - "furniture": { - "A": "f_atm_off", - "-": "f_counter", - "7": "f_bookcase", - "C": "f_crate_c", - "S": "f_sink", - "]": "f_rack", - "^": "f_indoor_plant", - "b": "f_stool", - "f": "f_glass_fridge", - "r": "f_rack", - "t": "f_table" - }, - "toilets": { "T": { } }, + "palettes": [ "grocery_store_palette" ], + "terrain": { "l": { "param": "linoleum_color", "fallback": "t_linoleum_gray" } }, "place_items": [ { "item": "produce", "x": [ 3, 6 ], "y": 5, "chance": 85, "repeat": [ 1, 10 ] }, { "item": "produce", "x": [ 8, 12 ], "y": 5, "chance": 85, "repeat": [ 1, 10 ] }, @@ -95,24 +63,11 @@ { "item": "groce_dairyegg", "x": [ 18, 21 ], "y": 21, "chance": 80, "repeat": [ 1, 12 ] }, { "item": "cash_register_random", "x": [ 18, 20 ], "y": 6, "chance": 100 } ], - "place_vehicles": [ - { "vehicle": "shopping_cart", "x": 3, "y": 2, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 4, "y": 2, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 5, "y": 2, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 6, "y": 2, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 7, "y": 2, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 8, "y": 2, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 9, "y": 2, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 3, "y": 3, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 4, "y": 3, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 5, "y": 3, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 6, "y": 3, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 7, "y": 3, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 8, "y": 3, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 9, "y": 3, "chance": 10 }, - { "vehicle": "shopping_cart", "x": [ 4, 21 ], "y": 13, "chance": 15 }, - { "vehicle": "grocery_cart", "x": [ 19, 22 ], "y": 3, "chance": 10, "repeat": [ 1, 3 ], "rotation": 90 } - ], + "vehicles": { + " ": { "vehicle": "shopping_cart", "chance": 10, "rotation": [ 0, 90, 180, 270 ] }, + "s": { "vehicle": "shopping_cart", "chance": 10, "rotation": [ 0, 90, 180, 270 ] } + }, + "place_vehicles": [ { "vehicle": "grocery_cart", "x": [ 19, 22 ], "y": 3, "chance": 10, "repeat": [ 1, 3 ], "rotation": 90 } ], "place_monster": [ { "monster": [ "mon_grocerybot", "mon_grocerybot_busted" ], "x": [ 19, 22 ], "y": 2, "chance": 15, "repeat": [ 1, 3 ] } ] @@ -151,38 +106,8 @@ "sss####################_" ], "fill_ter": { "param": "linoleum_color", "fallback": "t_linoleum_white" }, - "palettes": [ "parametrized_linoleum_palette", "parametrized_carpets_palette", "parametrized_walls_palette" ], - "terrain": { - " ": { "param": "linoleum_color", "fallback": "t_linoleum_white" }, - "*": "t_thconc_floor", - "+": [ [ "t_door_b", 20 ], [ "t_door_frame", 10 ], [ "t_door_o", 70 ], [ "t_door_c", 5 ], [ "t_door_locked_interior", 3 ] ], - "g": "t_wall_glass", - "A": { "param": "linoleum_color", "fallback": "t_linoleum_white" }, - "C": "t_thconc_floor", - "S": { "param": "linoleum_color", "fallback": "t_linoleum_gray" }, - "T": { "param": "linoleum_color", "fallback": "t_linoleum_gray" }, - "W": "t_chainfence", - "[": "t_door_glass_c", - "]": "t_thconc_floor", - "_": "t_region_groundcover_urban", - "l": { "param": "linoleum_color", "fallback": "t_linoleum_gray" }, - "s": "t_concrete", - "w": "t_chainfence", - "4": "t_gutter_downspout" - }, - "furniture": { - "-": "f_counter", - "7": "f_bookcase", - "C": [ [ "f_crate_c", 20 ], [ "f_crate_o", 80 ] ], - "S": "f_sink", - "]": "f_rack", - "^": "f_indoor_plant", - "b": "f_stool", - "f": "f_glass_fridge", - "r": "f_rack", - "t": "f_table" - }, - "toilets": { "T": { } }, + "terrain": { "l": { "param": "linoleum_color", "fallback": "t_linoleum_white" } }, + "palettes": [ "grocery_store_palette" ], "fields": { "T": { "field": "fd_bile", "intensity": 1, "age": 10 }, "S": { "field": "fd_bile", "intensity": 1, "age": 10 } }, "liquids": { " ": [ @@ -249,24 +174,10 @@ { "item": "styrofoam_cup", "chance": 1 } ] }, - "place_vehicles": [ - { "vehicle": "shopping_cart", "x": 3, "y": 2, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 4, "y": 2, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 5, "y": 2, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 6, "y": 2, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 7, "y": 2, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 8, "y": 2, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 9, "y": 2, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 3, "y": 3, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 4, "y": 3, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 5, "y": 3, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 6, "y": 3, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 7, "y": 3, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 8, "y": 3, "chance": 10 }, - { "vehicle": "shopping_cart", "x": 9, "y": 3, "chance": 10 }, - { "vehicle": "shopping_cart", "x": [ 4, 21 ], "y": 13, "chance": 15 }, - { "vehicle": "grocery_cart", "x": [ 19, 22 ], "y": 3, "chance": 10, "repeat": [ 1, 3 ], "rotation": 90 } - ], + "vehicles": { + " ": { "vehicle": "shopping_cart", "chance": 10, "rotation": [ 0, 90, 180, 270 ] }, + "s": { "vehicle": "shopping_cart", "chance": 10, "rotation": [ 0, 90, 180, 270 ] } + }, "place_monster": [ { "monster": [ "mon_grocerybot", "mon_grocerybot_busted" ], "x": [ 19, 22 ], "y": 2, "chance": 15, "repeat": [ 1, 3 ] } ], @@ -315,43 +226,14 @@ "sssL***+**************#_", "sss####################_" ], - "fill_ter": { "param": "linoleum_color", "fallback": "t_linoleum_white" }, - "palettes": [ "parametrized_linoleum_palette", "parametrized_carpets_palette", "parametrized_walls_palette" ], + "fill_ter": { "param": "linoleum_color", "fallback": "t_linoleum_gray" }, + "palettes": [ "grocery_store_palette" ], "terrain": { - " ": { "param": "linoleum_color", "fallback": "t_linoleum_white" }, - "*": "t_thconc_floor", "+": "t_door_boarded", - "g": "t_wall_glass", - "C": "t_thconc_floor", + "l": { "param": "linoleum_color", "fallback": "t_linoleum_white" }, "I": "t_door_boarded", - "L": "t_door_boarded", - "S": { "param": "linoleum_color", "fallback": "t_linoleum_gray" }, - "T": { "param": "linoleum_color", "fallback": "t_linoleum_gray" }, - "W": "t_chainfence", - "[": "t_door_glass_c", - "]": "t_thconc_floor", - "_": "t_region_groundcover_urban", - "l": { "param": "linoleum_color", "fallback": "t_linoleum_gray" }, - "s": "t_concrete", - "w": "t_chainfence", - "4": "t_gutter_downspout", - "Ю": "t_concrete" - }, - "furniture": { - "A": "f_atm_off", - "-": "f_counter", - "7": "f_bookcase", - "C": "f_crate_c", - "S": "f_sink", - "]": "f_rack", - "^": "f_indoor_plant", - "b": "f_stool", - "f": "f_glass_fridge", - "r": "f_rack", - "t": "f_table", - "Ю": "f_sandbag_half" + "L": "t_door_boarded" }, - "toilets": { "T": { } }, "place_items": [ { "item": "produce", "x": [ 3, 6 ], "y": 5, "chance": 1, "repeat": [ 1, 10 ] }, { "item": "produce", "x": [ 8, 12 ], "y": 5, "chance": 1, "repeat": [ 1, 10 ] }, @@ -438,42 +320,32 @@ "object": { "fill_ter": { "param": "linoleum_color", "fallback": "t_linoleum_gray" }, "rows": [ - " ss ", - " ss ", - " ###:::###++###:::### ", - " #..................# ", - " #..................# ", - " #..-..{-..{-..{-..{# ", - " #..-..{-..{-..{-..{# ", - " #..-..{-..{-..{-..{# ", - " #..................# ", - " #..................# ", - " #&..{{..{{..{{....{# ", - " #&..{{..{{..{{..{{{# ", - " #&..{{..{{..{{....{# ", - " #&..{{..{{..{{....{# ", - " #&..{{..{{..{{..{{{# ", - " #&..{{..{{..{{....{# ", - " #..................# ", - " #..................# ", - " #||||.........-----# ", - " #T.S|.........-.b..# ", - " #L..+.&&&&&&&....&&# ", - " #################### ", - " 4 ", - " " + "___________ss___________", + "___________ss___________", + "__###:::###++###:::###__", + "__# #__", + "__# #__", + "__# - r- r- r- r#__", + "__# - r- r- r- r#__", + "__# - r- r- r- r#__", + "__# #__", + "__# #__", + "__#f rr rr rr r#__", + "__#f rr rr rr rrr#__", + "__#f rr rr rr r#__", + "__#f rr rr rr r#__", + "__#f rr rr rr rrr#__", + "__#f rr rr rr r#__", + "__# #__", + "__# #__", + "__#|||| -----#__", + "__#T S| - b #__", + "__#L + fffffff ff#__", + "__####################__", + "___4____________________", + "________________________" ], - "palettes": [ "parametrized_linoleum_palette", "parametrized_walls_palette" ], - "terrain": { - " ": "t_region_groundcover_urban", - "s": "t_concrete", - "+": "t_door_c", - ".": { "param": "linoleum_color", "fallback": "t_linoleum_gray" }, - ":": "t_window", - "4": "t_gutter_downspout" - }, - "furniture": { "-": "f_counter", "&": "f_glass_fridge", "{": "f_rack", "b": "f_stool", "S": "f_sink", "L": "f_locker" }, - "toilets": { "T": { } }, + "palettes": [ "grocery_store_palette" ], "place_items": [ { "item": "fridgesnacks", "x": 3, "y": [ 10, 15 ], "chance": 80, "repeat": [ 1, 12 ] }, { "item": "fridge", "x": [ 8, 14 ], "y": 20, "chance": 80, "repeat": [ 1, 12 ] }, @@ -506,7 +378,7 @@ { "monster": "GROUP_PLAGUE_ROACH", "x": [ 2, 21 ], "y": [ 2, 21 ], "chance": 20 }, { "monster": "GROUP_ROACH", "x": [ 2, 21 ], "y": [ 2, 21 ], "chance": 20 } ], - "vehicles": { ".": { "vehicle": "shopping_cart", "chance": 1, "status": 1 } } + "vehicles": { " ": { "vehicle": "shopping_cart", "chance": 10, "rotation": [ 0, 90, 180, 270 ] } } } }, { @@ -517,42 +389,33 @@ "object": { "fill_ter": { "param": "linoleum_color", "fallback": "t_linoleum_gray" }, "rows": [ - " ss ", - " ss ", - " ###:::###++###:::### ", - " #..................# ", - " #..................# ", - " #..-..{-..{-..{-..{# ", - " #..-..{-..{-..{-..{# ", - " #..-..{-..{-..{-..{# ", - " #..................# ", - " #..................# ", - " #&..{{..{{..{{....{# ", - " #&..{{..{{..{{..{{{# ", - " #&..{{..{{..{{....{# ", - " #&..{{..{{..{{....{# ", - " #&..{{..{{..{{..{{{# ", - " #&..{{..{{..{{....{# ", - " #..................# ", - " #..................# ", - " #||||.........-----# ", - " #T.S|.........-.b..# ", - " #L..+.&&&&&&&....&&# ", - " #################### ", - " 4 ", - " " + "___________ss___________", + "___________ss___________", + "__###:::###++###:::###__", + "__# #__", + "__# #__", + "__# - r- r- r- r#__", + "__# - r- r- r- r#__", + "__# - r- r- r- r#__", + "__# #__", + "__# #__", + "__#f rr rr rr r#__", + "__#f rr rr rr rrr#__", + "__#f rr rr rr r#__", + "__#f rr rr rr r#__", + "__#f rr rr rr rrr#__", + "__#f rr rr rr r#__", + "__# #__", + "__# #__", + "__#|||| -----#__", + "__#T S| - b #__", + "__#L + fffffff ff#__", + "__####################__", + "___4____________________", + "________________________" ], - "palettes": [ "parametrized_linoleum_palette", "parametrized_walls_palette" ], - "terrain": { - " ": "t_region_groundcover_urban", - "s": "t_concrete", - "+": [ [ "t_door_b", 20 ], [ "t_door_frame", 10 ], [ "t_door_o", 70 ], [ "t_door_c", 5 ], [ "t_door_locked_interior", 3 ] ], - ".": { "param": "linoleum_color", "fallback": "t_linoleum_gray" }, - ":": [ [ "t_window_frame", 70 ], [ "t_window_empty", 20 ], [ "t_window", 5 ] ], - "4": "t_gutter_downspout" - }, - "furniture": { "-": "f_counter", "&": "f_glass_fridge", "{": "f_rack", "b": "f_stool", "S": "f_sink", "L": "f_locker" }, - "toilets": { "T": { } }, + "palettes": [ "grocery_store_palette" ], + "terrain": { ":": [ [ "t_window_frame", 70 ], [ "t_window_empty", 20 ], [ "t_window", 5 ] ] }, "fields": { "T": { "field": "fd_bile", "intensity": 1, "age": 10 }, "S": { "field": "fd_bile", "intensity": 1, "age": 10 } }, "liquids": { ".": [ @@ -600,7 +463,7 @@ { "item": "cash_register_random_ransacked", "x": 17, "y": 5, "chance": 100 } ], "item": { - ".": [ + " ": [ { "item": "bottle_glass", "chance": 1 }, { "item": "bottle_plastic", "chance": 1 }, { "item": "can_drink", "chance": 1 }, @@ -620,7 +483,7 @@ { "monster": "GROUP_PLAGUE_ROACH", "x": [ 2, 21 ], "y": [ 2, 21 ], "chance": 20 }, { "monster": "GROUP_ROACH", "x": [ 2, 21 ], "y": [ 2, 21 ], "chance": 20 } ], - "vehicles": { ".": { "vehicle": "shopping_cart", "chance": 1, "status": 1 } }, + "vehicles": { " ": { "vehicle": "shopping_cart", "chance": 10, "rotation": [ 0, 90, 180, 270 ] } }, "nested": { "|": { "chunks": [ [ "bile_field", 1 ], [ "shelter_graffiti", 10 ], [ "general_graffiti", 20 ], [ "null", 75 ] ] }, "#": { "chunks": [ [ "bile_field", 1 ], [ "shelter_graffiti", 10 ], [ "general_graffiti", 20 ], [ "null", 75 ] ] }, @@ -637,42 +500,33 @@ "object": { "fill_ter": { "param": "linoleum_color", "fallback": "t_linoleum_gray" }, "rows": [ - " ss ", - " ss ", - " ###:::###++###:::### ", - " #..................# ", - " #..................# ", - " #..-..{-..{-..{-..{# ", - " #..-..{-..{-..{-..{# ", - " #..-..{-..{-..{-..{# ", - " #..................# ", - " #..................# ", - " #&..{{..{{..{{....{# ", - " #&..{{..{{..{{..{{{# ", - " #&..{{..{{..{{....{# ", - " #&..{{..{{..{{....{# ", - " #&..{{..{{..{{..{{{# ", - " #&..{{..{{..{{....{# ", - " #..................# ", - " #..................# ", - " #||||.........-----# ", - " #T.S|.........-.b..# ", - " #L..+.&&&&&&&....&&# ", - " #################### ", - " 4 ", - " " + "___________ss___________", + "___________ss___________", + "__###:::###++###:::###__", + "__# #__", + "__# #__", + "__# - r- r- r- r#__", + "__# - r- r- r- r#__", + "__# - r- r- r- r#__", + "__# #__", + "__# #__", + "__#f rr rr rr r#__", + "__#f rr rr rr rrr#__", + "__#f rr rr rr r#__", + "__#f rr rr rr r#__", + "__#f rr rr rr rrr#__", + "__#f rr rr rr r#__", + "__# #__", + "__# #__", + "__#|||| -----#__", + "__#T S| - b #__", + "__#L + fffffff ff#__", + "__####################__", + "___4____________________", + "________________________" ], - "palettes": [ "parametrized_linoleum_palette", "parametrized_walls_palette" ], - "terrain": { - " ": "t_region_groundcover_urban", - "s": "t_concrete", - "+": "t_door_boarded", - ".": { "param": "linoleum_color", "fallback": "t_linoleum_gray" }, - ":": "t_window_boarded", - "4": "t_gutter_downspout" - }, - "furniture": { "-": "f_counter", "&": "f_glass_fridge", "{": "f_rack", "b": "f_stool", "S": "f_sink", "L": "f_locker" }, - "toilets": { "T": { } }, + "palettes": [ "grocery_store_palette" ], + "terrain": { "+": "t_door_boarded", ":": "t_window_boarded" }, "place_items": [ { "item": "fridgesnacks", "x": 3, "y": [ 10, 15 ], "chance": 1, "repeat": [ 1, 12 ] }, { "item": "fridge", "x": [ 8, 14 ], "y": 20, "chance": 1, "repeat": [ 1, 12 ] }, @@ -705,7 +559,7 @@ { "monster": "GROUP_PLAGUE_ROACH", "x": [ 2, 21 ], "y": [ 2, 21 ], "chance": 20 }, { "monster": "GROUP_ROACH", "x": [ 2, 21 ], "y": [ 2, 21 ], "chance": 20 } ], - "vehicles": { ".": { "vehicle": "shopping_cart", "chance": 1, "status": 1 } } + "vehicles": { " ": { "vehicle": "shopping_cart", "chance": 10, "rotation": [ 0, 90, 180, 270 ] } } } }, { @@ -751,10 +605,5 @@ } ] } - }, - { - "type": "ter_furn_transform", - "id": "glass_door_wall_2_floor", - "terrain": [ { "result": "t_floor", "valid_terrain": [ "t_wall_glass", "t_door_glass_c" ] } ] } ] diff --git a/data/json/mapgen_palettes/grocery_palette.json b/data/json/mapgen_palettes/grocery_palette.json new file mode 100644 index 0000000000000..d3a9fd3293372 --- /dev/null +++ b/data/json/mapgen_palettes/grocery_palette.json @@ -0,0 +1,41 @@ +[ + { + "type": "palette", + "id": "grocery_store_palette", + "palettes": [ "parametrized_linoleum_palette", "parametrized_carpets_palette", "parametrized_walls_palette" ], + "terrain": { + "*": "t_thconc_floor", + "+": [ [ "t_door_b", 2 ], [ "t_door_o", 7 ], [ "t_door_c", 5 ], [ "t_door_locked_interior", 3 ] ], + "g": "t_wall_glass", + "C": "t_thconc_floor", + "I": "t_door_locked_interior", + "L": "t_door_locked", + "W": "t_chainfence", + "[": "t_door_glass_c", + "]": "t_thconc_floor", + "_": "t_region_groundcover_urban", + "s": "t_concrete", + "w": "t_chainfence", + "4": "t_gutter_downspout", + ":": "t_window", + "Ю": "t_concrete" + }, + "furniture": { + "A": "f_atm_off", + "-": "f_counter", + "7": "f_bookcase", + "C": [ [ "f_crate_c", 30 ], [ "f_crate_o", 70 ] ], + "S": "f_sink", + "]": "f_rack", + "^": "f_indoor_plant", + "b": "f_stool", + "f": "f_glass_fridge", + "r": "f_rack", + "t": "f_table", + "Ю": "f_sandbag_half", + "L": "f_locker" + }, + "items": { }, + "toilets": { "T": { } } + } +]