Unify food-related conducts when eating a monster
This commit is contained in:
@@ -607,6 +607,7 @@ E void NDECL(vomit);
|
|||||||
E int FDECL(eaten_stat, (int,struct obj *));
|
E int FDECL(eaten_stat, (int,struct obj *));
|
||||||
E void FDECL(food_disappears, (struct obj *));
|
E void FDECL(food_disappears, (struct obj *));
|
||||||
E void FDECL(food_substitution, (struct obj *,struct obj *));
|
E void FDECL(food_substitution, (struct obj *,struct obj *));
|
||||||
|
E void FDECL(eating_conducts, (struct permonst *));
|
||||||
E int FDECL(eat_brains, (struct monst *,struct monst *,BOOLEAN_P,int *));
|
E int FDECL(eat_brains, (struct monst *,struct monst *,BOOLEAN_P,int *));
|
||||||
E void NDECL(fix_petrification);
|
E void NDECL(fix_petrification);
|
||||||
E void FDECL(consume_oeaten, (struct obj *,int));
|
E void FDECL(consume_oeaten, (struct obj *,int));
|
||||||
|
|||||||
24
src/eat.c
24
src/eat.c
@@ -431,6 +431,17 @@ boolean message;
|
|||||||
context.victual.fullwarn = context.victual.eating = context.victual.doreset = FALSE;
|
context.victual.fullwarn = context.victual.eating = context.victual.doreset = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
eating_conducts(pd)
|
||||||
|
struct permonst *pd;
|
||||||
|
{
|
||||||
|
u.uconduct.food++;
|
||||||
|
if (!vegan(pd))
|
||||||
|
u.uconduct.unvegan++;
|
||||||
|
if (!vegetarian(pd))
|
||||||
|
violated_vegetarian();
|
||||||
|
}
|
||||||
|
|
||||||
/* handle side-effects of mind flayer's tentacle attack */
|
/* handle side-effects of mind flayer's tentacle attack */
|
||||||
int
|
int
|
||||||
eat_brains(magr, mdef, visflag, dmg_p)
|
eat_brains(magr, mdef, visflag, dmg_p)
|
||||||
@@ -483,11 +494,7 @@ int *dmg_p; /* for dishing out extra damage in lieu of Int loss */
|
|||||||
/*
|
/*
|
||||||
* player mind flayer is eating something's brain
|
* player mind flayer is eating something's brain
|
||||||
*/
|
*/
|
||||||
u.uconduct.food++;
|
eating_conducts(pd);
|
||||||
if (!vegan(pd))
|
|
||||||
u.uconduct.unvegan++;
|
|
||||||
if (!vegetarian(pd))
|
|
||||||
violated_vegetarian();
|
|
||||||
if (mindless(pd)) { /* (cannibalism not possible here) */
|
if (mindless(pd)) { /* (cannibalism not possible here) */
|
||||||
pline("%s doesn't notice.", Monnam(mdef));
|
pline("%s doesn't notice.", Monnam(mdef));
|
||||||
/* all done; no extra harm inflicted upon target */
|
/* all done; no extra harm inflicted upon target */
|
||||||
@@ -1270,12 +1277,7 @@ const char *mesg;
|
|||||||
|
|
||||||
You("consume %s %s.", tintxts[r].txt, mons[mnum].mname);
|
You("consume %s %s.", tintxts[r].txt, mons[mnum].mname);
|
||||||
|
|
||||||
/* KMH, conduct */
|
eating_conducts(&mons[mnum]);
|
||||||
u.uconduct.food++;
|
|
||||||
if (!vegan(&mons[mnum]))
|
|
||||||
u.uconduct.unvegan++;
|
|
||||||
if (!vegetarian(&mons[mnum]))
|
|
||||||
violated_vegetarian();
|
|
||||||
|
|
||||||
tin->dknown = tin->known = 1;
|
tin->dknown = tin->known = 1;
|
||||||
cprefx(mnum);
|
cprefx(mnum);
|
||||||
|
|||||||
10
src/uhitm.c
10
src/uhitm.c
@@ -1809,14 +1809,8 @@ register struct attack *mattk;
|
|||||||
(mattk->adtyp == AD_DGST && (is_rider(pd) ||
|
(mattk->adtyp == AD_DGST && (is_rider(pd) ||
|
||||||
(pd == &mons[PM_MEDUSA] && !Stone_resistance)));
|
(pd == &mons[PM_MEDUSA] && !Stone_resistance)));
|
||||||
|
|
||||||
if ((mattk->adtyp == AD_DGST && !Slow_digestion) || fatal_gulp) {
|
if ((mattk->adtyp == AD_DGST && !Slow_digestion) || fatal_gulp)
|
||||||
/* KMH, conduct */
|
eating_conducts(pd);
|
||||||
u.uconduct.food++;
|
|
||||||
if (!vegan(pd))
|
|
||||||
u.uconduct.unvegan++;
|
|
||||||
if (!vegetarian(pd))
|
|
||||||
violated_vegetarian();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fatal_gulp && !is_rider(pd)) { /* petrification */
|
if (fatal_gulp && !is_rider(pd)) { /* petrification */
|
||||||
char kbuf[BUFSZ];
|
char kbuf[BUFSZ];
|
||||||
|
|||||||
Reference in New Issue
Block a user