sacrificing tune-up (trunk only)
There was code to give feedback if you attempted to offer the Amulet on a regular altar instead of the final high altar, but that code was unreachable; getobj() yielded "that's a silly thing" whenever you picked an amulet while not on the Astral (or recently changed, Sanctum) level. This allows you to try to offer the real or fake Amulet of Yendor on any altar, but they'll only be listed as likely candidates when on the Astral level. Conversely, it no longer lists carried corpses as likely candidates at the Astral high altars; they're still acceptable but not what the hero is supposed to be fiddling with there. Also, allow corpses on the floor to be offered on high altars, fixing a complaint we've gotten a few times over the years. (Unfortunately there's no way to suppress them as likely candidates on the high altars while still allowing them to be sacrified.)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)eat.c 3.5 2006/10/06 */
|
||||
/* SCCS Id: @(#)eat.c 3.5 2006/12/07 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -74,6 +74,7 @@ char msgbuf[BUFSZ];
|
||||
#define nonrotting_food(otyp) ((otyp) == LEMBAS_WAFER || (otyp) == CRAM_RATION)
|
||||
|
||||
STATIC_OVL NEARDATA const char comestibles[] = { FOOD_CLASS, 0 };
|
||||
STATIC_OVL NEARDATA const char offerfodder[] = { FOOD_CLASS, AMULET_CLASS, 0 };
|
||||
|
||||
/* Gold must come first for getobj(). */
|
||||
STATIC_OVL NEARDATA const char allobj[] = {
|
||||
@@ -2760,7 +2761,8 @@ floorfood(verb,corpsecheck) /* get food from floor or pack */
|
||||
register struct obj *otmp;
|
||||
char qbuf[QBUFSZ];
|
||||
char c;
|
||||
boolean feeding = (!strcmp(verb, "eat"));
|
||||
boolean feeding = !strcmp(verb, "eat"), /* corpsecheck==0 */
|
||||
offering = !strcmp(verb, "sacrifice"); /* corpsecheck==1 */
|
||||
|
||||
/* if we can't touch floor objects then use invent food only */
|
||||
if (!can_reach_floor(TRUE) ||
|
||||
@@ -2834,9 +2836,9 @@ floorfood(verb,corpsecheck) /* get food from floor or pack */
|
||||
/* We cannot use ALL_CLASSES since that causes getobj() to skip its
|
||||
* "ugly checks" and we need to check for inedible items.
|
||||
*/
|
||||
otmp = getobj(feeding ? (const char *)allobj :
|
||||
(const char *)comestibles, verb);
|
||||
if (corpsecheck && otmp)
|
||||
otmp = getobj(feeding ? allobj : offering ? offerfodder : comestibles,
|
||||
verb);
|
||||
if (corpsecheck && otmp && !(offering && otmp->oclass == AMULET_CLASS))
|
||||
if (otmp->otyp != CORPSE || (corpsecheck == 2 && !tinnable(otmp))) {
|
||||
You_cant("%s that!", verb);
|
||||
return (struct obj *)0;
|
||||
|
||||
Reference in New Issue
Block a user