Skip to content

Commit

Permalink
Display damage dealt when monster is knocked into a wall (#49120)
Browse files Browse the repository at this point in the history
* Display damage dealt when monster is knocked into a wall
Co-authored-by: Binrui Dong <[email protected]>
  • Loading branch information
Saelfen authored Jul 10, 2021
1 parent b5a1a64 commit 8d7d838
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/monmove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2018,14 +2018,14 @@ void monster::knock_back_to( const tripoint &to )
}

map &here = get_map();
// It's some kind of wall.
if( here.impassable( to ) ) {

// It's some kind of wall.
apply_damage( nullptr, bodypart_id( "torso" ), static_cast<float>( type->size ) );
const int dam = static_cast<int>( type->size );
apply_damage( nullptr, bodypart_id( "torso" ), dam );
add_effect( effect_stunned, 2_turns );
if( u_see ) {
add_msg( _( "The %1$s bounces off a %2$s." ), name(),
here.obstacle_name( to ) );
add_msg( _( "The %1$s bounces off a %2$s and takes %3$d damage." ), name(),
here.obstacle_name( to ), dam );
}

} else { // It's no wall
Expand Down

0 comments on commit 8d7d838

Please sign in to comment.