prevent possible minor MAIL abuse

<email deleted> wrote:
> * MAIL Abuse: one can polymorph into a gelatinous cube, send themselves lots of
> scrolls of mail, and eat them, gaining free nutrition.
This commit is contained in:
nethack.allison
2006-03-25 21:06:49 +00:00
parent e063031f00
commit 05ce448135
2 changed files with 15 additions and 2 deletions

View File

@@ -129,6 +129,7 @@ prevent scroll of charging that has already disappeared from showing in the
doors break instead of absorbing the blast of a broken wand of striking doors break instead of absorbing the blast of a broken wand of striking
avoid "Something's in the way" message with unidentified wand of locking avoid "Something's in the way" message with unidentified wand of locking
better handling for Fort Ludios and endgame in wizard mode's `^V ?' menu better handling for Fort Ludios and endgame in wizard mode's `^V ?' menu
no free lunch for gelatinous cubes including scrolls of mail
Platform- and/or Interface-Specific Fixes Platform- and/or Interface-Specific Fixes

View File

@@ -1902,6 +1902,12 @@ eatspecial() /* called after eating non-food */
useupf(otmp, otmp->quan); useupf(otmp, otmp->quan);
return; return;
} }
#ifdef MAIL
if (otmp->otyp == SCR_MAIL) {
/* no nutrition */
pline("This junk mail is less than satisfying.");
}
#endif
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);
@@ -2179,7 +2185,7 @@ doeat() /* generic "eat" command funtion (see cmd.c) */
{ {
register struct obj *otmp; register struct obj *otmp;
int basenutrit; /* nutrition of full item */ int basenutrit; /* nutrition of full item */
boolean dont_start = FALSE; boolean dont_start = FALSE, nodelicious = FALSE;
if (Strangled) { if (Strangled) {
pline("If you can't breathe air, how can you consume solids?"); pline("If you can't breathe air, how can you consume solids?");
@@ -2263,6 +2269,12 @@ doeat() /* generic "eat" command funtion (see cmd.c) */
basenutrit = weight(otmp); basenutrit = weight(otmp);
/* oc_nutrition is usually weight anyway */ /* oc_nutrition is usually weight anyway */
else basenutrit = objects[otmp->otyp].oc_nutrition; else basenutrit = objects[otmp->otyp].oc_nutrition;
#ifdef MAIL
if (otmp->otyp == SCR_MAIL) {
basenutrit = 0;
nodelicious = TRUE;
}
#endif
context.victual.nmod = basenutrit; context.victual.nmod = basenutrit;
context.victual.eating = TRUE; /* needed for lesshungry() */ context.victual.eating = TRUE; /* needed for lesshungry() */
@@ -2285,7 +2297,7 @@ doeat() /* generic "eat" command funtion (see cmd.c) */
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) } else if (!otmp->cursed && !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)) ? "" : "This ", (otmp->oartifact < ART_ORB_OF_DETECTION)) ? "" : "This ",