Skip to content

Commit

Permalink
Spawn searchlights in military/police roadblocks (#39984)
Browse files Browse the repository at this point in the history
* Added searchlight and plutonium generator to military/police roadblocks map extra

Also fixed small error at mapgen (it checked for east road twice instead of once for east and once for west).

* Simplified code

* Sorting

* Corpses spawn last

* Remove empty line
  • Loading branch information
Night-Pryanik authored Apr 28, 2020
1 parent 338c4ca commit 983cc7f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion data/json/itemgroups/Locations_MapExtras/map_extras.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"type": "item_group",
"subtype": "collection",
"id": "map_extra_military",
"entries": [ { "item": "corpse", "damage": 3 }, { "group": "mon_zombie_soldier_death_drops" } ]
"entries": [ { "group": "mon_zombie_soldier_death_drops" }, { "item": "corpse", "damage": 3 } ]
},
{
"type": "item_group",
Expand Down
21 changes: 15 additions & 6 deletions src/map_extras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ static const mtype_id mon_spider_cellar_giant( "mon_spider_cellar_giant" );
static const mtype_id mon_spider_web( "mon_spider_web" );
static const mtype_id mon_spider_widow_giant( "mon_spider_widow_giant" );
static const mtype_id mon_turret_bmg( "mon_turret_bmg" );
static const mtype_id mon_turret_searchlight( "mon_turret_searchlight" );
static const mtype_id mon_turret_rifle( "mon_turret_rifle" );
static const mtype_id mon_turret_riot( "mon_turret_riot" );
static const mtype_id mon_wasp( "mon_wasp" );
Expand Down Expand Up @@ -573,11 +574,8 @@ static bool mx_roadblock( map &m, const tripoint &abs_sub )
m.add_spawn( mon_turret_riot, 1, { x, y, abs_sub.z } );
}
};
bool mil = false;
if( one_in( 6 ) ) {
mil = true;
}
if( mil ) { //Military doesn't joke around with their barricades!

if( one_in( 6 ) ) { //Military doesn't joke around with their barricades!

if( one_in( 2 ) ) {
if( road_at_north ) {
Expand All @@ -592,7 +590,7 @@ static bool mx_roadblock( map &m, const tripoint &abs_sub )
line( &m, t_fence_barbed, point( 4, SEEY * 2 - 3 ), point( 10, SEEY * 2 - 3 ) );
line( &m, t_fence_barbed, point( 13, SEEY * 2 - 3 ), point( 19, SEEY * 2 - 3 ) );
}
if( road_at_east ) {
if( road_at_west ) {
line( &m, t_fence_barbed, point( 3, 4 ), point( 3, 10 ) );
line( &m, t_fence_barbed, point( 3, 13 ), point( 3, 19 ) );
}
Expand Down Expand Up @@ -647,6 +645,11 @@ static bool mx_roadblock( map &m, const tripoint &abs_sub )
}
}

line_furn( &m, f_sandbag_wall, point( 12, 7 ), point( 15, 7 ) );
m.add_spawn( mon_turret_searchlight, 1, { 13, 8, abs_sub.z } );
m.ter_set( point( 14, 8 ), t_plut_generator );
line_furn( &m, f_sandbag_wall, point( 12, 9 ), point( 15, 9 ) );

int num_bodies = dice( 2, 5 );
for( int i = 0; i < num_bodies; i++ ) {
if( const auto p = random_point( m, [&m]( const tripoint & n ) {
Expand Down Expand Up @@ -685,6 +688,12 @@ static bool mx_roadblock( map &m, const tripoint &abs_sub )

m.add_vehicle( vproto_id( "policecar" ), point( 8, 6 ), 20 );
m.add_vehicle( vproto_id( "policecar" ), point( 16, SEEY * 2 - 6 ), 145 );

line_furn( &m, f_sandbag_wall, point( 6, 10 ), point( 9, 10 ) );
m.add_spawn( mon_turret_searchlight, 1, { 7, 11, abs_sub.z } );
m.ter_set( point( 8, 11 ), t_plut_generator );
line_furn( &m, f_sandbag_wall, point( 6, 12 ), point( 9, 12 ) );

int num_bodies = dice( 1, 6 );
for( int i = 0; i < num_bodies; i++ ) {
if( const auto p = random_point( m, [&m]( const tripoint & n ) {
Expand Down

0 comments on commit 983cc7f

Please sign in to comment.