Skip to content

Commit

Permalink
Review
Browse files Browse the repository at this point in the history
  • Loading branch information
Venera3 committed Jun 18, 2023
1 parent 767a055 commit d5d4b8f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/mattack_actors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ int melee_actor::do_grab( monster &z, Creature *target, bodypart_id bp_id ) cons
game_message_type msg_type = target->is_avatar() ? m_warning : m_info;
const std::string mon_name = get_player_character().sees( z.pos() ) ?
z.disp_name( false, true ) : _( "Something" );
Character *foe = dynamic_cast<Character *>( target );
Character *foe = target->as_character();
map &here = get_map();

int eff_grab_strength = grab_data.grab_strength == -1 ? z.get_grab_strength() :
Expand Down Expand Up @@ -608,7 +608,7 @@ int melee_actor::do_grab( monster &z, Creature *target, bodypart_id bp_id ) cons
std::advance( intersect_iter, rng( 0, intersect.size() - 1 ) );
tripoint target_square = random_entry<std::set<tripoint>>( intersect );
if( z.can_move_to( target_square ) ) {
monster *zz = dynamic_cast<monster *>( target );
monster *zz = target->as_monster();
tripoint zpt = z.pos();
z.move_to( target_square, false, false, grab_data.drag_movecost_mod );
if( !g->is_empty( zpt ) ) { //Cancel the grab if the space is occupied by something
Expand Down
11 changes: 0 additions & 11 deletions src/melee.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1909,17 +1909,6 @@ void Character::perform_technique( const ma_technique &technique, Creature &t,
}
}
}
// Remove our grab if we knocked back our grabber (if we can do so is handled by tech conditions)
if( has_flag( json_flag_GRAB ) && t.has_effect_with_flag( json_flag_GRAB_FILTER ) ) {
for( const effect &eff : get_effects_with_flag( json_flag_GRAB ) ) {
if( t.has_effect( eff.get_bp()->grabbing_effect ) ) {
t.remove_effect( eff.get_bp()->grabbing_effect );
remove_effect( eff.get_id(), eff.get_bp() );
add_msg_debug( debugmode::DF_MELEE, "Grabber %s knocked back, grab on %s removed", t.get_name(),
eff.get_bp()->name );
}
}
}
}

Character *you = dynamic_cast<Character *>( &t );
Expand Down
6 changes: 3 additions & 3 deletions src/monattack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2967,7 +2967,7 @@ bool mattack::nurse_operate( monster *z )
}
}
} else {
z->type->special_attacks.at( "grab" ).operator * ().call( *z );
z->type->special_attacks.at( "grab" )->call( *z );
// Check if we successfully grabbed the target
if( target->has_effect( effect_grabbed ) ) {
z->dragged_foe_id = target->getID();
Expand Down Expand Up @@ -4956,7 +4956,7 @@ bool mattack::flesh_tendril( monster *z )

if( ( distance_to_target == 2 || distance_to_target == 3 ) && one_in( 4 ) ) {
//it pulls you towards itself and then knocks you away
bool pulled = z->type->special_attacks.at( "ranged_pull" ).operator * ().call( *z );
bool pulled = z->type->special_attacks.at( "ranged_pull" )->call( *z );
if( pulled && one_in( 4 ) ) {
sounds::sound( z->pos(), 60, sounds::sound_t::alarm, _( "a deafening roar!" ), false, "shout",
"roar" );
Expand All @@ -4969,7 +4969,7 @@ bool mattack::flesh_tendril( monster *z )
g->fling_creature( target, coord_to_angle( z->pos(), target->pos() ),
z->type->melee_sides * z->type->melee_dice * 3 );
} else {
z->type->special_attacks.at( "grab" ).operator * ().call( *z );
z->type->special_attacks.at( "grab" )->call( *z );
}
}

Expand Down

0 comments on commit d5d4b8f

Please sign in to comment.