Skip to content

Commit

Permalink
style(autofix.ci): automated formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Sep 11, 2023
1 parent 43d62f8 commit 3ba4f47
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 29 deletions.
5 changes: 3 additions & 2 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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--;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/magic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 %
Expand Down
53 changes: 27 additions & 26 deletions src/mondeath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -474,20 +475,20 @@ void mdeath::guilt( monster &z )
add_msg( msgtype, msg, z.name() );

int moraleMalus = -50 * ( 1.0 - ( static_cast<float>( kill_count ) / maxKills ) );
int maxMalus = -250 * ( 1.0 - ( static_cast<float>( kill_count ) / maxKills ) );
time_duration duration = 30_minutes * ( 1.0 - ( static_cast<float>( kill_count ) / maxKills ) );
time_duration decayDelay = 3_minutes * ( 1.0 - ( static_cast<float>( kill_count ) / maxKills ) );
int maxMalus = -250 * ( 1.0 - ( static_cast<float>( kill_count ) / maxKills ) );
time_duration duration = 30_minutes * ( 1.0 - ( static_cast<float>( kill_count ) / maxKills ) );
time_duration decayDelay = 3_minutes * ( 1.0 - ( static_cast<float>( 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 );

}

Expand Down

0 comments on commit 3ba4f47

Please sign in to comment.