omx = mtmp->mx;
omy = mtmp->my;
- /* if we are carrying something then we drop it (perhaps near @) */
- /* Note: if apport == 1 then our behaviour is independent of udist */
- /* Use udist+1 so steed won't cause divide by zero */
+ /* If we are carrying something then we drop it (perhaps near @).
+ * Note: if apport == 1 then our behaviour is independent of udist.
+ * Use udist+1 so steed won't cause divide by zero.
+ */
if (droppables(mtmp)) {
if (!rn2(udist + 1) || !rn2(edog->apport))
if (rn2(10) < edog->apport) {
return 0;
}
-/* set dog's goal -- gtyp, gx, gy
+/* set dog's goal -- gtyp, gx, gy;
returns -1/0/1 (dog's desire to approach player) or -2 (abort move) */
STATIC_OVL int
dog_goal(mtmp, edog, after, udist, whappr)
int
dog_move(mtmp, after)
register struct monst *mtmp;
-register int after; /* this is extra fast monster movement */
+int after; /* this is extra fast monster movement */
{
int omx, omy; /* original mtmp position */
int appr, whappr, udist;
&& better_with_displacing && !undesirable_disp(mtmp, nx, ny)) {
int mstatus;
register struct monst *mtmp2 = m_at(nx, ny);
+
mstatus = mdisplacem(mtmp, mtmp2, FALSE); /* displace monster */
if (mstatus & MM_DEF_DIED)
return 2;
if (mtmp->mleashed) {
if (!Deaf)
whimper(mtmp);
- } else
+ } else {
/* 1/40 chance of stepping on it anyway, in case
* it has to pass one to follow the player...
*/
if (trap->tseen && rn2(40))
- continue;
+ continue;
+ }
}
}
/* (minion isn't interested; `cursemsg' stays FALSE) */
if (has_edog)
for (obj = level.objects[nx][ny]; obj; obj = obj->nexthere) {
- if (obj->cursed)
+ if (obj->cursed) {
cursemsg[i] = TRUE;
- else if ((otyp = dogfood(mtmp, obj)) < MANFOOD
+ } else if ((otyp = dogfood(mtmp, obj)) < MANFOOD
&& (otyp < ACCFOOD
|| edog->hungrytime <= monstermoves)) {
/* Note: our dog likes the food so much that he
wasseen = canseemon(mtmp);
remove_monster(omx, omy);
place_monster(mtmp, nix, niy);
- if (cursemsg[chi] && (wasseen || canseemon(mtmp)))
- pline("%s moves only reluctantly.", noit_Monnam(mtmp));
+ if (cursemsg[chi] && (wasseen || canseemon(mtmp))) {
+ /* describe top item of pile, not necessarily cursed item itself;
+ don't use glyph_at() here--it would return the pet but we want
+ to know whether an object is remembered at this map location */
+ struct obj *o = (!Hallucination
+ && glyph_is_object(levl[nix][niy].glyph))
+ ? vobj_at(nix, niy) : 0;
+ const char *what = o ? distant_name(o, doname) : something;
+
+ pline("%s %s reluctantly over %s.", noit_Monnam(mtmp),
+ vtense((char *) 0, locomotion(mtmp->data, "step")), what);
+ }
for (j = MTSZ - 1; j > 0; j--)
mtmp->mtrack[j] = mtmp->mtrack[j - 1];
mtmp->mtrack[0].x = omx;
mtmp->mtrack[0].y = omy;
- /* We have to know if the pet's gonna do a combined eat and
+ /* We have to know if the pet's going to do a combined eat and
* move before moving it, but it can't eat until after being
* moved. Thus the do_eat flag.
*/
return FALSE;
}
-/*ARGSUSED*/ /* do_clear_area client */
+/* do_clear_area client */
STATIC_PTR void
wantdoor(x, y, distance)
int x, y;