Skip to content

Commit

Permalink
Worm Spawn Map Extra (#72975)
Browse files Browse the repository at this point in the history
* Worm Spawn

* Update wilderness.json

* Update overmap.cpp

Overmap changes
  • Loading branch information
RanikOrtega authored Apr 16, 2024
1 parent e5cca6f commit c1e691b
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 14 deletions.
53 changes: 53 additions & 0 deletions data/json/mapgen/map_extras/wilderness.json
Original file line number Diff line number Diff line change
Expand Up @@ -769,5 +769,58 @@
{ "monster": "GROUP_SWAMP", "x": [ 0, 23 ], "y": [ 0, 23 ], "chance": 5, "density": 0.5 }
]
}
},
{
"type": "mapgen",
"method": "json",
"update_mapgen_id": "mx_worm_sign",
"object": {
"rows": [
" ......... ",
" ............... ",
" ................... ",
" .................... ",
" ..................... ",
" ...................... ",
" ...................... ",
"........................",
"........................",
"........................",
"...........x............",
"........................",
"........................",
"........................",
"........................",
"........................",
"........................",
" ...................... ",
" ...................... ",
" ...................... ",
" .................... ",
" .................... ",
" ................ ",
" .......... "
],
"flags": [ "ALLOW_TERRAIN_UNDER_OTHER_DATA" ],
"nested": {
".": { "chunks": [ [ "null", 20 ], [ "1x1_upturn_earth", 1 ] ] },
"x": { "chunks": [ [ "null", 20 ], [ "1x1_upturn_earth", 1 ] ] }
},
"monsters": {
".": { "monster": "GROUP_WORM", "chance": 2, "density": 0.0001 },
"x": { "monster": "GROUP_WORM", "chance": 100, "density": 0.0001 }
}
}
},
{
"type": "mapgen",
"method": "json",
"nested_mapgen_id": "1x1_upturn_earth",
"object": { "mapgensize": [ 1, 1 ], "place_ter_furn_transforms": [ { "transform": "upturn_earth", "x": 0, "y": 0 } ] }
},
{
"type": "ter_furn_transform",
"id": "upturn_earth",
"terrain": [ { "result": "t_dirtmound", "valid_flags": [ "DIGGABLE" ] } ]
}
]
11 changes: 11 additions & 0 deletions data/json/overmap/map_extras.json
Original file line number Diff line number Diff line change
Expand Up @@ -658,5 +658,16 @@
"description": "An ordinary beehive.",
"generator": { "generator_method": "update_mapgen", "generator_id": "mx_beehive_natural" },
"min_max_zlevel": [ 0, 0 ]
},
{
"id": "mx_worm_sign",
"type": "map_extra",
"name": { "str": "Upturned Earth" },
"description": "There is a lot of upturned earth here.",
"generator": { "generator_method": "update_mapgen", "generator_id": "mx_worm_sign" },
"min_max_zlevel": [ 0, 0 ],
"sym": "o",
"color": "red",
"autonote": true
}
]
1 change: 1 addition & 0 deletions data/json/regional_map_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,7 @@
"mx_collegekids": 30,
"mx_drugdeal": 30,
"mx_corpses": 30,
"mx_worm_sign": 20,
"mx_toxic_waste": 10,
"mx_portal": 10,
"mx_portal_in": 10,
Expand Down
14 changes: 0 additions & 14 deletions src/overmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ static const mongroup_id GROUP_OCEAN_SHORE( "GROUP_OCEAN_SHORE" );
static const mongroup_id GROUP_RIVER( "GROUP_RIVER" );
static const mongroup_id GROUP_SUBWAY_CITY( "GROUP_SUBWAY_CITY" );
static const mongroup_id GROUP_SWAMP( "GROUP_SWAMP" );
static const mongroup_id GROUP_WORM( "GROUP_WORM" );
static const mongroup_id GROUP_ZOMBIE( "GROUP_ZOMBIE" );

static const oter_str_id oter_central_lab( "central_lab" );
Expand Down Expand Up @@ -7121,19 +7120,6 @@ void overmap::place_mongroups()
}
}
}

// Place the "put me anywhere" groups
int numgroups = rng( 0, 3 );
for( int i = 0; i < numgroups; i++ ) {
float norm_factor = std::abs( GROUP_WORM->freq_total / 1000.0f );
tripoint_om_sm p( rng( 0, OMAPX * 2 - 1 ), rng( 0, OMAPY * 2 - 1 ), 0 );
unsigned int pop = std::round( norm_factor * rng( 30, 50 ) );
// ensure GROUP WORM doesn't get placed in ocean or lake.
if( !is_water_body( ter( {p.x(), p.y(), 0} ) ) ) {
spawn_mon_group(
mongroup( GROUP_WORM, project_combine( pos(), p ), pop ), rng( 20, 40 ) );
}
}
}

void overmap::place_nemesis( const tripoint_abs_omt &p )
Expand Down

0 comments on commit c1e691b

Please sign in to comment.