Skip to content

Commit

Permalink
Merge pull request CleverRaven#77401 from Night-Pryanik/repose
Browse files Browse the repository at this point in the history
Forbid drinking liquids underwater for characters with `Aqueous Repose` and `Embrace of the Waters` mutations, as it stated in mutations' descriptions
  • Loading branch information
Maleclypse authored Oct 29, 2024
2 parents 40ca576 + a680ecd commit a88f8f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/consumption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -834,8 +834,9 @@ ret_val<edible_rating> Character::can_eat( const item &food ) const

// TODO: This condition occurs way too often. Unify it.
// update Sep. 26 2018: this apparently still occurs way too often. yay!
if( is_underwater() && ( !has_trait( trait_WATERSLEEP ) ||
has_trait( trait_UNDINE_SLEEP_WATER ) ) ) {
if( is_underwater() &&
( ( !has_trait( trait_WATERSLEEP ) && !has_trait( trait_UNDINE_SLEEP_WATER ) ) ||
( ( has_trait( trait_WATERSLEEP ) || has_trait( trait_UNDINE_SLEEP_WATER ) ) && drinkable ) ) ) {
return ret_val<edible_rating>::make_failure( _( "You can't do that while underwater." ) );
}

Expand Down
3 changes: 2 additions & 1 deletion src/player_hardcoded_effects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ static const trait_id trait_INFRESIST( "INFRESIST" );
static const trait_id trait_M_IMMUNE( "M_IMMUNE" );
static const trait_id trait_M_SKIN3( "M_SKIN3" );
static const trait_id trait_THRESH_MYCUS( "THRESH_MYCUS" );
static const trait_id trait_UNDINE_SLEEP_WATER( "UNDINE_SLEEP_WATER" );
static const trait_id trait_WATERSLEEP( "WATERSLEEP" );

static const vitamin_id vitamin_blood( "blood" );
Expand Down Expand Up @@ -1090,7 +1091,7 @@ static void eff_fun_sleep( Character &u, effect &it )
}
}
}
if( u.has_trait( trait_WATERSLEEP ) ) {
if( u.has_trait( trait_WATERSLEEP ) || u.has_trait( trait_UNDINE_SLEEP_WATER ) ) {
u.mod_sleepiness( -3 ); // Fish sleep less in water
}
}
Expand Down

0 comments on commit a88f8f8

Please sign in to comment.