Skip to content

Commit

Permalink
Merge pull request CleverRaven#56895 from ZhilkinSerg/fix-mod-MA-2022…
Browse files Browse the repository at this point in the history
…-04-18

Misc fixes to MA mod (2022-04-18)
  • Loading branch information
kevingranade authored Apr 19, 2022
2 parents e3d3ab5 + 6a10c8a commit 897795a
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 38 deletions.
35 changes: 35 additions & 0 deletions data/core/game_balance.json
Original file line number Diff line number Diff line change
Expand Up @@ -271,5 +271,40 @@
"info": "Allows to place procgen ravines during overmap generation.",
"stype": "bool",
"value": true
},
{
"type": "EXTERNAL_OPTION",
"name": "OVERMAP_PLACE_CITIES",
"info": "Allows to place cities during overmap generation.",
"stype": "bool",
"value": true
},
{
"type": "EXTERNAL_OPTION",
"name": "OVERMAP_PLACE_FOREST_TRAILS",
"info": "Allows to place procgen forest trails during overmap generation.",
"stype": "bool",
"value": true
},
{
"type": "EXTERNAL_OPTION",
"name": "OVERMAP_PLACE_ROADS",
"info": "Allows to place procgen roads during overmap generation.",
"stype": "bool",
"value": true
},
{
"type": "EXTERNAL_OPTION",
"name": "OVERMAP_PLACE_SPECIALS",
"info": "Allows to place overmap specials during overmap generation.",
"stype": "bool",
"value": true
},
{
"type": "EXTERNAL_OPTION",
"name": "OVERMAP_PLACE_FOREST_TRAILHEADS",
"info": "Allows to place procgen forest trailheads during overmap generation.",
"stype": "bool",
"value": true
}
]
Binary file modified data/mods/MA/MA_overmap_cities.xlsx
Binary file not shown.
50 changes: 25 additions & 25 deletions data/mods/MA/cities.json
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@
},
{
"type": "city",
"id": "MA_83_EAST BRIDGEWATER",
"id": "MA_83_EAST_BRIDGEWATER",
"database_id": 83,
"name": "EAST BRIDGEWATER",
"population": 13794,
Expand All @@ -831,7 +831,7 @@
},
{
"type": "city",
"id": "MA_84_EAST BROOKFIELD",
"id": "MA_84_EAST_BROOKFIELD",
"database_id": 84,
"name": "EAST BROOKFIELD",
"population": 2183,
Expand All @@ -841,7 +841,7 @@
},
{
"type": "city",
"id": "MA_85_EAST LONGMEADOW",
"id": "MA_85_EAST_LONGMEADOW",
"database_id": 85,
"name": "EAST LONGMEADOW",
"population": 15720,
Expand Down Expand Up @@ -941,7 +941,7 @@
},
{
"type": "city",
"id": "MA_95_FALL RIVER",
"id": "MA_95_FALL_RIVER",
"database_id": 95,
"name": "FALL RIVER",
"population": 88857,
Expand Down Expand Up @@ -1121,7 +1121,7 @@
},
{
"type": "city",
"id": "MA_113_GREAT BARRINGTON",
"id": "MA_113_GREAT_BARRINGTON",
"database_id": 113,
"name": "GREAT BARRINGTON",
"population": 7104,
Expand Down Expand Up @@ -1941,7 +1941,7 @@
},
{
"type": "city",
"id": "MA_195_MOUNT WASHINGTON",
"id": "MA_195_MOUNT_WASHINGTON",
"database_id": 195,
"name": "MOUNT WASHINGTON",
"population": 167,
Expand Down Expand Up @@ -1991,7 +1991,7 @@
},
{
"type": "city",
"id": "MA_200_NEW ASHFORD",
"id": "MA_200_NEW_ASHFORD",
"database_id": 200,
"name": "NEW ASHFORD",
"population": 228,
Expand All @@ -2001,7 +2001,7 @@
},
{
"type": "city",
"id": "MA_201_NEW BEDFORD",
"id": "MA_201_NEW_BEDFORD",
"database_id": 201,
"name": "NEW BEDFORD",
"population": 95072,
Expand All @@ -2011,7 +2011,7 @@
},
{
"type": "city",
"id": "MA_202_NEW BRAINTREE",
"id": "MA_202_NEW_BRAINTREE",
"database_id": 202,
"name": "NEW BRAINTREE",
"population": 999,
Expand All @@ -2021,7 +2021,7 @@
},
{
"type": "city",
"id": "MA_203_NEW MARLBOROUGH",
"id": "MA_203_NEW_MARLBOROUGH",
"database_id": 203,
"name": "NEW MARLBOROUGH",
"population": 1509,
Expand All @@ -2031,7 +2031,7 @@
},
{
"type": "city",
"id": "MA_204_NEW SALEM",
"id": "MA_204_NEW_SALEM",
"database_id": 204,
"name": "NEW SALEM",
"population": 990,
Expand Down Expand Up @@ -2081,7 +2081,7 @@
},
{
"type": "city",
"id": "MA_209_NORTH ADAMS",
"id": "MA_209_NORTH_ADAMS",
"database_id": 209,
"name": "NORTH ADAMS",
"population": 13708,
Expand All @@ -2091,7 +2091,7 @@
},
{
"type": "city",
"id": "MA_210_NORTH ANDOVER",
"id": "MA_210_NORTH_ANDOVER",
"database_id": 210,
"name": "NORTH ANDOVER",
"population": 28352,
Expand All @@ -2101,7 +2101,7 @@
},
{
"type": "city",
"id": "MA_211_NORTH ATTLEBOROUGH",
"id": "MA_211_NORTH_ATTLEBOROUGH",
"database_id": 211,
"name": "NORTH ATTLEBOROUGH",
"population": 28712,
Expand All @@ -2111,7 +2111,7 @@
},
{
"type": "city",
"id": "MA_212_NORTH BROOKFIELD",
"id": "MA_212_NORTH_BROOKFIELD",
"database_id": 212,
"name": "NORTH BROOKFIELD",
"population": 4680,
Expand All @@ -2121,7 +2121,7 @@
},
{
"type": "city",
"id": "MA_213_NORTH READING",
"id": "MA_213_NORTH_READING",
"database_id": 213,
"name": "NORTH READING",
"population": 14892,
Expand Down Expand Up @@ -2201,7 +2201,7 @@
},
{
"type": "city",
"id": "MA_221_OAK BLUFFS",
"id": "MA_221_OAK_BLUFFS",
"database_id": 221,
"name": "OAK BLUFFS",
"population": 4527,
Expand Down Expand Up @@ -2741,7 +2741,7 @@
},
{
"type": "city",
"id": "MA_275_SOUTH HADLEY",
"id": "MA_275_SOUTH_HADLEY",
"database_id": 275,
"name": "SOUTH HADLEY",
"population": 17514,
Expand Down Expand Up @@ -3201,7 +3201,7 @@
},
{
"type": "city",
"id": "MA_321_WEST BOYLSTON",
"id": "MA_321_WEST_BOYLSTON",
"database_id": 321,
"name": "WEST BOYLSTON",
"population": 7669,
Expand All @@ -3211,7 +3211,7 @@
},
{
"type": "city",
"id": "MA_322_WEST BRIDGEWATER",
"id": "MA_322_WEST_BRIDGEWATER",
"database_id": 322,
"name": "WEST BRIDGEWATER",
"population": 6916,
Expand All @@ -3221,7 +3221,7 @@
},
{
"type": "city",
"id": "MA_323_WEST BROOKFIELD",
"id": "MA_323_WEST_BROOKFIELD",
"database_id": 323,
"name": "WEST BROOKFIELD",
"population": 3701,
Expand All @@ -3231,7 +3231,7 @@
},
{
"type": "city",
"id": "MA_324_WEST NEWBURY",
"id": "MA_324_WEST_NEWBURY",
"database_id": 324,
"name": "WEST NEWBURY",
"population": 4235,
Expand All @@ -3241,7 +3241,7 @@
},
{
"type": "city",
"id": "MA_325_WEST SPRINGFIELD",
"id": "MA_325_WEST_SPRINGFIELD",
"database_id": 325,
"name": "WEST SPRINGFIELD",
"population": 28391,
Expand All @@ -3251,7 +3251,7 @@
},
{
"type": "city",
"id": "MA_326_WEST STOCKBRIDGE",
"id": "MA_326_WEST_STOCKBRIDGE",
"database_id": 326,
"name": "WEST STOCKBRIDGE",
"population": 1306,
Expand All @@ -3261,7 +3261,7 @@
},
{
"type": "city",
"id": "MA_327_WEST TISBURY",
"id": "MA_327_WEST_TISBURY",
"database_id": 327,
"name": "WEST TISBURY",
"population": 2740,
Expand Down
37 changes: 36 additions & 1 deletion data/mods/MA/game_balance.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"name": "OVERMAP_POPULATE_OUTSIDE_CONNECTIONS_FROM_NEIGHBORS",
"info": "Allows to populate outside connections from neighbors.",
"stype": "bool",
"value": false
"value": true
},
{
"type": "EXTERNAL_OPTION",
Expand Down Expand Up @@ -54,5 +54,40 @@
"info": "Allows to place procgen ravines during overmap generation.",
"stype": "bool",
"value": false
},
{
"type": "EXTERNAL_OPTION",
"name": "OVERMAP_PLACE_CITIES",
"info": "Allows to place cities during overmap generation.",
"stype": "bool",
"value": true
},
{
"type": "EXTERNAL_OPTION",
"name": "OVERMAP_PLACE_FOREST_TRAILS",
"info": "Allows to place procgen forest trails during overmap generation.",
"stype": "bool",
"value": true
},
{
"type": "EXTERNAL_OPTION",
"name": "OVERMAP_PLACE_ROADS",
"info": "Allows to place procgen roads during overmap generation.",
"stype": "bool",
"value": true
},
{
"type": "EXTERNAL_OPTION",
"name": "OVERMAP_PLACE_SPECIALS",
"info": "Allows to place overmap specials during overmap generation.",
"stype": "bool",
"value": true
},
{
"type": "EXTERNAL_OPTION",
"name": "OVERMAP_PLACE_FOREST_TRAILHEADS",
"info": "Allows to place procgen forest trailheads during overmap generation.",
"stype": "bool",
"value": true
}
]
36 changes: 24 additions & 12 deletions src/overmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3290,12 +3290,21 @@ void overmap::generate( const overmap *north, const overmap *east,
if( get_option<bool>( "OVERMAP_PLACE_RAVINES" ) ) {
place_ravines();
}

place_cities();
place_forest_trails();
place_roads( north, east, south, west );
place_specials( enabled_specials );
place_forest_trailheads();
if( get_option<bool>( "OVERMAP_PLACE_CITIES" ) ) {
place_cities();
}
if( get_option<bool>( "OVERMAP_PLACE_FOREST_TRAILS" ) ) {
place_forest_trails();
}
if( get_option<bool>( "OVERMAP_PLACE_ROADS" ) ) {
place_roads( north, east, south, west );
}
if( get_option<bool>( "OVERMAP_PLACE_SPECIALS" ) ) {
place_specials( enabled_specials );
}
if( get_option<bool>( "OVERMAP_PLACE_FOREST_TRAILHEADS" ) ) {
place_forest_trailheads();
}

polish_river();

Expand Down Expand Up @@ -4962,17 +4971,20 @@ void overmap::place_cities()
tmp.size = size;
}
} else {
placement_attempts = 0;
tmp = random_entry( cities_to_place );
p = tripoint_om_omt( tmp.pos, 0 );
ter_set( tripoint_om_omt( tmp.pos, 0 ), oter_road_nesw );
}
cities.push_back( tmp );
const om_direction::type start_dir = om_direction::random();
om_direction::type cur_dir = start_dir;
if( placement_attempts == 0 ) {
cities.push_back( tmp );
const om_direction::type start_dir = om_direction::random();
om_direction::type cur_dir = start_dir;

do {
build_city_street( local_road, tmp.pos, tmp.size, cur_dir, tmp );
} while( ( cur_dir = om_direction::turn_right( cur_dir ) ) != start_dir );
do {
build_city_street( local_road, tmp.pos, tmp.size, cur_dir, tmp );
} while( ( cur_dir = om_direction::turn_right( cur_dir ) ) != start_dir );
}
}
}

Expand Down

0 comments on commit 897795a

Please sign in to comment.