Make hostile monsters with launcher and ammo keep away

If a hostile monster is wielding a ranged weapon, and is carrying
appropriate ammo for it, make the monster try to stay away,
outside the melee range.
This commit is contained in:
Pasi Kallinen
2020-04-14 15:19:26 +03:00
parent ffb9540295
commit bddb80f13c
4 changed files with 24 additions and 0 deletions

View File

@@ -999,6 +999,12 @@ register int after;
> ((ygold = findgold(g.invent)) ? ygold->quan : 0L))))
appr = -1;
/* hostile monsters with ranged thrown weapons try to stay away */
if (!mtmp->mpeaceful
&& (dist2(mtmp->mx, mtmp->my, mtmp->mux, mtmp->muy) < 5*5)
&& m_canseeu(mtmp) && m_has_launcher_and_ammo(mtmp))
appr = -1;
if (!should_see && can_track(ptr)) {
register coord *cp;