Skip to content

Commit

Permalink
Merge pull request #77251 from Night-Pryanik/prying-failure-message
Browse files Browse the repository at this point in the history
Print message for failed prying attempt regardless of whether terrain/furniture has `breakable` defined
  • Loading branch information
Maleclypse authored Oct 23, 2024
2 parents 178bed6 + b26af45 commit d69572f
Showing 1 changed file with 14 additions and 16 deletions.
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

0 comments on commit d69572f

Please sign in to comment.