From d21d65583aad77e5c3b531f42a8ac023033850a1 Mon Sep 17 00:00:00 2001 From: stubkan <34361592+stubkan@users.noreply.github.com> Date: Fri, 28 May 2021 11:33:35 +0100 Subject: [PATCH] Placing specials around cities now scales with city size (#48628) --- doc/OVERMAP.md | 7 +++---- src/overmap.cpp | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/OVERMAP.md b/doc/OVERMAP.md index beca346df7b2b..a9a8ed9a55801 100644 --- a/doc/OVERMAP.md +++ b/doc/OVERMAP.md @@ -332,8 +332,7 @@ level value and then only specify it for individual entries that differ. During generation of a new overmap, cities and their connecting roads will be generated before specials are placed. Each city gets assigned a size at generation and will begin its life as a single intersection. The city distance field specifies the minimum and maximum distance the special can be -placed from _this_ intersection, *not* from the edge of the city, meaning a special with a low minimum -distance and a high or unbounded maximum city size may be placed on the outer border of a larger city. +placed from the edge of the urban radius of a city, and not from the center of the city. Both city size and city distance requirements are only checked for the "nearest" city, measured from the original intersection. @@ -347,7 +346,7 @@ original intersection. | `overmaps` | List of overmap terrains and their relative `[ x, y, z ]` location within the special. | | `connections` | List of overmap connections and their relative `[ x, y, z ]` location within the special. | | `locations` | List of `overmap_location` ids that the special may be placed on. | -| `city_distance` | Min/max distance from a city that the special may be placed. Use -1 for unbounded. | +| `city_distance` | Min/max distance from a city edge that the special may be placed. Use -1 for unbounded. | | `city_sizes` | Min/max city size for a city that the special may be placed near. Use -1 for unbounded. | | `occurrences` | Min/max number of occurrences when placing the special. If UNIQUE flag is set, becomes X of Y chance. | | `flags` | See `Overmap specials` in [JSON_FLAGS.md](JSON_FLAGS.md). | @@ -393,7 +392,7 @@ original intersection. | `terrain` | Will go away in favor of `connection` eventually. Use `road`, `subway`, `sewer`, etc. | | `connection` | Id of the `overmap_connection` to build. Optional for now, but you should specify it explicitly. | | `from` | Optional point `[ x, y, z]` within the special to treat as the origin of the connection. | -| `existing` | Boolean, default false. If the special requires a preexisting terrain to spawn. | +| `existing` | Boolean, default false. If the special requires a preexisting terrain to spawn. | ## City Building diff --git a/src/overmap.cpp b/src/overmap.cpp index 1c0b0e9022879..a8a5e35aa6324 100644 --- a/src/overmap.cpp +++ b/src/overmap.cpp @@ -852,7 +852,7 @@ bool overmap_special::can_belong_to_city( const tripoint_om_omt &p, const city & if( !cit || !city_size.contains( cit.size ) ) { return false; } - return city_distance.contains( cit.get_distance_from( p ) ); + return city_distance.contains( cit.get_distance_from( p ) - ( cit.size ) ); } void overmap_special::load( const JsonObject &jo, const std::string &src )