fix #H3723 - eating "YUM YUM" scroll
From November, 2014, player thought eating a scroll labeled YUM YUM while polymorphed ought to give a special message. While implementing it, I noticed that if a g.cube managed to get on to a spot containing a scroll of scare monster, it would eat that along with everything else.
This commit is contained in:
@@ -300,6 +300,7 @@ conduct: wishing for an artifact and not getting it because it already exists
|
|||||||
counts as wishing for an artifact, just like when not getting it
|
counts as wishing for an artifact, just like when not getting it
|
||||||
because of quest restrictions or too many artifacts in play does
|
because of quest restrictions or too many artifacts in play does
|
||||||
avoid ring of poison resistance as starting equipment for orcish wizard
|
avoid ring of poison resistance as starting equipment for orcish wizard
|
||||||
|
gelatinous cube shouldn't be able to eat a scroll of scare monster
|
||||||
|
|
||||||
|
|
||||||
Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository
|
Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 eat.c $NHDT-Date: 1454715969 2016/02/05 23:46:09 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.163 $ */
|
/* NetHack 3.6 eat.c $NHDT-Date: 1466289475 2016/06/18 22:37:55 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.169 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -2014,12 +2014,23 @@ eatspecial()
|
|||||||
vault_gd_watching(GD_EATGOLD);
|
vault_gd_watching(GD_EATGOLD);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (objects[otmp->otyp].oc_material == PAPER) {
|
||||||
#ifdef MAIL
|
#ifdef MAIL
|
||||||
if (otmp->otyp == SCR_MAIL) {
|
if (otmp->otyp == SCR_MAIL)
|
||||||
/* no nutrition */
|
/* no nutrition */
|
||||||
pline("This junk mail is less than satisfying.");
|
pline("This junk mail is less than satisfying.");
|
||||||
}
|
else
|
||||||
#endif
|
#endif
|
||||||
|
if (otmp->otyp == SCR_SCARE_MONSTER)
|
||||||
|
/* to eat scroll, hero is currently polymorphed into a monster */
|
||||||
|
pline("Yuck%c", otmp->blessed ? '!' : '.');
|
||||||
|
else if (otmp->oclass == SCROLL_CLASS
|
||||||
|
/* check description after checking for specific scrolls */
|
||||||
|
&& !strcmpi(OBJ_DESCR(objects[otmp->otyp]), "YUM YUM"))
|
||||||
|
pline("Yum%c", otmp->blessed ? '!' : '.');
|
||||||
|
else
|
||||||
|
pline("Needs salt...");
|
||||||
|
}
|
||||||
if (otmp->oclass == POTION_CLASS) {
|
if (otmp->oclass == POTION_CLASS) {
|
||||||
otmp->quan++; /* dopotion() does a useup() */
|
otmp->quan++; /* dopotion() does a useup() */
|
||||||
(void) dopotion(otmp);
|
(void) dopotion(otmp);
|
||||||
@@ -2453,8 +2464,11 @@ doeat()
|
|||||||
u.uconduct.unvegan++;
|
u.uconduct.unvegan++;
|
||||||
u.uconduct.food++;
|
u.uconduct.food++;
|
||||||
|
|
||||||
if (otmp->cursed)
|
if (otmp->cursed) {
|
||||||
(void) rottenfood(otmp);
|
(void) rottenfood(otmp);
|
||||||
|
nodelicious = TRUE;
|
||||||
|
} else if (objects[otmp->otyp].oc_material == PAPER)
|
||||||
|
nodelicious = TRUE;
|
||||||
|
|
||||||
if (otmp->oclass == WEAPON_CLASS && otmp->opoisoned) {
|
if (otmp->oclass == WEAPON_CLASS && otmp->opoisoned) {
|
||||||
pline("Ecch - that must have been poisonous!");
|
pline("Ecch - that must have been poisonous!");
|
||||||
@@ -2463,7 +2477,7 @@ doeat()
|
|||||||
losehp(rnd(15), xname(otmp), KILLED_BY_AN);
|
losehp(rnd(15), xname(otmp), KILLED_BY_AN);
|
||||||
} else
|
} else
|
||||||
You("seem unaffected by the poison.");
|
You("seem unaffected by the poison.");
|
||||||
} else if (!otmp->cursed && !nodelicious) {
|
} else if (!nodelicious) {
|
||||||
pline("%s%s is delicious!",
|
pline("%s%s is delicious!",
|
||||||
(obj_is_pname(otmp)
|
(obj_is_pname(otmp)
|
||||||
&& otmp->oartifact < ART_ORB_OF_DETECTION)
|
&& otmp->oartifact < ART_ORB_OF_DETECTION)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 mon.c $NHDT-Date: 1463534459 2016/05/18 01:20:59 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.221 $ */
|
/* NetHack 3.6 mon.c $NHDT-Date: 1466289475 2016/06/18 22:37:55 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.227 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -908,7 +908,12 @@ struct monst *mtmp;
|
|||||||
&& !resists_ston(mtmp))
|
&& !resists_ston(mtmp))
|
||||||
/* don't engulf boulders and statues or ball&chain */
|
/* don't engulf boulders and statues or ball&chain */
|
||||||
|| otmp->oclass == ROCK_CLASS
|
|| otmp->oclass == ROCK_CLASS
|
||||||
|| otmp == uball || otmp == uchain) {
|
|| otmp == uball || otmp == uchain
|
||||||
|
/* normally mtmp won't have stepped onto scare monster
|
||||||
|
scroll, but if it does, don't eat or engulf that
|
||||||
|
(note: scrolls inside eaten containers will still
|
||||||
|
become engulfed) */
|
||||||
|
|| otmp->otyp == SCR_SCARE_MONSTER) {
|
||||||
/* do nothing--neither eaten nor engulfed */
|
/* do nothing--neither eaten nor engulfed */
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -940,11 +945,18 @@ struct monst *mtmp;
|
|||||||
} else {
|
} else {
|
||||||
/* devour */
|
/* devour */
|
||||||
++count;
|
++count;
|
||||||
if (cansee(mtmp->mx, mtmp->my) && flags.verbose)
|
if (cansee(mtmp->mx, mtmp->my)) {
|
||||||
pline("%s eats %s!", Monnam(mtmp),
|
if (flags.verbose)
|
||||||
distant_name(otmp, doname));
|
pline("%s eats %s!", Monnam(mtmp),
|
||||||
else if (flags.verbose)
|
distant_name(otmp, doname));
|
||||||
You_hear("a slurping sound.");
|
/* give this one even if !verbose */
|
||||||
|
if (otmp->oclass == SCROLL_CLASS
|
||||||
|
&& !strcmpi(OBJ_DESCR(objects[otmp->otyp]), "YUM YUM"))
|
||||||
|
pline("Yum%c", otmp->blessed ? '!' : '.');
|
||||||
|
} else {
|
||||||
|
if (flags.verbose)
|
||||||
|
You_hear("a slurping sound.");
|
||||||
|
}
|
||||||
/* Heal up to the object's weight in hp */
|
/* Heal up to the object's weight in hp */
|
||||||
if (mtmp->mhp < mtmp->mhpmax) {
|
if (mtmp->mhp < mtmp->mhpmax) {
|
||||||
mtmp->mhp += objects[otmp->otyp].oc_weight;
|
mtmp->mhp += objects[otmp->otyp].oc_weight;
|
||||||
|
|||||||
Reference in New Issue
Block a user