Skip to content

Commit

Permalink
Don't penalize strong characters for dragging
Browse files Browse the repository at this point in the history
One of the changes introduced in PR CleverRaven#37787 dropped the conditional check
for character strength being *equal* to exertion required, and instead
applied the "It takes some time" movement penalty to everyone
(regardless of strength).

And, due to the first `if` being changed to `ex >= u.get_str() + 1`,
there was no case for `ex == u.get_str()`, allowing characters with a
very specific strength, just 1 less than the strength needed, to avoid
any movement penalty at all.

Fixes CleverRaven#38104

The pain penalty is preserved (with comment), and a narrower condition
(potentially matching 2 different strength stat values) gives the "It
takes some time" message with the same movement penalty.

Any character with sufficient (or more than sufficient) strength to drag
the vehicle will see no message and receive no additional movement
penalty.
  • Loading branch information
wapcaplet committed Feb 20, 2020
1 parent 142295b commit ad087d4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/grab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,14 @@ bool game::grabbed_veh_move( const tripoint &dp )
u.moves -= 100 * str_req / std::max( 1, u.get_str() );
const int ex = dice( 1, 3 ) - 1 + str_req;
if( ex > u.get_str() + 1 ) {
// Pain and movement penalty if exertion exceeds character strength
add_msg( m_bad, _( "You strain yourself to move the %s!" ), grabbed_vehicle->name );
u.moves -= 200;
u.mod_pain( 1 );
} else {
u.moves -= 200;
} else if( ex >= u.get_str() ) {
// Movement is slow if exertion nearly equals character strength
add_msg( _( "It takes some time to move the %s." ), grabbed_vehicle->name );
u.moves -= 200;
}
} else {
u.moves -= 100;
Expand Down

0 comments on commit ad087d4

Please sign in to comment.