Skip to content

Commit

Permalink
Falling into deep water deals less damage (#39903)
Browse files Browse the repository at this point in the history
  • Loading branch information
int-ua authored May 4, 2020
1 parent 8b4a4e2 commit 5de957a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1276,8 +1276,12 @@ int player::impact( const int force, const tripoint &p )
if( g->m.has_furn( p ) ) {
// TODO: Make furniture matter
} else if( g->m.has_flag( TFLAG_SWIMMABLE, p ) ) {
// TODO: Some formula of swimming
effective_force /= 4;
const int swim_skill = get_skill_level( skill_swimming );
effective_force /= 4.0f + 0.1f * swim_skill;
if( g->m.has_flag( TFLAG_DEEP_WATER, p ) ) {
effective_force /= 1.5f;
mod /= 1.0f + ( 0.1f * swim_skill );
}
}
}

Expand Down Expand Up @@ -4420,4 +4424,3 @@ bool player::query_yn( const std::string &mes ) const
{
return ::query_yn( mes );
}

0 comments on commit 5de957a

Please sign in to comment.