Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Placing specials around cities now scales with city size #48628

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -866,7 +866,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