From b6eff2405a6c63c90da6d5d24d50ec3947b5f44b Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Tue, 21 Feb 2006 03:28:57 +0000 Subject: [PATCH] leather spellbook wrote: > * Eating a leather spellbook doesn't violate > vegetarian conduct. I suggest you rename it to > something else. (May I suggest "bark"?) Also, I refuse > to consider "leather" to be a colour or texture. > * While as a water nymph in water, seducing an unseen > monster on dry land sometimes gives away its identity. > * When submerged iron golem monsters residually > "rust", and the rust damage kills them, it doesn't > report their death. > * Drum of Earthquake says "the entire dungeon shakes > around you" even when you're in the Endgame or the > Quest's top level. > * Wishing for a statue of a guard, then destoning it, > then chatting to it, makes it say "drop that gold" > without context. This could probably be extended to > other cases, too (like Croesus?) This corrects only the first complaint in the list above. --- doc/fixes34.4 | 1 + src/eat.c | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index cd199eb50..0cca84fff 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -193,6 +193,7 @@ candles should not be fireproof monsters could end up off the left side of the Ranger quest start level worms don't have scales, krakens have tentacles, stalkers have a head you no longer "fry to a crisp" as a water elemental +leather spellbooks violate vegetarian conduct Platform- and/or Interface-Specific Fixes diff --git a/src/eat.c b/src/eat.c index 8d6dc02e7..e7dff2a55 100644 --- a/src/eat.c +++ b/src/eat.c @@ -45,6 +45,7 @@ STATIC_DCL void FDECL(eataccessory, (struct obj *)); STATIC_DCL const char *FDECL(foodword, (struct obj *)); STATIC_DCL int FDECL(tin_variety, (struct obj *,BOOLEAN_P)); STATIC_DCL boolean FDECL(maybe_cannibal, (int,BOOLEAN_P)); +STATIC_DCL boolean FDECL(leather_cover, (struct obj *)); char msgbuf[BUFSZ]; @@ -2022,6 +2023,18 @@ register struct obj *otmp; return; } +STATIC_OVL boolean +leather_cover(otmp) +struct obj *otmp; +{ + const char *odesc = OBJ_DESCR(objects[otmp->otyp]); + if (odesc && (otmp->oclass == SPBOOK_CLASS)) { + if (!strcmp(odesc, "leather")) + return TRUE; + } + return FALSE; +} + /* * return 0 if the food was not dangerous. * return 1 if the food was dangerous and you chose to stop. @@ -2128,6 +2141,7 @@ struct obj *otmp; if (!u.uconduct.unvegan && ((material == LEATHER || material == BONE || material == DRAGON_HIDE || material == WAX) || + (leather_cover(otmp)) || (cadaver && !vegan(&mons[mnum])))) { Sprintf(buf, "%s foul and unfamiliar to you. %s", foodsmell, eat_it_anyway); @@ -2137,6 +2151,7 @@ struct obj *otmp; if (!u.uconduct.unvegetarian && ((material == LEATHER || material == BONE || material == DRAGON_HIDE) || + (leather_cover(otmp)) || (cadaver && !vegetarian(&mons[mnum])))) { Sprintf(buf, "%s unfamiliar to you. %s", foodsmell, eat_it_anyway); @@ -2248,7 +2263,8 @@ doeat() /* generic "eat" command funtion (see cmd.c) */ material = objects[otmp->otyp].oc_material; if (material == LEATHER || - material == BONE || material == DRAGON_HIDE) { + material == BONE || material == DRAGON_HIDE || + leather_cover(otmp)) { u.uconduct.unvegan++; violated_vegetarian(); } else if (material == WAX) -- 2.40.0