Skip to content

Commit

Permalink
remove chance of removing mutations from other trees (#60218)
Browse files Browse the repository at this point in the history
* remove chance of removing mutations from other trees

* Update mutation.cpp
  • Loading branch information
anoobindisguise authored Aug 20, 2022
1 parent f7ccaa3 commit 5235d18
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions src/mutation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1029,30 +1029,6 @@ void Character::mutate( const int &true_random_chance, const bool use_vitamins )
}
}

// Check whether any of our current mutations are candidates for
// removal. If the mutation doesn't belong to the current category and
// can be removed there is 1/4 chance of it being added to the removal
// candidates list.
for( const auto &mutations_iter : my_mutations ) {
const trait_id &mutation_id = mutations_iter.first;
const mutation_branch &base_mdata = mutation_id.obj();
if( has_base_trait( mutation_id ) || find( base_mdata.category.begin(), base_mdata.category.end(),
cat ) != base_mdata.category.end() ) {
continue;
}

// mark for removal
// no removing Thresholds/Professions this way!
// unpurifiable traits also cannot be purified
// removing a Terminus trait is a definite no
if( !base_mdata.threshold && !base_mdata.terminus && !base_mdata.profession &&
base_mdata.purifiable ) {
if( one_in( 4 ) ) {
downgrades.push_back( mutation_id );
}
}
}

// Prioritize upgrading existing mutations
if( one_in( 2 ) ) {
if( !upgrades.empty() ) {
Expand All @@ -1064,15 +1040,6 @@ void Character::mutate( const int &true_random_chance, const bool use_vitamins )
return;
}
}
} else {
// Remove existing mutations that don't fit into our category
if( !downgrades.empty() ) {
size_t roll = rng( 0, downgrades.size() + 4 );
if( roll < downgrades.size() ) {
remove_mutation( downgrades[roll] );
return;
}
}
}

// Remove anything we already have, that we have a child of, that
Expand Down

0 comments on commit 5235d18

Please sign in to comment.