male rather than on all nymphs being female but charm message was
using hardcoded pronouns She,her for target monster--wrong for male
target and noticable if "<mon> finishes taking off his suit" is given
-hostile monsters with a spit attack or launcher and ammo try to stay away
- from melee range
+hostile monsters with a ranged attack try to stay away from melee range
allow displacing peaceful creatures
unicorn horns don't restore attribute loss anymore
when a shop is changed from food to health food, change room type to match
static void FDECL(release_hero, (struct monst *));
static void FDECL(distfleeck, (struct monst *, int *, int *, int *));
static int FDECL(m_arrival, (struct monst *));
+static boolean FDECL(m_balks_at_approaching, (struct monst *));
static boolean FDECL(stuff_prevents_passage, (struct monst *));
static int FDECL(vamp_shift, (struct monst *, struct permonst *,
BOOLEAN_P));
return FALSE;
}
+/* does monster want to avoid you? */
+static boolean
+m_balks_at_approaching(mtmp)
+struct monst *mtmp;
+{
+ /* peaceful, far away, or can't see you */
+ if (mtmp->mpeaceful
+ || (dist2(mtmp->mx, mtmp->my, mtmp->mux, mtmp->muy) >= 5*5)
+ || !m_canseeu(mtmp))
+ return FALSE;
+
+ /* has ammo+launcher or can spit */
+ if (m_has_launcher_and_ammo(mtmp)
+ || attacktype(mtmp->data, AT_SPIT))
+ return TRUE;
+
+ /* is using a polearm and in range */
+ if (MON_WEP(mtmp) && is_pole(MON_WEP(mtmp))
+ && dist2(mtmp->mx, mtmp->my, mtmp->mux, mtmp->muy) <= MON_POLE_DIST)
+ return TRUE;
+
+ /* breath attack, and hp loss or breath not used */
+ if (attacktype(mtmp->data, AT_BREA)
+ && ((mtmp->mhp < (mtmp->mhpmax+1) / 3)
+ || !mtmp->mspec_used))
+ return TRUE;
+
+ return FALSE;
+}
+
/* Return values:
* 0: did not move, but can still attack and do other stuff.
* 1: moved, possibly can attack.
> ((ygold = findgold(g.invent)) ? ygold->quan : 0L))))
appr = -1;
- /* hostiles with ranged weapons or spit attack 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) || attacktype(mtmp->data, AT_SPIT)))
+ /* hostiles with ranged weapon or attack try to stay away */
+ if (m_balks_at_approaching(mtmp))
appr = -1;
if (!should_see && can_track(ptr)) {
#define URETREATING(x, y) \
(distmin(u.ux, u.uy, x, y) > distmin(u.ux0, u.uy0, x, y))
-#define POLE_LIM 5 /* How far monsters can use pole-weapons */
-
-#define PET_MISSILE_RANGE2 36 /* Square of distance within which pets shoot */
-
/*
* Keep consistent with breath weapons in zap.c, and AD_* in monattk.h.
*/
if (otmp != MON_WEP(mtmp))
return; /* polearm must be wielded */
- if (dist2(mtmp->mx, mtmp->my, mtmp->mux, mtmp->muy) > POLE_LIM
+ if (dist2(mtmp->mx, mtmp->my, mtmp->mux, mtmp->muy) > MON_POLE_DIST
|| !couldsee(mtmp->mx, mtmp->my))
return; /* Out of range, or intervening wall */