Skip to content

Commit

Permalink
Prevent safecracking if wearing earphones
Browse files Browse the repository at this point in the history
To increase realism and game consistency regarding partial deafness

Partially fixes #36013

Disallows an attempt at safecracking while player has
`effect_earphones`. Due to a loophole caused by mp3 player activation
being instantaneous, it is still possible to begin safecracking
immediately after putting on the mp3 player (but not after 1 turn has
passed with the mp3 active).
  • Loading branch information
wapcaplet committed Jan 29, 2020
1 parent 0f3aa32 commit 4092208
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/iexamine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ static const efftype_id effect_mending( "mending" );
static const efftype_id effect_pkill2( "pkill2" );
static const efftype_id effect_teleglow( "teleglow" );
static const efftype_id effect_sleep( "sleep" );
static const efftype_id effect_earphones( "earphones" );

static const trait_id trait_DEBUG_HS( "DEBUG_HS" );
static const trait_id trait_AMORPHOUS( "AMORPHOUS" );
Expand Down Expand Up @@ -1220,6 +1221,10 @@ void iexamine::safe( player &p, const tripoint &examp )
add_msg( m_info, _( "You can't crack a safe while deaf!" ) );
return;
}
if( p.has_effect( effect_earphones ) ) {
add_msg( m_info, _( "You can't crack a safe while wearing headphones!" ) );
return;
}
if( query_yn( _( "Attempt to crack the safe?" ) ) ) {
add_msg( m_info, _( "You start cracking the safe." ) );
// 150 minutes +/- 20 minutes per mechanics point away from 3 +/- 10 minutes per
Expand Down

0 comments on commit 4092208

Please sign in to comment.