Skip to content

Commit

Permalink
Add Trait "Deaf" (#29124)
Browse files Browse the repository at this point in the history
* Added Trait Deaf

Adds the trait Deaf, making it impossible to hear.
  • Loading branch information
SantosValourion authored and ZhilkinSerg committed Apr 1, 2019
1 parent 604288d commit 1bad38c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions data/json/mutations.json
Expand Up @@ -736,7 +736,18 @@
"starting_trait" : true,
"category" : ["PLANT"],
"cancels" : ["GOODHEARING"],
"changes_to" : ["DEAF"],
"hearing_modifier" : 0.5
},{
"type" : "mutation",
"id" : "DEAF",
"name" : "Deaf",
"points" : -4,
"description" : "You're not able to hear anything, and as such you're not able to talk to NPCs.",
"starting_trait" : true,
"prereqs" : ["BADHEARING"],
"cancels" : ["GOODHEARING"],
"hearing_modifier" : 0
},{
"type" : "mutation",
"id" : "SLOWLEARNER",
Expand Down
3 changes: 2 additions & 1 deletion src/player.cpp
Expand Up @@ -256,6 +256,7 @@ static const trait_id trait_COLDBLOOD2( "COLDBLOOD2" );
static const trait_id trait_COLDBLOOD3( "COLDBLOOD3" );
static const trait_id trait_COLDBLOOD4( "COLDBLOOD4" );
static const trait_id trait_COMPOUND_EYES( "COMPOUND_EYES" );
static const trait_id trait_DEAF( "DEAF" );
static const trait_id trait_DEBUG_BIONIC_POWER( "DEBUG_BIONIC_POWER" );
static const trait_id trait_DEBUG_CLOAK( "DEBUG_CLOAK" );
static const trait_id trait_DEBUG_HS( "DEBUG_HS" );
Expand Down Expand Up @@ -12026,7 +12027,7 @@ void player::add_known_trap( const tripoint &pos, const trap &t )

bool player::is_deaf() const
{
return get_effect_int( effect_deaf ) > 2 || worn_with_flag( "DEAF" ) ||
return get_effect_int( effect_deaf ) > 2 || worn_with_flag( "DEAF" ) || has_trait( trait_DEAF ) ||
( has_active_bionic( bio_earplugs ) && !has_active_bionic( bio_ears ) ) ||
( has_trait( trait_M_SKIN3 ) && g->m.has_flag_ter_or_furn( "FUNGUS", pos() ) && in_sleep_state() );
}
Expand Down

0 comments on commit 1bad38c

Please sign in to comment.