Skip to content

Commit

Permalink
Merge pull request CleverRaven#39029 from kevingranade/npc-crit-bugfix
Browse files Browse the repository at this point in the history
Base crit eligibility on targeted body part hp
  • Loading branch information
Rivet-the-Zombie authored Mar 26, 2020
2 parents af9ef0c + 79debcf commit d959c76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,13 +628,13 @@ void Creature::deal_projectile_attack( Creature *source, dealt_projectile_attack
game_message_type gmtSCTcolor = m_neutral;
if( magic ) {
damage_mult *= rng_float( 0.9, 1.1 );
} else if( goodhit < accuracy_headshot && max_damage > 0.4 * get_hp_max() ) {
} else if( goodhit < accuracy_headshot && max_damage > 0.4 * get_hp_max( hp_head ) ) {
message = _( "Headshot!" );
gmtSCTcolor = m_headshot;
damage_mult *= rng_float( 1.95, 2.05 );
bp_hit = bp_head; // headshot hits the head, of course

} else if( goodhit < accuracy_critical && max_damage > 0.4 * get_hp_max() ) {
} else if( goodhit < accuracy_critical && max_damage > 0.4 * get_hp_max( hp_torso ) ) {
message = _( "Critical!" );
gmtSCTcolor = m_critical;
damage_mult *= rng_float( 1.5, 2.0 );
Expand Down

0 comments on commit d959c76

Please sign in to comment.