Skip to content

Commit

Permalink
Add a concrete carpet parametrized palette and apply it (#78004)
Browse files Browse the repository at this point in the history
* Add the palette

* Apply palette where applicable

* Collapsed tower palette

* Params in palette doesn't work apparently
  • Loading branch information
Milopetilo authored Nov 23, 2024
1 parent 8ff5859 commit 98baf15
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 81 deletions.
24 changes: 12 additions & 12 deletions data/json/mapgen/city_blocks/urban_14_dense_house_mart_food.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@
"%%%%%%%%%%%%#####################%%%%%%%%%%%%%%%",
"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
],
"palettes": [ "standard_domestic_palette" ],
"palettes": [ "parametrized_concrete_carpets_palette", "standard_domestic_palette" ],
"terrain": {
"%": "t_soil",
"=": "t_carpet_concrete_yellow",
"I": "t_carpet_concrete_yellow",
"h": "t_carpet_concrete_yellow",
"s": "t_carpet_concrete_yellow",
"y": "t_carpet_concrete_yellow",
"E": "t_carpet_concrete_yellow",
"T": "t_carpet_concrete_yellow",
"d": "t_carpet_concrete_yellow",
"@": "t_carpet_concrete_yellow",
"=": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_yellow" },
"I": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_yellow" },
"h": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_yellow" },
"s": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_yellow" },
"y": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_yellow" },
"E": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_yellow" },
"T": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_yellow" },
"d": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_yellow" },
"@": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_yellow" },
"~": "t_dirtfloor",
"$": "t_sai_box",
":": "t_wall_glass",
Expand Down Expand Up @@ -102,13 +102,13 @@
"____________#####################_______________",
"________________________________________________"
],
"palettes": [ "city_block_foundation_palette" ],
"palettes": [ "parametrized_concrete_carpets_palette", "city_block_foundation_palette" ],
"terrain": {
"`": "t_linoleum_white",
"F": "t_concrete",
"a": "t_window_bars_domestic",
"b": "t_door_metal_pickable",
"=": "t_carpet_concrete_yellow",
"=": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_yellow" },
"_": "t_pavement",
"[": "t_pavement",
"(": "t_pavement"
Expand Down
4 changes: 2 additions & 2 deletions data/json/mapgen/homeimprovement.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
" ###################### ",
" U<UU4 "
],
"palettes": [ "parametrized_walls_palette" ],
"palettes": [ "parametrized_walls_palette", "parametrized_concrete_carpets_palette" ],
"terrain": {
"+": "t_door_c",
" ": "t_region_groundcover_urban",
",": "t_concrete",
".": "t_thconc_floor",
"O": "t_window",
"r": "t_carpet_concrete_red",
"r": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_red" },
"4": "t_gutter_downspout",
"<": "t_ladder_up"
},
Expand Down
4 changes: 2 additions & 2 deletions data/json/mapgen/mall/mall_basement.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
" #**,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*# ",
" #*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,**# "
],
"palettes": [ "mall_palette_basement" ],
"palettes": [ "parametrized_concrete_carpets_palette", "mall_palette_basement" ],
"terrain": {
"#": "t_brick_wall",
"*": "t_linoleum_gray",
",": "t_linoleum_white",
"6": "t_carpet_concrete_red",
"6": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_red" },
"{": "t_linoleum_gray",
"Y": "t_linoleum_gray",
"}": "t_linoleum_white",
Expand Down
92 changes: 46 additions & 46 deletions data/json/mapgen/mansion.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,14 @@
"...........<<........+.U",
"###++##############++###"
],
"palettes": [ "standard_domestic_palette" ],
"palettes": [ "parametrized_concrete_carpets_palette", "standard_domestic_palette" ],
"terrain": {
" ": "t_soil",
".": "t_thconc_floor",
"0": "t_thconc_floor",
"-": "t_carpet_concrete_red",
"h": "t_carpet_concrete_red",
"=": "t_carpet_concrete_red"
"-": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_red" },
"h": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_red" },
"=": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_red" }
},
"furniture": { "=": "f_table", "?": "f_glass_fridge", "!": "f_speaker_cabinet" },
"place_loot": [ { "item": "stereo", "x": 23, "y": 16, "chance": 100 }, { "item": "television", "x": 4, "y": 11, "chance": 100 } ],
Expand Down Expand Up @@ -455,24 +455,24 @@
" ",
" "
],
"palettes": [ "standard_domestic_palette" ],
"palettes": [ "parametrized_concrete_carpets_palette", "standard_domestic_palette" ],
"terrain": {
" ": "t_soil",
".": "t_thconc_floor",
"]": "t_sewage_pipe",
")": "t_sewage_pump",
"N": "t_carpet_concrete_green",
"-": "t_carpet_concrete_green",
"r": "t_carpet_concrete_green",
"I": "t_carpet_concrete_green",
"T": "t_carpet_concrete_green",
"h": "t_carpet_concrete_green",
"&": "t_carpet_concrete_green",
"?": "t_carpet_concrete_green",
"A": "t_carpet_concrete_green",
"@": "t_carpet_concrete_green",
"N": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" },
"-": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" },
"r": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" },
"I": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" },
"T": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" },
"h": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" },
"&": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" },
"?": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" },
"A": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" },
"@": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" },
"/": "t_door_locked_interior",
"%": "t_carpet_concrete_green"
"%": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" }
},
"furniture": {
"%": "f_rack_wood",
Expand Down Expand Up @@ -999,14 +999,14 @@
" ",
" "
],
"palettes": [ "standard_domestic_palette", "standard_domestic_lino_bathroom" ],
"palettes": [ "parametrized_concrete_carpets_palette", "standard_domestic_palette", "standard_domestic_lino_bathroom" ],
"terrain": {
" ": "t_soil",
".": "t_thconc_floor",
"]": "t_door_glass_c",
"-": "t_carpet_concrete_purple",
"}": "t_carpet_concrete_purple",
"b": "t_carpet_concrete_purple",
"-": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_purple" },
"}": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_purple" },
"b": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_purple" },
"$": { "param": "linoleum_color_bathroom", "fallback": "t_linoleum_gray" },
"i": { "param": "linoleum_color_bathroom", "fallback": "t_linoleum_gray" },
"%": { "param": "linoleum_color_bathroom", "fallback": "t_linoleum_gray" },
Expand Down Expand Up @@ -1174,17 +1174,17 @@
" ",
" "
],
"palettes": [ "standard_domestic_palette", "standard_domestic_lino_bathroom" ],
"palettes": [ "parametrized_concrete_carpets_palette", "standard_domestic_palette", "standard_domestic_lino_bathroom" ],
"terrain": {
" ": "t_soil",
".": "t_thconc_floor",
"]": "t_sewage_pipe",
")": "t_sewage_pump",
"-": "t_carpet_concrete_purple",
"E": "t_carpet_concrete_purple",
"r": "t_carpet_concrete_purple",
"T": "t_carpet_concrete_purple",
"P": "t_carpet_concrete_purple",
"-": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_purple" },
"E": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_purple" },
"r": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_purple" },
"T": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_purple" },
"P": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_purple" },
"Z": { "param": "linoleum_color_bathroom", "fallback": "t_linoleum_gray" },
"A": { "param": "linoleum_color_bathroom", "fallback": "t_linoleum_gray" },
"w": { "param": "linoleum_color_bathroom", "fallback": "t_linoleum_gray" },
Expand Down Expand Up @@ -1369,16 +1369,16 @@
" ",
" "
],
"palettes": [ "standard_domestic_palette", "standard_domestic_lino_bathroom" ],
"palettes": [ "parametrized_concrete_carpets_palette", "standard_domestic_palette", "standard_domestic_lino_bathroom" ],
"terrain": {
" ": "t_soil",
".": "t_thconc_floor",
"x": "t_carpet_concrete_yellow",
"-": "t_carpet_concrete_yellow",
"H": "t_carpet_concrete_yellow",
"s": "t_carpet_concrete_yellow",
"J": "t_carpet_concrete_yellow",
"m": "t_carpet_concrete_yellow"
"x": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_yellow" },
"-": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_yellow" },
"H": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_yellow" },
"s": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_yellow" },
"J": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_yellow" },
"m": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_yellow" }
},
"furniture": { "&": "f_table", "!": [ "f_cardboard_box", "f_crate_c" ], "?": "f_sofa" },
"items": {
Expand Down Expand Up @@ -1665,16 +1665,16 @@
"#eehh!!.#zz.......JJJJJ#",
"###########++###########"
],
"palettes": [ "standard_domestic_palette" ],
"palettes": [ "parametrized_concrete_carpets_palette", "standard_domestic_palette" ],
"terrain": {
" ": "t_soil",
".": "t_thconc_floor",
"]": "t_sewage_pipe",
")": "t_sewage_pump",
"-": "t_carpet_concrete_red",
"$": "t_carpet_concrete_red",
"r": "t_carpet_concrete_red",
"/": "t_carpet_concrete_red",
"-": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_red" },
"$": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_red" },
"r": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_red" },
"/": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_red" },
"%": "t_door_metal_locked"
},
"furniture": {
Expand Down Expand Up @@ -1980,17 +1980,17 @@
"# #..# #",
"###########++###########"
],
"palettes": [ "standard_domestic_palette", "standard_domestic_lino_bathroom" ],
"palettes": [ "parametrized_concrete_carpets_palette", "standard_domestic_palette", "standard_domestic_lino_bathroom" ],
"terrain": {
" ": "t_soil",
".": "t_thconc_floor",
"-": "t_carpet_concrete_yellow",
"h": "t_carpet_concrete_yellow",
"&": "t_carpet_concrete_yellow",
"r": "t_carpet_concrete_yellow",
"J": "t_carpet_concrete_yellow",
"F": "t_carpet_concrete_yellow",
"Y": "t_carpet_concrete_yellow"
"-": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_yellow" },
"h": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_yellow" },
"&": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_yellow" },
"r": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_yellow" },
"J": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_yellow" },
"F": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_yellow" },
"Y": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_yellow" }
},
"furniture": { "!": [ "f_cardboard_box", "f_crate_c" ], "&": "f_console_broken", "?": "f_glass_fridge" },
"items": {
Expand Down
24 changes: 12 additions & 12 deletions data/json/mapgen/mansion_boarded.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,24 +178,24 @@
" ",
" "
],
"palettes": [ "standard_domestic_palette" ],
"palettes": [ "parametrized_concrete_carpets_palette", "standard_domestic_palette" ],
"terrain": {
" ": "t_soil",
".": "t_thconc_floor",
"]": "t_sewage_pipe",
")": "t_sewage_pump",
"N": "t_carpet_concrete_green",
"-": "t_carpet_concrete_green",
"r": "t_carpet_concrete_green",
"I": "t_carpet_concrete_green",
"T": "t_carpet_concrete_green",
"h": "t_carpet_concrete_green",
"&": "t_carpet_concrete_green",
"?": "t_carpet_concrete_green",
"A": "t_carpet_concrete_green",
"@": "t_carpet_concrete_green",
"N": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" },
"-": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" },
"r": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" },
"I": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" },
"T": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" },
"h": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" },
"&": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" },
"?": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" },
"A": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" },
"@": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" },
"/": "t_door_metal_c",
"%": "t_carpet_concrete_green"
"%": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" }
},
"furniture": {
"%": "f_rack_wood",
Expand Down
10 changes: 5 additions & 5 deletions data/json/mapgen/musicstore.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
" #H###H#sssss ",
" "
],
"palettes": [ "parametrized_walls_palette" ],
"palettes": [ "parametrized_concrete_carpets_palette", "parametrized_walls_palette" ],
"terrain": {
" ": "t_region_groundcover_urban",
"z": "t_region_shrub_decorative",
Expand All @@ -46,10 +46,10 @@
"+": "t_door_glass_c",
"-": "t_wall_glass",
".": "t_linoleum_gray",
"g": "t_carpet_concrete_green",
"h": "t_carpet_concrete_green",
"K": "t_carpet_concrete_green",
"7": "t_carpet_concrete_green",
"g": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" },
"h": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" },
"K": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" },
"7": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_green" },
"<": "t_gutter_downspout"
},
"furniture": {
Expand Down
4 changes: 2 additions & 2 deletions data/json/mapgen/thrift.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"...Z...........2UU22U...",
"........................"
],
"palettes": [ "parametrized_walls_palette" ],
"palettes": [ "parametrized_concrete_carpets_palette", "parametrized_walls_palette" ],
"terrain": {
" ": "t_thconc_floor",
"+": "t_door_locked",
Expand All @@ -41,7 +41,7 @@
"2": "t_concrete",
"U": "t_concrete",
"g": "t_door_glass_c",
"o": "t_carpet_concrete_purple",
"o": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_concrete_purple" },
"r": "t_pavement",
"y": "t_pavement_y",
"Z": "t_gutter_downspout",
Expand Down
19 changes: 19 additions & 0 deletions data/json/mapgen_palettes/common_parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,24 @@
}
},
"terrain": { "=": { "param": "carpet_color_type", "fallback": "t_carpet_red" } }
},
{
"type": "palette",
"id": "parametrized_concrete_carpets_palette",
"//": "Use to randomly assign carpet colors",
"parameters": {
"concrete_carpet_color_type": {
"type": "ter_str_id",
"default": {
"distribution": [
[ "t_carpet_concrete_red", 1 ],
[ "t_carpet_concrete_green", 1 ],
[ "t_carpet_concrete_purple", 1 ],
[ "t_carpet_concrete_yellow", 1 ]
]
}
}
},
"terrain": { "=": { "param": "concrete_carpet_color_type", "fallback": "t_carpet_red" } }
}
]

0 comments on commit 98baf15

Please sign in to comment.