diff --git a/src/character.cpp b/src/character.cpp index 9e950664411d..116743b12c5e 100644 --- a/src/character.cpp +++ b/src/character.cpp @@ -3488,8 +3488,9 @@ void Character::practice( const skill_id &id, int amount, int cap, bool suppress focus_pool -= chance_to_drop / 100; // Apex Predators don't think about much other than killing. // They don't lose Focus when practicing combat skills. - if( ( rng( 1, 100 ) <= ( chance_to_drop % 100 ) ) && ( !( has_trait_flag( trait_flag_str_id( "PRED4" ) ) && - skill.is_combat_skill() ) ) ) { + if( ( rng( 1, 100 ) <= ( chance_to_drop % 100 ) ) && + ( !( has_trait_flag( trait_flag_str_id( "PRED4" ) ) && + skill.is_combat_skill() ) ) ) { focus_pool--; } } diff --git a/src/magic.cpp b/src/magic.cpp index df38dfec12ae..5e21de7cd950 100644 --- a/src/magic.cpp +++ b/src/magic.cpp @@ -758,7 +758,8 @@ float spell::spell_fail( const Character &guy ) const return 1.0f; } float fail_chance = std::pow( ( effective_skill - 30.0f ) / 30.0f, 2 ); - if( has_flag( spell_flag::SOMATIC ) && !guy.has_trait_flag( trait_flag_str_id( "SUBTLE_SPELL" ) ) ) { + if( has_flag( spell_flag::SOMATIC ) && + !guy.has_trait_flag( trait_flag_str_id( "SUBTLE_SPELL" ) ) ) { // the first 20 points of encumbrance combined is ignored const int arms_encumb = std::max( 0, guy.encumb( bp_arm_l ) + guy.encumb( bp_arm_r ) - 20 ); // each encumbrance point beyond the "gray" color counts as half an additional fail % diff --git a/src/mondeath.cpp b/src/mondeath.cpp index 68b63d44a691..b826c11d1025 100644 --- a/src/mondeath.cpp +++ b/src/mondeath.cpp @@ -439,27 +439,28 @@ void mdeath::guilt( monster &z ) guilt_tresholds[25] = _( "You feel remorse for killing %s." ); if( g->u.has_trait( trait_PSYCHOPATH ) || g->u.has_trait_flag( trait_flag_str_id( "PRED3" ) || - g->u.has_trait_flag( trait_flag_str_id( "PRED4" ) || g->u.has_trait( trait_KILLER ) ) { - return; - } - if( rl_dist( z.pos(), g->u.pos() ) > MAX_GUILT_DISTANCE ) { - // Too far away, we can deal with it. - return; - } - if( z.get_hp() >= 0 ) { - // We probably didn't kill it - return; - } - if( kill_count >= maxKills ) { - // player no longer cares - if( kill_count == maxKills ) { + g->u.has_trait_flag( trait_flag_str_id( "PRED4" ) || g->u.has_trait( trait_KILLER ) ) { + return; +} +if( rl_dist( z.pos(), g->u.pos() ) > MAX_GUILT_DISTANCE ) { + // Too far away, we can deal with it. + return; +} +if( z.get_hp() >= 0 ) { + // We probably didn't kill it + return; +} +if( kill_count >= maxKills ) { + // player no longer cares + if( kill_count == maxKills ) { //~ Message after killing a lot of monsters which would normally affect the morale negatively. %s is the monster name, it will be pluralized with a number of 100. add_msg( m_good, _( "After killing so many bloody %s you no longer care " "about their deaths anymore." ), z.name( maxKills ) ); } return; - } else if( ( g->u.has_trait_flag( trait_flag_str_id( "PRED1" ) ) || ( g->u.has_trait_flag( trait_flag_str_id( "PRED2" ) ) ) { - msg = ( _( "Culling the weak is distasteful, but necessary." ) ); + } else if( ( g->u.has_trait_flag( trait_flag_str_id( "PRED1" ) ) || + ( g->u.has_trait_flag( trait_flag_str_id( "PRED2" ) ) ) { + msg = ( _( "Culling the weak is distasteful, but necessary." ) ); msgtype = m_neutral; } else { msgtype = m_bad; @@ -474,20 +475,20 @@ void mdeath::guilt( monster &z ) add_msg( msgtype, msg, z.name() ); int moraleMalus = -50 * ( 1.0 - ( static_cast( kill_count ) / maxKills ) ); - int maxMalus = -250 * ( 1.0 - ( static_cast( kill_count ) / maxKills ) ); - time_duration duration = 30_minutes * ( 1.0 - ( static_cast( kill_count ) / maxKills ) ); - time_duration decayDelay = 3_minutes * ( 1.0 - ( static_cast( kill_count ) / maxKills ) ); + int maxMalus = -250 * ( 1.0 - ( static_cast( kill_count ) / maxKills ) ); + time_duration duration = 30_minutes * ( 1.0 - ( static_cast( kill_count ) / maxKills ) ); + time_duration decayDelay = 3_minutes * ( 1.0 - ( static_cast( kill_count ) / maxKills ) ); if( z.type->in_species( ZOMBIE ) ) { - moraleMalus /= 10; - if( g->u.has_trait( trait_PACIFIST ) ) { + moraleMalus /= 10; + if( g->u.has_trait( trait_PACIFIST ) ) { moraleMalus *= 5; } else if( g->u.has_trait_flag( trait_flag_str_id( "PRED1" ) ) { - moraleMalus /= 4; - } else if( g->u.has_trait_flag( trait_flag_str_id( "PRED2" ) ) { - moraleMalus /= 5; - } + moraleMalus /= 4; + } else if( g->u.has_trait_flag( trait_flag_str_id( "PRED2" ) ) { + moraleMalus /= 5; } - g->u.add_morale( MORALE_KILLED_MONSTER, moraleMalus, maxMalus, duration, decayDelay ); +} +g->u.add_morale( MORALE_KILLED_MONSTER, moraleMalus, maxMalus, duration, decayDelay ); }