Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPCs to use ranged weapons against all enemies, and automatic fire against dangerous enemies #40089

Merged
merged 2 commits into from
Jun 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/npcmove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,7 @@ npc_action npc::method_of_attack()
return m.melee() || m.flags.count( "NPC_AVOID" ) ||
!m->ammo_sufficient( m.qty ) || !can_use( *m.target ) ||
m->get_gun_ups_drain() > ups_charges ||
( ( danger <= ( m.qty == 1 ? 3.0 : 15.0 ) ) && !emergency() ) ||
( ( danger <= ( m.qty == 1 ? 0.0 : 15 ) ) && !emergency() ) ||
( rules.has_flag( ally_rule::use_silent ) && is_player_ally() &&
!m.target->is_silent() );

Expand Down Expand Up @@ -1382,7 +1382,7 @@ npc_action npc::method_of_attack()
}

if( dist == 1 && same_z ) {
add_msg( m_debug, "%s is trying a melle attack", disp_name() );
add_msg( m_debug, "%s is trying a melee attack", disp_name() );
return npc_melee;
}

Expand Down