Skip to content

Commit

Permalink
Update character.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan1ss1mo authored Mar 8, 2023
1 parent f178740 commit f3ab69d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10963,7 +10963,7 @@ void Character::mod_pain( int npain )
{
if( npain > 0 ) {
double mult = enchantment_cache->get_value_multiply( enchant_vals::mod::PAIN );
if( has_trait( trait_NOPAIN ) || has_effect( effect_narcosis ) ) {
if( has_trait( trait_NOPAIN ) || has_effect( effect_narcosis ) || has_flag( json_flag_PAIN_IMMUNE ) ) {
return;
}
// if there is a positive multiplier we always want to add at least 1 pain
Expand All @@ -10973,6 +10973,12 @@ void Character::mod_pain( int npain )
if( mult < 0 ) {
npain = roll_remainder( npain * ( 1 + mult ) );
}
if( mutation_value( "pain_modifier" ) != 0 ) {
npain = roll_remainder( npain + mutation_value( "pain_modifier" ) );
if( npain < 0 ) {
return;
}
}
npain += enchantment_cache->get_value_add( enchant_vals::mod::PAIN );

// no matter how powerful the enchantment if we are gaining pain we always gain at least a little/don't lose any
Expand Down

0 comments on commit f3ab69d

Please sign in to comment.