Skip to content

Commit

Permalink
Merge pull request #40457 from ymber/military_spawns
Browse files Browse the repository at this point in the history
Spawn soldier zombies at mx_military, rearrange weapon spawns
  • Loading branch information
kevingranade authored May 12, 2020
2 parents 6e003e2 + 18b706e commit 030e444
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 18 deletions.
10 changes: 0 additions & 10 deletions data/json/itemgroups/Locations_MapExtras/map_extras.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,6 @@
{ "item": "corpse", "damage": 3, "//": "always a corpse, pulped!" }
]
},
{
"type": "item_group",
"subtype": "collection",
"id": "map_extra_military",
"entries": [
{ "group": "mon_zombie_soldier_death_drops" },
{ "group": "military_standard_sniper_rifles", "prob": 10 },
{ "item": "corpse", "damage": 3 }
]
},
{
"type": "item_group",
"subtype": "collection",
Expand Down
4 changes: 2 additions & 2 deletions data/json/monsterdrops/zombie_soldier.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{ "group": "military_standard_lmgs", "contents-item": "shoulder_strap", "prob": 10 },
{ "group": "military_standard_shotguns", "contents-item": "shoulder_strap", "prob": 5 }
],
"prob": 70
"prob": 10
},
{ "group": "infantry_common_gear" },
{ "group": "military_standard_grenades", "count": [ 1, 3 ], "prob": 20 },
Expand Down Expand Up @@ -53,7 +53,7 @@
{ "group": "military_standard_lmgs", "contents-item": "shoulder_strap", "prob": 10 },
{ "group": "military_standard_shotguns", "contents-item": "shoulder_strap", "prob": 5 }
],
"prob": 70
"prob": 10
},
{ "group": "infantry_common_gear" },
{ "group": "military_standard_grenades", "count": [ 1, 3 ], "prob": 20 },
Expand Down
3 changes: 2 additions & 1 deletion data/json/vehicles/military.json
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@
],
"items": [
{ "x": 0, "y": 0, "chance": 5, "items": [ "id_military" ] },
{ "x": -2, "y": 2, "chance": 15, "item_groups": [ "fuel_diesel" ] }
{ "x": -2, "y": 2, "chance": 15, "item_groups": [ "fuel_diesel" ] },
{ "x": -2, "y": 1, "chance": 7, "item_groups": [ "military_standard_sniper_rifles" ] }
]
},
{
Expand Down
48 changes: 43 additions & 5 deletions src/map_extras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,16 +469,39 @@ static bool mx_military( map &m, const tripoint & )
if( const auto p = random_point( m, [&m]( const tripoint & n ) {
return m.passable( n );
} ) ) {
if( one_in( 10 ) ) {
m.add_spawn( mon_zombie_soldier, 1, *p );
} else if( one_in( 25 ) ) {
if( one_in( 25 ) ) {
if( one_in( 2 ) ) {
m.add_spawn( mon_zombie_bio_op, 1, *p );

int splatter_range = rng( 1, 3 );
for( int j = 0; j <= splatter_range; j++ ) {
m.add_field( *p + point( -j * 1, j * 1 ), fd_blood, 1, 0_turns );
}
} else {
m.add_spawn( mon_dispatch, 1, *p );
}
} else {
m.place_items( "map_extra_military", 100, *p, *p, true, calendar::start_of_cataclysm );
m.add_spawn( mon_zombie_soldier, 1, *p );
// 10% chance of zombie carrying weapon so 90% chance of it being on the ground
if( !one_in( 10 ) ) {
std::string group;
// 75% assault rifles, 10% LMGs, 5% shotguns, 5% sniper rifles
if( one_in( 20 ) ) {
group = "military_standard_sniper_rifles";
} else if( one_in( 20 ) ) {
group = "military_standard_shotguns";
} else if( one_in( 10 ) ) {
group = "military_standard_lmgs";
} else {
group = "military_standard_assault_rifles";
}
m.place_items( group, 100, *p, *p, true, calendar::start_of_cataclysm );
}

int splatter_range = rng( 1, 3 );
for( int j = 0; j <= splatter_range; j++ ) {
m.add_field( *p + point( -j * 1, j * 1 ), fd_blood, 1, 0_turns );
}
}
}

Expand Down Expand Up @@ -656,7 +679,22 @@ static bool mx_roadblock( map &m, const tripoint &abs_sub )
if( const auto p = random_point( m, [&m]( const tripoint & n ) {
return m.passable( n );
} ) ) {
m.place_items( "map_extra_military", 100, *p, *p, true, calendar::start_of_cataclysm );
m.add_spawn( mon_zombie_soldier, 1, *p );
// 10% chance of zombie carrying weapon so 90% chance of it being on the ground
if( !one_in( 10 ) ) {
std::string group;
// 75% assault rifles, 10% LMGs, 5% shotguns, 5% sniper rifles
if( one_in( 20 ) ) {
group = "military_standard_sniper_rifles";
} else if( one_in( 20 ) ) {
group = "military_standard_shotguns";
} else if( one_in( 10 ) ) {
group = "military_standard_lmgs";
} else {
group = "military_standard_assault_rifles";
}
m.place_items( group, 100, *p, *p, true, calendar::start_of_cataclysm );
}

int splatter_range = rng( 1, 3 );
for( int j = 0; j <= splatter_range; j++ ) {
Expand Down

0 comments on commit 030e444

Please sign in to comment.