Skip to content

Commit

Permalink
Merge pull request #45523 from kevingranade/weary-counter-check
Browse files Browse the repository at this point in the history
Incorporate exertion penalty into counter cost check
  • Loading branch information
ZhilkinSerg authored Nov 22, 2020
2 parents c8149d5 + 3b8ab8f commit e8a7cca
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/melee.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1225,10 +1225,11 @@ matec_id Character::pick_technique( Creature &t, const item &weap,

// Don't counter if it would exhaust moves.
if( tec.block_counter || tec.dodge_counter ) {
int move_cost = attack_speed( used_weapon() );
float move_cost = attack_speed( used_weapon() );
move_cost *= tec.move_cost_multiplier( *this );
move_cost += tec.move_cost_penalty( *this );

float move_mult = exertion_adjusted_move_multiplier( EXTRA_EXERCISE );
move_cost *= ( 1.0f / move_mult );
if( get_moves() + get_speed() - move_cost < 0 ) {
continue;
}
Expand Down

0 comments on commit e8a7cca

Please sign in to comment.