Skip to content

Commit

Permalink
Placing specials around cities now scales with city size (#48628)
Browse files Browse the repository at this point in the history
  • Loading branch information
stubkan authored May 28, 2021
1 parent 81f2065 commit 10ca012
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions doc/OVERMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,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.

Expand All @@ -342,7 +341,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). |
Expand Down Expand Up @@ -388,7 +387,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

Expand Down
2 changes: 1 addition & 1 deletion src/overmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down

0 comments on commit 10ca012

Please sign in to comment.