Skip to content

Commit

Permalink
more linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan1ss1mo committed Feb 17, 2023
1 parent db14729 commit 4e5a4cf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5735,8 +5735,8 @@ static const std::map<std::string, std::function <float( std::vector<const mutat
mutation_value_map = {
{ "healing_awake", calc_mutation_value<&mutation_branch::healing_awake> },
{ "healing_resting", calc_mutation_value<&mutation_branch::healing_resting> },
{ "pain_multiplier", calc_mutation_value_multiplicative<&mutation_branch::pain_multiplier> },
{ "pain_modifier", calc_mutation_value<&mutation_branch::pain_modifier> },
{ "pain_multiplier", calc_mutation_value_multiplicative<&mutation_branch::pain_multiplier> },
{ "pain_modifier", calc_mutation_value<&mutation_branch::pain_modifier> },
{ "mending_modifier", calc_mutation_value_multiplicative<&mutation_branch::mending_modifier> },
{ "hp_modifier", calc_mutation_value<&mutation_branch::hp_modifier> },
{ "hp_modifier_secondary", calc_mutation_value<&mutation_branch::hp_modifier_secondary> },
Expand Down Expand Up @@ -10924,20 +10924,20 @@ bool Character::immune_to( const bodypart_id &bp, damage_unit dam ) const
void Character::mod_pain( int npain )
{
if( npain > 0 ) {
if( has_effect( effect_narcosis ) || mutation_value( "pain_multiplier" ) == 0 ) {
if( has_effect( effect_narcosis ) || mutation_value( "pain_multiplier" ) == 0 ) {
return;
}
// always increase pain gained by one from these bad mutations
if( mutation_value( "pain_multiplier" ) > 1 ) {
npain += std::max( 1, roll_remainder( npain *( mutation_value( "pain_multiplier" )-1 ) ) );
npain += std::max( 1, roll_remainder( npain * ( mutation_value( "pain_multiplier" ) - 1 ) ) );
}
if( npain > 1 && mutation_value( "pain_multiplier" ) < 1 ) {
// if it's 1 it'll just become 0, which is bad
npain = roll_remainder( npain * mutation_value( "pain_multiplier" ) );
npain = roll_remainder( npain * mutation_value( "pain_multiplier" ) );
}
if( mutation_value( "pain_modifier" ) != 0 ) {
npain += mutation_value( "pain_modifier" );
}
if ( mutation_value( "pain_modifier" ) != 0) {
npain += mutation_value( "pain_modifier" );
}
}
Creature::mod_pain( npain );
}
Expand Down
4 changes: 2 additions & 2 deletions src/mutation.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ struct mutation_branch {
cata::optional<float> healing_resting = cata::nullopt;
// Limb mending bonus
cata::optional<float> mending_modifier = cata::nullopt;
cata::optional<float> pain_multiplier = cata::nullopt;
cata::optional<float> pain_modifier = cata::nullopt;
cata::optional<float> pain_multiplier = cata::nullopt;
cata::optional<float> pain_modifier = cata::nullopt;
// Bonus HP multiplier. That is, 1.0 doubles hp, -0.5 halves it.
cata::optional<float> hp_modifier = cata::nullopt;
// Second HP modifier that stacks with first but is otherwise identical.
Expand Down
4 changes: 2 additions & 2 deletions src/mutation_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ void mutation_branch::load( const JsonObject &jo, const std::string & )

optional( jo, was_loaded, "healing_awake", healing_awake, cata::nullopt );
optional( jo, was_loaded, "healing_resting", healing_resting, cata::nullopt );
optional( jo, was_loaded, "pain_multiplier", pain_multiplier, cata::nullopt );
optional( jo, was_loaded, "pain_modifier", pain_modifier, cata::nullopt );
optional( jo, was_loaded, "pain_multiplier", pain_multiplier, cata::nullopt );
optional( jo, was_loaded, "pain_modifier", pain_modifier, cata::nullopt );
optional( jo, was_loaded, "mending_modifier", mending_modifier, cata::nullopt );
optional( jo, was_loaded, "hp_modifier", hp_modifier, cata::nullopt );
optional( jo, was_loaded, "hp_modifier_secondary", hp_modifier_secondary, cata::nullopt );
Expand Down

0 comments on commit 4e5a4cf

Please sign in to comment.