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

Worm Spawn Map Extra #72975

Merged
merged 3 commits into from
Apr 16, 2024
Merged

Worm Spawn Map Extra #72975

merged 3 commits into from
Apr 16, 2024

Conversation

RanikOrtega
Copy link
Contributor

@RanikOrtega RanikOrtega commented Apr 12, 2024

Summary

Content "Created Map Extra that spawns monsters from the Group_Worm"

Purpose of change

To address worms spawning randomly and without notice. A mapgen extra showing upturned earth helps identify their spawn.

Describe the solution

Created Mapgen Extra with a small chance of spawning.

Describe alternatives you've considered

Testing

Tested Map spawn manually in debug mode. Then cranked chance of spawn to very high and tested it showed up. Once satisfied I turned spawn rate back down. Map Extra has a guaranteed spawn, but also a chance of more.

Additional context

image
image
image

@github-actions github-actions bot added [JSON] Changes (can be) made in JSON Map / Mapgen Overmap, Mapgen, Map extras, Map display astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Apr 12, 2024
@Procyonae
Copy link
Contributor

Procyonae commented Apr 12, 2024

You can delete the current way they spawn here, I wouldn't worry about compiling it (if you don't want to tho I'll do it in a separate PR)

Cataclysm-DDA/src/overmap.cpp

Lines 7129 to 7141 in 0bcda8a

// 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 ) );
}
}
static const mongroup_id GROUP_WORM( "GROUP_WORM" );

@github-actions github-actions bot added the [C++] Changes (can be) made in C++. Previously named `Code` label Apr 13, 2024
@RanikOrtega
Copy link
Contributor Author

You can delete the current way they spawn here, I wouldn't worry about compiling it (if you don't want to tho I'll do it in a separate PR)

Cataclysm-DDA/src/overmap.cpp

Lines 7129 to 7141 in 0bcda8a

// 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 ) );
}
}

static const mongroup_id GROUP_WORM( "GROUP_WORM" );

Deleted the entries you listed. Double check if able.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 13, 2024
@Maleclypse Maleclypse merged commit c1e691b into CleverRaven:master Apr 16, 2024
24 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Map / Mapgen Overmap, Mapgen, Map extras, Map display
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants