From 1fb61c1d41cffd682a46fa6970f98c171762061a Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Wed, 12 Jun 2024 13:14:46 +0100 Subject: [PATCH] [Backrooms] Update to use indestructible terrain, whitelist and EXTERNAL_OPTIONs (#74434) * Update backrooms * "extend" and "delete" support for map_extra s * Add "connects_to" to allow the light/non-light floors to multitile * Add Backrooms label and add the maintainer as a reviewer * Removes unnecessary world setting advice Cities being disabled by external option means this no longer does anything --- .github/labeler.yml | 3 + .github/reviewers.yml | 2 + data/mods/Backrooms/README.md | 1 - data/mods/Backrooms/furniture_terrain.json | 39 ++++--- data/mods/Backrooms/game_balance.json | 79 +++++++++++++ data/mods/Backrooms/map_extras.json | 108 +++++++++++++++++- data/mods/Backrooms/overmap_terrain.json | 17 ++- .../mods/Backrooms/regional_map_settings.json | 54 ++++----- src/map_extras.cpp | 15 ++- 9 files changed, 265 insertions(+), 53 deletions(-) create mode 100644 data/mods/Backrooms/game_balance.json diff --git a/.github/labeler.yml b/.github/labeler.yml index f4185024b028f..e7033a8987daa 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -222,6 +222,9 @@ - data/mods/Aftershock/**/* - data/mods/aftershock_exoplanet/**/* +"Mods: Backrooms": + - data/mods/Backrooms/**/* + "Mods: Dark Days of the Dead": - data/mods/classic_zombies/**/* diff --git a/.github/reviewers.yml b/.github/reviewers.yml index f0ee9dc1c8ed7..760534ed32787 100644 --- a/.github/reviewers.yml +++ b/.github/reviewers.yml @@ -2,6 +2,8 @@ files: 'data/mods/Aftershock/**': - Maleclypse - John-Candlebury + 'data/mods/Backrooms/**': + - onura46 'data/mods/DinoMod/**': - LyleSY 'data/mods/BombasticPerks/**': diff --git a/data/mods/Backrooms/README.md b/data/mods/Backrooms/README.md index 3d93c9393368e..7266d1a6fc830 100644 --- a/data/mods/Backrooms/README.md +++ b/data/mods/Backrooms/README.md @@ -7,7 +7,6 @@ This is an indoor only conversion for Cataclysm. The entire worldgen is replaced ## Warning: You MUST choose the scenario "Backrooms" when creating a character! As the Backrooms are the only location in the entire world, characters trying to start in other locations will fail to spawn. -Turning city size to 0 is recommended just to avoid strangeness in map labeling. # Questions ### What's the current state of the mod? diff --git a/data/mods/Backrooms/furniture_terrain.json b/data/mods/Backrooms/furniture_terrain.json index 334852531aae8..2bf09ed70a979 100644 --- a/data/mods/Backrooms/furniture_terrain.json +++ b/data/mods/Backrooms/furniture_terrain.json @@ -1,4 +1,19 @@ [ + { + "type": "terrain", + "id": "t_backroom_wall_border", + "name": "faded wall", + "description": "A yellowed, numbingly monotonous wallpaper decorates these thin walls. They smell of mildew and have a faintly damp feel.", + "symbol": "#", + "color": "yellow", + "looks_like": "t_wall_y", + "move_cost": 0, + "coverage": 100, + "roof": "t_carpet_backrooms", + "connect_groups": "WALL", + "connects_to": "WALL", + "flags": [ "NOITEM", "SUPPORTS_ROOF", "WALL", "NO_SCENT", "AUTO_WALL_SYMBOL", "MINEABLE", "BLOCK_WIND" ] + }, { "type": "terrain", "id": "t_backroom_wall", @@ -59,6 +74,7 @@ "looks_like": "t_carpet_backrooms", "roof": "t_flat_roof", "connect_groups": "INDOORFLOOR", + "connects_to": "INDOORFLOOR", "flags": [ "TRANSPARENT", "SUPPORTS_ROOF", "INDOORS", "FLAT", "RUG" ], "bash": { "str_min": 4, @@ -82,15 +98,8 @@ "move_cost": 2, "roof": "t_flat_roof", "connect_groups": "INDOORFLOOR", - "flags": [ "TRANSPARENT", "SUPPORTS_ROOF", "INDOORS", "FLAT", "RUG" ], - "bash": { - "sound": "SMASH!", - "ter_set": "t_thconc_floor", - "str_min": 50, - "str_max": 400, - "str_min_supported": 100, - "items": [ { "item": "splinter", "count": [ 2, 8 ] }, { "item": "nail", "charges": [ 6, 13 ] } ] - } + "connects_to": "INDOORFLOOR", + "flags": [ "TRANSPARENT", "SUPPORTS_ROOF", "INDOORS", "FLAT", "RUG" ] }, { "type": "terrain", @@ -104,6 +113,7 @@ "looks_like": "t_tile_backrooms", "roof": "t_flat_roof", "connect_groups": "INDOORFLOOR", + "connects_to": "INDOORFLOOR", "flags": [ "TRANSPARENT", "SUPPORTS_ROOF", "INDOORS", "FLAT" ], "bash": { "str_min": 4, @@ -127,15 +137,8 @@ "move_cost": 2, "roof": "t_flat_roof", "connect_groups": "INDOORFLOOR", - "flags": [ "TRANSPARENT", "SUPPORTS_ROOF", "INDOORS", "FLAT" ], - "bash": { - "sound": "SMASH!", - "ter_set": "t_thconc_floor", - "str_min": 50, - "str_max": 400, - "str_min_supported": 100, - "items": [ { "item": "splinter", "count": [ 2, 8 ] }, { "item": "nail", "charges": [ 6, 13 ] } ] - } + "connects_to": "INDOORFLOOR", + "flags": [ "TRANSPARENT", "SUPPORTS_ROOF", "INDOORS", "FLAT" ] }, { "type": "furniture", diff --git a/data/mods/Backrooms/game_balance.json b/data/mods/Backrooms/game_balance.json new file mode 100644 index 0000000000000..1e1120c3a60f7 --- /dev/null +++ b/data/mods/Backrooms/game_balance.json @@ -0,0 +1,79 @@ +[ + { + "type": "EXTERNAL_OPTION", + "name": "OVERMAP_PLACE_CITIES", + "info": "Allows to place cities during overmap generation.", + "stype": "bool", + "value": false + }, + { + "type": "EXTERNAL_OPTION", + "name": "OVERMAP_PLACE_ROADS", + "info": "Allows to place procgen roads during overmap generation.", + "stype": "bool", + "value": false + }, + { + "type": "EXTERNAL_OPTION", + "name": "OVERMAP_POPULATE_OUTSIDE_CONNECTIONS_FROM_NEIGHBORS", + "info": "Allows to populate outside connections from neighbors.", + "stype": "bool", + "value": false + }, + { + "type": "EXTERNAL_OPTION", + "name": "OVERMAP_PLACE_RIVERS", + "info": "Allows to place procgen rivers during overmap generation.", + "stype": "bool", + "value": false + }, + { + "type": "EXTERNAL_OPTION", + "name": "OVERMAP_PLACE_LAKES", + "info": "Allows to place procgen lakes during overmap generation.", + "stype": "bool", + "value": false + }, + { + "type": "EXTERNAL_OPTION", + "name": "OVERMAP_PLACE_OCEANS", + "info": "Allows to place oceans during overmap generation.", + "stype": "bool", + "value": false + }, + { + "type": "EXTERNAL_OPTION", + "name": "OVERMAP_PLACE_FORESTS", + "info": "Allows to place procgen forests during overmap generation.", + "stype": "bool", + "value": false + }, + { + "type": "EXTERNAL_OPTION", + "name": "OVERMAP_PLACE_SWAMPS", + "info": "Allows to place procgen swamps during overmap generation.", + "stype": "bool", + "value": false + }, + { + "type": "EXTERNAL_OPTION", + "name": "OVERMAP_PLACE_RAVINES", + "info": "Allows to place procgen ravines during overmap generation.", + "stype": "bool", + "value": false + }, + { + "type": "EXTERNAL_OPTION", + "name": "OVERMAP_PLACE_FOREST_TRAILS", + "info": "Allows to place procgen forest trails during overmap generation.", + "stype": "bool", + "value": false + }, + { + "type": "EXTERNAL_OPTION", + "name": "OVERMAP_PLACE_FOREST_TRAILHEADS", + "info": "Allows to place procgen forest trailheads during overmap generation.", + "stype": "bool", + "value": false + } +] diff --git a/data/mods/Backrooms/map_extras.json b/data/mods/Backrooms/map_extras.json index 37a9baaf77d14..0fd217cac1379 100644 --- a/data/mods/Backrooms/map_extras.json +++ b/data/mods/Backrooms/map_extras.json @@ -7,7 +7,8 @@ "generator": { "generator_method": "update_mapgen", "generator_id": "mx_teleporter_node" }, "sym": "X", "color": "red", - "autonote": true + "autonote": true, + "flags": [ "BACKROOMS" ] }, { "id": "mx_autodoc_room", @@ -17,6 +18,109 @@ "generator": { "generator_method": "update_mapgen", "generator_id": "mx_autodoc_room" }, "sym": "A", "color": "pink", - "autonote": true + "autonote": true, + "flags": [ "BACKROOMS" ] + }, + { + "id": "mx_casings", + "type": "map_extra", + "copy-from": "mx_casings", + "extend": { "flags": [ "BACKROOMS" ] } + }, + { + "id": "mx_corpses", + "type": "map_extra", + "copy-from": "mx_corpses", + "extend": { "flags": [ "BACKROOMS" ] } + }, + { + "id": "mx_collegekids", + "type": "map_extra", + "copy-from": "mx_collegekids", + "extend": { "flags": [ "BACKROOMS" ] } + }, + { + "id": "mx_spider", + "type": "map_extra", + "copy-from": "mx_spider", + "extend": { "flags": [ "BACKROOMS" ] } + }, + { + "id": "mx_nest_dermatik", + "type": "map_extra", + "copy-from": "mx_nest_dermatik", + "extend": { "flags": [ "BACKROOMS" ] } + }, + { + "id": "mx_science", + "type": "map_extra", + "copy-from": "mx_science", + "extend": { "flags": [ "BACKROOMS" ] } + }, + { + "id": "mx_crater", + "type": "map_extra", + "copy-from": "mx_crater", + "extend": { "flags": [ "BACKROOMS" ] } + }, + { + "id": "mx_nest_wasp", + "type": "map_extra", + "copy-from": "mx_nest_wasp", + "extend": { "flags": [ "BACKROOMS" ] } + }, + { + "id": "mx_house_wasp", + "type": "map_extra", + "copy-from": "mx_house_wasp", + "extend": { "flags": [ "BACKROOMS" ] } + }, + { + "id": "mx_pond", + "type": "map_extra", + "copy-from": "mx_pond", + "extend": { "flags": [ "BACKROOMS" ] } + }, + { + "id": "mx_military", + "type": "map_extra", + "copy-from": "mx_military", + "extend": { "flags": [ "BACKROOMS" ] } + }, + { + "id": "mx_drugdeal", + "type": "map_extra", + "copy-from": "mx_drugdeal", + "extend": { "flags": [ "BACKROOMS" ] } + }, + { + "id": "mx_supplydrop", + "type": "map_extra", + "copy-from": "mx_supplydrop", + "extend": { "flags": [ "BACKROOMS" ] } + }, + { + "id": "mx_portal", + "type": "map_extra", + "copy-from": "mx_portal", + "extend": { "flags": [ "BACKROOMS" ] } + }, + { + "id": "mx_portal_in", + "type": "map_extra", + "copy-from": "mx_portal_in", + "extend": { "flags": [ "BACKROOMS" ] } + }, + { + "id": "mx_jabberwock", + "type": "map_extra", + "copy-from": "mx_jabberwock", + "extend": { "flags": [ "BACKROOMS" ] } + }, + { + "id": "mx_helicopter", + "type": "map_extra", + "copy-from": "mx_helicopter", + "extend": { "flags": [ "BACKROOMS" ] } } ] diff --git a/data/mods/Backrooms/overmap_terrain.json b/data/mods/Backrooms/overmap_terrain.json index 706fd1d082dca..0d7b7d7db3efe 100644 --- a/data/mods/Backrooms/overmap_terrain.json +++ b/data/mods/Backrooms/overmap_terrain.json @@ -12,7 +12,16 @@ "color": "white", "see_cost": 20, "spawns": { "group": "GROUP_BACKROOMS", "population": [ 2, 15 ], "chance": 40 }, - "extras": "field" + "extras": "backrooms" + }, + { + "type": "overmap_terrain", + "id": "backroom_border", + "name": "", + "sym": ".", + "color": "white", + "see_cost": 20, + "flags": [ "NO_ROTATE" ] }, { "type": "mapgen", @@ -52,5 +61,11 @@ } ] } + }, + { + "type": "mapgen", + "method": "json", + "om_terrain": "backroom_border", + "object": { "fill_ter": "t_backroom_wall_border" } } ] diff --git a/data/mods/Backrooms/regional_map_settings.json b/data/mods/Backrooms/regional_map_settings.json index 38843d2367d32..08ef109f6e08d 100644 --- a/data/mods/Backrooms/regional_map_settings.json +++ b/data/mods/Backrooms/regional_map_settings.json @@ -3,27 +3,27 @@ "type": "region_settings", "id": "default", "default_oter": [ - "open_air", - "open_air", - "open_air", - "open_air", - "open_air", - "open_air", - "open_air", - "open_air", - "open_air", - "solid_earth", + "backroom_border", + "backroom_border", + "backroom_border", + "backroom_border", + "backroom_border", + "backroom_border", + "backroom_border", + "backroom_border", + "backroom_border", + "backroom_border", "backfloorchamber_north", - "solid_earth", - "empty_rock", - "empty_rock", - "deep_rock", - "deep_rock", - "deep_rock", - "deep_rock", - "deep_rock", - "deep_rock", - "deep_rock" + "backroom_border", + "backroom_border", + "backroom_border", + "backroom_border", + "backroom_border", + "backroom_border", + "backroom_border", + "backroom_border", + "backroom_border", + "backroom_border" ], "default_groundcover": [ [ "t_region_groundcover", 1 ] ], "region_terrain_and_furniture": { @@ -144,14 +144,14 @@ "trailheads": { "trailhead_basic": 1, "trailhead_outhouse": 1, "trailhead_shack": 1 } }, "map_extras": { - "field": { + "backrooms": { "chance": 40, "extras": { "mx_teleporter_node": 100, + "mx_autodoc_room": 25, "mx_casings": 50, "mx_corpses": 50, "mx_collegekids": 25, - "mx_autodoc_room": 25, "mx_spider": 20, "mx_nest_dermatik": 20, "mx_science": 20, @@ -167,13 +167,7 @@ "mx_jabberwock": 1, "mx_helicopter": 1 } - }, - "forest_thick": { "chance": 0, "extras": { } }, - "forest_water": { "chance": 0, "extras": { } }, - "forest": { "chance": 0, "extras": { } }, - "road": { "chance": 0, "extras": { } }, - "build": { "chance": 0, "extras": { } }, - "subway": { "chance": 0, "extras": { } } + } }, "city": { "shop_radius": 30, @@ -193,6 +187,6 @@ "base_wind_season_variation": 50, "weather_black_list": [ "early_portal_storm", "portal_storm" ] }, - "overmap_feature_flag_settings": { "clear_blacklist": false, "blacklist": [ "LAB" ], "clear_whitelist": false, "whitelist": [ ] } + "overmap_feature_flag_settings": { "clear_blacklist": false, "blacklist": [ ], "clear_whitelist": true, "whitelist": [ "BACKROOMS" ] } } ] diff --git a/src/map_extras.cpp b/src/map_extras.cpp index 4521a7ce92271..fd741f3e165ae 100644 --- a/src/map_extras.cpp +++ b/src/map_extras.cpp @@ -2366,10 +2366,23 @@ void map_extra::load( const JsonObject &jo, const std::string_view ) mandatory( jg, was_loaded, "generator_id", generator_id ); } optional( jo, was_loaded, "sym", symbol, unicode_codepoint_from_symbol_reader, NULL_UNICODE ); - color = jo.has_member( "color" ) ? color_from_string( jo.get_string( "color" ) ) : c_white; + color = jo.has_member( "color" ) ? color_from_string( jo.get_string( "color" ) ) : was_loaded ? + color : c_white; optional( jo, was_loaded, "autonote", autonote, false ); optional( jo, was_loaded, "min_max_zlevel", min_max_zlevel_ ); optional( jo, was_loaded, "flags", flags_ ); + if( was_loaded && jo.has_member( "extend" ) ) { + JsonObject joe = jo.get_object( "extend" ); + for( auto &flag : joe.get_string_array( "flags" ) ) { + flags_.insert( flag ); + } + } + if( was_loaded && jo.has_member( "delete" ) ) { + JsonObject joe = jo.get_object( "extend" ); + for( auto &flag : joe.get_string_array( "flags" ) ) { + flags_.erase( flag ); + } + } } void map_extra::check() const