From 521469f27bdd6d8f81e04d852656896c2d92925c Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sat, 24 Feb 2007 04:59:43 +0000 Subject: [PATCH] mind flayer vs ghost (trunk only) There's newsgroup discussion about a mind flayer sucking the brains of a ghost, plus speculation that the fix for C343-121 has already taken care of it. I agree with them that ghost's brains are too insubstantial to be hit by brainsuck damage from mind flayers' tentacles. C343-121 is vague enough to cover this; the corresponding fixes entry was more specific and is augmented here. --- doc/fixes35.0 | 1 + src/eat.c | 7 ++++++- src/mhitu.c | 11 +++++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 50bac5039..159ffe7f4 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -88,6 +88,7 @@ prevent polymorphing into "new man" at low level from magnifying HP and Pw losing a level while polymorphed affects hero's current monster HP as well as underlying normal HP mind flayer brain eating is subject to certain fatal targets and to cannibalism +mind flayer can't eat brains of ghost or shade corpses of unique monsters in bones behaved incorrectly if revived or eaten fix pluralization for "this tin smells like mother-in-laws" when hallucinating try harder to keep pluralization straight when user assigns an already plural diff --git a/src/eat.c b/src/eat.c index 8da84fc2a..781f028dc 100644 --- a/src/eat.c +++ b/src/eat.c @@ -468,7 +468,12 @@ int *dmg_p; /* for dishing out extra damage in lieu of Int loss */ boolean give_nutrit = FALSE; int result = MM_HIT, xtra_dmg = rnd(10); - if (magr == &youmonst) { + if (noncorporeal(pd)) { + if (visflag) + pline("%s brain is unharmed.", + (mdef == &youmonst) ? "Your" : s_suffix(mon_nam(mdef))); + return MM_MISS; /* side-effects can't occur */ + } else if (magr == &youmonst) { You("eat %s brain!", s_suffix(mon_nam(mdef))); } else if (mdef == &youmonst) { Your("brain is eaten!"); diff --git a/src/mhitu.c b/src/mhitu.c index 98e797ee0..29dc2b101 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -1073,8 +1073,15 @@ dopois: if (Half_physical_damage) dmg = (dmg+1) / 2; mdamageu(mtmp, dmg); - if (!uarmh || uarmh->otyp != DUNCE_CAP) - (void) eat_brains(mtmp, &youmonst, TRUE, (int *)0); + if (!uarmh || uarmh->otyp != DUNCE_CAP) { + /* eat_brains() will miss if target is mindless (won't + happen here; hero is considered to retain his mind + regardless of current shape) or is noncorporeal + (can't happen here; no one can poly into a ghost + or shade) so this check for missing is academic */ + if (eat_brains(mtmp, &youmonst, TRUE, (int *)0) == MM_MISS) + break; + } /* adjattrib gives dunce cap message when appropriate */ (void) adjattrib(A_INT, -rnd(2), FALSE); forget_levels(25); /* lose memory of 25% of levels */