Corpse-eating monsters will home in on corpses
Also allow non-tame ghouls to eat corpses.
This commit is contained in:
@@ -1148,6 +1148,7 @@ prevent hug attacks and touch or engulf attacks for wrap, stick-to, and
|
||||
vortices, a few others)
|
||||
wand of speed gives temporary speed, potion gives intrinsic
|
||||
some monsters (riders, shopkeepers, priests, quest leader) can break boulders
|
||||
corpse-eating monsters will go out of their way to eat corpses on the floor
|
||||
|
||||
|
||||
Fixes to 3.7.0-x General Problems Exposed Via git Repository
|
||||
|
||||
@@ -1699,6 +1699,7 @@ extern int mstrength(struct permonst *);
|
||||
/* ### monmove.c ### */
|
||||
|
||||
extern boolean mon_would_take_item(struct monst *, struct obj *);
|
||||
extern boolean mon_would_consume_item(struct monst *, struct obj *);
|
||||
extern boolean itsstuck(struct monst *);
|
||||
extern boolean mb_trapped(struct monst *, boolean);
|
||||
extern void mon_track_add(struct monst *, coordxy, coordxy);
|
||||
|
||||
@@ -254,6 +254,12 @@
|
||||
(vegan(ptr) \
|
||||
|| ((ptr)->mlet == S_PUDDING && (ptr) != &mons[PM_BLACK_PUDDING]))
|
||||
|
||||
#define corpse_eater(ptr) \
|
||||
(ptr == &mons[PM_PURPLE_WORM] \
|
||||
|| ptr == &mons[PM_BABY_PURPLE_WORM] \
|
||||
|| ptr == &mons[PM_GHOUL] \
|
||||
|| ptr == &mons[PM_PIRANHA])
|
||||
|
||||
/* monkeys are tamable via bananas but not pacifiable via food,
|
||||
otherwise their theft attack could be nullified too easily;
|
||||
dogs and cats can be tamed by anything they like to eat and are
|
||||
|
||||
@@ -910,6 +910,17 @@ mon_would_take_item(struct monst *mtmp, struct obj *otmp)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* monster mtmp would love to consume object otmp, without picking it up */
|
||||
boolean
|
||||
mon_would_consume_item(struct monst *mtmp, struct obj *otmp)
|
||||
{
|
||||
if (otmp->otyp == CORPSE && !touch_petrifies(&mons[otmp->corpsenm])
|
||||
&& corpse_eater(mtmp->data))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
boolean
|
||||
itsstuck(register struct monst* mtmp)
|
||||
{
|
||||
@@ -1224,8 +1235,9 @@ m_search_items(struct monst *mtmp, coordxy *ggx, coordxy *ggy, schar *mmoved, in
|
||||
if (costly && !otmp->no_charge)
|
||||
continue;
|
||||
|
||||
if (mon_would_take_item(mtmp, otmp)
|
||||
&& (can_carry(mtmp, otmp) > 0)
|
||||
if (((mon_would_take_item(mtmp, otmp)
|
||||
&& (can_carry(mtmp, otmp) > 0))
|
||||
|| mon_would_consume_item(mtmp, otmp))
|
||||
&& can_touch_safely(mtmp, otmp)) {
|
||||
minr = distmin(omx, omy, xx, yy);
|
||||
*ggx = otmp->ox;
|
||||
@@ -1794,9 +1806,7 @@ m_move(register struct monst* mtmp, register int after)
|
||||
return etmp; /* it died or got forced off the level */
|
||||
}
|
||||
/* Maybe a purple worm ate a corpse */
|
||||
if (ptr == &mons[PM_PURPLE_WORM]
|
||||
|| ptr == &mons[PM_BABY_PURPLE_WORM]
|
||||
|| ptr == &mons[PM_PIRANHA]) {
|
||||
if (corpse_eater(ptr)) {
|
||||
if ((etmp = meatcorpse(mtmp)) >= 2)
|
||||
return etmp; /* it died or got forced off the level */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user