Skip to content

Commit

Permalink
Merge pull request #37787 from SeventhSandwich/vehicle_dragging_fix
Browse files Browse the repository at this point in the history
Rebalance stamina and pain penalties for dragging wheeled vehicles
  • Loading branch information
ZhilkinSerg authored Feb 17, 2020
2 parents 85bfff5 + b7fff6f commit f184dad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8911,7 +8911,13 @@ bool game::walk_move( const tripoint &dest_loc )
Monsters don't currently have stamina however.
For the time being just don't burn players stamina when mounted.
*/
u.burn_move_stamina( previous_moves - u.moves );
if( grabbed_vehicle == nullptr || grabbed_vehicle->wheelcache.empty() ) {
//Burn normal amount of stamina if no vehicle grabbed or vehicle lacks wheels
u.burn_move_stamina( previous_moves - u.moves );
} else {
//Burn half as much stamina if vehicle has wheels, without changing move time
u.burn_move_stamina( 0.50 * ( previous_moves - u.moves ) );
}
}
// Max out recoil
u.recoil = MAX_RECOIL;
Expand Down
4 changes: 2 additions & 2 deletions src/grab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ bool game::grabbed_veh_move( const tripoint &dp )
///\EFFECT_STR increases speed of dragging vehicles
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() ) {
if( ex > u.get_str() + 1 ) {
add_msg( m_bad, _( "You strain yourself to move the %s!" ), grabbed_vehicle->name );
u.moves -= 200;
u.mod_pain( 1 );
} else if( ex == u.get_str() ) {
} else {
u.moves -= 200;
add_msg( _( "It takes some time to move the %s." ), grabbed_vehicle->name );
}
Expand Down

0 comments on commit f184dad

Please sign in to comment.