Skip to content

Commit

Permalink
Merge pull request CleverRaven#26776 from Night-Pryanik/ducks-flying-…
Browse files Browse the repository at this point in the history
…over-the-water

Flying creatures will fly over the deep water
  • Loading branch information
Rivet-the-Zombie authored Nov 21, 2018
2 parents 8b0577e + 4572d1b commit a00b61e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/monmove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ bool monster::can_move_to( const tripoint &p ) const
return false;
}

if( !can_submerge() && g->m.has_flag( TFLAG_DEEP_WATER, p ) ) {
if( ( !can_submerge() && !has_flag( MF_FLIES ) ) && g->m.has_flag( TFLAG_DEEP_WATER, p ) ) {
return false;
}
if( has_flag( MF_DIGS ) && !g->m.has_flag( "DIGGABLE", p ) ) {
Expand Down Expand Up @@ -1053,7 +1053,13 @@ bool monster::move_to( const tripoint &p, bool force, const float stagger_adjust
bool was_water = g->m.is_divable( pos() );
bool will_be_water = on_ground && can_submerge() && g->m.is_divable( p );

if( was_water && !will_be_water && g->u.sees( p ) ) {
//Birds and other flying creatures flying over the deep water terrain
if( was_water && flies && g->u.sees( p ) ) {
if( one_in( 4 ) ) {
add_msg( m_warning, _( "A %1$s flies over the %2$s!" ), name().c_str(),
g->m.tername( pos() ).c_str() );
}
} else if( was_water && !will_be_water && g->u.sees( p ) ) {
//Use more dramatic messages for swimming monsters
add_msg( m_warning, _( "A %1$s %2$s from the %3$s!" ), name().c_str(),
has_flag( MF_SWIMS ) || has_flag( MF_AQUATIC ) ? _( "leaps" ) : _( "emerges" ),
Expand Down

0 comments on commit a00b61e

Please sign in to comment.