diff --git a/data/json/monsters/nether.json b/data/json/monsters/nether.json index 43f7ceee061b9..e72c2c62a1886 100644 --- a/data/json/monsters/nether.json +++ b/data/json/monsters/nether.json @@ -411,6 +411,7 @@ "default_faction": "mutant", "bodytype": "dog", "species": [ "NETHER" ], + "diff": 2, "volume": "62500 ml", "weight": "81500 g", "hp": 120, @@ -755,6 +756,7 @@ "default_faction": "mutant", "bodytype": "blob", "species": [ "NETHER" ], + "diff": 2, "volume": "92500 ml", "weight": "120 kg", "hp": 160, diff --git a/src/monattack.cpp b/src/monattack.cpp index 8299cde2f270a..07d929f0e94be 100644 --- a/src/monattack.cpp +++ b/src/monattack.cpp @@ -2525,14 +2525,18 @@ bool mattack::tentacle( monster *z ) // TODO: handle friendly monsters return false; } - Creature *target = &g->u; - if( !z->sees( g->u ) ) { + Creature *target = z->attack_target(); + if( target == nullptr || rl_dist( z->pos(), target->pos() ) > 3 || !z->sees( *target ) ) { return false; } - add_msg( m_bad, _( "The %s lashes its tentacle at you!" ), z->name() ); + game_message_type msg_type = target == &g->u ? m_bad : m_info; + target->add_msg_player_or_npc( msg_type, + _( "The %s lashes its tentacle at you!" ), + _( "The %s lashes its tentacle at !" ), + z->name() ); z->moves -= 100; - if( g->u.uncanny_dodge() ) { + if( target->uncanny_dodge() ) { return true; } // Can we dodge the attack? Uses player dodge function % chance (melee.cpp) @@ -2544,12 +2548,28 @@ bool mattack::tentacle( monster *z ) } const bodypart_id hit = target->get_random_body_part(); + const body_part hit_token = hit->token; int dam = rng( 10, 20 ); - //~ 1$s is bodypart name, 2$d is damage value. - add_msg( m_bad, _( "Your %1$s is hit for %2$d damage!" ), body_part_name( hit->token ), dam ); - g->u.deal_damage( z, hit, damage_instance( DT_BASH, dam ) ); + dam = target->deal_damage( z, hit, damage_instance( DT_BASH, dam ) ).total_damage(); + + if( dam > 0 ) { + target->add_msg_player_or_npc( msg_type, + //~ 1$s is bodypart name, 2$d is damage value. + _( "Your %1$s is hit for %2$d damage!" ), + //~ 1$s is bodypart name, 2$d is damage value. + _( "'s %1$s is hit for %2$d damage!" ), + body_part_name( hit_token ), + dam ); + } else { + target->add_msg_player_or_npc( + _( "The %1$s lashes its tentacle at your %2$s, but glances off your armor!" ), + _( "The %1$s lashes its tentacle at 's %2$s, but glances off their armor!" ), + z->name(), + body_part_name_accusative( hit_token ) ); + } + target->on_hit( z, hit, z->type->melee_skill ); - g->u.check_dead_state(); + target->check_dead_state(); return true; }