mind flayer brain attacks (trunk only)

Fix a couple of problems From a bug report.  Eating a Rider corpse is fatal, but eating a live Rider's
brain was not--now it will be, both for monster mind flayers and for player
poly'd into one.  Also, there was no check for cannibalism when poly'd hero
eats brains--now there is.  Not mentioned in the report:  eating Medusa's
brains will now be fatal just like eating her corpse.  And pet mind flayers
who eat the hero's brains will gain some nutrition like they do when eating
monster brains.

     Creating a common eat_brains() routine turned out to be something of
a mistake; there is only a tiny amount of overlap among the u-vs-m, m-vs-u,
and m-vs-m cases.

     Makefiles need a dependency update to add edog.h for eat.c.
This commit is contained in:
nethack.rankin
2005-10-01 05:14:19 +00:00
parent be193d27b5
commit f1fe8c1600
6 changed files with 161 additions and 81 deletions

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)mhitu.c 3.5 2005/07/13 */
/* SCCS Id: @(#)mhitu.c 3.5 2005/09/27 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1060,45 +1060,12 @@ dopois:
if (Half_physical_damage) dmg = (dmg+1) / 2;
mdamageu(mtmp, dmg);
if (!uarmh || uarmh->otyp != DUNCE_CAP) {
Your("brain is eaten!");
/* No such thing as mindless players... */
if (ABASE(A_INT) <= ATTRMIN(A_INT)) {
int lifesaved = 0;
struct obj *wore_amulet = uamul;
while(1) {
/* avoid looping on "die(y/n)?" */
if (lifesaved && (discover || wizard)) {
if (wore_amulet && !uamul) {
/* used up AMULET_OF_LIFE_SAVING; still
subject to dying from brainlessness */
wore_amulet = 0;
} else {
/* explicitly chose not to die;
arbitrarily boost intelligence */
ABASE(A_INT) = ATTRMIN(A_INT) + 2;
You_feel("like a scarecrow.");
break;
}
}
if (lifesaved)
pline("Unfortunately your brain is still gone.");
else
Your("last thought fades away.");
Strcpy(killer.name, "brainlessness");
killer.format = KILLED_BY;
done(DIED);
lifesaved++;
}
}
}
if (!uarmh || uarmh->otyp != DUNCE_CAP)
(void) eat_brains(mtmp, &youmonst, TRUE, (int *)0);
/* adjattrib gives dunce cap message when appropriate */
(void) adjattrib(A_INT, -rnd(2), FALSE);
forget_levels(25); /* lose memory of 25% of levels */
forget_objects(25); /* lose memory of 25% of objects */
exercise(A_WIS, FALSE);
break;
case AD_PLYS:
hitmsg(mtmp, mattk);