Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print message for failed prying attempt regardless of whether terrain/furniture has breakable defined #77251

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions src/activity_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5941,23 +5941,21 @@ void prying_activity_actor::handle_prying( Character &who )
};

auto handle_failure = [&]( const pry_data & pdata ) -> void {
if( !pdata.breakable )
if( pdata.breakable )
{
return;
}

int difficulty = pdata.difficulty;
difficulty -= tool->get_quality( qual_PRY ) - pdata.prying_level;

/** @EFFECT_MECHANICS reduces chance of breaking when prying */
const int dice_mech = dice( 2, static_cast<int>( round( who.get_skill_level( skill_mechanics ) ) ) );
/** @ARM_STR reduces chance of breaking when prying */
const int dice_str = dice( 2, who.get_arm_str() );

if( dice( 4, difficulty ) > dice_mech + dice_str )
{
// bash will always succeed
here.bash( target, 0, false, true );
int difficulty = pdata.difficulty;
difficulty -= tool->get_quality( qual_PRY ) - pdata.prying_level;

/** @EFFECT_MECHANICS reduces chance of breaking when prying */
const int dice_mech = dice( 2,
static_cast<int>( round( who.get_skill_level( skill_mechanics ) ) ) );
/** @ARM_STR reduces chance of breaking when prying */
const int dice_str = dice( 2, who.get_arm_str() );

if( dice( 4, difficulty ) > dice_mech + dice_str ) {
// bash will always succeed
here.bash( target, 0, false, true );
}
}

if( !data->prying_data().failure.empty() )
Expand Down
Loading